Package org.apache.sling.testing.tools.http

Examples of org.apache.sling.testing.tools.http.RequestBuilder.buildPostRequest()


        final MultipartEntity entity = new MultipartEntity();
        // Add Sling POST options
        entity.addPart("lang", new StringBody("esp"));
        entity.addPart("code", new InputStreamBody(getClass().getResourceAsStream("/test.js"), "test.js"));
        executor.execute(
                rb.buildPostRequest("/system/console/scriptconsole.json")
                 .withEntity(entity)
                 .withCredentials("admin","admin")
            ).assertStatus(200);
    }
}
View Full Code Here


            }
        }
       
        log.info("Executing test remotely, path={} JUnit servlet URL={}",
                subpath, junitServletUrl);
        final Request r = builder
        .buildPostRequest(subpath.toString())
        .withCredentials(username, password)
        .withCustomizer(requestCustomizer)
        .withEntity(new UrlEncodedFormEntity(opt));
        executor.execute(r).assertStatus(200);
View Full Code Here

        final MultipartEntity entity = new MultipartEntity();
        // Add Sling POST options
        entity.addPart("lang", new StringBody("groovy"));
        entity.addPart("code", code);
        executor.execute(
            rb.buildPostRequest("/system/console/sc").withEntity(entity).withCredentials(
                    "admin", "admin")).assertStatus(200);
    }

    private void execute2(String code) throws Exception
    {
View Full Code Here

        params.add(new BasicNameValuePair("code",code));

        final HttpEntity entity = new UrlEncodedFormEntity(params);
        // Add Sling POST options
        executor.execute(
                rb.buildPostRequest("/system/console/sc")
                        .withEntity(entity)
                        .withCredentials("admin", "admin"))
                .assertStatus(200);
    }
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.