Tabnine Logo
org.jboss.cdi.tck.tests.implementation.enterprise.newBean
Code IndexAdd Tabnine to your IDE (free)

How to use org.jboss.cdi.tck.tests.implementation.enterprise.newBean

Best Java code snippets using org.jboss.cdi.tck.tests.implementation.enterprise.newBean (Showing top 20 results out of 315)

origin: stackoverflow.com

 Character c = new Wizard();
....
Character c = new Elf();
origin: org.jboss.cdi.tck/cdi-tck-impl

@Produces
@Tame
public Litter produceLitter() {
  return new Litter(nextLitterSize);
}
origin: org.jboss.cdi.tck/cdi-tck-impl

@Test
@SpecAssertion(section = NEW_EE, id = "o")
public void testNewBeanHasTheSameInterceptorBindings() {
  // Method foo() is intercepted
  assertTrue(getContextualReference(NewSessionBeanConsumer.class).getOrder().ping());
}
origin: org.jboss.cdi.tck/cdi-tck-impl

@Test(dataProvider = ARQUILLIAN_DATA_PROVIDER)
@SpecAssertions({ @SpecAssertion(section = NEW_EE, id = "yj") })
public void testNewBeanCreatedForObserverMethod(Wizard wizard) {
  Bean<Hat> bean = getUniqueBean(Hat.class, New.Literal.INSTANCE);
  checkNewQualifiedBean(bean, Object.class, Hat.class);
  getCurrentManager().fireEvent(new Wizard());
  assertTrue(wizard.getHat().ping());
}
origin: org.jboss.cdi.tck/cdi-tck-impl

/**
 * Sets up both the bean and the @New bean with different configurations so that the correct producer method used can be
 * determined.
 * 
 * @throws Exception
 */
@Test
@SpecAssertion(section = NEW_EE, id = "v")
public void testNewBeanHasNoProducerMethods() throws Exception {
  FoxLocal fox = getContextualReference(FoxLocal.class);
  FoxLocal newFox = getContextualReference(FoxLocal.class, New.Literal.of(Fox.class));
  fox.setNextLitterSize(3);
  newFox.setNextLitterSize(5);
  @SuppressWarnings("serial")
  Litter theOnlyLitter = getContextualReference(Litter.class, new AnnotationLiteral<Tame>() {
  });
  assert theOnlyLitter.getQuantity() == fox.getNextLitterSize();
}
origin: org.jboss.cdi.tck/cdi-tck-impl

@Test(dataProvider = ARQUILLIAN_DATA_PROVIDER)
@SpecAssertions({ @SpecAssertion(section = NEW_EE, id = "yf") })
public void testNewBeanCreatedForConstructorInjectionPoint(Wizard wizard) {
  Bean<Spell> bean = getUniqueBean(Spell.class, New.Literal.INSTANCE);
  checkNewQualifiedBean(bean, Object.class, Spell.class);
  assertTrue(wizard.getSpell().ping());
}
origin: org.jboss.cdi.tck/cdi-tck-impl

@Test(dataProvider = ARQUILLIAN_DATA_PROVIDER)
@SpecAssertions({ @SpecAssertion(section = NEW_EE, id = "yb") })
public void testNewBeanCreatedForFieldInjectionPoint(Wizard wizard) {
  Bean<Tiger> bean = getUniqueBean(Tiger.class, New.Literal.INSTANCE);
  checkNewQualifiedBean(bean, Object.class, Tiger.class);
  assertTrue(wizard.getTiger().ping());
}
origin: org.jboss.cdi.tck/cdi-tck-impl

@Test(dataProvider = ARQUILLIAN_DATA_PROVIDER)
@SpecAssertions({ @SpecAssertion(section = NEW_EE, id = "yh") })
public void testNewBeanCreatedForProducerMethod(Wizard wizard) {
  Bean<Dragon> bean = getUniqueBean(Dragon.class, New.Literal.INSTANCE);
  checkNewQualifiedBean(bean, Object.class, Dragon.class);
  assertTrue(wizard.getDragon().ping());
}
origin: org.jboss.cdi.tck/cdi-tck-impl

