Examples of IsisSystemUsingInstallersWithinJunit


Examples of org.apache.isis.core.integtestsupport.legacy.components.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().injectServicesInto(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

Examples of org.apache.isis.core.integtestsupport.legacy.components.IsisSystemUsingInstallersWithinJunit

        final InstallerLookup installerLookup = new InstallerLookup();
        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.UNIT_TESTING;

            // 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().injectServicesInto(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

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

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
TOP
Copyright © 2018 www.massapi.com. 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.