@Override public void bind(TransactionResource resource) { // Not checking for type of TransactionRes if (resource != null && resource instanceof RedisTransaction) { this.resource = resource; } else { throw new KunderaTransactionException("Invalid transaction resource provided:" + resource + " Should have been an instance of :" + RedisTransaction.class); } }
@Test public void testKunderaTransactionException() { KunderaTransactionException exception = new KunderaTransactionException(); Assert.assertNotNull(exception); exception = new KunderaTransactionException("Error with string"); Assert.assertNotNull(exception); exception = new KunderaTransactionException(new RuntimeException()); Assert.assertNotNull(exception); exception = new KunderaTransactionException("Error with string", new RuntimeException()); Assert.assertNotNull(exception); exception = new KunderaTransactionException("Error with string", new RuntimeException()); Assert.assertNotNull(exception); }
/** * Binds Transaction resource to this client. * * @param resource * the resource */ @Override public void bind(TransactionResource resource) { if (resource != null && resource instanceof Neo4JTransaction) { ((Neo4JTransaction) resource).setGraphDb(factory.getConnection()); this.resource = resource; } else { throw new KunderaTransactionException("Invalid transaction resource provided:" + resource + " Should have been an instance of :" + Neo4JTransaction.class); } }
throw new KunderaTransactionException( "Client : " + client.getClass() throw new KunderaTransactionException(e);
@Override public void bind(TransactionResource resource) { // Not checking for type of TransactionRes if (resource != null && resource instanceof RedisTransaction) { this.resource = resource; } else { throw new KunderaTransactionException("Invalid transaction resource provided:" + resource + " Should have been an instance of :" + RedisTransaction.class); } }
/** * Binds Transaction resource to this client. * * @param resource * the resource */ @Override public void bind(TransactionResource resource) { if (resource != null && resource instanceof Neo4JTransaction) { ((Neo4JTransaction) resource).setGraphDb(factory.getConnection()); this.resource = resource; } else { throw new KunderaTransactionException("Invalid transaction resource provided:" + resource + " Should have been an instance of :" + Neo4JTransaction.class); } }