@Ignore("null value is not allowed") @Test public void testGetWithASingleNullItem() throws Exception { Observable<String> obs = Observable.just((String)null); Future<String> f = obs.toFuture(); assertEquals(null, f.get()); } }
@Ignore @Test // this test is quite slow. TODO: re-enable with JUnit categories public void testNonFileResourceExists() throws Exception { Resource resource = new UrlResource("http://www.springframework.org"); assertTrue(resource.exists()); }
@Test @Ignore("Observers can't throw") public void onErrorNotImplementedFailureSafe() { try { new SafeObserver<String>(OBSERVER_ONERROR_NOTIMPLEMENTED()).onError(new SafeObserverTestException("error!")); fail("expects exception to be thrown"); } catch (Exception e) { // assertTrue(e instanceof OnErrorNotImplementedException); assertTrue(e.getCause() instanceof SafeObserverTestException); assertEquals("error!", e.getCause().getMessage()); } }
@Ignore("subscribe() should not throw") @Test(expected = TestException.class) public void testExceptionThrownFromOnSubscribe() { Iterable<String> strings = Flowable.unsafeCreate(new Publisher<String>() { @Override public void subscribe(Subscriber<? super String> subscriber) { throw new TestException("intentional"); } }).blockingIterable(); for (String string : strings) { // never reaches here System.out.println(string); } }
@Ignore // passes under Eclipse, fails under Ant @Test public void classpathStarWithPatternOnFileSystem() throws IOException { Resource[] resources = resolver.getResources("classpath*:org/springframework/core/io/sup*/*.class"); // Have to exclude Clover-generated class files here, // as we might be running as part of a Clover test run. List<Resource> noCloverResources = new ArrayList<>(); for (Resource resource : resources) { if (!resource.getFilename().contains("$__CLOVER_")) { noCloverResources.add(resource); } } resources = noCloverResources.toArray(new Resource[noCloverResources.size()]); assertProtocolAndFilenames(resources, "file", StringUtils.concatenateStringArrays(CLASSES_IN_CORE_IO_SUPPORT, TEST_CLASSES_IN_CORE_IO_SUPPORT)); }
@Ignore( "TODO(DRILL-2470): unignore when SMALLINT is implemented" ) @Test public void test_IS_NULLABLE_hasRightValue_mdrOptSMALLINT() throws SQLException { assertThat( mdrOptSMALLINT.getString( "IS_NULLABLE" ), equalTo( "YES" ) ); }
@Test @Ignore("Intended for use during development only") public void shouldBeFasterThanSynchronizedMap() throws InterruptedException { Map<Integer, WeakReference<String>> synchronizedMap = Collections.synchronizedMap(new WeakHashMap<Integer, WeakReference<String>>()); StopWatch mapTime = timeMultiThreaded("SynchronizedMap", synchronizedMap, v -> new WeakReference<>(String.valueOf(v))); System.out.println(mapTime.prettyPrint()); this.map.setDisableTestHooks(true); StopWatch cacheTime = timeMultiThreaded("WeakConcurrentCache", this.map, String::valueOf); System.out.println(cacheTime.prettyPrint()); // We should be at least 4 time faster assertThat(cacheTime.getTotalTimeSeconds(), is(lessThan(mapTime.getTotalTimeSeconds() / 4.0))); }
@Test @Ignore // SPR-15122 public void listenersReceiveEarlyEvents() { load(EventOnPostConstruct.class, OrderedTestListener.class); OrderedTestListener listener = this.context.getBean(OrderedTestListener.class); assertThat(listener.order, contains("first", "second", "third")); }
@Test @Ignore public void testIntroductionWithArgumentBinding() { TestBean target = new TestBean(); assertThat(modifiable, instanceOf(Modifiable.class)); Lockable lockable = (Lockable) modifiable; assertFalse(lockable.locked()); int oldAge = itb.getAge(); itb.setAge(oldAge + 1); assertTrue(modifiable.isModified()); modifiable.acceptChanges(); assertFalse(modifiable.isModified()); assertFalse("Setting same value does not modify", modifiable.isModified()); itb.setName("And now for something completely different"); assertTrue(modifiable.isModified()); assertTrue(lockable.locked()); try { itb.setName("Else");
@Test @Ignore("Observers can't throw") public void onErrorNotImplementedFailureSafe() { try { new SafeSubscriber<String>(subscriberOnErrorNotImplemented()).onError(new SafeSubscriberTestException("error!")); fail("expects exception to be thrown"); } catch (Exception e) { // assertTrue(e instanceof OnErrorNotImplementedException); assertTrue(e.getCause() instanceof SafeSubscriberTestException); assertEquals("error!", e.getCause().getMessage()); } }
@Ignore("subscribe() should not throw") @Test(expected = TestException.class) public void testExceptionThrownFromOnSubscribe() { Iterable<String> strings = Observable.unsafeCreate(new ObservableSource<String>() { @Override public void subscribe(Observer<? super String> observer) { throw new TestException("intentional"); } }).blockingIterable(); for (String string : strings) { // never reaches here System.out.println(string); } }
@Test @Ignore("[SPR-8644] findMethod() does not currently support var-args") public void invokeMethodWithPrimitiveVarArgs() { // IntelliJ IDEA 11 won't accept int assignment here Integer sum = invokeMethod(component, "add", 1, 2, 3, 4); assertEquals("add(1,2,3,4)", 10, sum.intValue()); }
@Ignore( "TODO(DRILL-2683): unignore when REAL is implemented" ) @Test public void test_IS_NULLABLE_hasRightValue_mdrOptREAL() throws SQLException { assertThat( mdrOptREAL.getString( "IS_NULLABLE" ), equalTo( "YES" ) ); }
@Test @Ignore("Not implemented yet, see http://jira.springframework.org/browse/SPR-5708") public void testExclusionOfNonPublicInterfaces() { JFrame frame = new JFrame(); ProxyFactory proxyFactory = new ProxyFactory(frame); Object proxy = proxyFactory.getProxy(); assertTrue(proxy instanceof RootPaneContainer); assertTrue(proxy instanceof Accessible); }
@Test @Ignore // TODO: fragile due to socket failures public void basicTest() throws Exception { URI url = new URI("http://localhost:" + port); ResponseEntity<String> response = new RestTemplate().exchange( RequestEntity.get(url).build(), String.class); assertThat(response.getBody(), Matchers.equalTo("hello")); }
@Test @Ignore("Observers can't throw") public void onNextOnErrorFailureSafe() { try { new SafeSubscriber<String>(OBSERVER_ONNEXT_ONERROR_FAIL()).onNext("one"); fail("expects exception to be thrown"); } catch (Exception e) { e.printStackTrace(); assertTrue(e instanceof RuntimeException); assertEquals("Error occurred when trying to propagate error to Subscriber.onError", e.getMessage()); Throwable e2 = e.getCause(); assertTrue(e2 instanceof CompositeException); List<Throwable> innerExceptions = ((CompositeException) e2).getExceptions(); assertEquals(2, innerExceptions.size()); Throwable e3 = innerExceptions.get(0); assertTrue(e3 instanceof SafeSubscriberTestException); assertEquals("onNextFail", e3.getMessage()); Throwable e4 = innerExceptions.get(1); assertTrue(e4 instanceof SafeSubscriberTestException); assertEquals("onErrorFail", e4.getMessage()); } }
@Test @Ignore("Null values not permitted") public void mergeWithNullValues() { System.out.println("mergeWithNullValues"); TestObserver<String> to = new TestObserver<String>(); Observable.merge(Observable.just(null, "one"), Observable.just("two", null)).subscribe(to); to.assertTerminated(); to.assertNoErrors(); to.assertValues(null, "one", "two", null); }
@Ignore("null value is not allowed") @Test public void testGetWithASingleNullItem() throws Exception { Flowable<String> obs = Flowable.just((String)null); Future<String> f = obs.toFuture(); assertEquals(null, f.get()); } }