/** * Create a container, specifying the classes and beans.xml to deploy * * @param lifecycle * @param classes * @param beansXml */ public TestContainer(BeansXml beansXml, Collection<Class<?>> classes) { this(new FlatDeployment(new BeanDeploymentArchiveImpl(beansXml, classes))); }
/** * Create a container, specifying the classes and beans.xml to deploy * * @param lifecycle * @param classes * @param beansXml */ public TestContainer(BeansXml beansXml, Collection<Class<?>> classes) { this(forBeanDeploymentArchive(new BeanDeploymentArchiveImpl(beansXml, classes))); }
@Override public ResourceReferenceFactory<EntityManagerFactory> registerPersistenceUnitInjectionPoint(InjectionPoint injectionPoint) { return MockResourceReferenceFactory.instance(); } }
protected void configureServices() { services.add(TransactionServices.class, new MockTransactionServices()); services.add(SecurityServices.class, new MockSecurityServices()); services.add(EjbServices.class, new MockEjBServices()); // javax.validation is an optional dependency if (Utils.isClassAccessible("javax.validation.Validator", AbstractDeployment.class.getClassLoader())) { services.add(ValidationServices.class, new MockValidationServices()); } }
protected void configureServices() { this.services.add(EjbInjectionServices.class, new MockEjbInjectionServices()); this.services.add(JpaInjectionServices.class, new MockJpaInjectionServices()); this.services.add(ResourceInjectionServices.class, new MockResourceInjectionServices()); this.services.add(ResourceLoader.class, new MockResourceLoader()); }
protected void configureServices() { this.services.add(EjbInjectionServices.class, new MockEjbInjectionServices()); this.services.add(JpaInjectionServices.class, new MockJpaInjectionServices()); this.services.add(ResourceInjectionServices.class, new MockResourceInjectionServices()); }
public static Deployment forBeanDeploymentArchive(BeanDeploymentArchiveImpl beanDeploymentArchive) { if (isAccessible(CDI11DEPLOYMENT_CLASS_NAME, DeploymentFactory.class.getClassLoader())) { return new CDI11FlatDeployment(beanDeploymentArchive); } else { return new FlatDeployment(beanDeploymentArchive); } }
/** * Bootstrap and shutdown the container. * */ public void run() throws Exception { run(NO_OP); }
/** * Wicket does not use the RequestDispatcher, so this implementation just returns a dummy value. * * @param name * The name of the servlet or JSP * @return The dispatcher */ public RequestDispatcher getNamedDispatcher(final String name) { return getRequestDispatcher(name); }
public Validator getValidator() { return new MockValidator(); }
/** * Bootstrap and shutdown the container If the expected exception must be * thrown (including message). * * @throws AssertionError if the exception that was expected is not * thrown. */ public void runAndExpect(Exception expected) { runAndExpect(NO_OP, expected); }
@Override protected void configureServices() { super.configureServices(); }
protected void configureServices() { services.add(TransactionServices.class, new MockTransactionServices()); services.add(SecurityServices.class, new MockSecurityServices()); services.add(ValidationServices.class, new MockValidationServices()); services.add(EjbServices.class, new MockEjBServices()); }
/** * Bootstrap and shutdown the container. * */ public void run() throws Exception { run(NO_OP); }
/** * Wicket does not use the RequestDispatcher, so this implementation just returns a dummy value. * * @param name * The name of the servlet or JSP * @return The dispatcher */ public RequestDispatcher getNamedDispatcher(final String name) { return getRequestDispatcher(name); }
public Validator getValidator() { return new MockValidator(); }
/** * Bootstrap and shutdown the container If the expected exception must be * thrown (including message). * * @throws AssertionError if the exception that was expected is not * thrown. */ public void runAndExpect(Exception expected) { runAndExpect(NO_OP, expected); }
@Override protected void configureServices() { super.configureServices(); }
@Override public ResourceReferenceFactory<Object> registerEjbInjectionPoint(InjectionPoint injectionPoint) { return MockResourceReferenceFactory.instance(); } }
@Override public ResourceReferenceFactory<Object> registerResourceInjectionPoint(String jndiName, String mappedName) { return MockResourceReferenceFactory.instance(); } }