/** * @return the default TransientSpace */ public static Space getSpace () { return getSpace (TSPACE, DEFAULT, null); }
private Space grabSpace (Element e) throws ConfigurationException { String uri = e != null ? e.getText() : ""; return SpaceFactory.getSpace (uri); }
@SuppressWarnings("unchecked") private Space<String, Object> grabSpace(Element e) { return (Space<String, Object>) SpaceFactory.getSpace(e != null ? e.getText() : ""); }
@SuppressWarnings("unchecked") private Space<String,Object> grabSpace (Element e) { return (Space<String,Object>) SpaceFactory.getSpace (e != null ? e.getText() : ""); }
public SpaceProxy () throws RemoteException { super(); sp = SpaceFactory.getSpace (); startService (); } public SpaceProxy (String spaceUri) throws RemoteException {
public SpaceProxy (String spaceUri) throws RemoteException { super (); sp = SpaceFactory.getSpace (spaceUri); startService (); }
protected void startService () throws Exception { if (spaceName == null) sp = SpaceFactory.getSpace (); else sp = SpaceFactory.getSpace (spaceName); objectName = new ObjectName (Q2.QBEAN_NAME + getName() + ",space=" + (spaceName != null ? spaceName : "default") ); getServer().getMBeanServer().registerMBean (sp, objectName); }
private LocalSpace grabSpace (Element e) throws ConfigurationException { String uri = e != null ? e.getText() : ""; Space sp = SpaceFactory.getSpace (uri); if (sp instanceof LocalSpace) { return (LocalSpace) sp; } throw new ConfigurationException ("Invalid space " + uri); }
private LocalSpace grabSpace (Element e) throws ConfigurationException { String uri = e != null ? e.getText() : ""; Space sp = SpaceFactory.getSpace (uri); if (sp instanceof LocalSpace) { return (LocalSpace) sp; } throw new ConfigurationException ("Invalid space " + uri); }
@Test(expected = NullPointerException.class) public void testGetSpaceThrowsNullPointerException2() throws Throwable { SpaceFactory.getSpace("testSpaceFactoryScheme", "testSpaceFactoryName", null); }
public void setConfiguration (Configuration cfg) throws ConfigurationException { sp = SpaceFactory.getSpace(cfg.get ("space", "")); queue = cfg.get ("queue", null); if (queue == null) throw new ConfigurationException ("Unspecified queue"); timeout = cfg.getLong ("timeout", 60000L); } }
public void testGetSpaceThrowsNullPointerException1() throws Throwable { try { SpaceFactory.getSpace("testSpaceFactoryScheme", "testSpaceFactoryName", "testSpaceFactoryParam"); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { assertNull("ex.getMessage()", ex.getMessage()); } }
public void setUp () throws Exception { sp = SpaceFactory.getSpace("tspace:txnmgrtest"); q2 = new Q2("build/resources/test/org/jpos/transaction"); q2.start(); } // public void testSimpleTransaction() {
@Override public void setConfiguration (Configuration cfg) throws ConfigurationException { super.setConfiguration(cfg); queueName = cfg.get("queue", null); if (queueName == null) throw new ConfigurationException("'queue' property not configured"); sp = SpaceFactory.getSpace(cfg.get("space")); timeout = cfg.getLong("timeout", timeout); } }
@Test public void testGetSpace2() throws Throwable { TSpace result = (TSpace) SpaceFactory.getSpace("testString"); assertTrue("result.isEmpty()", result.isEmpty()); }
private static Element createSchema() { Element schema = new Element("schema"); schema.setAttribute("id","base"); SpaceFactory.getSpace().put(SCHEMA_PREFIX+"base.xml", schema); return schema; }
@Test public void testWipe1() throws Throwable { SpaceUtil.wipe(SpaceFactory.getSpace(), ""); assertTrue("Test completed without Exception", true); // dependencies on static and environment state led to removal of 1 // assertion }
@Test public void testInpAll1() throws Throwable { Space sp = SpaceFactory.getSpace("testSpaceUtilSpaceUri"); SpaceUtil.nextLong(sp, ""); Object[] result = SpaceUtil.inpAll(sp, ""); assertEquals("(TSpace) sp.entries.size()", 0, ((TSpace) sp).entries.size()); assertFalse("(TSpace) sp.entries.containsKey(\"\")", ((TSpace) sp).entries.containsKey("")); assertEquals("result.length", 1, result.length); assertEquals("result[0]", 1L, result[0]); }
@Test public void testRdp() throws Throwable { Space sp = SpaceFactory.getSpace(); SpaceInterceptor spaceInterceptor = new SpaceInterceptor(sp); Object result = spaceInterceptor.rdp(sp); assertNull("result", result); assertSame("spaceInterceptor.sp", sp, spaceInterceptor.sp); }
@BeforeClass public static void setUp() { RestAssured.baseURI = APITest.BASE_URL; RestAssured.requestSpecification = new RequestSpecBuilder().build().contentType(MediaType.APPLICATION_JSON); sp = SpaceFactory.getSpace(); if (sp.rdp ("JPOSEE:STARTED") == null) { System.setProperty("user.name", "admin"); q2 = new Q2(); q2.start(); } ISOUtil.sleep(5000); }