@Test(dataProvider = ARQUILLIAN_DATA_PROVIDER)
@SpecAssertions({ @SpecAssertion(section = NEW_EE, id = "yd") })
public void testNewBeanCreatedForInitializerInjectionPoint(Wizard wizard) {
  Bean<Staff> bean = getUniqueBean(Staff.class, New.Literal.INSTANCE);
  checkNewQualifiedBean(bean, Object.class, Staff.class);
  assertTrue(wizard.getStaff().ping());
}
origin: org.jboss.cdi.tck/cdi-tck-impl

@Test(dataProvider = ARQUILLIAN_DATA_PROVIDER)
@SpecAssertions({ @SpecAssertion(section = NEW_EE, id = "yl") })
public void testNewBeanCreatedForDisposerMethod(DragonProducer producer) {
  Bean<Fireball> bean = getUniqueBean(Fireball.class, New.Literal.INSTANCE);
  checkNewQualifiedBean(bean, Object.class, Fireball.class);
  Bean<Dragon> dragonBean = getUniqueBean(Dragon.class, TameLiteral.INSTANCE);
  CreationalContext<Dragon> ctx = getCurrentManager().createCreationalContext(dragonBean);
  Dragon dragon = dragonBean.create(ctx);
  dragonBean.destroy(dragon, ctx);
  assertTrue(producer.isDragonDestroyed());
}
origin: org.jboss.cdi.tck/cdi-tck-impl

@Test
@SpecAssertion(section = NEW_EE, id = "l")
public void testNewBeanHasSameConstructor() {
  ExplicitConstructor newBean = getContextualReference(ExplicitConstructor.class, New.Literal.of(
      ExplicitConstructorSessionBean.class));
  assert newBean.getConstructorCalls() == 1;
  assert newBean.getInjectedSimpleBean() != null;
}
origin: org.jboss.cdi.tck/cdi-tck-impl

@Test
@SpecAssertion(section = NEW_EE, id = "m")
public void testNewBeanHasSameInitializers() {
  InitializerSimpleBeanLocal bean = getContextualReference(InitializerSimpleBeanLocal.class);
  InitializerSimpleBeanLocal newBean = getContextualReference(InitializerSimpleBeanLocal.class, New.Literal.of(
      InitializerSimpleBean.class));
  assert bean != newBean;
  assert bean.getInitializerCalls() == 2;
}
origin: org.jboss.cdi.tck/cdi-tck-impl

@Tame
@Stateful
public class Lion implements LionLocal {

  @Remove
  public void remove() {

  }

}

origin: org.jboss.cdi.tck/cdi-tck-impl

@Interceptor
@Secure
public class OrderInterceptor {

  @AroundInvoke
  public Object intercept(InvocationContext ctx) throws Exception {
    return true;
  }
}

origin: org.jboss.cdi.tck/cdi-tck-impl

@Stateful
@AnimalStereotype
public class Monkey implements MonkeyLocal {

}

origin: stackoverflow.com

Champion wizard = new Wizard();
 Champion warrior = new Warrior();
 AttackTypes attackType = AttackTypes.Ranged;
 System.out.println("can wizard attack? : " + wizard.canAttack(attackType));
 System.out.println("can warrior attack? : " + warrior.canAttack(attackType));
origin: org.jboss.cdi.tck/cdi-tck-impl

public void disposeLitter(@Disposes @Tame Litter litter) {
  this.litterDisposed = true;
}
origin: org.jboss.cdi.tck/cdi-tck-impl

@Secure
@Stateful
public class Order implements OrderLocal {

  @Remove
  public void remove() {

  }

  @Override
  public boolean ping() {
    return false;
  }

}

origin: org.jboss.cdi.tck/cdi-tck-impl

@Produces
@Tame
public Dragon summon(@New Dragon dragon) {
  return dragon;
}
origin: org.jboss.cdi.tck/cdi-tck-impl

public void destroyDragon(@Disposes @Tame Dragon dragon, @New Fireball fireball) {
  isDragonDestroyed = true;
}
org.jboss.cdi.tck.tests.implementation.enterprise.newBean

Most used classes

  • Wizard
  • AnimalStereotype
  • Dragon
  • DragonProducer
  • ExplicitConstructor
  • Hat,
  • InitializerSimpleBeanLocal,
  • Litter,
  • NewEnterpriseBeanICTest,
  • NewEnterpriseBeanTest,
  • NewSessionBeanConsumer,
  • OrderLocal,
  • Secure,
  • Spell,
  • Staff,
  • Tame,
  • Tiger
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now