Package org.richfaces.deployment

Examples of org.richfaces.deployment.CoreDeployment


    URL contextPath;

    @Deployment
    public static WebArchive createDeployment() {

        CoreDeployment deployment = new CoreDeployment(ITResourceMapping.class);
//        deployment.withWholeCore();

        PropertiesAsset staticResourceMapping = new PropertiesAsset()
                .key(":original.css").value("relocated.css")
                .key(":part1.css").value("aggregated.css")
                .key(":part2.css").value("aggregated.css")
                .key("part1.js").value("aggregated.js")
                .key("part2.js").value("aggregated.js");

        EmptyAsset emptyResource = EmptyAsset.INSTANCE;

        FaceletAsset relocationPage = new FaceletAsset().head("<h:outputStylesheet name=\"original.css\" />");

        FaceletAsset aggregationPage = new FaceletAsset().head("<h:outputStylesheet name=\"part1.css\" />"
                + "<h:outputStylesheet name=\"part2.css\" />");

        FaceletAsset javaScriptAggregationPage = new FaceletAsset().head("<h:outputScript name=\"part1.js\" />"
                + "<h:outputScript name=\"part2.js\" />");

        deployment.archive()
                /** classes */
                .addPackage(ResourceHandlerImpl.class.getPackage())
                .addPackage(ResourceTracker.class.getPackage())
                .addPackage(ResourceMapper.class.getPackage())
                .addClasses(Codec.class)
                /** META-INF */
                .addAsResource(staticResourceMapping, "META-INF/richfaces/static-resource-mappings.properties")
                /** ROOT */
                .addAsWebResource(relocationPage, "relocation.xhtml")
                .addAsWebResource(aggregationPage, "aggregation.xhtml")
                .addAsWebResource(javaScriptAggregationPage, "javaScriptAggregation.xhtml")
                .addAsWebResource(emptyResource, "resources/original.css")
                .addAsWebResource(emptyResource, "resources/part1.css")
                .addAsWebResource(emptyResource, "resources/part2.css")
                .addAsWebResource(emptyResource, "resources/relocated.css")
                .addAsWebResource(emptyResource, "resources/aggregated.css")
                .addAsWebResource(emptyResource, "resources/part1.js")
                .addAsWebResource(emptyResource, "resources/part2.js")
                .addAsWebResource(emptyResource, "resources/aggregated.js");

        deployment.webXml(new Function<WebAppDescriptor, WebAppDescriptor>() {
            public WebAppDescriptor apply(WebAppDescriptor descriptor) {

                descriptor.getOrCreateContextParam()
                        .paramName("org.richfaces.enableControlSkinning")
                        .paramValue("false");

                return descriptor;
            }
        });

        return deployment.getFinalArchive();
    }
View Full Code Here


    @ArquillianResource
    URL contextPath;

    public static CoreDeployment createBasicDeployment(Class<?> testClass) {

        CoreDeployment deployment = new CoreDeployment(testClass);
        deployment.withA4jComponents();
       
        FaceletAsset p = new FaceletAsset();
        p.body("<script>document.title = 'waiting-for-message'; RichFaces.Push.logLevel = \"debug\";</script>");
        p.body("<a4j:push address=\"" + Commons.TOPIC + "\" ondataavailable=\"console.log('a4j:push message: ' + event.rf.data); document.title = 'message-received: ' + event.rf.data\" />");

        deployment.addMavenDependency(
                "org.atmosphere:atmosphere-runtime");

        deployment.archive().addAsWebResource(p, "index.xhtml");

        return deployment;
    }
View Full Code Here

@Ignore("The test is unstable, https://issues.jboss.org/browse/RF-13888")
public class ITPushFilterWithoutWarp extends AbstractPushTestWithoutWarp {

