Package org.apache.isis.viewer.junit.internal

Examples of org.apache.isis.viewer.junit.internal.IsisSystemUsingInstallersWithinJunit


        final InstallerLookupDefault installerLookup = new InstallerLookupDefault();
        isisConfigurationBuilder.injectInto(installerLookup);
        installerLookup.init();

        IsisSystemUsingInstallersWithinJunit system = null;
        AuthenticationSession session = null;
        try {
            // init the system; cf similar code in Isis and
            // IsisServletContextInitializer
            final DeploymentType deploymentType = DeploymentType.PROTOTYPE;

            // TODO: replace with regular IsisSystem and remove this subclass.
            system = new IsisSystemUsingInstallersWithinJunit(deploymentType, installerLookup, testClass);

            system.init();

            // specific to this bootstrap mechanism
            AuthenticationRequest request;
            final LogonFixture logonFixture = system.getFixturesInstaller().getLogonFixture();
            if (logonFixture != null) {
                request = new AuthenticationRequestLogonFixture(logonFixture);
            } else {
                request = new AuthenticationRequestExploration(logonFixture);
            }
            session = IsisContext.getAuthenticationManager().authenticate(request);

            IsisContext.openSession(session);
            getTransactionManager().startTransaction();

            final Object test = createTest();
            getServicesInjector().injectDependencies(test);

            final TestMethod testMethod = wrapMethod(method);
            new MethodRoadie(test, testMethod, notifier, description).run();

            getTransactionManager().endTransaction();

        } catch (final InvocationTargetException e) {
            testAborted(notifier, description, e.getCause());
            getTransactionManager().abortTransaction();
            return;
        } catch (final Exception e) {
            testAborted(notifier, description, e);
            return;
        } finally {
            if (system != null) {
                if (session != null) {
                    IsisContext.closeSession();
                }
                system.shutdown();
            }
        }
    }
View Full Code Here


        final InstallerLookupDefault installerLookup = new InstallerLookupDefault();
        isisConfigurationBuilder.injectInto(installerLookup);
        installerLookup.init();

        IsisSystemUsingInstallersWithinJunit system = null;
        AuthenticationSession session = null;
        try {
            // init the system; cf similar code in Isis and IsisServletContextInitializer
            final DeploymentType deploymentType = DeploymentType.PROTOTYPE;

            // TODO: replace with regular IsisSystem and remove this subclass.
            system = new IsisSystemUsingInstallersWithinJunit(deploymentType, installerLookup, testClass);

            system.init();

            // specific to this bootstrap mechanism
            AuthenticationRequest request;
            final LogonFixture logonFixture = system.getFixturesInstaller().getLogonFixture();
            if (logonFixture != null) {
                request = new AuthenticationRequestLogonFixture(logonFixture);
            } else {
                request = new AuthenticationRequestExploration(logonFixture);
            }
            session = IsisContext.getAuthenticationManager().authenticate(request);

            IsisContext.openSession(session);
            getTransactionManager().startTransaction();

            final Object test = createTest();
            getServicesInjector().injectDependencies(test);

            final TestMethod testMethod = wrapMethod(method);
            new MethodRoadie(test, testMethod, notifier, description).run();

            getTransactionManager().endTransaction();

        } catch (final InvocationTargetException e) {
            testAborted(notifier, description, e.getCause());
            getTransactionManager().abortTransaction();
            return;
        } catch (final Exception e) {
            testAborted(notifier, description, e);
            return;
        } finally {
            if (system != null) {
                if (session != null) {
                    IsisContext.closeSession();
                }
                system.shutdown();
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.junit.internal.IsisSystemUsingInstallersWithinJunit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.