Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

LPS-26321 Update tests for Geronimo, JBoss, and WebSphere

  • Loading branch information...
commit baa5d1514d612f6be4a77aa312c70e4b7229899e 1 parent ff9b944
@brianchandotcom brianchandotcom authored
View
51 portlets/test-pacl-portlet/docroot/WEB-INF/liferay-plugin-package.properties
@@ -22,23 +22,54 @@ security-manager-expando-bridge=\
com.liferay.portal.model.User
security-manager-files-delete=\
- ../webapps/chat-portlet/WEB-INF/src/com/liferay/chat/util/ChatUtil.java
+ ${auto.deploy.installed.dir}/chat-portlet/WEB-INF/src/com/liferay/chat/util/ChatUtil.java,\
+ \
+ ${auto.deploy.installed.dir}/chat-portlet.war/WEB-INF/src/com/liferay/chat/util/ChatUtil.java,\
+ \
+ ${org.apache.geronimo.home.dir}/repository/liferay/chat-portlet/${release.info.version}.1/chat-portlet-${release.info.version}.1.car/WEB-INF/src/com/liferay/chat/util/ChatUtil.java,\
+ \
+ ${websphere.profile.dir}/installedApps/liferay-cell/chat-portlet.ear/chat-portlet.war/WEB-INF/src/com/liferay/chat/util/ChatUtil.java
security-manager-files-execute=\
/bin/bash,\
C:\\WINDOWS\\system32\\ping.exe
security-manager-files-read=\
- ../webapps/chat-portlet/images/*,\
- ../webapps/chat-portlet/WEB-INF/liferay-releng.properties,\
- ../webapps/chat-portlet/WEB-INF/src/-,\
+ ${auto.deploy.installed.dir}/chat-portlet/images/*,\
+ ${auto.deploy.installed.dir}/chat-portlet/WEB-INF/liferay-releng.properties,\
+ ${auto.deploy.installed.dir}/chat-portlet/WEB-INF/src/-,\
+ \
+ ${auto.deploy.installed.dir}/chat-portlet.war/images/*,\
+ ${auto.deploy.installed.dir}/chat-portlet.war/WEB-INF/liferay-releng.properties,\
+ ${auto.deploy.installed.dir}/chat-portlet.war/WEB-INF/src/-,\
+ \
+ ${org.apache.geronimo.home.dir}/repository/liferay/chat-portlet/${release.info.version}.1/chat-portlet-${release.info.version}.1.car/images/*,\
+ ${org.apache.geronimo.home.dir}/repository/liferay/chat-portlet/${release.info.version}.1/chat-portlet-${release.info.version}.1.car/WEB-INF/liferay-releng.properties,\
+ ${org.apache.geronimo.home.dir}/repository/liferay/chat-portlet/${release.info.version}.1/chat-portlet-${release.info.version}.1.car/WEB-INF/src/-,\
+ \
+ ${websphere.profile.dir}/installedApps/liferay-cell/chat-portlet.ear/chat-portlet.war/images/*,\
+ ${websphere.profile.dir}/installedApps/liferay-cell/chat-portlet.ear/chat-portlet.war/WEB-INF/liferay-releng.properties,\
+ ${websphere.profile.dir}/installedApps/liferay-cell/chat-portlet.ear/chat-portlet.war/WEB-INF/src/-,\
+ \
/bin/bash,\
C:\\WINDOWS\\system32\\ping.exe
security-manager-files-write=\
- ../webapps/chat-portlet/images/*,\
- ../webapps/chat-portlet/WEB-INF/*,\
- ../webapps/chat-portlet/WEB-INF/src/com/liferay/chat/util/ChatUtil.java
+ ${auto.deploy.installed.dir}/chat-portlet/images/*,\
+ ${auto.deploy.installed.dir}/chat-portlet/WEB-INF/*,\
+ ${auto.deploy.installed.dir}/chat-portlet/WEB-INF/src/com/liferay/chat/util/ChatUtil.java,\
+ \
+ ${auto.deploy.installed.dir}/chat-portlet.war/images/*,\
+ ${auto.deploy.installed.dir}/chat-portlet.war/WEB-INF/*,\
+ ${auto.deploy.installed.dir}/chat-portlet.war/WEB-INF/src/com/liferay/chat/util/ChatUtil.java,\
+ \
+ ${org.apache.geronimo.home.dir}/repository/liferay/chat-portlet/${release.info.version}.1/chat-portlet-${release.info.version}.1.car/images/*,\
+ ${org.apache.geronimo.home.dir}/repository/liferay/chat-portlet/${release.info.version}.1/chat-portlet-${release.info.version}.1.car/WEB-INF/*,\
+ ${org.apache.geronimo.home.dir}/repository/liferay/chat-portlet/${release.info.version}.1/chat-portlet-${release.info.version}.1.car/WEB-INF/src/com/liferay/chat/util/ChatUtil.java,\
+ \
+ ${websphere.profile.dir}/installedApps/liferay-cell/chat-portlet.ear/chat-portlet.war/images/*,\
+ ${websphere.profile.dir}/installedApps/liferay-cell/chat-portlet.ear/chat-portlet.war/WEB-INF/*,\
+ ${websphere.profile.dir}/installedApps/liferay-cell/chat-portlet.ear/chat-portlet.war/WEB-INF/src/com/liferay/chat/util/ChatUtil.java
security-manager-get-bean-property=\
com.liferay.portlet.layoutconfiguration.util.RuntimePageUtil
@@ -65,9 +96,9 @@ security-manager-hook-struts-action-paths=\
/portal/test/pacl/success
security-manager-jndi-names=\
- test-pacl:matthew,\
- test-pacl:[mM]ark|test-pacl:[lL]uke,\
- test-pacl:.*john.*
+ test-pacl-matthew,\
+ test-pacl-[mM]ark|test-pacl-[lL]uke,\
+ test-pacl-.*john.*
security-manager-message-bus-listen=\
liferay/test_pacl,\
View
47 portlets/test-pacl-portlet/docroot/WEB-INF/src/com/liferay/testpacl/util/TestPACLUtil.java
@@ -14,10 +14,15 @@
package com.liferay.testpacl.util;
+import com.liferay.portal.kernel.deploy.DeployManagerUtil;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.messaging.Message;
import com.liferay.portal.kernel.messaging.MessageBusUtil;
+import com.liferay.portal.kernel.util.ReleaseInfo;
+import com.liferay.portal.kernel.util.ServerDetector;
+import com.liferay.portal.kernel.util.StringPool;
+import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.service.PortalServiceUtil;
import com.liferay.portal.service.UserLocalServiceUtil;
@@ -101,7 +106,8 @@ public void run() {
}
public static void testWriteFile() {
- File file = new File("../webapps/chat-portlet/css/main.css");
+ File file = new File(
+ translateFileName("../webapps/chat-portlet/css/main.css"));
try {
file.exists();
@@ -112,6 +118,45 @@ public static void testWriteFile() {
}
}
+ public static String translateFileName(String fileName) {
+ if (fileName.startsWith("../webapps")) {
+ String installedDir = StringPool.BLANK;
+
+ try {
+ installedDir = DeployManagerUtil.getInstalledDir();
+ }
+ catch (Exception e) {
+ _log.error(e, e);
+ }
+
+ fileName = StringUtil.replace(fileName, "../webapps", installedDir);
+
+ if (ServerDetector.isGeronimo()) {
+ String geronimoHome = System.getProperty(
+ "org.apache.geronimo.home.dir");
+ String version = ReleaseInfo.getVersion();
+
+ fileName = StringUtil.replace(
+ fileName, installedDir + "/chat-portlet/",
+ geronimoHome + "/repository/liferay/chat-portlet/" +
+ version + ".1/chat-portlet-" + version + ".1.car/");
+ }
+ else if (ServerDetector.isJBoss()) {
+ fileName = StringUtil.replace(
+ fileName, "/chat-portlet/", "/chat-portlet.war/");
+ }
+ else if (ServerDetector.isWebSphere()) {
+ fileName = StringUtil.replace(
+ fileName, installedDir + "/chat-portlet/",
+ System.getenv("USER_INSTALL_ROOT") +
+ "/installedApps/liferay-cell/chat-portlet.ear" +
+ "/chat-portlet.war/");
+ }
+ }
+
+ return fileName;
+ }
+
private static Log _log = LogFactoryUtil.getLog(TestPACLUtil.class);
}
View
54 portlets/test-pacl-portlet/docroot/view.jsp
@@ -950,7 +950,7 @@
new JNDISecurityExceptionTest(out, themeDisplay, false) {
protected void test() throws Exception {
- testBind("test-pacl:matthew", "Matthew");
+ testBind("test-pacl-matthew", "Matthew");
}
};
@@ -958,7 +958,7 @@
new JNDISecurityExceptionTest(out, themeDisplay, true) {
protected void test() throws Exception {
- testBind("test-pacl:Matthew", "Matthew");
+ testBind("test-pacl-Matthew", "Matthew");
}
};
@@ -966,7 +966,7 @@
new JNDISecurityExceptionTest(out, themeDisplay, false) {
protected void test() throws Exception {
- testBind("test-pacl:mark", "Mark");
+ testBind("test-pacl-mark", "Mark");
}
};
@@ -974,7 +974,7 @@
new JNDISecurityExceptionTest(out, themeDisplay, false) {
protected void test() throws Exception {
- testBind("test-pacl:Mark", "Mark");
+ testBind("test-pacl-Mark", "Mark");
}
};
@@ -982,7 +982,7 @@
new JNDISecurityExceptionTest(out, themeDisplay, false) {
protected void test() throws Exception {
- testBind("test-pacl:luke", "Luke");
+ testBind("test-pacl-luke", "Luke");
}
};
@@ -990,7 +990,7 @@
new JNDISecurityExceptionTest(out, themeDisplay, false) {
protected void test() throws Exception {
- testBind("test-pacl:Luke", "Luke");
+ testBind("test-pacl-Luke", "Luke");
}
};
@@ -998,7 +998,7 @@
new JNDISecurityExceptionTest(out, themeDisplay, false) {
protected void test() throws Exception {
- testBind("test-pacl:john 3:16", "John");
+ testBind("test-pacl-john 3:16", "John");
}
};
@@ -1022,7 +1022,7 @@
new JNDISecurityExceptionTest(out, themeDisplay, false) {
protected void test() throws Exception {
- testLookup("test-pacl:matthew", "Matthew");
+ testLookup("test-pacl-matthew", "Matthew");
}
};
@@ -1031,7 +1031,7 @@
protected void test() throws Exception {
try {
- testLookup("test-pacl:matthew", "Matthew 1:1");
+ testLookup("test-pacl-matthew", "Matthew 1:1");
}
catch (ExpectedTestException ete) {
}
@@ -1042,7 +1042,7 @@
new JNDISecurityExceptionTest(out, themeDisplay, false) {
protected void test() throws Exception {
- testLookup("test-pacl:mark", "Mark");
+ testLookup("test-pacl-mark", "Mark");
}
};
@@ -1050,7 +1050,7 @@
new JNDISecurityExceptionTest(out, themeDisplay, false) {
protected void test() throws Exception {
- testLookup("test-pacl:Mark", "Mark");
+ testLookup("test-pacl-Mark", "Mark");
}
};
@@ -1058,7 +1058,7 @@
new JNDISecurityExceptionTest(out, themeDisplay, false) {
protected void test() throws Exception {
- testLookup("test-pacl:luke", "Luke");
+ testLookup("test-pacl-luke", "Luke");
}
};
@@ -1066,7 +1066,7 @@
new JNDISecurityExceptionTest(out, themeDisplay, false) {
protected void test() throws Exception {
- testLookup("test-pacl:Luke", "Luke");
+ testLookup("test-pacl-Luke", "Luke");
}
};
@@ -1074,7 +1074,7 @@
new JNDISecurityExceptionTest(out, themeDisplay, false) {
protected void test() throws Exception {
- testLookup("test-pacl:john 3:16", "John");
+ testLookup("test-pacl-john 3:16", "John");
}
};
@@ -1090,7 +1090,7 @@
new JNDISecurityExceptionTest(out, themeDisplay, false) {
protected void test() throws Exception {
- testUnbind("test-pacl:matthew");
+ testUnbind("test-pacl-matthew");
}
};
@@ -1098,7 +1098,7 @@
new JNDISecurityExceptionTest(out, themeDisplay, true) {
protected void test() throws Exception {
- testUnbind("test-pacl:Matthew");
+ testUnbind("test-pacl-Matthew");
}
};
@@ -1106,7 +1106,7 @@
new JNDISecurityExceptionTest(out, themeDisplay, false) {
protected void test() throws Exception {
- testUnbind("test-pacl:mark");
+ testUnbind("test-pacl-mark");
}
};
@@ -1114,7 +1114,7 @@
new JNDISecurityExceptionTest(out, themeDisplay, false) {
protected void test() throws Exception {
- testUnbind("test-pacl:Mark");
+ testUnbind("test-pacl-Mark");
}
};
@@ -1122,7 +1122,7 @@
new JNDISecurityExceptionTest(out, themeDisplay, false) {
protected void test() throws Exception {
- testUnbind("test-pacl:luke");
+ testUnbind("test-pacl-luke");
}
};
@@ -1130,7 +1130,7 @@
new JNDISecurityExceptionTest(out, themeDisplay, false) {
protected void test() throws Exception {
- testUnbind("test-pacl:Luke");
+ testUnbind("test-pacl-Luke");
}
};
@@ -1138,7 +1138,7 @@
new JNDISecurityExceptionTest(out, themeDisplay, false) {
protected void test() throws Exception {
- testUnbind("test-pacl:john 3:16");
+ testUnbind("test-pacl-john 3:16");
}
};
@@ -2421,6 +2421,8 @@ private class FileSecurityExceptionTest extends SecurityExceptionTest {
}
protected void testDeleteWithFile(String fileName) throws Exception {
+ fileName = TestPACLUtil.translateFileName(fileName);
+
writer.write(fileName);
writer.write("=");
@@ -2455,6 +2457,8 @@ private class FileSecurityExceptionTest extends SecurityExceptionTest {
}
protected void testDeleteWithFileUtil(String fileName) throws Exception {
+ fileName = TestPACLUtil.translateFileName(fileName);
+
writer.write(fileName);
writer.write("=");
@@ -2498,6 +2502,8 @@ private class FileSecurityExceptionTest extends SecurityExceptionTest {
}
protected void testReadWithFile(String fileName) throws Exception {
+ fileName = TestPACLUtil.translateFileName(fileName);
+
writer.write(fileName);
writer.write("=");
@@ -2512,6 +2518,8 @@ private class FileSecurityExceptionTest extends SecurityExceptionTest {
}
protected void testReadWithFileUtil(String fileName) throws Exception {
+ fileName = TestPACLUtil.translateFileName(fileName);
+
writer.write(fileName);
writer.write("=");
@@ -2519,6 +2527,8 @@ private class FileSecurityExceptionTest extends SecurityExceptionTest {
}
protected void testWriteWithFile(String fileName) throws Exception {
+ fileName = TestPACLUtil.translateFileName(fileName);
+
writer.write(fileName);
writer.write("=");
@@ -2533,6 +2543,8 @@ private class FileSecurityExceptionTest extends SecurityExceptionTest {
}
protected void testWriteWithFileUtil(String fileName) throws Exception {
+ fileName = TestPACLUtil.translateFileName(fileName);
+
writer.write(fileName);
writer.write("=");
Please sign in to comment.
Something went wrong with that request. Please try again.