@Override public void start(BundleContext context) throws Exception { if ("true".equalsIgnoreCase(context.getProperty("org.jpos.q2.autostart"))) (q2 = new Q2(new String[] {}, context)).start(); }
public static void main (String[] args) throws Exception { Q2 q2 = new Q2(args); q2.setExit (true); q2.start(); } public static String getVersion() {
@Before public void setUp() { m_q2 = new Q2(m_args); }
@Test public void testSetLogger() throws Throwable { String[] args = new String[0]; Element e = new Element("testQFactoryName"); new QFactory(new ObjectName(""), new Q2(args)).setLogger(new Object(), e); assertEquals("e.getName()", "testQFactoryName", e.getName()); }
public void setUp () throws Exception { sp = SpaceFactory.getSpace("tspace:txnmgrtest"); q2 = new Q2("build/resources/test/org/jpos/transaction"); q2.start(); } // public void testSimpleTransaction() {
@Test public void testShutdown() throws Throwable { String[] args = new String[1]; args[0] = "testString"; Q2 q2 = new Q2(args); q2.shutdown(true); }
@Test public void testShutdown1() throws Throwable { String[] args = new String[1]; args[0] = "undeploed:"; Q2 q2 = new Q2(args); q2.shutdown(); } }
@Test public void testAccept() throws Throwable { String[] args = new String[2]; args[0] = ""; args[1] = ""; boolean result = new Q2(args).accept(new File("testQ2Param1")); assertFalse("result", result); }
@Test public void testGetDeployDir() throws Throwable { String[] args = new String[0]; File result = new Q2(args).getDeployDir(); assertEquals("result.getName()", "deploy", result.getName()); }
@Test public void testDestroyQBeanThrowsNullPointerException1() throws Throwable { String[] args = new String[0]; Hashtable<String, String> hashtable = new Hashtable<String, String>(100, 100.0F); hashtable.put("testString", "testString"); try { new QFactory(ObjectName.getInstance("testQFactoryParam1", hashtable), null).destroyQBean(new Q2(args), new ObjectName( "testQFactoryParam1", "testQFactoryParam2", "testQFactoryParam3"), new ChannelAdaptor()); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { assertNull("ex.getMessage()", ex.getMessage()); } }
@Test public void testGetFactory() throws Throwable { String[] args = new String[2]; args[0] = "testString"; args[1] = "testString"; QFactory result = new Q2(args).getFactory(); assertNull("result", result); }
@Test public void testGetMBeanServer() throws Throwable { String[] args = new String[0]; MBeanServer result = new Q2(args).getMBeanServer(); assertNull("result", result); }
@Test public void testAcceptThrowsNullPointerException() throws Throwable { String[] args = new String[1]; args[0] = ""; try { new Q2(args).accept(null); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { assertNull("ex.getMessage()", ex.getMessage()); } }
@Test public void testDecryptThrowsNullPointerException() throws Throwable { String[] args = new String[1]; args[0] = "testString"; Q2 q2 = new Q2(args); try { q2.decrypt(null); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { assertNull("ex.getMessage()", ex.getMessage()); } }
@Test public void testRelaxThrowsIllegalArgumentException() throws Throwable { String[] args = new String[0]; try { new Q2(args).relax(-100L); fail("Expected IllegalArgumentException to be thrown"); } catch (IllegalArgumentException ex) { assertEquals("ex.getMessage()", "timeout value is negative", ex.getMessage()); } }
@Test public void testGetKey() throws Throwable { String[] args = new String[2]; args[0] = "testString"; args[1] = "testString"; Q2 q2 = new Q2(args); byte[] result = q2.getKey(); assertEquals("result.length", 8, result.length); assertEquals("result[0]", (byte) 67, result[0]); }
@Test public void testGetCommandLineArgs() throws Throwable { String[] args = new String[1]; args[0] = "testString"; String[] result = new Q2(args).getCommandLineArgs(); assertSame("result", args, result); assertEquals("m_args[0]", "testString", args[0]); }
@Test public void testGetLog2() throws Throwable { String[] args = new String[2]; args[0] = "testString"; args[1] = "testString"; m_q2 = new Q2(args); Log log = m_q2.getLog(); Log result = m_q2.getLog(); assertSame("result", log, result); }
@BeforeClass public static void setUp() throws NameRegistrar.NotFoundException { if (q2 == null) { q2 = new Q2(); q2.start(); NameRegistrar.get("qrest", 60000L); NameRegistrar.get("qrest"); // this time throw exception mgr = NameRegistrar.get("http-client-txnmgr", 10000L); } }
@BeforeClass public static void setUp() throws NameRegistrar.NotFoundException { RestAssured.baseURI = BASE_URL; RestAssured.useRelaxedHTTPSValidation(); RestAssured.requestSpecification = new RequestSpecBuilder().build().contentType(APPLICATION_JSON.toString()); if (q2 == null) { q2 = new Q2(); q2.start(); NameRegistrar.get("qrest", 60000L); NameRegistrar.get("qrest"); // this time throw exception } }