/** * {@inheritDoc} */ @Override public boolean validateObject(final PooledObject<T> p) { writeLock.lock(); try { return factory.validateObject(p); } finally { writeLock.unlock(); } }
/** * {@inheritDoc} */ @Override public boolean validateObject(final PooledObject<T> p) { writeLock.lock(); try { return factory.validateObject(p); } finally { writeLock.unlock(); } }
if (!factory.validateObject(ref)) { success = false; } else {
private static <T> List<String> invokeEveryMethod(final PooledObjectFactory<T> pof) throws Exception { pof.activateObject(null); pof.destroyObject(null); pof.makeObject(); pof.passivateObject(null); pof.validateObject(null); pof.toString(); final List<String> expectedMethods = Arrays.asList(new String[] { "activateObject", "destroyObject", "makeObject", "passivateObject", "validateObject", "toString", }); return expectedMethods; }
if (!factory.validateObject(ref)) { success = false; } else {
try { factory.activateObject(ref); if (!factory.validateObject(ref)) { throw new Exception("ValidateObject failed");
Throwable validationThrowable = null; try { validate = factory.validateObject(p); } catch (final Throwable t) { PoolUtils.checkRethrow(t);
@Test public void testDefaultMethods() throws Exception { final PooledObjectFactory<Object> factory = new TestFactory(); factory.activateObject(null); // a no-op factory.passivateObject(null); // a no-op factory.destroyObject(null); // a no-op assertTrue(factory.validateObject(null)); // constant true }
/** * {@inheritDoc} */ @Override public boolean validateObject(final PooledObject<T> p) { writeLock.lock(); try { return factory.validateObject(p); } finally { writeLock.unlock(); } }
if (!factory.validateObject(underTest)) { destroy(underTest); destroyedByEvictorCount.incrementAndGet();
if (getTestOnReturn() && !factory.validateObject(p)) { try { destroy(p);
if (!factory.validateObject(ref)) { success = false; } else {
if (!factory.validateObject(ref)) { success = false; } else {
try { factory.activateObject(ref); if (!factory.validateObject(ref)) { throw new Exception("ValidateObject failed");
Throwable validationThrowable = null; try { validate = factory.validateObject(p); } catch (final Throwable t) { PoolUtils.checkRethrow(t);
if (!factory.validateObject(underTest)) { destroy(underTest); destroyedByEvictorCount.incrementAndGet();
if (getTestOnReturn() && !factory.validateObject(p)) { try { destroy(p);