static { // determine good/bad nodes: final ConnectionFactory cf = ConnectionFactory.getInstance(); cf.testAllNodes(); // set not to automatically try reconnects (auto-retries prevent ConnectionException tests from // working): final DefaultConnectionPolicy cp = ((DefaultConnectionPolicy) cf.getConnectionPolicy()); cp.setMaxRetries(0); scalarisNode = cp.selectNode().toString(); }
@Test public void testGetConnection() throws SQLException { System.out.println("ConnectionFactory"); System.out.println("Testando a criação de Intâcia: 'ConnectionFactory'"); ConnectionFactory instance = new ConnectionFactory(); assertNotNull( ">>> A instância da Classe 'ConnectionFactory' não pode ser criada! <<<", instance); Connection conn = instance.getConnection(); assertNotNull(conn); }