Codota Logo
Test.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.junit.Test
constructor

Best Java code snippets using org.junit.Test.<init> (Showing top 20 results out of 101,880)

Refine searchRefine arrow

  • Assert.assertEquals
  • Assert.assertTrue
  • List.size
  • Assert.assertFalse
  • Assert.assertNotNull
  • List.get
  • Common ways to obtain Test
private void myMethod () {
Test t =
  • Codota IconMethod method;method.getAnnotation(Test.class)
  • Codota IconFrameworkMethod method;method.getAnnotation(Test.class)
  • Codota IconDescription description;description.getAnnotation(Test.class)
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-framework

@Test
public void testListWithInconsistentElementType() {
  ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("spr7283.xml", getClass());
  List<?> list = ctx.getBean("list", List.class);
  assertEquals(2, list.size());
  assertTrue(list.get(0) instanceof A);
  assertTrue(list.get(1) instanceof B);
}
origin: ReactiveX/RxJava

@Test
public void enumMethods() {
  assertEquals(1, DisposableHelper.values().length);
  assertNotNull(DisposableHelper.valueOf("DISPOSED"));
}
origin: ReactiveX/RxJava

@Test
public void dispose() {
  PublishProcessor<Integer> pp = PublishProcessor.create();
  TestObserver<Integer> to = pp.singleElement().delay(100, TimeUnit.MILLISECONDS).test();
  assertTrue(pp.hasSubscribers());
  to.cancel();
  assertFalse(pp.hasSubscribers());
}
origin: spring-projects/spring-framework

@Test
public void testCollectionInjectionFromSameConfigurationClass() {
  ApplicationContext ctx = new AnnotationConfigApplicationContext(CollectionInjectionConfiguration.class);
  CollectionInjectionConfiguration bean = ctx.getBean(CollectionInjectionConfiguration.class);
  assertNotNull(bean.testBeans);
  assertEquals(1, bean.testBeans.size());
  assertSame(ctx.getBean(TestBean.class), bean.testBeans.get(0));
}
origin: ReactiveX/RxJava

@Test
public void emptyObserverEnum() {
  assertEquals(1, TestObserver.EmptyObserver.values().length);
  assertNotNull(TestObserver.EmptyObserver.valueOf("INSTANCE"));
}
origin: ReactiveX/RxJava

@Test
public void shouldUnsubscribeFromUnderlyingSubscriptionOnDispose() {
  final PublishProcessor<String> processor = PublishProcessor.create();
  final TestScheduler scheduler = new TestScheduler();
  final TestSubscriber<String> subscriber = processor
      .timeout(100, TimeUnit.MILLISECONDS, scheduler)
      .test();
  assertTrue(processor.hasSubscribers());
  subscriber.dispose();
  assertFalse(processor.hasSubscribers());
}
origin: spring-projects/spring-framework

@Test
public void loadPackagePrivateFactory() {
  List<DummyPackagePrivateFactory> factories =
      SpringFactoriesLoader.loadFactories(DummyPackagePrivateFactory.class, null);
  assertEquals(1, factories.size());
  assertTrue((factories.get(0).getClass().getModifiers() & Modifier.PUBLIC) == 0);
}
origin: ReactiveX/RxJava

@Test
public void backpressureKind() {
  assertEquals(6, BackpressureKind.values().length);
  assertNotNull(BackpressureKind.valueOf("FULL"));
}
origin: ReactiveX/RxJava

@Test
public void cancelAsFlowable() {
  PublishProcessor<Integer> pp = PublishProcessor.create();
  TestSubscriber<Integer> ts = pp.singleOrError().toFlowable().test();
  assertTrue(pp.hasSubscribers());
  ts.assertEmpty();
  ts.cancel();
  assertFalse(pp.hasSubscribers());
}
origin: spring-projects/spring-framework

@Test
public void loadFactoriesInCorrectOrder() {
  List<DummyFactory> factories = SpringFactoriesLoader.loadFactories(DummyFactory.class, null);
  assertEquals(2, factories.size());
  assertTrue(factories.get(0) instanceof MyDummyFactory1);
  assertTrue(factories.get(1) instanceof MyDummyFactory2);
}
origin: ReactiveX/RxJava

  @Test
  public void checkEnum() {
    assertEquals(2, EmptyDisposable.values().length);
    assertNotNull(EmptyDisposable.valueOf("INSTANCE"));
    assertNotNull(EmptyDisposable.valueOf("NEVER"));
  }
}
origin: ReactiveX/RxJava