    @Deployment
    public static WebArchive createDeployment() {
        CoreDeployment deployment = createBasicDeployment(ITPushFilterWithoutWarp.class);

        deployment.webXml(new Function<WebAppDescriptor, WebAppDescriptor>() {
            public WebAppDescriptor apply(WebAppDescriptor webXml) {
                return webXml
                    .createFilter()
                    .filterName(PushFilter.class.getSimpleName())
                    .filterClass(PushFilter.class.getName())
                    .asyncSupported(true)
                    .up()
                    .createFilterMapping()
                    .filterName(PushFilter.class.getSimpleName())
                    .servletName(FacesServlet.class.getSimpleName())
                    .up();
            }
        });

        return deployment.getFinalArchive();
    }
View Full Code Here

    @FindBy(css = "input[name='javax.faces.ClientWindow']")
    private WebElement hiddenFieldWithClientWindowID;

    @Deployment
    public static WebArchive createDeployment() {
        CoreDeployment deployment = createBasicDeployment(ITCliendWindowID.class);

        deployment.webXml(new Function<WebAppDescriptor, WebAppDescriptor>() {
            public WebAppDescriptor apply(WebAppDescriptor webXml) {
                return webXml
                    .createContextParam()
                    .paramName("javax.faces.CLIENT_WINDOW_MODE")
                    .paramValue("url")
                    .up();
            }
        });

        addIndexPage(deployment);
        return deployment.getFinalArchive().addClass(SimpleBean.class);
    }
View Full Code Here

    @ArquillianResource
    JavascriptExecutor executor;

    public static CoreDeployment createBasicDeployment(Class<?> testClass) {

        CoreDeployment deployment = new CoreDeployment(testClass);
        deployment.withA4jComponents();
        deployment.archive().addClass(AbstractPushTestWithoutWarp.class);

        FaceletAsset p = new FaceletAsset();
        p.body("<script>document.title = 'waiting-for-message';</script>");
        p.body("<a4j:push address=\"" + TOPIC + "\" ondataavailable=\"console.log('a4j:push message: ' + event.rf.data); document.title = 'message-received: ' + event.rf.data;\" />");
        p.form("<a4j:commandButton id=\"sendMessage\" value=\"send message\" action=\"#{pushBean.sendMessage}\" />");

        deployment.addMavenDependency(
            "org.atmosphere:atmosphere-runtime");
        deployment.archive().addClass(PushBean.class);

        deployment.archive().addAsWebResource(p, "index.xhtml");

        return deployment;
    }
View Full Code Here

    @FindBy
    private WebElement btn;

    @Deployment(testable = false)
    public static WebArchive deployment() {
        CoreDeployment deployment = new CoreDeployment(ITPartialResponseEnding.class);
        deployment.withA4jComponents();
       
        addIndexPage(deployment);
        deployment.addMavenDependency("org.omnifaces:omnifaces:1.3");

        return deployment.getFinalArchive().addClass(SimpleBean.class);
    }
View Full Code Here

@Ignore("The test is unstable, https://issues.jboss.org/browse/RF-13888")
public class ITPushServletMappingWithoutWarp extends AbstractPushTestWithoutWarp {

    @Deployment
    public static WebArchive createDeployment() {
        CoreDeployment deployment = createBasicDeployment(ITPushServletMappingWithoutWarp.class);

        deployment.webXml(new Function<WebAppDescriptor, WebAppDescriptor>() {
            public WebAppDescriptor apply(WebAppDescriptor webXml) {
                return webXml
                    .createServlet()
                    .servletName(PushServlet.class.getSimpleName())
                    .servletClass(PushServlet.class.getName())
                    .asyncSupported(true)
                    .up()
                    .createServletMapping()
                    .servletName(PushServlet.class.getSimpleName())
                    .urlPattern("/__custom_mapping")
                    .up()
                    .createContextParam()
                    .paramName("org.richfaces.push.handlerMapping")
                    .paramValue("/__custom_mapping")
                    .up();
            }
        });

        return deployment.getFinalArchive();
    }
View Full Code Here

TOP

Related Classes of org.richfaces.deployment.CoreDeployment

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.