org.junit.Ignore.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(8.8k)|赞(0)|评价(0)|浏览(109)

本文整理了Java中org.junit.Ignore.<init>()方法的一些代码示例,展示了Ignore.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ignore.<init>()方法的具体详情如下:
包路径:org.junit.Ignore
类名称:Ignore
方法名:<init>

Ignore.<init>介绍

暂无

代码示例

代码示例来源:origin: ReactiveX/RxJava

@Ignore("This is not a separate class anymore")
@Test
public void constructorShouldBePrivate() {
  // TestHelper.checkUtilityClass(BlockingOperatorToIterator.class);
}

代码示例来源:origin: ReactiveX/RxJava

@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());
  }
}

代码示例来源:origin: spring-projects/spring-framework

@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());
}

代码示例来源:origin: ReactiveX/RxJava

@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());
    }
  }

代码示例来源:origin: ReactiveX/RxJava

@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);
  }
}

代码示例来源:origin: spring-projects/spring-framework

@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));
}

代码示例来源:origin: apache/drill

@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" ) );
}

代码示例来源:origin: spring-projects/spring-framework

@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)));
}

代码示例来源:origin: spring-projects/spring-framework

@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"));
}

代码示例来源:origin: spring-projects/spring-framework

@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");

代码示例来源:origin: ReactiveX/RxJava

@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());
    }
  }

代码示例来源:origin: ReactiveX/RxJava

@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);
  }
}

代码示例来源:origin: spring-projects/spring-framework

@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());
}

代码示例来源:origin: apache/drill

@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" ) );
}

代码示例来源:origin: ReactiveX/RxJava

@Ignore("OnNextValue not ported")
  @Test
  public void testRenderVoid() {
//        assertEquals("null", OnNextValue.renderValue((Void) null));
  }
}

代码示例来源:origin: spring-projects/spring-framework

@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);
}

代码示例来源:origin: spring-projects/spring-framework

@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"));
}

代码示例来源:origin: ReactiveX/RxJava

@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());
  }
}

代码示例来源:origin: ReactiveX/RxJava

@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);
}

代码示例来源:origin: ReactiveX/RxJava

@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());
  }
}

相关文章

微信公众号

最新文章

更多