Skip to content

Commit

Permalink
resolved conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuszkubis committed Sep 22, 2016
1 parent 0b9dfec commit 31d5a61
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
<jcr:root xmlns:sling="https://sling.apache.org/jcr/sling/1.0" xmlns:cq="https://www.day.com/jcr/cq/1.0" xmlns:jcr="https://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Component"
sling:resourceSuperType="cognifide/secureaem/components/abstractTest"
testClass="com.cognifide.secureaem.tests.SlingJspScriptHandler"/>
testClass="com.cognifide.secureaem.tests.SlingJspScriptHandlerTest"/>
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,27 @@
import com.cognifide.secureaem.markers.AuthorTest;
import com.cognifide.secureaem.markers.PublishTest;

public class HtmlLibraryManagerTest extends AbstractTest implements AuthorTest, PublishTest, OsgiConfigurationTest {
public class HtmlLibraryManagerTest extends AbstractTest
implements AuthorTest, PublishTest, OsgiConfigurationTest {

public HtmlLibraryManagerTest(Configuration config) {
super(config);
}

@Override
public boolean doTest(String url, String instanceName) throws Exception {
String[] user = AuthorTest.ENVIRONMENT_NAME.equals(instanceName) ? UserHelper.splitUser(config.getStringValue("authorUser", "admin:admin")) : UserHelper.splitUser(config.getStringValue("publishUser", "admin:admin"));
String configurationEndpoint = url + "/system/console/configMgr/com.adobe.granite.ui.clientlibs.impl.HtmlLibraryManagerImpl.json";
@Override public boolean doTest(String url, String instanceName) throws Exception {
String[] user = AuthorTest.ENVIRONMENT_NAME.equals(instanceName) ?
UserHelper.splitUser(config.getStringValue("authorUser", "admin:admin")) :
UserHelper.splitUser(config.getStringValue("publishUser", "admin:admin"));
String configurationEndpoint = url
+ "/system/console/configMgr/com.adobe.granite.ui.clientlibs.impl.HtmlLibraryManagerImpl.json";
String body = getJsonBodyOfOsgiConfiguration(configurationEndpoint, user, instanceName);
checkBooleanValue(getBooleanValueFromJson("htmllibmanager.minify", body), true, "Minify", instanceName);
checkBooleanValue(getBooleanValueFromJson("htmllibmanager.minify", body), true, "Minify",
instanceName);
checkBooleanValue(getBooleanValueFromJson("htmllibmanager.gzip", body), true, "Gzip", instanceName);
checkBooleanValue(getBooleanValueFromJson("htmllibmanager.debug", body), false, "Debug", instanceName);
checkBooleanValue(getBooleanValueFromJson("htmllibmanager.timing", body), false, "Timing", instanceName);
checkBooleanValue(getBooleanValueFromJson("htmllibmanager.debug", body), false, "Debug",
instanceName);
checkBooleanValue(getBooleanValueFromJson("htmllibmanager.timing", body), false, "Timing",
instanceName);
return getErrorMessages().isEmpty();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@
import com.cognifide.secureaem.markers.AuthorTest;
import com.cognifide.secureaem.markers.PublishTest;

public class SlingJsHandlerTest extends AbstractTest implements AuthorTest, PublishTest, OsgiConfigurationTest {
public class SlingJsHandlerTest extends AbstractTest
implements AuthorTest, PublishTest, OsgiConfigurationTest {

public SlingJsHandlerTest(Configuration config) {
super(config);
}

@Override
public boolean doTest(String url, String instanceName) throws Exception {
String[] user = AuthorTest.ENVIRONMENT_NAME.equals(instanceName) ? UserHelper.splitUser(config.getStringValue("authorUser", "admin:admin")) : UserHelper.splitUser(config.getStringValue("publishUser", "admin:admin"));
String configurationEndpoint = url + "/system/console/configMgr/org.apache.sling.scripting.java.impl.JavaScriptEngineFactory.json";
@Override public boolean doTest(String url, String instanceName) throws Exception {
String[] user = AuthorTest.ENVIRONMENT_NAME.equals(instanceName) ?
UserHelper.splitUser(config.getStringValue("authorUser", "admin:admin")) :
UserHelper.splitUser(config.getStringValue("publishUser", "admin:admin"));
String configurationEndpoint = url
+ "/system/console/configMgr/org.apache.sling.scripting.java.impl.JavaScriptEngineFactory.json";
String jsonBody = getJsonBodyOfOsgiConfiguration(configurationEndpoint, user, instanceName);
checkBooleanValue(getBooleanValueFromJson("java.classdebuginfo", jsonBody), false, "Generate Debug Info", instanceName);
checkBooleanValue(getBooleanValueFromJson("java.classdebuginfo", jsonBody), false,
"Generate Debug Info", instanceName);
return getErrorMessages().isEmpty();
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.cognifide.secureaem.tests;

import com.cognifide.secureaem.AbstractTest;
import com.cognifide.secureaem.Configuration;
import com.cognifide.secureaem.UserHelper;
import com.cognifide.secureaem.markers.AuthorTest;
import com.cognifide.secureaem.markers.PublishTest;

public class SlingJspScriptHandlerTest extends AbstractTest
implements AuthorTest, PublishTest, OsgiConfigurationTest {

public SlingJspScriptHandlerTest(Configuration config) {
super(config);
}

@Override public boolean doTest(String url, String instanceName) throws Exception {
String[] user = AuthorTest.ENVIRONMENT_NAME.equals(instanceName) ?
UserHelper.splitUser(config.getStringValue("authorUser", "admin:admin")) :
UserHelper.splitUser(config.getStringValue("publishUser", "admin:admin"));
String configurationEndpoint = url
+ "/system/console/configMgr/com.adobe.granite.ui.clientlibs.impl.HtmlLibraryManagerImpl.json";
String body = getJsonBodyOfOsgiConfiguration(configurationEndpoint, user, instanceName);
checkBooleanValue(getBooleanValueFromJson("jasper.classdebuginfo", body), false,
"Generate Debug Info", instanceName);
checkBooleanValue(getBooleanValueFromJson("jasper.mappedfile", body), false, "Mapped Content",
instanceName);
return getErrorMessages().isEmpty();
}

}
4 changes: 4 additions & 0 deletions src/main/resources/test_suite.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ com.cognifide.secureaem.tests.BundlesTest, sling-development-bundle
com.cognifide.secureaem.tests.ErrorHandlerTest, error-handler
com.cognifide.secureaem.tests.SlingReferrerFilterTest, sling-referrer-filter
com.cognifide.secureaem.tests.WcmFilterTest, wcm-filter
com.cognifide.secureaem.tests.HtmlLibraryManagerTest, html-library-manager
com.cognifide.secureaem.tests.SlingJsHandlerTest, sling-js-handler
com.cognifide.secureaem.tests.SlingJspScriptHandlerTest, sling-jsp-script-handler

0 comments on commit 31d5a61

Please sign in to comment.