Package org.apache.sling.commons.testing.integration

Examples of org.apache.sling.commons.testing.integration.NameValuePairList


        String testNodeName = "testNode_" + String.valueOf(random.nextInt());
        props.put(SlingPostConstants.RP_NODE_NAME_HINT, testNodeName);
        testFile = getTestFile(getClass().getResourceAsStream("/integration-test/servlets/post/testimport.json"));
        props.put(SlingPostConstants.RP_CONTENT_TYPE, "json");
        props.put(SlingPostConstants.RP_REDIRECT_TO, SERVLET_CONTEXT + testPath + "/*");
        String importedNodeUrl = testClient.createNode(HTTP_BASE_URL + testPath, new NameValuePairList(props), null, true,
            testFile, SlingPostConstants.RP_CONTENT_FILE, null);

        // assert content at new location
        String content = getContent(importedNodeUrl + ".3.json", CONTENT_TYPE_JSON);

View Full Code Here


            SlingPostConstants.OPERATION_IMPORT);

        testFile = getTestFile(getClass().getResourceAsStream("/integration-test/servlets/post/testimport2.json"));
        props.put(SlingPostConstants.RP_CONTENT_TYPE, "json");
        props.put(SlingPostConstants.RP_REDIRECT_TO, SERVLET_CONTEXT + testPath + "/*");
        String importedNodeUrl = testClient.createNode(HTTP_BASE_URL + testPath, new NameValuePairList(props), null, true,
            testFile, SlingPostConstants.RP_CONTENT_FILE, null);

        //make sure the name is what was inside the file.
        assertTrue(importedNodeUrl.endsWith("/nodeName"));

View Full Code Here

        String testNodeName = "testNode_" + String.valueOf(random.nextInt());
        props.put(SlingPostConstants.RP_NODE_NAME_HINT, testNodeName);
        testFile = getTestFile(getClass().getResourceAsStream("/integration-test/servlets/post/testimport.xml"));
        props.put(SlingPostConstants.RP_CONTENT_TYPE, "xml");
        props.put(SlingPostConstants.RP_REDIRECT_TO, SERVLET_CONTEXT + testPath + "/*");
        String importedNodeUrl = testClient.createNode(HTTP_BASE_URL + testPath, new NameValuePairList(props), null, true,
            testFile, SlingPostConstants.RP_CONTENT_FILE, null);

        // assert content at new location
        String content = getContent(importedNodeUrl + ".3.json", CONTENT_TYPE_JSON);

View Full Code Here

            SlingPostConstants.OPERATION_IMPORT);

        testFile = getTestFile(getClass().getResourceAsStream("/integration-test/servlets/post/testimport2.xml"));
        props.put(SlingPostConstants.RP_CONTENT_TYPE, "xml");
        props.put(SlingPostConstants.RP_REDIRECT_TO, SERVLET_CONTEXT + testPath + "/*");
        String importedNodeUrl = testClient.createNode(HTTP_BASE_URL + testPath, new NameValuePairList(props), null, true,
            testFile, SlingPostConstants.RP_CONTENT_FILE, null);

        //make sure the name is what was inside the file.
        assertTrue(importedNodeUrl.endsWith("/nodeName"));

View Full Code Here

        String testNodeName = "testNode_" + String.valueOf(random.nextInt());
        props.put(SlingPostConstants.RP_NODE_NAME_HINT, testNodeName);
        testFile = getTestFile(getClass().getResourceAsStream("/integration-test/servlets/post/testimport.zip"));
        props.put(SlingPostConstants.RP_CONTENT_TYPE, "zip");
        props.put(SlingPostConstants.RP_REDIRECT_TO, SERVLET_CONTEXT + testPath + "/*");
        String importedNodeUrl = testClient.createNode(HTTP_BASE_URL + testPath, new NameValuePairList(props), null, true,
            testFile, SlingPostConstants.RP_CONTENT_FILE, null);

        // assert content at new location
        String content = getContent(importedNodeUrl + ".3.json", CONTENT_TYPE_JSON);

View Full Code Here

        String testNodeName = "testNode_" + String.valueOf(random.nextInt());
        props.put(SlingPostConstants.RP_NODE_NAME_HINT, testNodeName);
        testFile = getTestFile(getClass().getResourceAsStream("/integration-test/servlets/post/testimport.jar"));
        props.put(SlingPostConstants.RP_CONTENT_TYPE, "jar");
        props.put(SlingPostConstants.RP_REDIRECT_TO, SERVLET_CONTEXT + testPath + "/*");
        String importedNodeUrl = testClient.createNode(HTTP_BASE_URL + testPath, new NameValuePairList(props), null, true,
            testFile, SlingPostConstants.RP_CONTENT_FILE, null);

        // assert content at new location
        String content = getContent(importedNodeUrl + ".3.json", CONTENT_TYPE_JSON);

View Full Code Here

        String testNodeName = "testnode_1287021810";
        props.put(SlingPostConstants.RP_NODE_NAME, testNodeName);
        testFile = getTestFile(getClass().getResourceAsStream("/integration-test/servlets/post/testimport.jcr.xml"));
        props.put(SlingPostConstants.RP_CONTENT_TYPE, "jcr.xml");
        props.put(SlingPostConstants.RP_REDIRECT_TO, SERVLET_CONTEXT + testPath + "/*");
        String importedNodeUrl = testClient.createNode(HTTP_BASE_URL + testPath, new NameValuePairList(props), null, true,
            testFile, SlingPostConstants.RP_CONTENT_FILE, null);

        // assert content at new location
        String content = getContent(importedNodeUrl + ".3.json", CONTENT_TYPE_JSON);

View Full Code Here

        slingResourceType = getClass().getName();

        // create the test node, under a path that's specific to this class to allow collisions
        final String url = HTTP_BASE_URL + "/" + getClass().getSimpleName() + "/" + System.currentTimeMillis() + SlingPostConstants.DEFAULT_CREATE_SUFFIX;

        NameValuePairList list = new NameValuePairList();
        list.add("sling:resourceType", slingResourceType);
        list.add("text", testText);
        list.add("multiText", testMultiText1);
        list.add("multiText", testMultiText2);
        displayUrl = testClient.createNode(url, list, null, true);
    }
View Full Code Here

        postUrl = HTTP_BASE_URL + TEST_BASE_PATH + "/" + System.currentTimeMillis();
    }

    private void doDateTest(String expected, String input, String expected2, String input2)
            throws IOException {
        final NameValuePairList props = new NameValuePairList();
        props.add("someDate", input);
        props.add("someDate@TypeHint", "Date");

        props.add("manyDates", input);
        props.add("manyDates", input2);
        props.add("manyDates@TypeHint", "Date[]");
       
        final String createdNodeUrl = testClient.createNode(postUrl + SlingPostConstants.DEFAULT_CREATE_SUFFIX, props, null, false);
        String content = getContent(createdNodeUrl + ".json", CONTENT_TYPE_JSON);

        // default behaviour writes empty string
View Full Code Here

        this.testClient.mkdirs(WEBDAV_BASE_URL, scriptPath);

        // create the test node, under a path that's specific to this class to allow collisions
        final String url = HTTP_BASE_URL + "/" + getClass().getSimpleName() + "/" + System.currentTimeMillis() + SlingPostConstants.DEFAULT_CREATE_SUFFIX;

        final NameValuePairList list = new NameValuePairList();
        list.add("sling:resourceType", slingResourceType);

        this.displayUrl = testClient.createNode(url, list, null, true);

    }
View Full Code Here

TOP

Related Classes of org.apache.sling.commons.testing.integration.NameValuePairList

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.