Examples of TestConfig


Examples of org.apache.myfaces.mc.test.core.annotation.TestConfig

        this.mockedMyFacesTestContainer = new MyFacesContainer(new TestClass(this.testClass))
        {
            @Override
            protected String getWebappResourcePath()
            {
                TestConfig testConfig = testClass.getJavaClass().getAnnotation(TestConfig.class);

                if (testConfig == null || DEFAULT_TEST_CONFIG_LITERAL.webappResourcePath().equals(
                    testConfig.webappResourcePath()))
                {
                    return ConfigResolver.getPropertyValue("deltaspike.testcontrol.mf.test.webapp_resource_path", "");
                }
                return testConfig.webappResourcePath();
            }

            @Override
            protected void setUpServletObjects()
            {
View Full Code Here

Examples of org.apache.myfaces.mc.test.core.annotation.TestConfig

        if (jsfConfiguration == null)
        {
            jsfConfiguration = new SharedFacesConfiguration();
        }
       
        TestConfig testConfig = getTestJavaClass().getAnnotation(TestConfig.class);
        boolean enableJNDI = (testConfig != null) ? testConfig.enableJNDI() : true;
        if (enableJNDI)
        {
            System.setProperty(Context.INITIAL_CONTEXT_FACTORY, MockInitialContextFactory.class.getName());
            jndiContext = new DefaultContext();
            MockInitialContextFactory.setCurrentContext(jndiContext);
View Full Code Here

Examples of org.apache.myfaces.mc.test.core.annotation.TestConfig

     *
     * @return
     */
    protected String getWebappResourcePath()
    {
        TestConfig testConfig = getTestJavaClass().getAnnotation(TestConfig.class);
        if (testConfig != null && testConfig.webappResourcePath() != null &&
            !"testClassResourcePackage".equals(testConfig.webappResourcePath()))
        {
            return testConfig.webappResourcePath();
        }
        return this.getClass().getName().substring(0,
                this.getClass().getName().lastIndexOf('.')).replace('.', '/')
                + "/";
    }
View Full Code Here

Examples of org.apache.myfaces.mc.test.core.annotation.TestConfig

     *
     * @return
     */
    protected ExpressionFactory createExpressionFactory()
    {
        TestConfig testConfig = getTestJavaClass().getAnnotation(TestConfig.class);
        if (testConfig != null && testConfig.expressionFactory() != null &&
            testConfig.expressionFactory().length() > 0)
        {
            return (ExpressionFactory) ClassUtils.newInstance(
                testConfig.expressionFactory(), ExpressionFactory.class);
        }
        return new MockExpressionFactory();
    }
View Full Code Here

Examples of org.apache.myfaces.mc.test.core.annotation.TestConfig

     *
     * @return
     */
    protected boolean isScanAnnotations()
    {
        TestConfig testConfig = getTestJavaClass().getAnnotation(TestConfig.class);
        if (testConfig != null)
        {
            return testConfig.scanAnnotations();
        }
        return false;
    }
View Full Code Here

Examples of org.apache.myfaces.mc.test.core.annotation.TestConfig

        if (jsfConfiguration == null)
        {
            jsfConfiguration = new SharedFacesConfiguration();
        }
       
        TestConfig testConfig = getTestJavaClass().getAnnotation(TestConfig.class);
        boolean enableJNDI = (testConfig != null) ? testConfig.enableJNDI() : true;
        if (enableJNDI)
        {
            System.setProperty(Context.INITIAL_CONTEXT_FACTORY, MockInitialContextFactory.class.getName());
            jndiContext = new DefaultContext();
            MockInitialContextFactory.setCurrentContext(jndiContext);
View Full Code Here

Examples of org.apache.myfaces.mc.test.core.annotation.TestConfig

        servletContext.addInitParameter("javax.faces.PARTIAL_STATE_SAVING", "true");
        servletContext.addInitParameter(ViewHandler.FACELETS_REFRESH_PERIOD_PARAM_NAME,"-1");
        servletContext.addInitParameter("org.apache.myfaces.config.annotation.LifecycleProvider",
            NoInjectionAnnotationLifecycleProvider.class.getName());
       
        TestConfig testConfig = getTestJavaClass().getAnnotation(TestConfig.class);
        if (testConfig != null && testConfig.oamAnnotationScanPackages() != null &&
            testConfig.oamAnnotationScanPackages().length() > 0)
        {
            servletContext.addInitParameter("org.apache.myfaces.annotation.SCAN_PACKAGES",
                testConfig.oamAnnotationScanPackages());
        }

        List<FrameworkMethod> setupWebConfigParamMethods = testClass.getAnnotatedMethods(SetupWebConfigParams.class);
        if (setupWebConfigParamMethods != null && !setupWebConfigParamMethods.isEmpty())
        {
View Full Code Here

Examples of org.apache.myfaces.mc.test.core.annotation.TestConfig

     *
     * @return
     */
    protected String getWebappResourcePath()
    {
        TestConfig testConfig = getTestJavaClass().getAnnotation(TestConfig.class);
        if (testConfig != null && testConfig.webappResourcePath() != null &&
            !"testClassResourcePackage".equals(testConfig.webappResourcePath()))
        {
            return testConfig.webappResourcePath();
        }
        return getTestJavaClass().getName().substring(0,
                getTestJavaClass().getName().lastIndexOf('.')).replace('.', '/')
                + "/";
    }
View Full Code Here

Examples of org.apache.myfaces.mc.test.core.annotation.TestConfig

     *
     * @return
     */
    protected ExpressionFactory createExpressionFactory()
    {
        TestConfig testConfig = getTestJavaClass().getAnnotation(TestConfig.class);
        if (testConfig != null && testConfig.expressionFactory() != null &&
            testConfig.expressionFactory().length() > 0)
        {
            return (ExpressionFactory) ClassUtils.newInstance(
                testConfig.expressionFactory(), ExpressionFactory.class);
        }
        return new MockExpressionFactory();
    }
View Full Code Here

Examples of org.apache.myfaces.mc.test.core.annotation.TestConfig

     *
     * @return
     */
    protected boolean isScanAnnotations()
    {
        TestConfig testConfig = getTestJavaClass().getAnnotation(TestConfig.class);
        if (testConfig != null)
        {
            return testConfig.scanAnnotations();
        }
        return false;
    }
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.