@Test
public void switchMapInnerCancelled() {
  PublishProcessor<Integer> pp = PublishProcessor.create();
  TestSubscriber<Integer> ts = Flowable.just(1)
      .switchMap(Functions.justFunction(pp))
      .test();
  assertTrue(pp.hasSubscribers());
  ts.cancel();
  assertFalse(pp.hasSubscribers());
}
origin: spring-projects/spring-framework

@Test
public void testCollectionArgumentOnBeanMethod() {
  ApplicationContext ctx = new AnnotationConfigApplicationContext(CollectionArgumentConfiguration.class, TestBean.class);
  CollectionArgumentConfiguration bean = ctx.getBean(CollectionArgumentConfiguration.class);
  assertNotNull(bean.testBeans);
  assertEquals(1, bean.testBeans.size());
  assertSame(ctx.getBean(TestBean.class), bean.testBeans.get(0));
}
origin: ReactiveX/RxJava

@Test
public void emptyWithOnNext() {
  PublishProcessor<Object> pp = PublishProcessor.create();
  TestObserver<Integer> to = Maybe.<Integer>empty()
  .delay(pp).test();
  to.assertEmpty();
  assertTrue(pp.hasSubscribers());
  pp.onNext(1);
  assertFalse(pp.hasSubscribers());
  to.assertResult();
}
origin: spring-projects/spring-framework

@Test
public void testPrototypeListFactory() throws Exception {
  List list = (List) this.beanFactory.getBean("pListFactory");
  assertTrue(list instanceof LinkedList);
  assertTrue(list.size() == 2);
  assertEquals("bar", list.get(0));
  assertEquals("jenny", list.get(1));
}
origin: ReactiveX/RxJava

@Test
public void selectorFallbackTake() {
  PublishProcessor<Integer> pp = PublishProcessor.create();
  TestSubscriber<Integer> ts = pp
  .timeout(Functions.justFunction(Flowable.never()), Flowable.just(2))
  .take(1)
  .test();
  assertTrue(pp.hasSubscribers());
  pp.onNext(1);
  assertFalse(pp.hasSubscribers());
  ts.assertResult(1);
}
origin: spring-projects/spring-framework

@Test
public void testSPR3304() throws Exception {
  Method bridgedMethod = MegaMessageProducerImpl.class.getDeclaredMethod("receive", MegaMessageEvent.class);
  assertFalse(bridgedMethod.isBridge());
  Method bridgeMethod  = MegaMessageProducerImpl.class.getDeclaredMethod("receive", MegaEvent.class);
  assertTrue(bridgeMethod.isBridge());
  assertEquals(bridgedMethod, BridgeMethodResolver.findBridgedMethod(bridgeMethod));
}
origin: spring-projects/spring-framework

@Test
public void mergeListWithInnerBeanAsListElement() throws Exception {
  TestBean bean = (TestBean) this.beanFactory.getBean("childWithListOfRefs");
  List list = bean.getSomeList();
  assertNotNull(list);
  assertEquals(3, list.size());
  assertNotNull(list.get(2));
  assertTrue(list.get(2) instanceof TestBean);
}
origin: spring-projects/spring-framework

@Test
public void testStaticScriptWithInlineDefinedInstanceUsingJsr223() throws Exception {
  ApplicationContext ctx = new ClassPathXmlApplicationContext("groovyContextWithJsr223.xml", getClass());
  assertTrue(Arrays.asList(ctx.getBeanNamesForType(Messenger.class)).contains("messengerInstanceInline"));
  Messenger messenger = (Messenger) ctx.getBean("messengerInstanceInline");
  assertFalse("Shouldn't get proxy when refresh is disabled", AopUtils.isAopProxy(messenger));
  assertFalse("Scripted object should not be instance of Refreshable", messenger instanceof Refreshable);
  String desiredMessage = "Hello World!";
  assertEquals("Message is incorrect", desiredMessage, messenger.getMessage());
  assertTrue(ctx.getBeansOfType(Messenger.class).values().contains(messenger));
}
origin: ReactiveX/RxJava

@Test
public void normal() {
  TestResourceObserver<Integer> tc = new TestResourceObserver<Integer>();
  assertFalse(tc.isDisposed());
  assertEquals(0, tc.start);
  assertTrue(tc.values.isEmpty());
  assertTrue(tc.errors.isEmpty());
  Observable.just(1).subscribe(tc);
  assertTrue(tc.isDisposed());
  assertEquals(1, tc.start);
  assertEquals(1, tc.values.get(0).intValue());
  assertTrue(tc.errors.isEmpty());
}
org.junitTest<init>

Popular methods of Test

  • expected
  • timeout

Popular in Java

  • Making http post requests using okhttp
  • requestLocationUpdates (LocationManager)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • getSystemService (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • BoxLayout (javax.swing)
  • JList (javax.swing)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now