use of org.jpos.q2.Q2 in project jPOS by jpos.
the class TransactionManagerTestCase method setUp.
public void setUp() throws Exception {
sp = SpaceFactory.getSpace("tspace:txnmgrtest");
q2 = new Q2("build/resources/test/org/jpos/transaction");
q2.start();
}
use of org.jpos.q2.Q2 in project jPOS by jpos.
the class Q2Test method testQEntryIsQBean1.
@Test
public void testQEntryIsQBean1() throws Throwable {
Q2.QEntry qEntry = new Q2.QEntry(100L, new ObjectInstance(new ObjectName("testQEntryParam1", "testQEntryParam2", "testQEntryParam3"), "testQEntryParam2"));
qEntry.setObject(new SystemMonitor());
boolean result = qEntry.isQBean();
assertTrue(result, "result");
}
use of org.jpos.q2.Q2 in project jPOS by jpos.
the class QFactory2Test method testDestroyQBeanThrowsNullPointerException1.
@Test
public void testDestroyQBeanThrowsNullPointerException1() throws Throwable {
String[] args = new String[0];
String keyParam = "testString";
String valueParam = "testString";
Q2 q2 = new Q2(args);
try {
new QFactory(ObjectName.getInstance("testQFactoryParam1", keyParam, valueParam), null).destroyQBean(q2, new ObjectName("testQFactoryParam1", "testQFactoryParam2", "testQFactoryParam3"), new ChannelAdaptor());
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
if (isJavaVersionAtMost(JAVA_14)) {
assertNull(ex.getMessage(), "ex.getMessage()");
} else {
assertEquals("Cannot invoke \"javax.management.MBeanServer.invoke(javax.management.ObjectName, String, Object[], String[])\" because \"mserver\" is null", ex.getMessage(), "ex.getMessage()");
}
} finally {
q2.stop();
}
}
use of org.jpos.q2.Q2 in project jPOS by jpos.
the class QMUXTestCase method setUp.
@BeforeAll
public static void setUp(@TempDir Path deployDir) throws IOException {
sp = SpaceFactory.getSpace();
Files.walk(Paths.get("build/resources/test/org/jpos/q2/iso")).forEach(s -> {
if (Files.isRegularFile(s)) {
try {
Files.copy(s, deployDir.resolve(s.getFileName()), REPLACE_EXISTING);
} catch (IOException e) {
fail();
}
}
});
q2 = new Q2(deployDir.toString());
q2.start();
mux = NameRegistrar.get("mux.mux", 10000L);
assertNotNull(mux);
receivedHandback = null;
}
use of org.jpos.q2.Q2 in project jPOS by jpos.
the class LIST method exec.
@Override
public void exec(CLIContext ctx, String[] args) throws Exception {
Q2 q2 = ctx.getCLI().getQ2();
File deployDir = q2.getDeployDir();
ctx.println(printDirectoryTree(deployDir));
return;
}
Aggregations