本文整理汇总了Java中org.infinispan.test.TestingUtil类的典型用法代码示例。如果您正苦于以下问题:Java TestingUtil类的具体用法?Java TestingUtil怎么用?Java TestingUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TestingUtil类属于org.infinispan.test包,在下文中一共展示了TestingUtil类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: nukeBuckets
import org.infinispan.test.TestingUtil; //导入依赖的package包/类
@AfterMethod(alwaysRun = true)
private void nukeBuckets() throws Exception {
for (String name : cacheManager.getCacheNames()) {
CloudStore ccs = new CloudStore();
Cache cache = cacheManager.getCache(name);
ccs.init(new InitializationContextImpl(
cache.getAdvancedCache().getCacheConfiguration().persistence().stores().get(0),
cache,
TestingUtil.extractGlobalMarshaller(cacheManager),
cache.getAdvancedCache().getComponentRegistry().getTimeService(),
new ByteBufferFactoryImpl(),
new MarshalledEntryFactoryImpl()
));
ccs.start();
ccs.removeContainer();
ccs.stop();
}
}
开发者ID:infinispan,项目名称:infinispan-cachestore-cloud,代码行数:19,代码来源:CloudCacheStoreFunctionalIT.java
示例2: testJCloudsMetadataTest
import org.infinispan.test.TestingUtil; //导入依赖的package包/类
@Test
public void testJCloudsMetadataTest() throws IOException {
String blobName = "myBlob";
String containerName = (csBucket + "MetadataTest").toLowerCase();
BlobStore blobStore = ((CloudStore) cl).getBlobStore();
if (!blobStore.containerExists(containerName)) {
Location location = new LocationBuilder().scope(LocationScope.REGION).description("test").id(csLocation).build();
blobStore.createContainerInLocation(location, containerName);
TestingUtil.sleepThread(10000);
}
String payload = "Hello world";
Blob blob = blobStore.blobBuilder(blobName)
.payload(payload)
.contentLength(payload.length())
.contentType(MediaType.OCTET_STREAM)
.userMetadata(Collections.singletonMap("hello", "world"))
.build();
blobStore.putBlob(containerName, blob);
blob = blobStore.getBlob(containerName, blobName);
assertEquals(blob.getMetadata().getUserMetadata().get("hello"), "world");
PageSet<? extends StorageMetadata> ps = blobStore.list(containerName, ListContainerOptions.Builder.withDetails());
for (StorageMetadata sm : ps) {
assertEquals(sm.getUserMetadata().get("hello"), "world");
}
blobStore.deleteContainer(containerName);
}
开发者ID:infinispan,项目名称:infinispan-cachestore-cloud,代码行数:32,代码来源:CloudCacheStoreIT.java
示例3: testRemoteCacheStore
import org.infinispan.test.TestingUtil; //导入依赖的package包/类
public void testRemoteCacheStore() throws Exception {
String config = InfinispanStartTag.LATEST +
"<cache-container default-cache=\"default\">" +
" <local-cache name=\"default\">\n" +
" <persistence passivation=\"false\"> \n" +
" <cloud-store xmlns=\"urn:infinispan:config:store:cloud:7.2\" provider=\"transient\" location=\"test-location\" identity=\"me\" credential=\"s3cr3t\" container=\"test-container\" endpoint=\"http://test.endpoint\" compress=\"true\" overrides=\"key1=val1, key2=val2\" normalize-cache-names=\"true\" />\n" +
" </persistence>\n" +
" </local-cache>\n" +
"</cache-container>" +
INFINISPAN_END_TAG;
InputStream is = new ByteArrayInputStream(config.getBytes());
withCacheManager(new CacheManagerCallable(TestCacheManagerFactory.fromStream(is)) {
@Override
public void call() {
Cache<Object, Object> cache = cm.getCache();
cache.put(1, "v1");
assertEquals("v1", cache.get(1));
@SuppressWarnings("unchecked")
CloudStore<K, V> store = (CloudStore<K, V>) TestingUtil.getFirstLoader(cache);
assertEquals(store.getConfiguration().provider(), "transient");
assertEquals(store.getConfiguration().location(), "test-location");
assertEquals(store.getConfiguration().identity(), "me");
assertEquals(store.getConfiguration().credential(), "s3cr3t");
assertEquals(store.getConfiguration().container(), "test-container");
assertEquals(store.getConfiguration().endpoint(), "http://test.endpoint");
assertTrue(store.getConfiguration().compress());
assertEquals(store.getConfiguration().overrides().get("key1"), "val1");
assertEquals(store.getConfiguration().overrides().get("key2"), "val2");
assertTrue(store.getConfiguration().normalizeCacheNames());
}
});
}
开发者ID:infinispan,项目名称:infinispan-cachestore-cloud,代码行数:34,代码来源:XmlFileParsingTest.java
示例4: configurePersistence
import org.infinispan.test.TestingUtil; //导入依赖的package包/类
@Override
protected void configurePersistence(ConfigurationBuilder cb) {
tmpDirectory = TestingUtil.tmpDirectory(this);
new File(tmpDirectory).mkdirs();
cb.persistence()
.addStore(LevelDBStoreConfigurationBuilder.class)
.location(tmpDirectory + "/data")
.expiredLocation(tmpDirectory + "/expiry")
.clearThreshold(2);
}
开发者ID:danberindei,项目名称:infinispan-cachestore-leveldb,代码行数:11,代码来源:LevelDBParallelIterationTest.java
示例5: textXmlConfigLegacy
import org.infinispan.test.TestingUtil; //导入依赖的package包/类
@Test(enabled = false, description = "ISPN-3388")
public void textXmlConfigLegacy() throws IOException {
EmbeddedCacheManager cacheManager = new DefaultCacheManager("config/leveldb-config-legacy-" +
LevelDBStoreConfiguration.ImplementationType.AUTO.toString().toLowerCase() + ".xml");
Cache<String, String> cache = cacheManager.getCache("testCache");
cache.put("hello", "there legacy xml");
cache.stop();
cacheManager.stop();
TestingUtil.recursiveFileRemove("/tmp/leveldb/legacy");
}
开发者ID:danberindei,项目名称:infinispan-cachestore-leveldb,代码行数:13,代码来源:ConfigurationTest.java
示例6: testXmlConfig60
import org.infinispan.test.TestingUtil; //导入依赖的package包/类
public void testXmlConfig60() throws IOException {
EmbeddedCacheManager cacheManager = new DefaultCacheManager("config/leveldb-config-60-" +
LevelDBStoreConfiguration.ImplementationType.AUTO.toString().toLowerCase() + ".xml");
Cache<String, String> cache = cacheManager.getCache("testCache");
cache.put("hello", "there 60 xml");
cache.stop();
cacheManager.stop();
TestingUtil.recursiveFileRemove("/tmp/leveldb/60");
}
开发者ID:danberindei,项目名称:infinispan-cachestore-leveldb,代码行数:13,代码来源:ConfigurationTest.java
示例7: injectTimeService
import org.infinispan.test.TestingUtil; //导入依赖的package包/类
protected void injectTimeService() {
ts0 = new ControlledTimeService(0);
TestingUtil.replaceComponent(clusteredCacheContainers.get(0), TimeService.class, ts0, true);
ts1 = new ControlledTimeService(0);
TestingUtil.replaceComponent(clusteredCacheContainers.get(1), TimeService.class, ts1, true);
}
开发者ID:HydAu,项目名称:Camel,代码行数:7,代码来源:InfinispanClusterTestSupport.java
示例8: injectTimeService
import org.infinispan.test.TestingUtil; //导入依赖的package包/类
protected void injectTimeService() {
ts = new ControlledTimeService(0);
TestingUtil.replaceComponent((DefaultCacheManager) basicCacheContainer, TimeService.class, ts, true);
}
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:InfinispanTestSupport.java
示例9: cleanup
import org.infinispan.test.TestingUtil; //导入依赖的package包/类
@AfterMethod
public void cleanup() {
TestingUtil.killCacheManagers(cacheManager);
}
开发者ID:infinispan,项目名称:infinispan-cachestore-cloud,代码行数:5,代码来源:XmlFileParsingTest.java
示例10: cleanup
import org.infinispan.test.TestingUtil; //导入依赖的package包/类
@AfterMethod(alwaysRun = true)
public void cleanup() {
TestingUtil.killCacheManagers(cacheManager);
}
开发者ID:infinispan,项目名称:infinispan-cachestore-mongodb,代码行数:5,代码来源:MongoDBCacheStoreConfigurationParserTest.java
示例11: teardown
import org.infinispan.test.TestingUtil; //导入依赖的package包/类
@Override
protected void teardown() {
TestingUtil.recursiveFileRemove(tmpDirectory);
super.teardown();
}
开发者ID:danberindei,项目名称:infinispan-cachestore-leveldb,代码行数:6,代码来源:LevelDBParallelIterationTest.java
示例12: setPaths
import org.infinispan.test.TestingUtil; //导入依赖的package包/类
@BeforeClass
protected void setPaths() {
tmpDir = new File(TestingUtil.tmpDirectory(this));
}
开发者ID:danberindei,项目名称:infinispan-cachestore-leveldb,代码行数:5,代码来源:LevelDBMultiCacheStoreFunctionalTest.java
示例13: cleanDataFiles
import org.infinispan.test.TestingUtil; //导入依赖的package包/类
@BeforeMethod
protected void cleanDataFiles() {
if (tmpDir.exists()) {
TestingUtil.recursiveFileRemove(tmpDir);
}
}
开发者ID:danberindei,项目名称:infinispan-cachestore-leveldb,代码行数:7,代码来源:LevelDBMultiCacheStoreFunctionalTest.java
示例14: setUpTempDir
import org.infinispan.test.TestingUtil; //导入依赖的package包/类
@BeforeClass
protected void setUpTempDir() {
tmpDirectory = TestingUtil.tmpDirectory(this);
}
开发者ID:danberindei,项目名称:infinispan-cachestore-leveldb,代码行数:5,代码来源:LevelDBStoreTest.java
示例15: clearTempDir
import org.infinispan.test.TestingUtil; //导入依赖的package包/类
@AfterClass(alwaysRun = true)
protected void clearTempDir() {
TestingUtil.recursiveFileRemove(tmpDirectory);
new File(tmpDirectory).mkdirs();
}
开发者ID:danberindei,项目名称:infinispan-cachestore-leveldb,代码行数:6,代码来源:LevelDBStoreTest.java
示例16: tearDown
import org.infinispan.test.TestingUtil; //导入依赖的package包/类
@AfterMethod
@Override
public void tearDown() throws CacheLoaderException {
super.tearDown();
TestingUtil.killCacheManagers(cacheManager);
}
开发者ID:danberindei,项目名称:infinispan-cachestore-leveldb,代码行数:7,代码来源:LevelDBStoreTest.java
示例17: setUpTempDir
import org.infinispan.test.TestingUtil; //导入依赖的package包/类
@BeforeTest
protected void setUpTempDir() {
tmpDirectory = TestingUtil.tmpDirectory(this);
tmpDataDirectory = tmpDirectory + "/data";
tmpExpiredDirectory = tmpDirectory + "/expired";
}
开发者ID:danberindei,项目名称:infinispan-cachestore-leveldb,代码行数:7,代码来源:ConfigurationTest.java
示例18: clearTempDir
import org.infinispan.test.TestingUtil; //导入依赖的package包/类
@AfterTest(alwaysRun = true)
protected void clearTempDir() {
TestingUtil.recursiveFileRemove(tmpDirectory);
}
开发者ID:danberindei,项目名称:infinispan-cachestore-leveldb,代码行数:5,代码来源:ConfigurationTest.java
示例19: setUpTempDir
import org.infinispan.test.TestingUtil; //导入依赖的package包/类
@BeforeTest
protected void setUpTempDir() {
tmpDirectory = TestingUtil.tmpDirectory(this);
}
开发者ID:saturnism,项目名称:infinispan-cachestore-mapdb,代码行数:5,代码来源:ConfigurationTest.java
注:本文中的org.infinispan.test.TestingUtil类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论