public QFactory getFactory () { return getServer().getFactory (); }
private String q2Version() { return String.format("jPOS %s %s/%s (%s)", Q2.getVersion(), Q2.getBranch(), Q2.getRevision(), Q2.getBuildTimestamp() ); } private Map<String,Object> diskspace() {
public static String getRelease() { return getVersion() + " " + getRevision(); } public static String getAppVersionString() {
public static String getVersionString() { String appVersionString = getAppVersionString(); int l = PGPHelper.checkLicense(); String sl = l > 0 ? " " + Integer.toString(l,16) : ""; String vs = null; if (appVersionString != null) { vs = String.format ("jPOS %s %s/%s%s (%s)%n%s%s", getVersion(), getBranch(), getRevision(), sl, getBuildTimestamp(), appVersionString, getLicensee() ); } else { vs = String.format("jPOS %s %s/%s%s (%s) %s", getVersion(), getBranch(), getRevision(), sl, getBuildTimestamp(), getLicensee() ); } // if ((l & 0xE0000) > 0) // throw new IllegalAccessError(vs); return vs; }
@Before public void setUp() { m_q2 = new Q2(m_args); }
@Test public void testRetry() throws IOException { Q2 q2 = new Q2("build/resources/test/org/jpos/util/dirpoll_retry/deploy"); q2.start(); ISOUtil.sleep(5000L); createTestFile("build/resources/test/org/jpos/util/dirpoll_retry/request/REQ1", "RETRYME"); ISOUtil.sleep(5000L); q2.stop(); ISOUtil.sleep(2000L); assertTrue("Can't read request", new File("build/resources/test/org/jpos/util/dirpoll_retry/request/REQ1").canRead()); } public static class RetryTest implements DirPoll.Processor {
@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 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()); } }
qentry.setDeployed (f.lastModified ()); else if (deploy(f)) { if (qentry.isQBean ()) startList.add (qentry.getInstance()); undeploy (f); iter.remove (); loader.forceNewClassLoaderOnNextScan(); registerOSGIBundle(f); for (ObjectInstance instance : startList) start(instance);
@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]); }
public void shutdown () { shutdown(false); } public boolean running() {
@Test public void testGetMBeanServer() throws Throwable { String[] args = new String[0]; MBeanServer result = new Q2(args).getMBeanServer(); assertNull("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 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()); } }