public void addServicesAnnotatedOn(Class<?> javaClass) throws InstantiationException, IllegalAccessException { List<Object> services = new ArrayList<Object>(); addServicesAnnotatedOn(javaClass, services); addServices(services); }
private void addServicesAnnotatedOn(final Class<?> testClass, final List<Object> services) throws InstantiationException, IllegalAccessException { final Services servicesAnnotation = testClass.getAnnotation(Services.class); if (servicesAnnotation != null) { final Service[] serviceAnnotations = servicesAnnotation.value(); for (final Service serviceAnnotation : serviceAnnotations) { addServiceRepresentedBy(serviceAnnotation, services); } } final Service serviceAnnotation = testClass.getAnnotation(Service.class); if (serviceAnnotation != null) { addServiceRepresentedBy(serviceAnnotation, services); } }
this.testClass = testClass; setAuthenticatorInstaller(getInstallerLookup().configure(new AuthenticationInstallerWithinJunit())); setPersistenceMechanismInstaller(getInstallerLookup().configure(new InMemoryPersistenceMechanismInstallerWithinJunit())); setUserProfileStoreInstaller(getInstallerLookup().configure(new InMemoryUserProfileStoreInstaller())); FixtureInstallerAnnotatedClass fixtureInstaller = new FixtureInstallerAnnotatedClass(); try { fixtureInstaller.addFixturesAnnotatedOn(this.testClass.getJavaClass()); } catch (InstantiationException e) { throw new NakedObjectException(e); throw new NakedObjectException(e); setFixtureInstaller(fixtureInstaller); ServicesInstallerAnnotatedClass servicesInstaller = new ServicesInstallerAnnotatedClass(); try { servicesInstaller.addServicesAnnotatedOn(this.testClass.getJavaClass()); } catch (InstantiationException e) { throw new NakedObjectException(e); throw new NakedObjectException(e); setServicesInstaller(servicesInstaller);
system = new NakedObjectsSystemUsingInstallersWithinJunit( deploymentType, installerLookup, getTestClass()); system.setHideSplash(true); system.init(); final LogonFixture logonFixture = system.getFixturesInstaller().getLogonFixture(); if (logonFixture != null) { session = new SimpleSession(logonFixture.getUsername(), logonFixture.getRoles()); NakedObjectsContext.closeSession(); system.shutdown();
/** * Should be called prior to installing; typically called immediately after instantiation. * * <p> * Note: an alternative design would be to have a 1-arg constructor, but the convention for * installers is to make them no-arg. */ public void addFixturesAnnotatedOn(Class<?> javaClass) throws InstantiationException, IllegalAccessException { final Fixtures fixturesAnnotation = javaClass.getAnnotation(Fixtures.class); if (fixturesAnnotation != null) { final Fixture[] fixtureAnnotations = fixturesAnnotation.value(); for (final Fixture fixtureAnnotation : fixtureAnnotations) { addFixtureRepresentedBy(fixtureAnnotation, fixtures); } } final Fixture fixtureAnnotation = javaClass.getAnnotation(Fixture.class); if (fixtureAnnotation != null) { addFixtureRepresentedBy(fixtureAnnotation, fixtures); } }
this.testClass = testClass; setAuthenticatorInstaller(getInstallerLookup().configure(new AuthenticationInstallerWithinJunit())); setPersistenceMechanismInstaller(getInstallerLookup().configure(new InMemoryPersistenceMechanismInstallerWithinJunit())); setUserProfileStoreInstaller(getInstallerLookup().configure(new InMemoryUserProfileStoreInstaller())); FixtureInstallerAnnotatedClass fixtureInstaller = new FixtureInstallerAnnotatedClass(); try { fixtureInstaller.addFixturesAnnotatedOn(this.testClass.getJavaClass()); } catch (InstantiationException e) { throw new NakedObjectException(e); throw new NakedObjectException(e); setFixtureInstaller(fixtureInstaller); ServicesInstallerAnnotatedClass servicesInstaller = new ServicesInstallerAnnotatedClass(); try { servicesInstaller.addServicesAnnotatedOn(this.testClass.getJavaClass()); } catch (InstantiationException e) { throw new NakedObjectException(e); throw new NakedObjectException(e); setServicesInstaller(servicesInstaller);
system = new NakedObjectsSystemUsingInstallersWithinJunit( deploymentType, installerLookup, getTestClass()); system.setHideSplash(true); system.init(); final LogonFixture logonFixture = system.getFixturesInstaller().getLogonFixture(); if (logonFixture != null) { session = new SimpleSession(logonFixture.getUsername(), logonFixture.getRoles()); NakedObjectsContext.closeSession(); system.shutdown();
public void addServicesAnnotatedOn(Class<?> javaClass) throws InstantiationException, IllegalAccessException { List<Object> services = new ArrayList<Object>(); addServicesAnnotatedOn(javaClass, services); addServices(services); }
private void addServicesAnnotatedOn(final Class<?> testClass, final List<Object> services) throws InstantiationException, IllegalAccessException { final Services servicesAnnotation = testClass.getAnnotation(Services.class); if (servicesAnnotation != null) { final Service[] serviceAnnotations = servicesAnnotation.value(); for (final Service serviceAnnotation : serviceAnnotations) { addServiceRepresentedBy(serviceAnnotation, services); } } final Service serviceAnnotation = testClass.getAnnotation(Service.class); if (serviceAnnotation != null) { addServiceRepresentedBy(serviceAnnotation, services); } }
/** * Should be called prior to installing; typically called immediately after instantiation. * * <p> * Note: an alternative design would be to have a 1-arg constructor, but the convention for * installers is to make them no-arg. */ public void addFixturesAnnotatedOn(Class<?> javaClass) throws InstantiationException, IllegalAccessException { final Fixtures fixturesAnnotation = javaClass.getAnnotation(Fixtures.class); if (fixturesAnnotation != null) { final Fixture[] fixtureAnnotations = fixturesAnnotation.value(); for (final Fixture fixtureAnnotation : fixtureAnnotations) { addFixtureRepresentedBy(fixtureAnnotation, fixtures); } } final Fixture fixtureAnnotation = javaClass.getAnnotation(Fixture.class); if (fixtureAnnotation != null) { addFixtureRepresentedBy(fixtureAnnotation, fixtures); } }