Package org.apache.sling.junit.remote.httpclient

Examples of org.apache.sling.junit.remote.httpclient.RemoteTestHttpClient


    }
   
    @Before
    public void setupContent() throws Exception {
        slingClient = new SlingClient(getServerBaseUrl(), getServerUsername(), getServerPassword());
        testClient = new RemoteTestHttpClient(getServerBaseUrl() + JUNIT_SERVLET_PATH, getServerUsername(), getServerPassword(), true);
       
        cleanupContent();

        // A test node has the sling:Test mixin and points
        // to a test script
View Full Code Here


   private void invokeRemote(String remoteUrl, String remoteUsername, String remotePassword, FrameworkMethod method) throws Throwable {
       final String testClassesSelector = method.getMethod().getDeclaringClass().getName();
       final String methodName = method.getMethod().getName();
      
       final RemoteTestHttpClient testHttpClient = new RemoteTestHttpClient(remoteUrl, remoteUsername, remotePassword, false);
       testHttpClient.setRequestCustomizer(this);
       final RequestExecutor executor = testHttpClient.runTests(
               testClassesSelector, methodName, "serialized"
       );
       log.debug("Ran test {} method {} at URL {}",
               new Object[] { testClassesSelector, methodName, remoteUrl });
      
View Full Code Here

        if(testHttpClient != null) {
            // Tests already ran
            return;
        }
       
        testHttpClient = new RemoteTestHttpClient(testParameters.getJunitServletUrl(), this.username, this.password, true);

        // Let the parameters class customize the request if desired
        if(testParameters instanceof RequestCustomizer) {
            testHttpClient.setRequestCustomizer((RequestCustomizer)testParameters);
        }
View Full Code Here

    public ServerSideTestClient() {
        super(getServerBaseUrl(), getUsername(), getPassword());
    }
   
    public TestResults runTests(String testPackageOrClassName) throws Exception {
        final RemoteTestHttpClient testClient = new RemoteTestHttpClient(serverBaseUrl + "/system/sling/junit",serverUsername,serverPassword,true);
        final TestResults r = new TestResults();
        final Map<String, String> options = new HashMap<String, String>();
        options.put("forceReload", "true");
        final RequestExecutor executor = testClient.runTests(testPackageOrClassName, null, "json", options);
        executor.assertContentType("application/json");
        String content = executor.getContent();
        final JSONArray json = new JSONArray(new JSONTokener(content));

        for(int i = 0 ; i < json.length(); i++) {
View Full Code Here

TOP

Related Classes of org.apache.sling.junit.remote.httpclient.RemoteTestHttpClient

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.