forked from Terracotta-OSS/terracotta-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ Terracotta-OSS#191 : Initial Galvan testing set up for tc platform
- Loading branch information
1 parent
694781f
commit b461419
Showing
3 changed files
with
174 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
...ation-tests/src/test/java/org/terracotta/management/integration/tests/SimpleGalvanIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* Copyright Terracotta, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
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 = | ||
"<config xmlns:ohr='http://www.terracotta.org/config/offheap-resource'>" | ||
+ "<ohr:offheap-resources>" | ||
+ "<ohr:resource name=\"" + OFFHEAP_RESOURCE + "\" unit=\"MB\">64</ohr:resource>" | ||
+ "</ohr:offheap-resources>" + | ||
"</config>\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(); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...ple-entity/src/main/resources/META-INF/services/org.terracotta.entity.EntityServerService
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sample.server.HelloWorldEntityServerService | ||
org.terracotta.management.entity.sample.server.CacheEntityServerService |