@Test public void testService_AdvancedPooledConnection() throws Exception { int maxServices = 5; final int iterations = 5; int poolsize = maxServices - 1; createDatabase(); List<Service> serviceList = new ArrayList<Service>(); String name = Thread.currentThread().getName(); Thread.currentThread().setName(getName()); AdvancedJdbcPooledConnection conn = PooledConnectionHelper.createAdvancedPooledConnection(PROPERTIES.getProperty(JDBC_SEQUENCENUMBER_DRIVER), PROPERTIES.getProperty(JDBC_SEQUENCENUMBER_URL), poolsize); try { for (int i = 0; i < maxServices; i++) { StaticIdentitySequenceNumberService service = createServiceForTests(false); service.setConnection(conn); service.setIdentity(new GuidGenerator().safeUUID()); serviceList.add(service); start(service); } PooledConnectionHelper.executeTest(serviceList, iterations, new PooledConnectionHelper.MessageCreator() { @Override public AdaptrisMessage createMsgForPooledConnectionTest() throws Exception { return createMessageForTests(); } }); assertEquals(0, conn.currentBusyConnectionCount()); assertEquals(poolsize, conn.currentIdleConnectionCount()); assertEquals(poolsize, conn.currentConnectionCount()); } finally { stop(serviceList.toArray(new ComponentLifecycle[0])); Thread.currentThread().setName(name); } }
public void setIdentity(String id) { identity = id; }
StaticIdentitySequenceNumberService extends AbstractJdbcSequenceNumberService { public void setIdentity(String id) { identity = id; } }
StaticIdentitySequenceNumberService extends AbstractJdbcSequenceNumberService { public void setIdentity(String id) { identity = id; }  }
StaticIdentitySequenceNumberService extends AbstractJdbcSequenceNumberService { public void setIdentity(String id) { identity = id; }  String getIdentity(); void setIdentity(String id); }
StaticIdentitySequenceNumberService extends AbstractJdbcSequenceNumberService { public void setIdentity(String id) { identity = id; }  String getIdentity(); void setIdentity(String id);  }