use of org.infinispan.server.test.junit4.InfinispanServerTestMethodRule in project infinispan by infinispan.
the class AbstractAuthorization method testScriptUpload.
@Test
public void testScriptUpload() {
SkipJunit.skipSinceJDK(16);
InfinispanServerTestMethodRule serverTest = getServerTest();
for (TestUser user : EnumSet.of(TestUser.ADMIN, TestUser.DEPLOYER)) {
RemoteCacheManager remoteCacheManager = serverTest.hotrod().withClientConfiguration(hotRodBuilders.get(user)).createRemoteCacheManager();
serverTest.addScript(remoteCacheManager, "scripts/test.js");
}
for (TestUser user : EnumSet.of(TestUser.MONITOR, TestUser.APPLICATION, TestUser.OBSERVER, TestUser.WRITER)) {
RemoteCacheManager remoteCacheManager = serverTest.hotrod().withClientConfiguration(hotRodBuilders.get(user)).createRemoteCacheManager();
Exceptions.expectException(HotRodClientException.class, "(?s).*ISPN000287.*", () -> serverTest.addScript(remoteCacheManager, "scripts/test.js"));
}
}
use of org.infinispan.server.test.junit4.InfinispanServerTestMethodRule in project infinispan by infinispan.
the class AbstractAuthorization method testExecScripts.
@Test
public void testExecScripts() {
SkipJunit.skipSinceJDK(16);
InfinispanServerTestMethodRule serverTest = getServerTest();
RemoteCache cache = serverTest.hotrod().withClientConfiguration(hotRodBuilders.get(TestUser.ADMIN)).create();
String scriptName = serverTest.addScript(cache.getRemoteCacheManager(), "scripts/test.js");
Map params = new HashMap<>();
params.put("key", "k");
params.put("value", "v");
for (TestUser user : EnumSet.of(TestUser.ADMIN, TestUser.APPLICATION, TestUser.DEPLOYER)) {
RemoteCache cacheExec = serverTest.hotrod().withClientConfiguration(hotRodBuilders.get(user)).get();
cacheExec.execute(scriptName, params);
}
for (TestUser user : EnumSet.of(TestUser.MONITOR, TestUser.OBSERVER, TestUser.WRITER)) {
RemoteCache cacheExec = serverTest.hotrod().withClientConfiguration(hotRodBuilders.get(user)).get();
Exceptions.expectException(HotRodClientException.class, "(?s).*ISPN000287.*", () -> {
cacheExec.execute(scriptName, params);
});
}
}
use of org.infinispan.server.test.junit4.InfinispanServerTestMethodRule in project infinispan by infinispan.
the class StatefulSetRollingUpgradeIT method getRuleChain.
@Rule
public RuleChain getRuleChain() {
serverRule = InfinispanServerRuleBuilder.config("configuration/ClusteredServerTest.xml").numServers(numServers).runMode(ServerRunMode.CONTAINER).parallelStartup(false).build();
methodRule = new InfinispanServerTestMethodRule(serverRule);
return RuleChain.outerRule(serverRule).around(methodRule);
}
Aggregations