@Override public Weld selectAlternatives(Class<?>... alternativeClasses) { for (Class<?> alternativeClass : alternativeClasses) { addAlternative(alternativeClass); } return this; }
@Override public Weld selectAlternatives(Class<?>... alternativeClasses) { for (Class<?> alternativeClass : alternativeClasses) { addAlternative(alternativeClass); } return this; }
@Override public Weld selectAlternatives(Class<?>... alternativeClasses) { for (Class<?> alternativeClass : alternativeClasses) { addAlternative(alternativeClass); } return this; }
/** * Add alternatives classes to the list of selected alternatives for the synthetic bean archive. * <p> * This method does not add any class to the set of bean classes of the synthetic bean archive. * </p> * @param alternativeClasses classes of the alternatives to select * @return self */ public Weld selectAlternatives(Class<?>... alternativeClasses) { for (Class<?> clazz : alternativeClasses) { addAlternative(clazz); } return this; }
/** * Select alternatives for the synthetic bean archive, all previous values are removed. * <p> * This method does not add any class to the set of bean classes for the synthetic bean archive. It's purpose is solely to compensate the absence of the * <code>beans.xml</code> descriptor. * * @param alternativeClasses * @return self */ public Weld alternatives(Class<?>... alternativeClasses) { selectedAlternatives.clear(); for (Class<?> alternativeClass : alternativeClasses) { addAlternative(alternativeClass); } return this; }
MockBean<?> mockBean = (MockBean<?>) bean; if (mockBean.isAlternative() && mockBean.isSelectForSyntheticBeanArchive()) { this.weld.addAlternative(mockBean.getBeanClass());
MockBean<?> mockBean = (MockBean<?>) bean; if (mockBean.isAlternative() && mockBean.isSelectForSyntheticBeanArchive()) { this.weld.addAlternative(mockBean.getBeanClass());
CamelCdiDeployment(TestClass test, CamelCdiContext context) { this.context = context; weld = new Weld() // TODO: check parallel execution .containerId("camel-context-cdi") .property(ConfigurationKey.RELAXED_CONSTRUCTION.get(), true) .property(Weld.SHUTDOWN_HOOK_SYSTEM_PROPERTY, false) .enableDiscovery() .beanClasses(test.getJavaClass().getDeclaredClasses()) .addBeanClass(test.getJavaClass()) .addExtension(new CdiCamelExtension()); // Apply deployment customization provided by the @Beans annotation // if present on the test class if (test.getJavaClass().isAnnotationPresent(Beans.class)) { Beans beans = test.getJavaClass().getAnnotation(Beans.class); weld.addExtension(new CamelCdiTestExtension(beans)); for (Class<?> alternative : beans.alternatives()) { // It is not necessary to add the alternative class with WELD-2218 // anymore, though it's kept for previous versions weld.addBeanClass(alternative) .addAlternative(alternative); } for (Class<?> clazz : beans.classes()) { weld.addBeanClass(clazz); } weld.addPackages(false, beans.packages()); } }