@Test public void testRetryableInherited() throws Exception { Map<Class<? extends Throwable>, Boolean> retryable = getRetryableExceptionClasses("s3", getContext()); System.err.println(retryable); assertEquals(2, retryable.size()); containsClassified(retryable, IOException.class, true); }
@Test public void testRetryableInheritedMerge() throws Exception { Map<Class<? extends Throwable>, Boolean> retryable = getRetryableExceptionClasses("s4", getContext()); System.err.println(retryable); assertEquals(3, retryable.size()); containsClassified(retryable, IOException.class, true); }
@Test public void testInheritStreams() throws Exception { Collection<ItemStream> streams = getStreams("s1", getContext()); assertEquals(2, streams.size()); boolean c = false; for (ItemStream o : streams) { if (o instanceof CompositeItemStream) { c = true; } } assertTrue(c); }
@Test public void testRetryable() throws Exception { Map<Class<? extends Throwable>, Boolean> retryable = getRetryableExceptionClasses("s1", getContext()); System.err.println(retryable); assertEquals(3, retryable.size()); containsClassified(retryable, PessimisticLockingFailureException.class, true); containsClassified(retryable, CannotSerializeTransactionException.class, false); }
@Test public void testInheritStreamsWithNoMerge() throws Exception { Collection<ItemStream> streams = getStreams("s2", getContext()); assertEquals(1, streams.size()); boolean c = false; for (ItemStream o : streams) { if (o instanceof CompositeItemStream) { c = true; } } assertTrue(c); }
@Test public void testInheritRetryListenersWithNoMerge() throws Exception { Collection<RetryListener> retryListeners = getRetryListeners("s2", getContext()); assertEquals(1, retryListeners.size()); boolean h = false; for (RetryListener o : retryListeners) { if (o instanceof DummyRetryListener) { h = true; } } assertTrue(h); }
@Test public void testInheritSkippableWithNoMerge() throws Exception { Map<Class<? extends Throwable>, Boolean> skippable = getSkippableExceptionClasses("s2", getContext()); assertEquals(3, skippable.size()); containsClassified(skippable, IllegalArgumentException.class, true); assertFalse(skippable.containsKey(ArithmeticException.class)); containsClassified(skippable, ConcurrencyFailureException.class, false); assertFalse(skippable.containsKey(DeadlockLoserDataAccessException.class)); }
@Test public void testInheritSkippable() throws Exception { Map<Class<? extends Throwable>, Boolean> skippable = getSkippableExceptionClasses("s1", getContext()); System.err.println(skippable); assertEquals(5, skippable.size()); containsClassified(skippable, NullPointerException.class, true); containsClassified(skippable, ArithmeticException.class, true); containsClassified(skippable, CannotAcquireLockException.class, false); containsClassified(skippable, DeadlockLoserDataAccessException.class, false); }
@Test public void testInheritRetryListeners() throws Exception { Collection<RetryListener> retryListeners = getRetryListeners("s1", getContext()); assertEquals(2, retryListeners.size()); boolean g = false; boolean h = false; for (RetryListener o : retryListeners) { if (o instanceof RetryListenerSupport) { g = true; } else if (o instanceof DummyRetryListener) { h = true; } } assertTrue(g); assertTrue(h); }