From 3b9b04535958ce52201a3c5014ac1bea724aca8d Mon Sep 17 00:00:00 2001 From: Anthony Dahanne Date: Thu, 15 Dec 2016 19:56:59 -0500 Subject: [PATCH] :white_check_mark: #191 : Initial Galvan testing set up for tc platform --- management/testing/integration-tests/pom.xml | 119 ++++++++++++++++++ .../integration/tests/SimpleGalvanIT.java | 54 ++++++++ .../org.terracotta.entity.EntityServerService | 2 +- 3 files changed, 174 insertions(+), 1 deletion(-) create mode 100644 management/testing/integration-tests/src/test/java/org/terracotta/management/integration/tests/SimpleGalvanIT.java diff --git a/management/testing/integration-tests/pom.xml b/management/testing/integration-tests/pom.xml index 5cca087919..d881fbd429 100644 --- a/management/testing/integration-tests/pom.xml +++ b/management/testing/integration-tests/pom.xml @@ -42,6 +42,125 @@ ${galvan.version} test + + org.terracotta.management.testing + sample-entity + ${parent.version} + + + + + org.terracotta + entity-client-api + provided + + + + org.terracotta.management.dist + management-server + ${project.version} + provided + + + org.terracotta + offheap-resource + ${project.version} + provided + + + org.terracotta.management.dist + management-common + ${project.version} + + + org.terracotta.management.dist + management-client + ${project.version} + + + junit + junit + test + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + voltron-kit + prepare-package + + unpack + + + + + org.terracotta.internal + terracotta-kit + ${terracotta-core.version} + tar.gz + + + ${project.build.directory}/voltronKit + + + + unpack-sample-entity + prepare-package + + copy + + + + + org.terracotta.management.testing + sample-entity + ${project.version} + plugin + + + org.terracotta.management.dist + management-common + ${project.version} + + + org.terracotta.management.dist + management-server + ${project.version} + + + org.terracotta + offheap-resource + ${project.version} + + + ${project.build.directory}/voltronKit/${terracotta-core.version}/server/plugins/lib + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.19.1 + + + ${project.build.directory}/voltronKit/${terracotta-core.version}/ + + + + + + integration-test + verify + + + + + + \ No newline at end of file diff --git a/management/testing/integration-tests/src/test/java/org/terracotta/management/integration/tests/SimpleGalvanIT.java b/management/testing/integration-tests/src/test/java/org/terracotta/management/integration/tests/SimpleGalvanIT.java new file mode 100644 index 0000000000..1ef864e71f --- /dev/null +++ b/management/testing/integration-tests/src/test/java/org/terracotta/management/integration/tests/SimpleGalvanIT.java @@ -0,0 +1,54 @@ +package org.terracotta.management.integration.tests; + +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestName; +import org.terracotta.management.entity.sample.client.CacheFactory; +import org.terracotta.management.registry.collect.StatisticConfiguration; +import org.terracotta.testing.rules.BasicExternalCluster; +import org.terracotta.testing.rules.Cluster; + +import java.io.File; +import java.net.URI; +import java.util.concurrent.TimeUnit; + +import static java.util.Collections.emptyList; + +public class SimpleGalvanIT { + + private static final String OFFHEAP_RESOURCE = "primary-server-resource"; + + private static final String RESOURCE_CONFIG = + "" + + "" + + "64" + + "" + + "\n"; + + @ClassRule + public static Cluster CLUSTER = + new BasicExternalCluster(new File("target/galvan"), 1, emptyList(), "", RESOURCE_CONFIG, ""); + + @BeforeClass + public static void waitForActive() throws Exception { + CLUSTER.getClusterControl().waitForActive(); + } + + @Rule + public final TestName testName = new TestName(); + + @Test + public void simpleTest_one_active() throws Exception { + URI uri = CLUSTER.getConnectionURI(); + + StatisticConfiguration statisticConfiguration = new StatisticConfiguration() + .setAverageWindowDuration(1, TimeUnit.MINUTES) + .setHistorySize(100) + .setHistoryInterval(1, TimeUnit.SECONDS) + .setTimeToDisable(5, TimeUnit.SECONDS); + CacheFactory cacheFactory = new CacheFactory(uri.toString() + "/pif", statisticConfiguration); + cacheFactory.init(); + } +} diff --git a/management/testing/sample-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityServerService b/management/testing/sample-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityServerService index 48d4713f89..a0de85c3e3 100644 --- a/management/testing/sample-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityServerService +++ b/management/testing/sample-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityServerService @@ -1 +1 @@ -sample.server.HelloWorldEntityServerService \ No newline at end of file +org.terracotta.management.entity.sample.server.CacheEntityServerService \ No newline at end of file