JBoss Portal SVN: r12990 - branches/JBoss_Portal_Branch_2_6/theme/src/bin/portal-ajax-war/dyna.
by portal-commits@lists.jboss.org
Author: wesleyhales
Date: 2009-03-06 19:09:26 -0500 (Fri, 06 Mar 2009)
New Revision: 12990
Modified:
branches/JBoss_Portal_Branch_2_6/theme/src/bin/portal-ajax-war/dyna/dyna.js
Log:
JBPORTAL-2336 - remove debug
Modified: branches/JBoss_Portal_Branch_2_6/theme/src/bin/portal-ajax-war/dyna/dyna.js
===================================================================
--- branches/JBoss_Portal_Branch_2_6/theme/src/bin/portal-ajax-war/dyna/dyna.js 2009-03-07 00:08:27 UTC (rev 12989)
+++ branches/JBoss_Portal_Branch_2_6/theme/src/bin/portal-ajax-war/dyna/dyna.js 2009-03-07 00:09:26 UTC (rev 12990)
@@ -76,7 +76,6 @@
//attach onclick observer to all submit buttons
$$('input[type=submit]').invoke('observe', 'click', function(e) {
currentSubmit = this;
- alert(this);
});
// We found the window
17 years, 1 month
JBoss Portal SVN: r12989 - branches/JBoss_Portal_Branch_2_6/theme/src/bin/portal-ajax-war/dyna.
by portal-commits@lists.jboss.org
Author: wesleyhales
Date: 2009-03-06 19:08:27 -0500 (Fri, 06 Mar 2009)
New Revision: 12989
Modified:
branches/JBoss_Portal_Branch_2_6/theme/src/bin/portal-ajax-war/dyna/dyna.js
branches/JBoss_Portal_Branch_2_6/theme/src/bin/portal-ajax-war/dyna/prototype.js
Log:
JBPORTAL-2336
Modified: branches/JBoss_Portal_Branch_2_6/theme/src/bin/portal-ajax-war/dyna/dyna.js
===================================================================
--- branches/JBoss_Portal_Branch_2_6/theme/src/bin/portal-ajax-war/dyna/dyna.js 2009-03-06 23:23:03 UTC (rev 12988)
+++ branches/JBoss_Portal_Branch_2_6/theme/src/bin/portal-ajax-war/dyna/dyna.js 2009-03-07 00:08:27 UTC (rev 12989)
@@ -1,3 +1,5 @@
+var currentSubmit;
+
function sendData(action, windowId, fromPos, fromRegionId, toPos, toRegionId) {
var options = {
requestHeaders: ["ajax","true","bilto","toto"],
@@ -71,6 +73,12 @@
var source = Event.element(event);
var container = Element.up(source, "div.dyna-window");
+ //attach onclick observer to all submit buttons
+ $$('input[type=submit]').invoke('observe', 'click', function(e) {
+ currentSubmit = this;
+ alert(this);
+ });
+
// We found the window
if (container != null) {
@@ -124,7 +132,7 @@
options.enctype = enctype;
options.asynchronous = false;
options.method = "post"
- options.postBody = Form.serialize(current);
+ options.postBody = Form.serialize(current,'',currentSubmit);
}
}
}
Modified: branches/JBoss_Portal_Branch_2_6/theme/src/bin/portal-ajax-war/dyna/prototype.js
===================================================================
--- branches/JBoss_Portal_Branch_2_6/theme/src/bin/portal-ajax-war/dyna/prototype.js 2009-03-06 23:23:03 UTC (rev 12988)
+++ branches/JBoss_Portal_Branch_2_6/theme/src/bin/portal-ajax-war/dyna/prototype.js 2009-03-07 00:08:27 UTC (rev 12989)
@@ -1838,7 +1838,9 @@
"FORM": Object.clone(Form.Methods),
"INPUT": Object.clone(Form.Element.Methods),
"SELECT": Object.clone(Form.Element.Methods),
- "TEXTAREA": Object.clone(Form.Element.Methods)
+ "TEXTAREA": Object.clone(Form.Element.Methods),
+ //[SERIALIZE_ERROR]
+ "BUTTON": Object.clone(Form.Element.Methods)
});
}
@@ -2641,8 +2643,21 @@
};
Form.Methods = {
- serialize: function(form, getHash) {
- return Form.serializeElements(Form.getElements(form), getHash);
+ serialize: function(form, options, buttonPressed) {
+ //[SERIALIZE_ERROR] Implements additional functionality to support <button> and ensure other button-type
+ // <inputs> are not serialized
+ var elements = Form.getElements(form);
+ if (buttonPressed) {
+ elements = elements.findAll(
+ function(element) {
+ return element == $(buttonPressed) ||
+ (element.tagName.toLowerCase() != "button" &&
+ (element.tagName.toLowerCase() != "input" ||
+ (element.type != "submit" && element.type != "button" && element.type != "image" && element.type != "reset")));
+ }
+ );
+ };
+ return Form.serializeElements(elements, options);
},
getElements: function(form) {
@@ -2808,6 +2823,11 @@
return element.value;
},
+ //[SERIALIZE_ERROR]
+ button: function(element) {
+ return element.value;
+ },
+
select: function(element) {
return this[element.type == 'select-one' ?
'selectOne' : 'selectMany'](element);
17 years, 1 month
JBoss Portal SVN: r12988 - branches/JBoss_Portal_AS5_Deployer/search/src/main/org/jboss/portal/search/federation/impl.
by portal-commits@lists.jboss.org
Author: mwringe
Date: 2009-03-06 18:23:03 -0500 (Fri, 06 Mar 2009)
New Revision: 12988
Modified:
branches/JBoss_Portal_AS5_Deployer/search/src/main/org/jboss/portal/search/federation/impl/IndexFederationService.java
Log:
Merge JBoss_Portal_Branch_2_7 changes (rev range 12254:12964) into JBoss_Portal_AS5_Deployer branch
Modified: branches/JBoss_Portal_AS5_Deployer/search/src/main/org/jboss/portal/search/federation/impl/IndexFederationService.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/search/src/main/org/jboss/portal/search/federation/impl/IndexFederationService.java 2009-03-06 23:23:00 UTC (rev 12987)
+++ branches/JBoss_Portal_AS5_Deployer/search/src/main/org/jboss/portal/search/federation/impl/IndexFederationService.java 2009-03-06 23:23:03 UTC (rev 12988)
@@ -92,7 +92,7 @@
if (status != Info.Status.INDEXING)
{
Thread thread = new ReindexFederatedIndexThread(federated);
- thread.run();
+ thread.start();
}
}
}
17 years, 1 month
JBoss Portal SVN: r12987 - in branches/JBoss_Portal_AS5_Deployer/testsuite: ui-tests and 4 other directories.
by portal-commits@lists.jboss.org
Author: mwringe
Date: 2009-03-06 18:23:00 -0500 (Fri, 06 Mar 2009)
New Revision: 12987
Added:
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/end2end.xml
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/lib/jboss-test.jar
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/run.sh
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/EndToEndBeaPortlet.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSelenium.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSeleniumTestListener.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PageCoordinationTestCase.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/usecaseng.xml
Modified:
branches/JBoss_Portal_AS5_Deployer/testsuite/build.xml
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/build.xml
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/lib/selenium-java-client-driver.jar
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortletUserCreationTestCase.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserInterceptorPortletTestCase.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserLoginTestCase.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSDirectoryTestCase.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileTestCase.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileUploadTestCase.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowTestCase.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletDefinitionsTestCase.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java
branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/testng.xml
Log:
Merge JBoss_Portal_Branch_2_7 changes (rev range 12254:12964) into JBoss_Portal_AS5_Deployer branch
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/build.xml
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/build.xml 2009-03-06 23:22:50 UTC (rev 12986)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/build.xml 2009-03-06 23:23:00 UTC (rev 12987)
@@ -1,23 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?><!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ Copyright 2009, Red Hat Middleware, LLC, and individual
+ ~ contributors as indicated by the @authors tag. See the
+ ~ copyright.txt in the distribution for a full listing of
+ ~ individual contributors.
+ ~
+ ~ This is free software; you can redistribute it and/or modify it
+ ~ under the terms of the GNU Lesser General Public License as
+ ~ published by the Free Software Foundation; either version 2.1 of
+ ~ the License, or (at your option) any later version.
+ ~
+ ~ This software is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ ~ Lesser General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public
+ ~ License along with this software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
@@ -106,9 +106,11 @@
<server:start name="default"/>
<sequential>
<antcall target="agent-deploy"/>
+ <!-- cms is a module now
<antcall target="internal-test-module">
<param name="module" value="cms"/>
</antcall>
+ -->
<antcall target="internal-test-module">
<param name="module" value="faces"/>
</antcall>
@@ -155,8 +157,6 @@
<target name="clean">
<!-- remove generated test xml files -->
<delete>
- <fileset dir="../cms" includes="output/tests/*.log"/>
- <fileset dir="../cms" includes="output/tests/TEST-*.xml,output/tests/TEST-*.txt"/>
<fileset dir="../core" includes="output/tests/*.log"/>
<fileset dir="../core" includes="output/tests/TEST-*.xml,output/tests/TEST-*.txt"/>
<fileset dir="../faces" includes="*.log"/>
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/build.xml
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/build.xml 2009-03-06 23:22:50 UTC (rev 12986)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/build.xml 2009-03-06 23:23:00 UTC (rev 12987)
@@ -1,127 +1,216 @@
+
<project name="Tests" default="compile" basedir="." xmlns:server="http://jboss.org/ns/test/ant/server">
- <property environment="env" />
+ <property environment="env" />
- <property name="java.home" location="${env.JAVA_HOME}" />
+ <property name="workspace" location="build.xml" />
+ <property name="java.home" location="${env.JAVA_HOME}" />
- <property name="suitename" location="testng-files" />
- <property name="testname" location="testng-files" />
-
- <property name="testng.dir" location="testng-files" />
- <property name="testng.output.dir" location="test-output" />
- <property name="test.build.dir" location="output/classes" />
- <property name="test.src.dir" location="src" />
- <property name="lib.dir" location="lib" />
- <property name="hudson.lib.dir" location="/qa/tools/opt/" />
- <property name="jboss-test.jar" location="${hudson.lib.dir}/jboss-test.jar" />
- <available file="${jboss-test.jar}" property="jboss-test.jar.present" />
- <property name="junit.report.dir" location="test-report" />
+ <property name="suitename" location="testng-files" />
+ <property name="testname" location="testng-files" />
- <property name="selsrv.dir" location="selenium-rc-server" />
- <property name="node0" value="localhost" />
- <property name="jboss.test.home" value="${env.JBOSS_TEST_HOME}" />
- <property name="jboss.home" value="${env.JBOSS_HOME}" />
- <property name="jboss.test.jar" value="${env.JBOSSTESTJAR}" />
- <property name="jboss.portal.dir" value="${env.JBOSS_UNZIPED_DIR}" />
- <property name="portal_archive" value="${env.JBOSS_ARCHIVE}" />
- <property name="portal.instance" value="default" />
+ <property name="testng.dir" location="testng-files" />
+ <property name="testng.output.dir" location="test-output" />
+ <property name="test.build.dir" location="output/classes" />
+ <property name="test.src.dir" location="src" />
+ <property name="lib.dir" location="lib" />
+ <property name="hudson.lib.dir" location="/qa/tools/opt/" />
+ <property name="jboss-test.jar" location="${hudson.lib.dir}/jboss-test.jar" />
+ <available file="${jboss-test.jar}" property="jboss-test.jar.present" />
+ <property name="junit.report.dir" location="test-report" />
- <path id="jboss.test.classpath">
- <pathelement path="${jboss.test.jar}" />
- </path>
+ <property name="selsrv.dir" location="selenium-rc-server" />
+ <property name="node0" value="localhost" />
+ <property name="jboss.test.home" value="${env.JBOSS_TEST_HOME}" />
+ <property name="jboss.home" value="${env.JBOSS_HOME}" />
+ <property name="jboss.test.jar" value="lib/jboss-test.jar" />
+ <property name="jboss.portal.dir" value="${env.JBOSS_UNZIPED_DIR}" />
+ <property name="portal_archive" value="${env.JBOSS_ARCHIVE}" />
+ <property name="portal.instance" value="default" />
- <path id="libraries.cp">
- <fileset dir="${lib.dir}">
- <include name="*.jar" />
- </fileset>
+ <property name="test.suite" value="testng.xml" />
+ <property name="usecase.suite" value="end2end.xml" />
- </path>
+ <path id="jboss.test.classpath">
+ <pathelement path="${jboss.test.jar}" />
+ </path>
- <path id="test.cp">
- <pathelement location="${test.build.dir}" />
- <path refid="libraries.cp" />
- </path>
+ <path id="libraries.cp">
+ <fileset dir="${lib.dir}">
+ <include name="*.jar" />
+ </fileset>
- <taskdef name="testng" classpathref="libraries.cp" classname="org.testng.TestNGAntTask" />
-
-<target name="init">
- <echo message="Browser : ${browser}" />
- <echo message="Workspace : ${workspace}" />
- <echo message="Deleting testng report directory"/>
- <delete dir="${testng.output.dir}"/>
- </target>
+ </path>
+ <path id="test.cp">
+ <pathelement location="${test.build.dir}" />
+ <path refid="libraries.cp" />
+ </path>
- <target name="compile" depends="">
- <echo message="Compiling testsuite" />
- <mkdir dir="${test.build.dir}" />
- <javac srcdir="${test.src.dir}" destdir="${test.build.dir}" classpathref="libraries.cp" debug="on" />
- </target>
+ <taskdef name="testng" classpathref="libraries.cp" classname="org.testng.TestNGAntTask" />
+ <taskdef name="config" classname="org.jboss.ant.taskdefs.server.ConfigManagerTask" uri="http://jboss.org/ns/test/ant/server" loaderref="server.loader">
+ <classpath id="server.taskdef.classpath">
+ <path refid="jboss.test.classpath" />
+ </classpath>
+ </taskdef>
+ <taskdef name="start" classname="org.jboss.ant.taskdefs.server.StartServerTask" uri="http://jboss.org/ns/test/ant/server" loaderref="server.loader">
+ <classpath refid="server.taskdef.classpath" />
+ </taskdef>
+ <taskdef name="stop" classname="org.jboss.ant.taskdefs.server.StopServerTask" uri="http://jboss.org/ns/test/ant/server" loaderref="server.loader">
+ <classpath refid="server.taskdef.classpath" />
+ </taskdef>
- <target name="run-src">
- <echo message="Starting Selenium Remote Control" />
- <java jar="${selsrv.dir}/selenium-server.jar" fork="true" spawn="true">
- <arg value="-multiWindow" />
- <arg value="-port" />
- <arg value="44444" />
- <arg value="-log" />
- <arg value="selenium.log" />
- <arg value="-userExtensions" />
- <arg value="${selsrv.dir}/user-extensions.js" />
- </java>
- </target>
+ <target name="init">
+ <echo message="Browser : ${browser}" />
+ <echo message="Screenshot : ${screenshot}" />
+ <echo message="Deleting testng report directory" />
+ <delete dir="${testng.output.dir}" />
+ </target>
- <target name="stop-src">
- <get taskname="selenium-shutdown" src="http://localhost:44444/selenium-server/driver/?cmd=shutDown" dest="result.txt" ignoreerrors="true" />
- <echo taskname="selenium-shutdown" message="DGF Errors during shutdown are expected" />
- </target>
- <target name="copyApps">
- <echo message="Copying userInterceptor portlet into the ${portal.instance} server"/>
- <copy file="apps/userDetail-portlet.war" tofile="${jboss.home}/server/${portal.instance}/deploy/userDetail-portlet.war"/>
- </target>
+ <target name="compile" depends="">
+ <echo message="Compiling testsuite" />
+ <mkdir dir="${test.build.dir}" />
+ <javac srcdir="${test.src.dir}" destdir="${test.build.dir}" classpathref="libraries.cp" debug="on" />
+ <copy file="${test.src.dir}/org/jboss/portal/test/selenium/locator.properties" todir="${test.build.dir}/org/jboss/portal/test/selenium/"/>
+ </target>
- <target name="clean">
- <echo message="Going to delete directory ${test.build.dir}" />
- <delete dir="${test.build.dir}" />
- </target>
+ <target name="run-src">
+ <echo message="Starting Selenium Remote Control" />
+ <java jar="${selsrv.dir}/selenium-server.jar" fork="true" spawn="true">
+ <arg value="-multiWindow" />
+ <arg value="-port" />
+ <arg value="44444" />
+ <arg value="-log" />
+ <arg value="selenium.log" />
+ <arg value="-debug" />
+ <arg value="-userExtensions" />
+ <arg value="${selsrv.dir}/user-extensions.js" />
+ </java>
+ <sleep seconds="20" />
+ </target>
- <target name="cleanup">
- <echo message="Cleaning up..." />
- <antcall target="stop-src" />
+ <target name="stop-src">
+ <get taskname="selenium-shutdown" src="http://localhost:44444/selenium-server/driver/?cmd=shutDown" dest="result.txt" ignoreerrors="true" />
+ <echo taskname="selenium-shutdown" message="DGF Errors during shutdown are expected" />
+ </target>
- </target>
+ <target name="copyApps">
+ <echo message="Copying userInterceptor portlet into the ${portal.instance} server" />
+ <copy file="apps/userDetail-portlet.war" tofile="${jboss.home}/server/${portal.instance}/deploy/userDetail-portlet.war" />
+ </target>
- <target name="single-test" depends="init, compile, run-src">
+ <target name="clean">
+ <echo message="Going to delete directory ${test.build.dir}" />
+ <delete dir="${test.build.dir}" />
+ </target>
- <testng classpathref="test.cp" sourcedir="${test.src.dir}" outputdir="${testng.output.dir}" suitename="SeleniumTest" testname="org.jboss.portal.test.selenium.SingleTestCase">
-<!-- listeners="org.testng.reporters.JUnitXMLReporter"-->
- <classfileset dir="${test.build.dir}"
- includes="${testname}" />
- <sysproperty key="browser" value="${browser}" />
- <jvmarg value="-ea" />
- </testng>
+ <server:config javaHome="${java.home}" jbossHome="${jboss.home}">
+ <server name="${portal.instance}" host="${node0}">
+ <!-- jvmarg value="${jpda.cmdline}" / -->
+ <jvmarg value="-Xmx512m" />
+ <jvmarg value="-XX:MaxPermSize=128m" />
+ <sysproperty key="java.endorsed.dirs" value="${jboss.home}/lib/endorsed" />
+ </server>
+ </server:config>
- </target>
- <target name="selenium-test" depends="init, compile, run-src">
+ <target name="cleanup">
+ <echo message="Cleaning up..." />
+ <antcall target="stop-src" />
- <antcall target="copyApps" />
- <echo message="Runing TestNG" />
- <mkdir dir="test-output" />
- <testng classpathref="test.cp" sourcedir="${test.src.dir}" outputdir="${testng.output.dir}"
- suitename="SeleniumSuite">
+ </target>
- <xmlfileset dir="." includes="testng.xml" />
+ <target name="run-and-build" depends="init, compile, run-src">
+ <echo message="Starting portal instance : ${portal.instance}" />
+ <server:start name="${portal.instance}" />
- <sysproperty key="browser" value="${browser}" />
- <sysproperty key="workspace" value="${workspace}"/>
+ <echo message="Runing TestNG" />
+ <mkdir dir="test-output" />
+ <testng classpathref="test.cp" sourcedir="${test.src.dir}" outputdir="test-output" listeners="org.testng.reporters.JUnitXMLReporter" suitename="SeleniumSuite">
- <jvmarg value="-ea" />
+ <xmlfileset dir="." includes="${testng.suite}" />
+ <sysproperty key="browser" value="${browser}" />
+ <sysproperty key="screenshot" value="${screenshot}" />
+ <sysproperty key="workspace" value="${workspace}" />
+ <sysproperty key="userCount" value="${userCount}" />
+ <sysproperty key="html-src" value="${html-src}" />
+ <sysproperty key="output-dir" value="${testng.output.dir}" />
+ <jvmarg value="-ea" />
- </testng>
- <antcall target="cleanup" />
- </target>
+ </testng>
+ <echo message="Stoping portal instance : ${portal.instance}" />
+ <server:stop name="${portal.instance}" />
+ <antcall target="cleanup" />
+ </target>
+ <target name="single-test" depends="init, compile, run-src, copyApps">
+ <echo message="Runing TestNG" />
+
+ <mkdir dir="test-output" />
+ <testng classpathref="test.cp" sourcedir="${test.src.dir}" outputdir="${testng.output.dir}" listeners="org.jboss.portal.test.selenium.JBossSeleniumTestListener" suitename="SeleniumSingleTest" verbose="2">
+
+ <classfileset dir="${test.build.dir}" includes="${testname}" />
+ <sysproperty key="browser" value="${browser}" />
+ <sysproperty key="screenshot" value="${screenshot}" />
+ <sysproperty key="workspace" value="${workspace}" />
+ <sysproperty key="userCount" value="${userCount}" />
+ <sysproperty key="html-src" value="${html-src}" />
+ <sysproperty key="output-dir" value="${testng.output.dir}" />
+ <jvmarg value="-ea" />
+ </testng>
+ <antcall target="cleanup" />
+
+ </target>
+
+ <target name="selenium-test" depends="init, compile, run-src, copyApps">
+ <echo message="Runing TestNG" />
+
+ <mkdir dir="test-output" />
+ <testng classpathref="test.cp" sourcedir="${test.src.dir}" outputdir="${testng.output.dir}" suitename="SeleniumSuite">
+
+ <xmlfileset dir="." includes="${test.suite}" />
+
+ <sysproperty key="browser" value="${browser}" />
+ <sysproperty key="screenshot" value="${screenshot}" />
+ <sysproperty key="workspace" value="${workspace}" />
+ <sysproperty key="userCount" value="${userCount}" />
+ <sysproperty key="html-src" value="${html-src}" />
+ <sysproperty key="output-dir" value="${testng.output.dir}" />
+
+
+ <jvmarg value="-ea" />
+
+ </testng>
+ <antcall target="cleanup" />
+ </target>
+
+ <target name="selenium-usecase" depends="init, compile, run-src, copyApps">
+ <echo message="Runing TestNG" />
+
+ <mkdir dir="test-output" />
+ <testng classpathref="test.cp" sourcedir="${test.src.dir}" outputdir="${testng.output.dir}" suitename="SeleniumSuite">
+
+ <xmlfileset dir="." includes="${usecase.suite}" />
+
+ <sysproperty key="browser" value="${browser}" />
+ <sysproperty key="screenshot" value="${screenshot}" />
+ <sysproperty key="workspace" value="${workspace}" />
+ <sysproperty key="userCount" value="${userCount}" />
+ <sysproperty key="html-src" value="${html-src}" />
+ <sysproperty key="output-dir" value="${testng.output.dir}" />
+ <jvmarg value="-ea" />
+
+ </testng>
+ <antcall target="cleanup" />
+ </target>
+
+ <target name="archive" >
+ <!--<touch file="touchme.txt"/>-->
+ <echo file="touchme.txt" message="pipik2"/>
+ <genkey alias="apache-group" storepass="secret" dname="CN=Ant Group, OU=Jakarta Division, O=Apache.org, C=US"/>
+ <echo message=""/>
+ </target>
+
</project>
Copied: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/end2end.xml (from rev 12964, branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/end2end.xml)
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/end2end.xml (rev 0)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/end2end.xml 2009-03-06 23:23:00 UTC (rev 12987)
@@ -0,0 +1,14 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="SeleniumTest">
+
+ <test verbose="2" name="org.jboss.portal.test.selenium.portal.EndtoEndPortalAdminTestCase" annotations="JDK">
+ <classes>
+ <class name="org.jboss.portal.test.selenium.portal.EndtoEndPortalAdminTestCase"/>
+ </classes>
+ </test>
+
+<listeners>
+<!-- <listener class-name="org.testng.reporters.JUnitXMLReporter"></listener> -->
+ <listener class-name="org.jboss.portal.test.selenium.JBossSeleniumTestListener"/>
+</listeners>
+</suite>
Copied: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/lib/jboss-test.jar (from rev 12964, branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/lib/jboss-test.jar)
===================================================================
(Binary files differ)
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/lib/selenium-java-client-driver.jar
===================================================================
(Binary files differ)
Copied: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/run.sh (from rev 12964, branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/run.sh)
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/run.sh (rev 0)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/run.sh 2009-03-06 23:23:00 UTC (rev 12987)
@@ -0,0 +1,82 @@
+#!/bin/bash
+
+export HELPMODE=0
+
+#if [ ! -n "${1+x}" ]; then
+ #export HELPMODE=1
+#elif [ $1 = "help" ]; then
+ #export HELPMODE=1
+#fi
+
+if [ -z "$1" -o "$1" = "help" ]; then
+ echo "Usage: "
+ echo " run.sh MODE FF_LOCATION [TESTCLASS_NAME]"
+ echo
+ echo "Description:"
+ echo " Command used to run selenium test of JBoss Portal. Enviroment variables JBOSS_HOME, JAVA_HOME must be set before running the script. JBoss portal must run on the same machine where the script is being run (\"http://localhost:8080/portal/\") ."
+ echo
+ echo "FF_LOCATION - the location of firefox binary file (not the firefox running script - the binary is ussually located in \"/usr/lib*/firefox*/\" directory )"
+ echo
+ echo "MODE - one of available modes:"
+ echo " help : prints out this helpscreen"
+ echo " test : runnnig the selenium test suite defined in testng.xml"
+ echo " end2end : runnnig the selenium test suite defined in testng.xml"
+ echo " selenium : run the selenium server only (no tests are executed)"
+ echo " single : run single selenium testcase of specified class (TESTCLASS_NAME must be specified)"
+ echo
+ echo "TESTCLASS_NAME - the class specifiing single testcase (must be set when running \"single\" mode)"
+ echo
+ echo "Examples:"
+ echo " running the testsuite:"
+ echo " run.sh test /home/vrockai/opt/firefox3/firefox-bin"
+ echo
+ echo " running single testcase:"
+ echo " run.sh single /home/vrockai/opt/firefox3/firefox-bin org/jboss/portal/test/selenium/DashboardTestCase.class"
+else
+ if [ $1 != "help" ]; then
+ ant clean
+ echo "Action: $1"
+ echo "Firefox bin location: $2"
+ echo "Testclass name: $3"
+ fi
+
+ if [ $1 = "test" ]; then
+ if [ -z "$2" -o ! -f "$2" ]; then
+ echo
+ echo "ERROR: Firefox location not set";
+ exit 0;
+ fi
+ ant -f build.xml copyApps
+ ant -f build.xml selenium-test -Dbrowser="*firefox $2" -Dworkspace="/home/vrockai/workspace/ui-tests/" -Dscreenshot="true" -Dhtml-src="true"
+ elif [ $1 = "end2end" ]; then
+ if [ -z "$2" -o ! -f "$2" ]; then
+ echo
+ echo "ERROR: Firefox location not set";
+ exit 0;
+ fi
+ ant -f build.xml copyApps
+ ant -f build.xml selenium-usecase -Dbrowser="*firefox $2" -Dworkspace="/home/vrockai/workspace/ui-tests/" -Dscreenshot="true" -Dhtml-src="true"
+ elif [ $1 = "perf" ]; then
+ if [ -z "$2" -o ! -f "$2" ]; then
+ echo
+ echo "ERROR: Firefox location not set";
+ exit 0;
+ fi
+ ant -f build.xml copyApps
+ ant -f build.xml selenium-test -Dbrowser="*firefox $2" -Dworkspace="/home/vrockai/workspace/ui-tests/" -Dscreenshot="true" -Dhtml-src="true"
+ elif [ $1 = "selenium" ]; then
+ ant -f build.xml run-src
+ elif [ $1 = "single" ]; then
+ if [ -z "$2" -o ! -f "$2" ]; then
+ echo
+ echo "ERROR: Firefox location not set";
+ exit 0;
+ fi
+ if [ -z "$3" ]; then
+ echo
+ echo "ERROR: Testclasss not set";
+ exit 0;
+ fi
+ ant -f build.xml single-test -Dbrowser="*firefox $2" -Dtestname="$3" -Dscreenshot="true" -Dhtml-src="true"
+ fi
+fi
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -11,206 +11,267 @@
@Test(groups = { "cms_dashboard" }, enabled = true, description = "Dashboard issues test case.")
public class DashboardTestCase extends JBossPortalSeleniumTestCase {
- private static final String SEL_CONTENT_TYPE = "//select[contains(@id,'contentTypesForm:instanceId')]";
- private static final String SUB_DEL_FROM_CENTER_REGION = "//input[contains(@id,'layoutForm:l_center')]";
- private static final String SEL_CENTER_REGION = "//select[contains(@id,'layoutForm:selectMany_center')]";
- private static final String SUB_ADDCENTER = "//input[contains(@id,'layoutForm:a_center')]";
- private static final String SUB_ADDLEFT = "//input[contains(@id,'layoutForm:a_left')]";
- private static final String LNK_CONFIGURE_DASHBOARD = "link=Configure dashboard";
- private static final String LNK_DASHBOARD = "link=Dashboard";
- private static final String SEL_PAGE = "//select[contains(@id,'pageNameSelector')]";
- private static final String INP_PAGENAME = "//input[contains(@id,':pageName')]";
- private static final String SUB_CREATEPAGE = "//form[contains(@id,'j_id3')]/input[@type='submit']";
- private static final String SEL_LAYOUT = "//select[contains(@id,'dashboardLayoutForm:layoutSelector')]";
- private static final String SUB_LAYOUTSEL = "//form[contains(@id,'dashboardLayoutForm')]/input[@type='submit']";
- private static final String SEL_THEME = "//select[contains(@id,'dashboardThemeForm:themeSelector')]";
- private static final String SUB_THEMESEL = "//form[contains(@id,'dashboardThemeForm')]/input[@type='submit']";
+ public String casePfx = "dash.";
+ private final String SUB_LAYOUT_UPDATE = getProp(casePfx + "sub.layout.update", "//input[contains(@name,'dashboardLayoutForm:j_id12')]");
+ private final String SUB_PAGE_RENAME = getProp(casePfx + "sub.page.rename", "//form[contains(@id,'renameForm')]/input[@type='submit']");
+ private final String INP_PAGE_RENAME = getProp(casePfx + "inp.page.rename", "//input[contains(@id,'renameForm:newName')]");
+ private final String LINK_WEATHER_PORTLET = getProp(casePfx + "link.weather.portlet", "link=*WeatherPortlet*");
+ private final String LINK_PORTL2 = getProp(casePfx + "link.portl2", "link=*Who's online portlet*");
+ private final String LINK_PORTL1 = getProp(casePfx + "link.portl1", "link=*Welcome portlet*");
+ // private final String OPT_PORTL2 =
+ // getProp(casePfx+"opt.portl2","CurrentUsersPortletWindow");
+ private final String OPT_PORTL1 = getProp(casePfx + "opt.portl1", "JSPPortletWindow");
+ private final String SEL_CONTENT_TYPE = getProp(casePfx + "sel.content.type", "//select[contains(@id,'contentTypesForm:instanceId')]");
+ private final String SUB_DEL_FROM_CENTER_REGION = getProp(casePfx + "sub.del.from.center.region", "//input[contains(@id,'layoutForm:l_center')]");
+ private final String SUB_DOWN_CENTER_REGION = getProp(casePfx + "sub.down.center.region", "//input[contains(@id,'layoutForm:d_center')]");
+ private final String SUB_UP_CENTER_REGION = getProp(casePfx + "sub.up.center.region", "//input[contains(@id,'layoutForm:u_center')]");
+ private final String SEL_CENTER_REGION = getProp(casePfx + "sel.center.region", "//select[contains(@id,'layoutForm:selectMany_center')]");
+ private final String SUB_ADDCENTER = getProp(casePfx + "sub.addcenter", "//input[contains(@id,'layoutForm:a_center')]");
+ private final String SUB_ADDLEFT = getProp(casePfx + "sub.addleft", "//input[contains(@id,'layoutForm:a_left')]");
+ private final String LNK_CONFIGURE_DASHBOARD = getProp(casePfx + "lnk.configure.dashboard", "link=Configure dashboard");
+ private final String LNK_DASHBOARD = getProp(casePfx + "lnk.dashboard", "link=Dashboard");
+ private final String SEL_PAGE = getProp(casePfx + "sel.page", "//select[contains(@id,'pageNameSelector')]");
+ private final String INP_PAGENAME = getProp(casePfx + "inp.pagename", "//input[contains(@id,':pageName')]");
+ private final String SUB_CREATEPAGE = getProp(casePfx + "sub.createpage", "//form[contains(@id,'j_id3')]/input[@type='submit']");
+ private final String SEL_LAYOUT = getProp(casePfx + "sel.layout", "//select[contains(@id,'dashboardLayoutForm:layoutSelector')]");
+
+ private final String SEL_THEME = getProp(casePfx + "sel.theme", "//select[contains(@id,'dashboardThemeForm:themeSelector')]");
+ private final String SUB_THEMESEL = getProp(casePfx + "sub.themesel", "//form[contains(@id,'dashboardThemeForm')]/input[@type='submit']");
+
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
+ logoutIfPossible();
login("admin", "admin");
}
@AfterMethod(groups = { "log" })
public void logoutAfterTest() {
- logout();
+
}
+ private void wait(int t) {
+ try {
+ Thread.sleep(t);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
@Test(enabled = true)
public void testCreatePage() {
selenium.click(LNK_DASHBOARD);
+
+ // selenium.waitForPageToLoad(PAGE_LOAD);
+ wait(5000);
+
+ selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
+
+ final String pageName = "DashTestPage";
+ selenium.type(INP_PAGENAME, pageName);
+
+ clickAndWait(SUB_CREATEPAGE);
+
+ selenium.click(LNK_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isElementPresent("link=" + pageName));
+ selenium.click("link=" + pageName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("Powered by JBoss Portal"));
+ }
+
+ @Test(enabled = true, dependsOnMethods = { "testCreatePage" })
+ public void testRenamePage() {
+
+ // firstly create page
+
+ selenium.click(LNK_DASHBOARD);
+ wait(5000);
+
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(INP_PAGENAME, "DashTestPage");
-
- clickAndWait(SUB_CREATEPAGE);
-
+
+ final String pageName = "DashToRenamePage";
+ final String pageNameNew = "DashRenamedPage";
+ selenium.type(INP_PAGENAME, pageName);
+
+ clickAndWait(SUB_CREATEPAGE);
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isElementPresent("link=DashTestPage"));
- selenium.click("link=DashTestPage");
+ Assert.assertTrue(selenium.isElementPresent("link=" + pageName));
+ selenium.click("link=" + pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Powered by JBoss Portal"));
+
+ // then rename it
+ selenium.click(LNK_CONFIGURE_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selectIfNotSelected(SEL_PAGE, pageName);
+
+ selenium.type(INP_PAGE_RENAME, pageNameNew);
+ selenium.click(SUB_PAGE_RENAME);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
}
@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
public void testUpdateTheme() {
+ // selenium.setSpeed("10000");
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
+ wait(5000);
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
- for (String s: selenium.getSelectOptions(SEL_THEME))
- System.out.println("LABEL!:"+s);
-
selenium.select(SEL_THEME, "label=renaissance");
+
selenium.click(SUB_THEMESEL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- selenium.windowMaximize();
- selenium.captureScreenshot("2x.jpg");
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
- selenium.windowMaximize();
- selenium.captureScreenshot("2.jpg");
- for (String s: selenium.getSelectOptions(SEL_THEME))
- System.out.println("LABEL!:"+s);
Assert.assertEquals(selenium.getSelectedLabel(SEL_THEME), "renaissance", "Previously selected theme other then expected.");
}
@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
public void testUpdateLayout() {
+ // selenium.setSpeed("10000");
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
+ wait(5000);
selenium.windowMaximize();
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
- for (String s: selenium.getSelectOptions(SEL_LAYOUT))
- System.out.println("LABEL!:"+s);
- selenium.captureScreenshot("3x1.jpg");
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
+
selenium.select(SEL_LAYOUT, "label=generic");
- selenium.captureScreenshot("3x2.jpg");
- selenium.click(SUB_LAYOUTSEL);
- selenium.captureScreenshot("3x3.jpg");
+
+ selenium.click(SUB_LAYOUT_UPDATE);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.captureScreenshot("3x4.jpg");
-
- selenium.captureScreenshot("3x.jpg");
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
-
- selenium.windowMaximize();
- selenium.captureScreenshot("3.jpg");
- for (String s: selenium.getSelectOptions(SEL_LAYOUT))
- System.out.println("LABEL!:"+s);
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
+
Assert.assertEquals(selenium.getSelectedLabel(SEL_LAYOUT), "generic", "Previously selected layout other then expected.");
}
@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
public void testAddPortlet() {
- //selenium.setSpeed("3000");
+ // selenium.setSpeed("10000");
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- selenium.windowMaximize();
- selenium.captureScreenshot("1x1.jpg");
-
+
selenium.click(LNK_CONFIGURE_DASHBOARD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
+ wait(5000);
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
+ selenium.click(LINK_PORTL2);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.windowMaximize();
- selenium.captureScreenshot("1x21.jpg");
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
- selenium.click("link=Who's online portlet");
- selenium.captureScreenshot("1x221.jpg");
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.captureScreenshot("1x222.jpg");
waitForElement("portlet-editor-title");
- //selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.windowMaximize();
- selenium.captureScreenshot("1x3.jpg");
selenium.click(SUB_ADDCENTER);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.windowMaximize();
- selenium.captureScreenshot("1x4.jpg");
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=DashTestPage");
selenium.waitForPageToLoad(PAGE_LOAD);
-
- selenium.windowMaximize();
- selenium.captureScreenshot("1.jpg");
-
+
Assert.assertTrue(selenium.isTextPresent("Current users"));
Assert.assertTrue(selenium.isTextPresent("Among them: * logged-in"));
Assert.assertTrue(selenium.isTextPresent("[admin]"));
- //selenium.setSpeed("0");
+ // selenium.setSpeed("0");
}
- @Test(enabled = true, dependsOnMethods = { "testCreatePage","testAddPortlet" })
+ @Test(enabled = true, dependsOnMethods = { "testCreatePage", "testAddPortlet" })
public void testMovePortlet() {
final String pageName = "DashMovePage";
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- selenium.waitForPageToLoad(PAGE_LOAD);
-
+ // selenium.waitForPageToLoad(PAGE_LOAD);
+ wait(5000);
+
selenium.type(INP_PAGENAME, pageName);
selenium.click(SUB_CREATEPAGE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- selectIfNotSelected(SEL_PAGE,pageName);
- selenium.click("link=ExceptionPortletInstance");
+
+ selectIfNotSelected(SEL_PAGE, pageName);
+ selenium.click(LINK_PORTL1);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(SUB_ADDCENTER);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- selectIfNotSelected(SEL_PAGE,pageName);
- selenium.click("link=Who's online portlet");
+
+ selectIfNotSelected(SEL_PAGE, pageName);
+ selenium.click(LINK_PORTL2);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(SUB_ADDCENTER);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link="+pageName);
+ selenium.click("link=" + pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- Assert.assertFalse(assertTextOrder("Current;Exception"));
- Assert.assertTrue(assertTextOrder("Exception;Current"));
-
+
+ Assert.assertFalse(assertTextOrder("Current;Greetings"));
+ Assert.assertTrue(assertTextOrder("Greetings;Current"));
+
}
-
+
+ @Test(enabled = true, dependsOnMethods = { "testCreatePage", "testMovePortlet" })
+ public void testReorder() {
+ final String pageName = "DashMovePage";
+
+ selenium.click(LNK_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(LNK_CONFIGURE_DASHBOARD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
+ wait(5000);
+ selectIfNotSelected(SEL_PAGE, pageName);
+
+ selenium.addSelection(SEL_CENTER_REGION, OPT_PORTL1);
+ selenium.click(SUB_DOWN_CENTER_REGION);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click(LNK_DASHBOARD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=" + pageName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertFalse(assertTextOrder("Greetings;Current"));
+ Assert.assertTrue(assertTextOrder("Current;Greetings"));
+ }
+
@Test(enabled = true, dependsOnMethods = { "testAddPortlet" })
public void testDeletePortlet() {
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
+ wait(5000);
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
selenium.addSelection(SEL_CENTER_REGION, "label=CurrentUsersPortletWindow");
selenium.click(SUB_DEL_FROM_CENTER_REGION);
@@ -231,8 +292,9 @@
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selectIfNotSelected(SEL_PAGE,"DashTestPage");
+ // selenium.waitForPageToLoad(PAGE_LOAD);
+ wait(5000);
+ selectIfNotSelected(SEL_PAGE, "DashTestPage");
selenium.select(SEL_CONTENT_TYPE, "label=widget/google");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Band Culinaria");
@@ -249,6 +311,7 @@
}
// http://www.jboss.com/index.html?module=bb&op=viewtopic&t=143023
+ // https://jira.jboss.org/jira/browse/JBPORTAL-2177
@Test(enabled = true)
public void testBugResetPortletSetting() {
final String pageName = "page1";
@@ -260,7 +323,8 @@
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
+ wait(5000);
selenium.type(INP_PAGENAME, pageName);
selenium.click(SUB_CREATEPAGE);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -281,9 +345,9 @@
selenium.click(LNK_CONFIGURE_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
- selectIfNotSelected(SEL_PAGE,pageName);
+ selectIfNotSelected(SEL_PAGE, pageName);
- selenium.click("Link=*Weather Portlet*");
+ selenium.click(LINK_WEATHER_PORTLET);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(SUB_ADDLEFT);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -308,12 +372,13 @@
selenium.click(LNK_DASHBOARD);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CONFIGURE_DASHBOARD);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
+ wait(5000);
- selectIfNotSelected(SEL_PAGE,pageName);
+ selectIfNotSelected(SEL_PAGE, pageName);
- selenium.type("renameForm:newName", pageNameNew);
- selenium.click("renameForm:rename-button");
+ selenium.type(INP_PAGE_RENAME, pageNameNew);
+ selenium.click(SUB_PAGE_RENAME);
selenium.waitForPageToLoad(PAGE_LOAD);
// check the portlet again
@@ -324,14 +389,7 @@
selenium.click("link=" + pageNameNew);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("Alexandria"), "Previously selected portlet settings were changes after renaming of portal page.");
-
+ Assert.assertTrue(selenium.isTextPresent("Alexandria"), "Previously selected portlet settings were changed after renaming of portal page.");
}
- // TODO write an extension for checking of ordering of elements
- @Test(enabled = false, dependsOnMethods = { "testCreatePage" })
- public void testReorder() {
-
- }
-
}
Copied: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/EndToEndBeaPortlet.java (from rev 12964, branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/EndToEndBeaPortlet.java)
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/EndToEndBeaPortlet.java (rev 0)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/EndToEndBeaPortlet.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -0,0 +1,242 @@
+package org.jboss.portal.test.selenium;
+
+import java.text.MessageFormat;
+
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
+ */
+@Test(groups = {"end2end"}, enabled = true, description = "Creating of new portal with content.")
+public class EndToEndBeaPortlet extends JBossPortalSeleniumTestCase {
+
+
+ private static final String SUB_VIEW_PORTLETS = "//input[contains(@id,'definition-form:view-portlets')]";
+
+ private static final String SEL_CONS_TYPE = "//select[contains(@id,'definition-form:menu')]";
+
+ public static String casePfx = "e2e.wsrp.";
+
+ private final String ADR_HOME = getProp(casePfx+"adr.home","portal/auth/portal/default");
+ private final String INP_CONSUMER_NAME = getProp(casePfx+"inp.consumer.name","//input[contains(@id,'edit-cons-form:id')]");
+ private final String SUBMIT_REFRESH_CANCEL = getProp(casePfx+"submit.refresh.cancel","//a[contains(@id,'edit-cons-form:list-cons-link')]");
+ private final String SUBMIT_PROD_SAVE = getProp(casePfx+"submit.prod.save","//input[contains(@id,'producer-form:save-producer')]");
+ private final String SUBMIT_CONSDEL_CONF = getProp(casePfx+"submit.consdel.conf","//a[contains(@id,'confirm-delete-form:destroy-link')]");
+
+ private final String SUBMIT_CONS_REGVAL = getProp(casePfx+"submit.cons.regval","//input[contains(@id,'edit-cons-form:refresh-cons-link')]");
+ private final String SUBMIT_REFRESHFINAL = getProp(casePfx+"submit.refreshfinal","//input[contains(@id,'edit-cons-form:refresh-cons-link')]");
+
+ private final String INPUT_CONS_REGVALUE = getProp(casePfx+"input.cons.regvalue","//input[contains(@id,'edit-cons-form:existingProps:0:prop-value-input')]");
+ private final String SUBMIT_REFRESHSAVE = getProp(casePfx+"submit.refreshsave","//input[contains(@id,'edit-cons-form:refresh-cons-link')]");
+ private final String INPUT_CONSWSDL = getProp(casePfx+"input.conswsdl","//input[contains(@id,'edit-cons-form:wsdl')]");
+ private final String INPUT_CACHEEXP = getProp(casePfx+"input.cacheexp","//input[contains(@id,'edit-cons-form:cache')]");
+ private final String SUBMIT_ADDPROP_INIT = getProp(casePfx+"submit.addprop.init","//a[contains(@id,'producer-form:add-reg-prop')]");
+ private final String SUBMIT_ADDPROP = getProp(casePfx+"submit.addprop","//a[contains(@id,'producer-form:add-reg-prop')]");
+ private final String INPUT_PROPHINT = getProp(casePfx+"input.prophint","//input[contains(@id,'producer-form:reg-properties:0:hint')]");
+ private final String INPUT_PROPLABEL = getProp(casePfx+"input.proplabel","//input[contains(@id,'producer-form:reg-properties:0:label')]");
+ private final String INPUT_PROPNAME = getProp(casePfx+"input.propname","//input[contains(@id,'producer-form:reg-properties:0:name')]");
+ private final String SUBMIT_CREATECONS = getProp(casePfx+"submit.createcons","//input[contains(@id,'createConsumer:createConsumerButton')]");
+ private final String INPUT_CREATECONS = getProp(casePfx+"input.createcons","//input[contains(@id,'createConsumer:consumerName')]");
+ private final String ID_LINK_PRODCONF = getProp(casePfx+"id.link.prodconf","//a[contains(@id,'cons-temp-form:producer-link')]");
+ private final String ID_LINK_CONSCONF = getProp(casePfx+"id.link.consconf","//a[contains(@id,'producer-temp-form:consumersTab')]");
+ private final String LINK_CONSUMER_HOME =getProp(casePfx+"link.consumer.home","//a[contains(@id,'cons-temp-form1:list-cons-link')]");
+
+ private final String LINK_T_CONS_CON=getProp(casePfx+"link.t.cons.con","//a[contains(@id,''consumer-list-form:consumersList:{0}:configure'')]");
+ private final String LINK_T_CONS_REF=getProp(casePfx+"link.t.cons.ref","//a[contains(@id,''consumer-list-form:consumersList:{0}:refresh'')]");
+ private final String LINK_T_CONS_ACT=getProp(casePfx+"link.t.cons.act","//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]");
+ private final String LINK_T_CONS_DEA=getProp(casePfx+"link.t.cons.dea","//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]");
+ private final String LINK_T_CONS_REG=getProp(casePfx+"link.t.cons.reg","//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]");
+ private final String LINK_T_CONS_DER=getProp(casePfx+"link.t.cons.der","//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]");
+ private final String LINK_T_CONS_DEL=getProp(casePfx+"link.t.cons.del","//a[contains(@id,''consumer-list-form:consumersList:{0}:delete'')]");
+
+ ///
+
+ public final String SEL_PORTLET_TYPE = getProp(casePfx+"sel.portlet.type","//select[contains(@id,'windowForm:instanceId')]");
+ private final String SUB_LAYOUT_ADD_CENTER = getProp(casePfx+"sub.layout.add.center","//input[contains(@id,'layoutForm:a_center')]");
+ private final String INP_WINDOW_NAME = getProp(casePfx+"inp.window.name","//input[contains(@id,'windowForm:windowName')]");
+ private final String SUB_RENAME_PORTAL = getProp(casePfx+"sub.rename.portal","//input[contains(@id,'renameForm:rename')]");
+ private final String INP_RENAME_PORTAL = getProp(casePfx+"inp.rename.portal","//input[contains(@id,'renameForm:newName')]");
+ private final String SUB_DELETE_PORTAL_CONF = getProp(casePfx+"sub.delete.portal.conf","//input[contains(@id,'delete-view:confirm-form:delete')]");
+ private final String INP_SUBMIT_PAGECREATE = getProp(casePfx+"inp.submit.pagecreate","//input[contains(@id,'create-page-form:create-page')]");
+ private final String INP_PAGENAME = getProp(casePfx+"inp.pagename","//input[contains(@id,'create-page-form:pageName')]");
+ private final String INP_PORTALNAME = getProp(casePfx+"inp.portalname","//input[contains(@id,'create-portal-form:name')]");
+ private final String INP_SUBMIT_CREATEPORTAL = getProp(casePfx+"inp.submit.createportal","//input[contains(@id,'create-portal-form:create-portal')]");
+ private final String TAB_PORTALOBJ_ID = getProp(casePfx+"tab.portalobj.id","Link=Admin");
+ private final String LNK_PORTALS_ID = getProp(casePfx+"lnk.portals.id","link=*Portal Objects*");
+ private final String LNK_PORTAL_HOME = getProp(casePfx+"lnk.portal.home","//a[contains(@id,'obj-temp-form:object-link-0')]");
+ private final String TBL_PORTAL_ADMIN = getProp(casePfx+"tbl.portal.admin","//table[contains(@id,'obj-nav-form:portal-datatable')]");
+ private final String POR_TL_MAIN = getProp(casePfx+"por.tl.main","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]");
+ private final String POR_TL_SECURITY = getProp(casePfx+"por.tl.security","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]");
+ private final String POR_TL_PROPERTIES = getProp(casePfx+"por.tl.properties","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]");
+ private final String POR_TL_THEME = getProp(casePfx+"por.tl.theme","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]");
+ private final String POR_TL_RENAME = getProp(casePfx+"por.tl.rename","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]");
+ private final String POR_TL_DELETE = getProp(casePfx+"por.tl.delete","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]");
+ private final String POR_TL_MAKEDEF = getProp(casePfx+"por.tl.makedef","//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]");
+ private final String TBL_PORTALPAGE_ADMIN = getProp(casePfx+"tbl.portalpage.admin","//table[contains(@id,'obj-nav-form:pages-datatable')]");
+ private final String PAG_TL_MAIN = getProp(casePfx+"pag.tl.main","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]");
+ private final String PAG_TL_LAYOUT = getProp(casePfx+"pag.tl.layout","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]");
+ private final String PAG_TL_SECURITY = getProp(casePfx+"pag.tl.security","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]");
+ private final String PAG_TL_PROPERTIES = getProp(casePfx+"pag.tl.properties","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]");
+ private final String PAG_TL_THEME = getProp(casePfx+"pag.tl.theme","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]");
+ private final String PAG_TL_RENAME = getProp(casePfx+"pag.tl.rename","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link'')]");
+ private final String PAG_TL_DISPLAY = getProp(casePfx+"pag.tl.display","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]");
+ private final String PAG_TL_DELETE = getProp(casePfx+"pag.tl.delete","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]");
+ private final String PAG_TL_MAKEDEF = getProp(casePfx+"pag.tl.makedef","//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]");
+
+
+ /// def
+
+ private static final String T_LINK_PREF = "//a[contains(@id,''def-list:portlet-pref-{0}'')]";
+ private static final String SUBMIT_CREATE_INST = "//input[contains(@name,'add_instance_form:j_id19')]";
+ private static final String INPUT_INSTANCE_NAME = "//input[contains(@id,'add_instance_form:instanceId')]";
+ private static final String T_LINK_CREATE = "//a[contains(@id,''def-list:create-instance-{0}'')]";
+ private static final String SUBMIT_PROVIDER_VIEW = "//input[contains(@id,'definition-form:view-portlets')]";
+ private static final String SELECT_PROVIDER = "//select[contains(@id,'definition-form:menu')]";
+ private static final String TABLE_PORTLET = "//form[contains(@id,'def-list')]/table";
+ private static final String LINK_NAME_ADMIN_PORT = "//a[contains(@id,'common-show-portlet-detail-form:field1:select')]";
+ private static final String LINK_ADMIN_PORT = "//a[contains(@id,'def-list:portlet-def-0')]";
+ private static final String LINK_ADMIN = "link=Admin";
+ private static final String LINK_TAB_PD = "//a[contains(@id,'admin-subtab-form:portlet-def-link')]";
+ private static final String LINK_PD_MAIN = "//a[contains(@id,'man-form:def-link')]";
+
+ public static String WSRP_CONSUMER_TABLE = "//table[contains(@id,':consumer-list-form:consumersList')]";
+ @BeforeMethod(groups = { "log" })
+ public void loginBeforeTest() {
+ logoutIfPossible();
+ login("admin", "admin");
+ }
+
+ @AfterMethod(groups = { "log" })
+ public void logoutAfterTest() {
+ //logout();
+ }
+
+ private String PORTLET = "";
+
+ @Test(enabled = true, description = "Creating a standard BEA portlet.")
+ public void testEnd2EndBeaPortlet(){
+
+ String consName = "BeaE2E";
+ String portalName = "default";
+ String pageName = "default";
+ String defName= "BEA: Hello World";
+ String insName = "1BeaPor";
+
+ createConsumer(consName);
+ createInstance(defName, consName, insName);
+ addPortlet(portalName, pageName, insName, "portlet");
+
+ selenium.open(ADR_HOME);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent("1BeaPorWindow"));
+ Assert.assertTrue(selenium.isTextPresent("Welcome to WebLogic Portal WSRP Demo."));
+
+ }
+
+ private void createConsumer(String consumerName){
+ selenium.open(ADR_HOME);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=WSRP");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ clickIfVisible(ID_LINK_CONSCONF);
+
+ selenium.type(INPUT_CREATECONS, consumerName);
+
+ selenium.click(SUBMIT_CREATECONS);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INPUT_CACHEEXP, "600");
+
+ selenium.type(INPUT_CONSWSDL, "http://wsrp.bea.com:7001/producer/producer?WSDL");
+ selenium.click(SUBMIT_REFRESHSAVE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("Refresh failed (probably because the registration information was not valid)."));
+ Assert.assertTrue(selenium.isTextPresent("Missing value"));
+
+ selenium.type(INPUT_CONS_REGVALUE, "public");
+ selenium.click(SUBMIT_CONS_REGVAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("Refresh was successful."));
+ selenium.click(SUBMIT_REFRESHFINAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent(consumerName));
+ }
+
+ private void createInstance(String defName, String type, String insName){
+ selenium.open(ADR_HOME);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(LINK_ADMIN);
+ clickIfVisible(LINK_ADMIN);
+ clickIfVisible(LINK_TAB_PD);
+ clickIfVisible(LINK_PD_MAIN);
+
+ selenium.select(SEL_CONS_TYPE, "label="+type);
+ selenium.click(SUB_VIEW_PORTLETS);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int r = findTableRow(TABLE_PORTLET, defName, 0);
+
+ selenium.click(MessageFormat.format(T_LINK_CREATE,r-1));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.setSpeed("5555");
+ selenium.type(INPUT_INSTANCE_NAME, insName);
+ selenium.click(SUBMIT_CREATE_INST);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent(insName + " portlet details"));
+ }
+
+ private void addPortlet(String portalName, String pageName, String portletName, String type) {
+ selenium.open(ADR_HOME);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LNK_PORTALS_ID);
+ clickIfVisible(LNK_PORTAL_HOME);
+
+ int r = findTableRow(TBL_PORTAL_ADMIN, portalName, 0) - 1;
+ selenium.click(MessageFormat.format(POR_TL_MAIN, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ r = findTableRow(TBL_PORTALPAGE_ADMIN, pageName, 0) - 1;
+
+ // click on the page layout
+ selenium.click(MessageFormat.format(PAG_TL_LAYOUT, r));
+
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ //hack
+ selenium.select(SEL_PORTLET_TYPE, "label=" + "cms");
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ selenium.select(SEL_PORTLET_TYPE, "label=" + type);
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ selenium.click("link=*"+portletName+"*");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click(SUB_LAYOUT_ADD_CENTER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ }
+}
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -3,9 +3,7 @@
import java.text.MessageFormat;
import org.testng.Assert;
-import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -16,98 +14,110 @@
@Test(groups = { "admin_ui" }, enabled = true)
public class IdentityAdminTestCase extends JBossPortalSeleniumTestCase {
- private static final String SUB_EDIT_PROF = "//input[contains(@id,'profile-form:submit')]";
- private static final String SUB_EDIT_USER_EMAIL_CANCEL = "//input[contains(@id,'profile-form:cancel')]";
- private static final String INP_EDIT_USER_EMAIL = "//input[contains(@id,'profile-form:email')]";
- private static final String SUB_ROLE_SEARCH_USER = "//input[contains(@id,'search-user-form:search') and @type='submit']";
- private static final String INP_ROLE_SEARCH_USER = "//input[contains(@id,'search-user-form:searchString')]";
- private static final String SUB_EDIT_ROLE_SUBMIT = "//input[contains(@id,'edit-role-link:submit')]";
- private static final String SUB_EDIT_ROLE_CANCEL = "//input[contains(@id,'edit-role-link:cancel')]";
- private static final String INP_EDIT_ROLE_NAME = "//input[contains(@id,'edit-role-link:display-name')]";
- private static final String SUB_PASS_CHANGE_SUBMIT = "//input[contains(@name,'change-pwd-form:j_id31')]";
- private static final String SUB_PASS_CHANGE_CANCEL = "//input[contains(@id,'change-pwd-form:cancel')]";
- private static final String INPUT_PASS_CHANGE_P2 = "//input[contains(@id,':change-pwd-form:passwordCheck')]";
- private static final String INPUT_PASS_CHANGE_P1 = "//input[contains(@id,':change-pwd-form:password')]";
- private static final String LINK_CHANGE_PASS = "//a[contains(@id,':profile-form:change-pwd-adm-link')]";
- public static final String TABLE_USERLIST = "//table[contains(@id,'search-user-form1:userlist')]";
- public static final String LINK_T_USRLIST_DEL = "//a[contains(@id,''search-user-form1:userlist:{0}:delete-user-link'')]";
- public static final String LINK_T_USRLIST_ROLES = "//a[contains(@id,''search-user-form1:userlist:{0}:assign-role-link'')]";
- public static final String LINK_T_USRLIST_DIS = "//a[contains(@id,''search-user-form1:userlist:{0}:enable-user-link'')]";
- public static final String LINK_T_USRLIST_EDIT = "//a[contains(@id,''search-user-form1:userlist:{0}:rename-link'')]";
-
- public static final String TABLE_ROLELIST = "//table[contains(@id,':_viewRoot:roles-form:userlist')]";
-
- public static final String LINK_T_ROLLIST_DEL = "//a[contains(@id,''roles-form:userlist:{0}:delete-role-link'')]";
- public static final String LINK_T_ROLLIST_MEMBERS = "//a[contains(@id,''roles-form:userlist:{0}:view-role-link'')]";
- public static final String LINK_T_ROLLIST_EDIT = "//a[contains(@id,''roles-form:userlist:{0}:edit-role-link'')]";
-
- public static final String TABLE_ROLEMEMBERS = "//table[contains(@id,'role-members-form:role-data-table')]";
-
- public static final String ID_SUBMIT_CONF_CREATE_USER = "//input[contains(@id,'confirm-form:admin')]";
- public static final String ID_SUBMIT_DELETE_ROLE = "//input[contains(@id,'delete-role-form:confirm')]";
- public static final String ID_SUBMIT_ROLE_CREATE = "//input[contains(@id,':_viewRoot:create-role-form:submit')]";
- public static final String ID_INPUT_ROLEDISNAME = "//input[contains(@id,':_viewRoot:create-role-form:roledisplayname')]";
- public static final String ID_INPUT_ROLENAME = "//input[contains(@id,':_viewRoot:create-role-form:rolename')]";
-
- public static final String ID_BUT_ROLE_CREATE = "//a[contains(@id, ':_viewRoot:create-role-form:create-role-link')]";
- public static final String ID_BUT_SUBMIT_DEL_USER = "//input[contains(@id,'delete-user-form:submit')]";
- public static final String ID_SUBMIT_ASSIGN_ROLE = "//input[contains(@id,'assign-roles-form:submit')]";
- public static final String ID_SUBMIT_USER_ROLE = "//input[contains(@id,'register-role-form:submit')]";
- public static final String ID_SUBMIT_CREATE_USER = "//input[contains(@id,'register-form:submit')]";
- public static final String ID_INPUT_PASSWORD_CHK = "//input[contains(@id,'register-form:passwordCheck')]";
- public static final String ID_INPUT_PASSWORD = "//input[contains(@id,'register-form:password')]";
- public static final String ID_INPUT_USEREMAIL = "//input[contains(@id,'register-form:email')]";
- public static final String ID_INPUT_USERNAME = "//input[contains(@id,'register-form:username')]";
- public static final String ID_SUBMIT_SEARCH_USER = "//input[contains(@id,'search-user-form:search')]";
- public static final String ID_INPUT_SEARCH_USER = "//input[contains(@id,'search-user-form:searchString')]";
- public static final String LINK_SEARCH_USER = "//a[contains(@id,'user-form:search-user-link')]";
- public static final String ID_LINK_USERTAB = "//a[contains(@id,'role-temp-form:manage-users')]";
- public static final String ID_LINK_USERMAIN = "//a[contains(@id,'user-temp-form1:user-adm-link')]";
-
- public static final String ID_LINK_ROLETAB = "//a[contains(@id,'_viewRoot:user-temp-form:role-mgm-link')]";
-
- public static final String ID_LINK_ROLEMAIN = "//a[contains(@id, ':_viewRoot:role-temp-form1:role-admin-link')]";
- public static final String LINK_USERMANG_MAIN = "//a[contains(@id,'user-temp-form1:assign-role-link')]";
- public static final String LINK_USERMANG_MAIN2 = "//a[contains(@id,'user-temp-form1:user-mgm-link')]";
- public static final String ID_LINK_CREATE_USER = "//a[contains(@id,':user-form:create-user-link')]";
- public static final String ID_CHECK_ROLE = "//input[contains(@name,''assign-roles-form:roles'') and @value=''{0}'']";
-
+ public String casePfx = "iden.man.";
+ private final String INP_USER_SEARCH_PREV = getProp(casePfx + "inp.user.search.prev", "//input[contains(@id,'search-user-form1:prev-page')]");
+ private final String INP_USER_SEARCH_NEXT = getProp(casePfx + "inp.user.search.next", "//input[contains(@id,'search-user-form1:next-page')]");
+
+ private final String SEL_SEARCHUSER_LIMIT = getProp(casePfx + "sel.searchuser.limit", "//select[contains(@id,'search-user-form:limit')]");
+ private final String SUB_EDIT_PROF = getProp(casePfx + "sub.edit.prof", "//input[contains(@id,'profile-form:submit')]");
+
+ private final String SUB_PAGIN_LEFT = getProp(casePfx + "sub.pagin.left", INP_USER_SEARCH_PREV);
+ private final String SUB_PAGIN_RIGHT = getProp(casePfx + "sub.pagin.right", INP_USER_SEARCH_NEXT);
+
+ private final String SUB_EDIT_USER_EMAIL_CANCEL = getProp(casePfx + "sub.edit.user.email.cancel", "//input[contains(@id,'profile-form:cancel')]");
+ private final String INP_EDIT_USER_EMAIL = getProp(casePfx + "inp.edit.user.email", "//input[contains(@id,'profile-form:email')]");
+ private final String SUB_ROLE_SEARCH_USER = getProp(casePfx + "sub.role.search.user", "//input[contains(@id,'search-user-form:search') and @type='submit']");
+ private final String INP_ROLE_SEARCH_USER = getProp(casePfx + "inp.role.search.user", "//input[contains(@id,'search-user-form:searchString')]");
+ private final String SUB_EDIT_ROLE_SUBMIT = getProp(casePfx + "sub.edit.role.submit", "//input[contains(@id,'edit-role-link:submit')]");
+ private final String SUB_EDIT_ROLE_CANCEL = getProp(casePfx + "sub.edit.role.cancel", "//input[contains(@id,'edit-role-link:cancel')]");
+ private final String INP_EDIT_ROLE_NAME = getProp(casePfx + "inp.edit.role.name", "//input[contains(@id,'edit-role-link:display-name')]");
+ private final String SUB_PASS_CHANGE_SUBMIT = getProp(casePfx + "sub.pass.change.submit", "//input[contains(@name,'change-pwd-form:j_id31')]");
+ private final String SUB_PASS_CHANGE_CANCEL = getProp(casePfx + "sub.pass.change.cancel", "//input[contains(@id,'change-pwd-form:cancel')]");
+ private final String INP_PASS_CHANGE_P2 = getProp(casePfx + "inp.pass.change.p2", "//input[contains(@id,':change-pwd-form:passwordCheck')]");
+ private final String INP_PASS_CHANGE_P1 = getProp(casePfx + "inp.pass.change.p1", "//input[contains(@id,':change-pwd-form:password')]");
+ private final String LNK_CHANGE_PASS = getProp(casePfx + "lnk.change.pass", "//a[contains(@id,':profile-form:change-pwd-adm-link')]");
+ public final String TBL_USERLIST = getProp(casePfx + "tbl.userlist", "//table[contains(@id,'search-user-form1:userlist')]");
+ public final String LNK_T_USRLIST_DEL = getProp(casePfx + "lnk.t.usrlist.del", "//a[contains(@id,''search-user-form1:userlist:{0}:delete-user-link'')]");
+ public final String LNK_T_USRLIST_ROLES = getProp(casePfx + "lnk.t.usrlist.roles", "//a[contains(@id,''search-user-form1:userlist:{0}:assign-role-link'')]");
+ public final String LNK_T_USRLIST_DIS = getProp(casePfx + "lnk.t.usrlist.dis", "//a[contains(@id,''search-user-form1:userlist:{0}:enable-user-link'')]");
+ public final String LNK_T_USRLIST_EDIT = getProp(casePfx + "lnk.t.usrlist.edit", "//a[contains(@id,''search-user-form1:userlist:{0}:rename-link'')]");
+
+ public final String TBL_ROLELIST = getProp(casePfx + "tbl.rolelist", "//table[contains(@id,'roles-form:userlist')]");
+
+ public final String LNK_T_ROLLIST_DEL = getProp(casePfx + "lnk.t.rollist.del", "//a[contains(@id,''roles-form:userlist:{0}:delete-role-link'')]");
+ public final String LNK_T_ROLLIST_MEMBERS = getProp(casePfx + "lnk.t.rollist.members", "//a[contains(@id,''roles-form:userlist:{0}:view-role-link'')]");
+ public final String LNK_T_ROLLIST_EDIT = getProp(casePfx + "lnk.t.rollist.edit", "//a[contains(@id,''roles-form:userlist:{0}:edit-role-link'')]");
+
+ public final String TBL_ROLEMEMBERS = getProp(casePfx + "tbl.rolemembers", "//table[contains(@id,'role-members-form:role-data-table')]");
+
+ public final String SUB_CONF_CREATE_USER = getProp(casePfx + "sub.conf.create.user", "//input[contains(@id,'confirm-form:admin')]");
+ public final String SUB_DELETE_ROLE = getProp(casePfx + "sub.delete.role", "//input[contains(@id,'delete-role-form:confirm')]");
+ public final String SUB_ROLE_CREATE = getProp(casePfx + "sub.role.create", "//input[contains(@id,'create-role-form:submit')]");
+ public final String INP_ROLEDISNAME = getProp(casePfx + "inp.roledisname", "//input[contains(@id,'create-role-form:roledisplayname')]");
+ public final String INP_ROLENAME = getProp(casePfx + "inp.rolename", "//input[contains(@id,'create-role-form:rolename')]");
+
+ public final String LNK_ROLE_CREATE = getProp(casePfx + "lnk.role.create", "//a[contains(@id, 'create-role-form:create-role-link')]");
+ public final String SUB_DEL_USER = getProp(casePfx + "sub.del.user", "//input[contains(@id,'delete-user-form:submit')]");
+ public final String SUB_ASSIGN_ROLE = getProp(casePfx + "sub.assign.role", "//input[contains(@id,'assign-roles-form:submit')]");
+ public final String SUB_USER_ROLE = getProp(casePfx + "sub.user.role", "//input[contains(@id,'register-role-form:submit')]");
+ public final String SUB_CREATE_USER = getProp(casePfx + "sub.create.user", "//input[contains(@id,'register-form:submit')]");
+ public final String INP_PASSWORD_CHK = getProp(casePfx + "inp.password.chk", "//input[contains(@id,'register-form:passwordCheck')]");
+ public final String INP_PASSWORD = getProp(casePfx + "inp.password", "//input[contains(@id,'register-form:password')]");
+ public final String INP_USEREMAIL = getProp(casePfx + "inp.useremail", "//input[contains(@id,'register-form:email')]");
+ public final String INP_USERNAME = getProp(casePfx + "inp.username", "//input[contains(@id,'register-form:username')]");
+ public final String SUB_SEARCH_USER = getProp(casePfx + "sub.search.user", "//input[contains(@id,'search-user-form:search') and @type='submit']");
+ public final String INP_SEARCH_USER = getProp(casePfx + "inp.search.user", "//input[contains(@id,'search-user-form:searchString')]");
+ public final String LNK_SEARCH_USER = getProp(casePfx + "lnk.search.user", "//a[contains(@id,'user-form:search-user-link')]");
+ public final String LNK_USERTAB = getProp(casePfx + "lnk.usertab", "//a[contains(@id,'role-temp-form:manage-users')]");
+ public final String LNK_USERMAIN = getProp(casePfx + "lnk.usermain", "//a[contains(@id,'user-temp-form1:user-adm-link')]");
+
+ public final String LNK_ROLETAB = getProp(casePfx + "lnk.roletab", "//a[contains(@id,'user-temp-form:role-mgm-link')]");
+
+ public final String LNK_ROLEMAIN = getProp(casePfx + "lnk.rolemain", "//a[contains(@id, 'role-temp-form1:role-admin-link')]");
+ public final String LNK_USERMANG_MAIN = getProp(casePfx + "lnk.usermang.main", "//a[contains(@id,'user-temp-form1:assign-role-link')]");
+ public final String LNK_USERMANG_MAIN2 = getProp(casePfx + "lnk.usermang.main2", "//a[contains(@id,'user-temp-form1:user-mgm-link')]");
+ public final String LNK_CREATE_USER = getProp(casePfx + "lnk.create.user", "//a[contains(@id,':user-form:create-user-link')]");
+
+ public final String CHK_ROLE = getProp(casePfx + "chk.role", "//input[contains(@name,''assign-roles-form:roles'') and @value=''{0}'']");
+
+ public final long SEARCH_TIMEOUT = 10000;
+
private String butDelUsr_id(String userName) {
- String table = TABLE_USERLIST;
+ String table = TBL_USERLIST;
int r = findTableRow(table, userName, 0);
- return MessageFormat.format(LINK_T_USRLIST_DEL, r - 1);
+ return MessageFormat.format(LNK_T_USRLIST_DEL, r - 1);
}
private String butUsrRol_id(String userName) {
- String table = TABLE_USERLIST;
+ String table = TBL_USERLIST;
int r = findTableRow(table, userName, 0);
- return MessageFormat.format(LINK_T_USRLIST_ROLES, r - 1);
+ return MessageFormat.format(LNK_T_USRLIST_ROLES, r - 1);
}
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
+ logoutIfPossible();
login("admin", "admin");
}
@AfterMethod(groups = { "log" })
public void logoutAfterTest() {
- logoutIfPossible();
- }
-/*
- // For this mode to be functional, the user which is logged in must be "admin" after each test
- @BeforeClass(groups = { "single" })
- public void loginBefore() {
- login("admin", "admin");
}
- @AfterClass(groups = { "single" })
- public void logoutAfter() {
- logout();
- }
-*/
+ /*
+ * // For this mode to be functional, the user which is logged in must be
+ * "admin" after each test
+ *
+ * @BeforeClass(groups = { "single" }) public void loginBefore() {
+ * login("admin", "admin"); }
+ *
+ * @AfterClass(groups = { "single" }) public void logoutAfter() { logout();
+ * }
+ */
+
@Test(enabled = true, description = "Creation of new user.")
public void testCreateUser() {
createUser("tempUser", "tempPassword", "tempUser(a)redhat.com");
@@ -129,360 +139,367 @@
createRole(role, "tempRoleDisplay");
deleteRole(role);
}
-
+
@Test(enabled = true, description = "Creating and deteling a user.")
public void testDeleteUser() {
createUser("deleteMe", "deleterPass", "disableMe(a)redhat.com");
deleteUser("deleteMe", "disableMe(a)redhat.com");
}
-
+
@Test(enabled = true, description = "Creating and disabling a user.")
public void testDisableUser() {
- createUser("disableMe", "disablePass", "disableMe(a)redhat.com");
-
+ final String userName = "disableMe";
+ final String userPass = "disablePass";
+ final String userMail = "disableMe(a)redhat.com";
+
+ createUser(userName, userPass, userMail);
+
logout();
- login("disableMe", "disablePass");
+ login(userName, userPass);
logout();
- login("admin","admin");
-
- searchUser("disableMe", "disableMe(a)redhat.com");
- int r = findTableRow(TABLE_USERLIST, "disableMe", 0);
-
- selenium.click(MessageFormat.format(LINK_T_USRLIST_DIS, r - 1 ));
-
+ login("admin", "admin");
+
+ searchUser(userName, userMail);
+ int r = findTableRow(TBL_USERLIST, userName, 0);
+
+ selenium.click(MessageFormat.format(LNK_T_USRLIST_DIS, r - 1));
+
logout();
-
- //trying to log in with disabled account
+
+ // trying to log in with disabled account
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click(LINK_LOGIN);
selenium.selectFrame(FRAME_LOGIN_CONTENT);
-
+
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
-
- selenium.type(INPUT_USERNAME, "disableMe");
- selenium.type(INPUT_PASSWORD, "disablePass");
+
+ selenium.type(INPUT_USERNAME, userName);
+ selenium.type(INPUT_PASSWORD, userPass);
selenium.click(SUBMIT_LOGIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("Your account is disabled"));
+ Assert.assertTrue(selenium.isTextPresent("Your account is disabled"), "Message telling that account is disabled is other then expected or missing.");
// we should be unable to login with disabled account
// logging as user to end the test correctly
-
- login("admin","admin");
-
- deleteUser("disableMe", "disableMe(a)redhat.com");
+
+ login("admin", "admin");
+
+ deleteUser(userName, userMail);
}
-
- @Test(enabled = true, dependsOnMethods = {"testDisableUser"},description = "Enabling disabled user.")
+
+ @Test(enabled = true, dependsOnMethods = { "testDisableUser" }, description = "Enabling disabled user.")
public void testEnableUser() {
- createUser("enableMe", "enableMe", "enableMe(a)redhat.com");
- searchUser("enableMe", "enableMe(a)redhat.com");
-
- int r = findTableRow(TABLE_USERLIST, "Enable", 5);
- Assert.assertTrue(r<0,"No user should be disabled.");
- r = findTableRow(TABLE_USERLIST, "enableMe", 0);
-
- selenium.click(MessageFormat.format(LINK_T_USRLIST_DIS, r - 1 ));
+ final String userName = "enableMe";
+ final String userPass = "enableMe";
+ final String userMail = "enableMe(a)redhat.com";
+ createUser(userName, userPass, userMail);
+ searchUser(userName, userMail);
+
+ int r = findTableRow(TBL_USERLIST, "Enable", 5);
+ Assert.assertTrue(r < 0, "No user should be disabled.");
+ r = findTableRow(TBL_USERLIST, userName, 0);
+
+ selenium.click(MessageFormat.format(LNK_T_USRLIST_DIS, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
-
- searchUser("enableMe", "enableMe(a)redhat.com");
- r = findTableRow(TABLE_USERLIST, "Enable", 5);
- Assert.assertFalse(r<0,"One user should have been disabled.");
- r = findTableRow(TABLE_USERLIST, "enableMe", 0);
- selenium.click(MessageFormat.format(LINK_T_USRLIST_DIS, r - 1 ));
+ searchUser(userName, userMail);
+ r = findTableRow(TBL_USERLIST, "Enable", 5);
+ Assert.assertFalse(r < 0, "One user should have been disabled.");
+
+ r = findTableRow(TBL_USERLIST, userName, 0);
+ selenium.click(MessageFormat.format(LNK_T_USRLIST_DIS, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
-
- searchUser("enableMe", "enableMe(a)redhat.com");
- r = findTableRow(TABLE_USERLIST, "Enable", 5);
- Assert.assertTrue(r<0,"No user should be disabled.");
-
- deleteUser("enableMe", "enableMe(a)redhat.com");
+
+ searchUser(userName, userMail);
+ r = findTableRow(TBL_USERLIST, "Enable", 5);
+ Assert.assertTrue(r < 0, "No user should be disabled.");
+
+ deleteUser(userName, userMail);
}
-
+
@Test(enabled = true, description = "Editing a user.")
public void testEditUser() {
- createUser("editMe", "editPass", "editMe(a)redhat.com");
-
+ final String userName = "editMe";
+ final String userPass = "editPass";
+ final String userMail = "editMe(a)redhat.com";
+
+ createUser(userName, userPass, userMail);
+
// canceling the edit form
- searchUser("editMe", "editMe(a)redhat.com");
-
- int r = findTableRow(TABLE_USERLIST, "editMe", 0);
- selenium.click(MessageFormat.format(LINK_T_USRLIST_EDIT, r - 1));
+ searchUser(userName, userMail);
+
+ int r = findTableRow(TBL_USERLIST, userName, 0);
+ selenium.click(MessageFormat.format(LNK_T_USRLIST_EDIT, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.type(INP_EDIT_USER_EMAIL, "editMe2(a)redhat.com");
selenium.click(SUB_EDIT_USER_EMAIL_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("editMe(a)redhat.com"));
-
+ Assert.assertTrue(selenium.isTextPresent(userMail), "User not visible after cancelling editing.");
+
// filling out the edit page
- searchUser("editMe", "editMe(a)redhat.com");
-
- r = findTableRow(TABLE_USERLIST, "editMe", 0);
- selenium.click(MessageFormat.format(LINK_T_USRLIST_EDIT, r - 1));
- selenium.waitForPageToLoad(PAGE_LOAD);
-
+ searchUser(userName, userMail);
+
+ r = findTableRow(TBL_USERLIST, userName, 0);
+ selenium.click(MessageFormat.format(LNK_T_USRLIST_EDIT, r - 1));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
selenium.type(INP_EDIT_USER_EMAIL, "editMe2(a)redhat.com");
/*
- selenium.select("profile-form:timezone", "label=(GMT -12:00 hours) Eniwetok, Kwajalein");
- selenium.select("profile-form:theme", "label=portal.industrial");
- selenium.select("profile-form:locale", "label=Albanian");
- selenium.type("profile-form:givenname", "Edit");
- selenium.type("profile-form:lastname", "Meme");
- selenium.type("profile-form:location", "Editoland");
- selenium.type("profile-form:skype", "editor");
- selenium.type("profile-form:icq", "112113114");
- selenium.type("profile-form:aim", "83838495");
- selenium.type("profile-form:msnm", "u8u8i9o0");
- selenium.type("profile-form:yim", "99384875");
- selenium.type("profile-form:xmmp", "10309128");
- selenium.type("profile-form:homepage", "http://www.edit.com");
- selenium.type("profile-form:occupation", "editor");
- selenium.type("profile-form:interests", "editing");
- selenium.type("profile-form:signature", "----\n\ni like to edit");
- selenium.type("profile-form:extra", "me edit good");
- */
+ * selenium.select("profile-form:timezone",
+ * "label=(GMT -12:00 hours) Eniwetok, Kwajalein");
+ * selenium.select("profile-form:theme", "label=portal.industrial");
+ * selenium.select("profile-form:locale", "label=Albanian");
+ * selenium.type("profile-form:givenname", "Edit");
+ * selenium.type("profile-form:lastname", "Meme");
+ * selenium.type("profile-form:location", "Editoland");
+ * selenium.type("profile-form:skype", "editor");
+ * selenium.type("profile-form:icq", "112113114");
+ * selenium.type("profile-form:aim", "83838495");
+ * selenium.type("profile-form:msnm", "u8u8i9o0");
+ * selenium.type("profile-form:yim", "99384875");
+ * selenium.type("profile-form:xmmp", "10309128");
+ * selenium.type("profile-form:homepage", "http://www.edit.com");
+ * selenium.type("profile-form:occupation", "editor");
+ * selenium.type("profile-form:interests", "editing");
+ * selenium.type("profile-form:signature", "----\n\ni like to edit");
+ * selenium.type("profile-form:extra", "me edit good");
+ */
selenium.click(SUB_EDIT_PROF);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("editMe2(a)redhat.com"));
- Assert.assertTrue(selenium.isTextPresent("Edit"));
-
- deleteUser("editMe", "editMe2(a)redhat.com");
-
+ Assert.assertTrue(selenium.isTextPresent("editMe2(a)redhat.com"), "Edited e-mail adress not visible.");
+
+ deleteUser(userName, "editMe2(a)redhat.com");
+
}
-
+
@Test(enabled = true, description = "Editing a user - changing of password.")
public void testEditUserChangePassword() {
- createUser("changePass", "changePassPass", "changePass(a)redhat.com");
-
+ final String userName = "changePass";
+ final String userPass = "changePassPass";
+ final String userPass2 = "changePass2";
+ final String userMail = "changePass(a)redhat.com";
+
+ createUser(userName, userPass, userMail);
+
logout();
- login("changePass","changePassPass");
+ login(userName, userPass);
logout();
- login("admin","admin");
-
- /*
- * Canceling of change at the first approach
- */
-
- searchUser("changePass", "changePass(a)redhat.com");
-
-
- int r = findTableRow(TABLE_USERLIST, "changePass", 0);
- selenium.click(MessageFormat.format(LINK_T_USRLIST_EDIT, r - 1));
+ login("admin", "admin");
+
+ // Canceling of change at the first approach
+
+ searchUser(userName, userMail);
+
+ int r = findTableRow(TBL_USERLIST, userName, 0);
+ selenium.click(MessageFormat.format(LNK_T_USRLIST_EDIT, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click(LINK_CHANGE_PASS);
+ selenium.click(LNK_CHANGE_PASS);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(INPUT_PASS_CHANGE_P1, "changePass2");
- selenium.type(INPUT_PASS_CHANGE_P2, "changePass2");
+ selenium.type(INP_PASS_CHANGE_P1, userPass2);
+ selenium.type(INP_PASS_CHANGE_P2, userPass2);
selenium.click(SUB_PASS_CHANGE_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- Assert.assertFalse(selenium.isTextPresent("Password has been updated."));
-
+
+ Assert.assertFalse(selenium.isTextPresent("Password has been updated."), "Message telling that password has changed appeared after cancel.");
+
logout();
- login("changePass","changePassPass");
+ login(userName, userPass);
logout();
- login("admin","admin");
-
- /*
- * In the second approach really change the password
- */
-
- searchUser("changePass", "changePass(a)redhat.com");
-
- r = findTableRow(TABLE_USERLIST, "changePass", 0);
- selenium.click(MessageFormat.format(LINK_T_USRLIST_EDIT, r - 1));
+ login("admin", "admin");
+
+ // In the second approach really change the password
+
+ searchUser(userName, userMail);
+
+ r = findTableRow(TBL_USERLIST, userName, 0);
+ selenium.click(MessageFormat.format(LNK_T_USRLIST_EDIT, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click(LINK_CHANGE_PASS);
+ selenium.click(LNK_CHANGE_PASS);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(INPUT_PASS_CHANGE_P1, "changePass2");
- selenium.type(INPUT_PASS_CHANGE_P2, "changePass2");
+ selenium.type(INP_PASS_CHANGE_P1, userPass2);
+ selenium.type(INP_PASS_CHANGE_P2, userPass2);
selenium.click(SUB_PASS_CHANGE_SUBMIT);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- Assert.assertTrue(selenium.isTextPresent("Password has been updated."));
-
+
+ Assert.assertTrue(selenium.isTextPresent("Password has been updated."), "Message telling that password has changed other then expected or missing.");
+
logout();
- login("changePass","changePass2");
+ login(userName, userPass2);
logout();
- login("admin","admin");
-
- deleteUser("changePass","changePass(a)redhat.com");
+ login("admin", "admin");
+
+ deleteUser(userName, userMail);
}
-
+
@Test(enabled = true, description = "Managing members of role.")
public void testRoleMembers() {
- createRole("membersRole", "membersRoleDisplay");
- createUser("newRoleMember" , "newRoleMember", "newRoleMem(a)redhatqa.com");
- assignRole("newRoleMember", "newRoleMem(a)redhatqa.com", "membersRole", "membersRoleDisplay");
-
+ final String roleName = "membersRole";
+ final String roleDisplayName = "membersRoleDisplay";
+ final String userName = "newRoleMember";
+ final String userMail = "newRoleMem(a)redhatqa.com";
+ final String invalidMember = "newRoleNonMember";
+
+ createRole(roleName, roleDisplayName);
+ createUser(userName, userName, userMail);
+ assignRole(userName, userMail, roleName, roleDisplayName);
+
clickUntilMembers();
- clickIfVisible(ID_LINK_ROLETAB);
- clickIfVisible(ID_LINK_ROLEMAIN);
-
- int r = findTableRow(TABLE_ROLELIST, "membersRole", 0);
- selenium.click(MessageFormat.format(LINK_T_ROLLIST_MEMBERS, r-1));
+ clickIfVisible(LNK_ROLETAB);
+ clickIfVisible(LNK_ROLEMAIN);
+
+ int r = findTableRow(TBL_ROLELIST, roleName, 0);
+ selenium.click(MessageFormat.format(LNK_T_ROLLIST_MEMBERS, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
-
- //search for the real member of current role
- selenium.type(INP_ROLE_SEARCH_USER, "newRoleMember");
+
+ // search for the real member of current role
+ selenium.type(INP_ROLE_SEARCH_USER, userName);
selenium.click(SUB_ROLE_SEARCH_USER);
waitFor(10000);
-
- r = findTableRow(TABLE_ROLEMEMBERS, "newRoleMember", 0);
- Assert.assertTrue(r>0, "Assigned member not found in the role members table.");
-
- //search for the non-member user of current role
- selenium.type(INP_ROLE_SEARCH_USER, "newRoleNonMember");
+
+ r = findTableRow(TBL_ROLEMEMBERS, userName, 0);
+ Assert.assertTrue(r > 0, "Assigned member not found in the role members table.");
+
+ // search for the non-member user of current role
+ selenium.type(INP_ROLE_SEARCH_USER, invalidMember);
selenium.click(SUB_ROLE_SEARCH_USER);
waitFor(10000);
-
- Assert.assertFalse(selenium.isElementPresent(TABLE_ROLEMEMBERS), "Not assigned member found in the role members table.");
-
- deleteRole("membersRole");
- deleteUser("newRoleMember" , "newRoleMem(a)redhatqa.com");
+
+ Assert.assertFalse(selenium.isElementPresent(TBL_ROLEMEMBERS), "Not assigned member found in the role members table.");
+
+ deleteRole(roleName);
+ deleteUser(userName, userMail);
}
-
+
@Test(enabled = true, description = "Creation of new role.")
public void testRoleEdit() {
-
- createRole("editRole", "editRoleDisplay");
-
+ final String roleName = "editRole";
+ final String roleDisplayName = "editRoleDisplay";
+ final String roleDisplayNameEditet = "editedRoleDisplay";
+
+ createRole(roleName, roleDisplayName);
+
clickUntilMembers();
- clickIfVisible(ID_LINK_ROLETAB);
- clickIfVisible(ID_LINK_ROLEMAIN);
-
- int r = findTableRow(TABLE_ROLELIST, "editRoleDisplay", 1);
- Assert.assertTrue(r>=0,"Renamed display name found in table");
-
- r = findTableRow(TABLE_ROLELIST, "editedRoleDisplay", 1);
- Assert.assertFalse(r>=0,"Not created role display name found in table");
-
- //canceling of renaming of displayname for the first time
- r = findTableRow(TABLE_ROLELIST, "editRole", 0);
-
- selenium.click(MessageFormat.format(LINK_T_ROLLIST_EDIT, r -1));
+ clickIfVisible(LNK_ROLETAB);
+ clickIfVisible(LNK_ROLEMAIN);
+
+ int r = findTableRow(TBL_ROLELIST, roleDisplayName, 1);
+ Assert.assertTrue(r >= 0, "Renamed display name found in table");
+
+ r = findTableRow(TBL_ROLELIST, roleDisplayNameEditet, 1);
+ Assert.assertFalse(r >= 0, "Not created role display name found in table");
+
+ // canceling of renaming of displayname for the first time
+ r = findTableRow(TBL_ROLELIST, roleName, 0);
+
+ selenium.click(MessageFormat.format(LNK_T_ROLLIST_EDIT, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
-
- selenium.type(INP_EDIT_ROLE_NAME, "editedRoleDisplay");
+
+ selenium.type(INP_EDIT_ROLE_NAME, roleDisplayNameEditet);
selenium.click(SUB_EDIT_ROLE_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- r = findTableRow(TABLE_ROLELIST, "editRoleDisplay", 1);
- Assert.assertTrue(r>=0,"Renamed display name found in table");
-
- r = findTableRow(TABLE_ROLELIST, "editedRoleDisplay", 1);
- Assert.assertFalse(r>=0,"Not created role display name found in table");
-
+
+ r = findTableRow(TBL_ROLELIST, roleDisplayName, 1);
+ Assert.assertTrue(r >= 0, "Renamed display name found in table");
+
+ r = findTableRow(TBL_ROLELIST, roleDisplayNameEditet, 1);
+ Assert.assertFalse(r >= 0, "Not created role display name found in table");
+
// real renaming
- r = findTableRow(TABLE_ROLELIST, "editRole", 0);
- selenium.click(MessageFormat.format(LINK_T_ROLLIST_EDIT, r-1));
+ r = findTableRow(TBL_ROLELIST, roleName, 0);
+ selenium.click(MessageFormat.format(LNK_T_ROLLIST_EDIT, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
-
- selenium.type(INP_EDIT_ROLE_NAME, "editedRoleDisplay");
+
+ selenium.type(INP_EDIT_ROLE_NAME, roleDisplayNameEditet);
selenium.click(SUB_EDIT_ROLE_SUBMIT);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- r = findTableRow(TABLE_ROLELIST, "editRoleDisplay", 1);
- Assert.assertFalse(r>=0,"Renamed display name found in table");
-
- r = findTableRow(TABLE_ROLELIST, "editedRoleDisplay", 1);
- Assert.assertTrue(r>=0,"New role display name not found in table");
-
- deleteRole("editRole");
+
+ r = findTableRow(TBL_ROLELIST, roleDisplayName, 1);
+ Assert.assertFalse(r >= 0, "Renamed display name found in table");
+
+ r = findTableRow(TBL_ROLELIST, roleDisplayNameEditet, 1);
+ Assert.assertTrue(r >= 0, "New role display name not found in table");
+
+ deleteRole(roleName);
}
-
- @Test(enabled= false, description = "Altering the number of rows in user search")
- public void testSearchUserCount() {
-
- for(int i=0; i< 95; i++){
- createUser("man"+i+"us", "man"+i+"pas", "man"+i+"us"+"@redhatqa.com");
- }
-
- searchSimple("man","10");
- Assert.assertEquals(countTableRows(TABLE_USERLIST)-1,10,"Wrong number of row in user table #1.");
-
- searchSimple("man","50");
- Assert.assertEquals(countTableRows(TABLE_USERLIST)-1,50,"Wrong number of row in user table #2.");
- selenium.click("search-user-form1:next-page");
- selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertEquals(countTableRows(TABLE_USERLIST)-1,45,"Wrong number of row in user table #3.");
- selenium.click("search-user-form1:prev-page");
- selenium.waitForPageToLoad(PAGE_LOAD);
-
- searchSimple("man","100");
- Assert.assertEquals(countTableRows(TABLE_USERLIST)-1,95,"Wrong number of row in user table #4.");
- /*
- for(int i=0; i< 95; i++){
- deleteUser("man"+i+"us", "man"+i+"us"+"@redhatqa.com");
+
+ @Test(enabled = false)
+ public void testManyUsers() {
+ for (int i = 0; i < 25; i++) {
+ createUser("user0" + i + "", "useruser", "user0" + i + "" + "@portal.com");
}
- */
-
}
-
- private void searchSimple(String name, String count){
- selenium.open("/portal/");
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Admin");
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Members");
- selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(ID_LINK_USERTAB);
- clickIfVisible(ID_LINK_USERMAIN);
- clickIfVisible(LINK_USERMANG_MAIN);
+ @Test(enabled = true, description = "Altering the number of rows in user search")
+ public void testSearchUserCount() {
- selenium.click(LINK_SEARCH_USER);
+ for (int i = 0; i < 95; i++) {
+ createUser("man" + i + "us", "man" + i + "pas", "man" + i + "us" + "@redhatqa.com");
+ }
+
+ searchSimple("man", "10");
+ Assert.assertEquals(countTableRows(TBL_USERLIST) - 1, 10, "Wrong number of row in user table #1.");
+
+ searchSimple("man", "50");
+ Assert.assertEquals(countTableRows(TBL_USERLIST) - 1, 50, "Wrong number of row in user table #2.");
+ selenium.click(INP_USER_SEARCH_NEXT);
selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertEquals(countTableRows(TBL_USERLIST) - 1, 45, "Wrong number of row in user table #3.");
+ selenium.click(INP_USER_SEARCH_PREV);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertEquals(countTableRows(TBL_USERLIST) - 1, 50, "Wrong number of row in user table #2.");
+
+ searchSimple("man", "100");
+ //selenium.setSpeed("60000");
+ Assert.assertEquals(countTableRows(TBL_USERLIST) - 1, 95, "Wrong number of row in user table #4.");
+ //selenium.setSpeed("0");
+ /*
+ * for(int i=0; i< 95; i++){ deleteUser("man"+i+"us",
+ * "man"+i+"us"+"@redhatqa.com"); }
+ */
- selenium.type(ID_INPUT_SEARCH_USER, name);
- selenium.select("search-user-form:limit", "label="+count);
- selenium.click(ID_SUBMIT_SEARCH_USER);
- //selenium.waitForPageToLoad(PAGE_LOAD);
- waitBlock();
}
-
@Test(enabled = true, dependsOnMethods = { "testCreateUser", "testCreateRole" }, description = "Assigning of the role to the user.")
public void testAssignRole2User() {
String user = "tempUser";
String userMail = "tempUser(a)redhat.com";
String role = "tempRole";
- String roleDisplay = "tempRoleDisplay";
+ final String roleDisplayName = "tempRoleDisplay";
+ final String userPass = "tempPassword";
- createUser(user, "tempPassword", userMail);
- createRole(role, "tempRoleDisplay");
- assignRole(user, userMail, role, roleDisplay);
+ createUser(user, userPass, userMail);
+ createRole(role, roleDisplayName);
+ assignRole(user, userMail, role, roleDisplayName);
- deassignRole(user, userMail, role, roleDisplay);
+ deassignRole(user, userMail, role, roleDisplayName);
deleteRole(role);
deleteUser(user, userMail);
}
- void assignRole(String user, String email, String role, String roleDisplay) {
+ void assignRole(String userName, String userMail, String roleName, String roleDisplayName) {
- searchUser(user, email);
- selenium.click(butUsrRol_id(user));
+ searchUser(userName, userMail);
+ selenium.click(butUsrRol_id(userName));
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent(roleDisplay), "Role display name: " + roleDisplay + " not found on the page.");
+ Assert.assertTrue(selenium.isTextPresent(roleDisplayName), "Role display name: " + roleDisplayName + " not found on the page.");
- final String CHECK_ROLE = MessageFormat.format(ID_CHECK_ROLE, role);
+ final String CHECK_ROLE = MessageFormat.format(CHK_ROLE, roleName);
selenium.click(CHECK_ROLE);
- selenium.click(ID_SUBMIT_ASSIGN_ROLE);
+ selenium.click(SUB_ASSIGN_ROLE);
selenium.waitForPageToLoad(PAGE_LOAD);
- searchUser(user, email);
+ searchUser(userName, userMail);
- selenium.click(butUsrRol_id(user));
+ selenium.click(butUsrRol_id(userName));
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isChecked(CHECK_ROLE), "The role wasn't correctly assigned.");
@@ -497,10 +514,10 @@
Assert.assertTrue(selenium.isTextPresent(roleDisplay), "Role display name: " + roleDisplay + " not found on the page.");
// check the tempRole check box
- final String CHECK_ROLE = MessageFormat.format(ID_CHECK_ROLE, role);
+ final String CHECK_ROLE = MessageFormat.format(CHK_ROLE, role);
selenium.click(CHECK_ROLE);
- selenium.click(ID_SUBMIT_ASSIGN_ROLE);
+ selenium.click(SUB_ASSIGN_ROLE);
selenium.waitForPageToLoad(PAGE_LOAD);
searchUser(user, email);
@@ -511,7 +528,7 @@
}
- void createUser(String username, String password, String email) {
+ void createUser(String userName, String userPass, String userMail) {
selenium.open("/portal/auth/portal/default");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -521,30 +538,30 @@
selenium.click("link=Members");
selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(ID_LINK_USERTAB);
- clickIfVisible(ID_LINK_USERMAIN);
- selenium.click(ID_LINK_CREATE_USER);
+ clickIfVisible(LNK_USERTAB);
+ clickIfVisible(LNK_USERMAIN);
+ selenium.click(LNK_CREATE_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Username *"), "Label for username input is wrong or missing.");
- selenium.type(ID_INPUT_USERNAME, username);
+ selenium.type(INP_USERNAME, userName);
Assert.assertTrue(selenium.isTextPresent("E-Mail *"), "Label for e-mail input is wrong or missing.");
- selenium.type(ID_INPUT_USEREMAIL, email);
+ selenium.type(INP_USEREMAIL, userMail);
Assert.assertTrue(selenium.isTextPresent("Password *"), "Label for password input is wrong or missing.");
- selenium.type(ID_INPUT_PASSWORD, password);
+ selenium.type(INP_PASSWORD, userPass);
Assert.assertTrue(selenium.isTextPresent("Confirm Password *"), "Label for password confirm input is wrong or missing.");
- selenium.type(ID_INPUT_PASSWORD_CHK, password);
+ selenium.type(INP_PASSWORD_CHK, userPass);
- selenium.click(ID_SUBMIT_CREATE_USER);
+ selenium.click(SUB_CREATE_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertFalse(selenium.isTextPresent("This username is already taken. tempUser"), "User already exists.");
- selenium.click(ID_SUBMIT_USER_ROLE);
+ selenium.click(SUB_USER_ROLE);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Confirmation"), "Confirmation screen is missing or corrupted.");
- selenium.click(ID_SUBMIT_CONF_CREATE_USER);
+ selenium.click(SUB_CONF_CREATE_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("User created"), "User was not created (\"User created\" text missing).");
@@ -559,24 +576,22 @@
selenium.click("link=Members");
selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(ID_LINK_USERMAIN);
+ clickIfVisible(LNK_USERMAIN);
- selenium.click(ID_LINK_CREATE_USER);
+ selenium.click(LNK_CREATE_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(ID_INPUT_USERNAME, username);
- selenium.type(ID_INPUT_USEREMAIL, email);
- selenium.type(ID_INPUT_PASSWORD, password);
- selenium.type(ID_INPUT_PASSWORD_CHK, password);
- selenium.click(ID_SUBMIT_CREATE_USER);
+ selenium.type(INP_USERNAME, username);
+ selenium.type(INP_USEREMAIL, email);
+ selenium.type(INP_PASSWORD, password);
+ selenium.type(INP_PASSWORD_CHK, password);
+ selenium.click(SUB_CREATE_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert
- .assertTrue(selenium.isTextPresent("This username is already taken."),
- "No user was overwritten, current username wasn't already taken.");
+ Assert.assertTrue(selenium.isTextPresent("This username is already taken."), "No user was overwritten, current username wasn't already taken.");
}
- void searchUser(String username, String email) {
+ void searchUser(String userName, String userMail) {
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
@@ -584,21 +599,44 @@
selenium.click("link=Members");
selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(ID_LINK_USERTAB);
- clickIfVisible(ID_LINK_USERMAIN);
- clickIfVisible(LINK_USERMANG_MAIN);
+ clickIfVisible(LNK_USERTAB);
+ clickIfVisible(LNK_USERMAIN);
+ clickIfVisible(LNK_USERMANG_MAIN);
- selenium.click(LINK_SEARCH_USER);
+ selenium.click(LNK_SEARCH_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(ID_INPUT_SEARCH_USER, username);
- selenium.click(ID_SUBMIT_SEARCH_USER);
- //selenium.waitForPageToLoad(PAGE_LOAD);
- waitBlock();
- Assert.assertTrue(selenium.isTextPresent(username), "Username was not found.");
- Assert.assertTrue(selenium.isTextPresent(email), "User email adress was not found.");
+ selenium.type(INP_SEARCH_USER, userName);
+
+ selenium.click(SUB_SEARCH_USER);
+ waitFor(SEARCH_TIMEOUT);
+ if (!selenium.isTextPresent(userName) && !selenium.isTextPresent(userMail))
+ paginate(userName, userMail);
+
+ Assert.assertTrue(selenium.isTextPresent(userName), "Username was not found.");
+ Assert.assertTrue(selenium.isTextPresent(userMail), "User email adress was not found.");
}
+ private void paginate(String userName, String userMail) {
+
+ while (selenium.isElementPresent(SUB_PAGIN_RIGHT)) {
+ selenium.click(SUB_PAGIN_RIGHT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ if (selenium.isTextPresent(userName) && selenium.isTextPresent(userMail))
+ return;
+ }
+
+ while (selenium.isElementPresent(SUB_PAGIN_LEFT)) {
+ selenium.click(SUB_PAGIN_RIGHT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ if (selenium.isTextPresent(userName) && selenium.isTextPresent(userMail))
+ return;
+ }
+
+ }
+
private void deleteUser(String username, String email) {
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -607,30 +645,30 @@
selenium.click("link=Members");
selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(ID_LINK_USERTAB);
+ clickIfVisible(LNK_USERTAB);
// user home page
- clickIfVisible(ID_LINK_USERMAIN);
- clickIfVisible(LINK_USERMANG_MAIN);
- clickIfVisible(LINK_USERMANG_MAIN2);
+ clickIfVisible(LNK_USERMAIN);
+ clickIfVisible(LNK_USERMANG_MAIN);
+ clickIfVisible(LNK_USERMANG_MAIN2);
- selenium.click(LINK_SEARCH_USER);
+ selenium.click(LNK_SEARCH_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(ID_INPUT_SEARCH_USER, username);
- selenium.click(ID_SUBMIT_SEARCH_USER);
- //selenium.waitForPageToLoad(PAGE_LOAD);
- waitBlock();
+ selenium.type(INP_SEARCH_USER, username);
+ selenium.click(SUB_SEARCH_USER);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
+ waitFor(SEARCH_TIMEOUT);
Assert.assertTrue(selenium.isTextPresent(username), "Username was not found.");
Assert.assertTrue(selenium.isTextPresent(email), "User e-mail adress was not found.");
selenium.click(butDelUsr_id(username));
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click(ID_BUT_SUBMIT_DEL_USER);
+ selenium.click(SUB_DEL_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("User deleted"), "user was not deleted (\"User deleted\" text missing).");
}
- private void clickUntilMembers(){
+ private void clickUntilMembers() {
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
@@ -638,7 +676,7 @@
selenium.click("link=Members");
selenium.waitForPageToLoad(PAGE_LOAD);
}
-
+
private void createRole(String roleName, String roleDisplayName) {
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -647,19 +685,19 @@
selenium.click("link=Members");
selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(ID_LINK_ROLETAB);
- clickIfVisible(ID_LINK_ROLEMAIN);
+ clickIfVisible(LNK_ROLETAB);
+ clickIfVisible(LNK_ROLEMAIN);
- Assert.assertTrue(selenium.isElementPresent(ID_BUT_ROLE_CREATE), "Button for role creating has wrong id or doesn't exist.");
- Assert.assertEquals(selenium.getText(ID_BUT_ROLE_CREATE), "Create role", "Button for role creating has wrong label.");
- selenium.click(ID_BUT_ROLE_CREATE);
+ Assert.assertTrue(selenium.isElementPresent(LNK_ROLE_CREATE), "Button for role creating has wrong id or doesn't exist.");
+ Assert.assertEquals(selenium.getText(LNK_ROLE_CREATE), "Create role", "Button for role creating has wrong label.");
+ selenium.click(LNK_ROLE_CREATE);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Role"), "Label for role name not present or incorrect.");
- selenium.type(ID_INPUT_ROLENAME, roleName);
+ selenium.type(INP_ROLENAME, roleName);
Assert.assertTrue(selenium.isTextPresent("Display name"), "Label for display role name not present or incorrect.");
- selenium.type(ID_INPUT_ROLEDISNAME, roleDisplayName);
- selenium.click(ID_SUBMIT_ROLE_CREATE);
+ selenium.type(INP_ROLEDISNAME, roleDisplayName);
+ selenium.click(SUB_ROLE_CREATE);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent(roleName), "Name of newly created role is missing.");
@@ -674,31 +712,45 @@
selenium.click("link=Members");
selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(ID_LINK_ROLETAB);
- clickIfVisible(ID_LINK_ROLEMAIN);
+ clickIfVisible(LNK_ROLETAB);
+ clickIfVisible(LNK_ROLEMAIN);
Assert.assertTrue(selenium.isTextPresent(roleName), "Role name is missing");
- int r = findTableRow(TABLE_ROLELIST, roleName, 0);
- selenium.click(MessageFormat.format(LINK_T_ROLLIST_DEL, r-1));
+ int r = findTableRow(TBL_ROLELIST, roleName, 0);
+ selenium.click(MessageFormat.format(LNK_T_ROLLIST_DEL, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("Warning! You are about to delete the role '" + roleName+"'"),
+ Assert.assertTrue(selenium.isTextPresent("Warning! You are about to delete the role '" + roleName + "'"),
"Confirmation text for role deletion missing missing.");
- selenium.click(ID_SUBMIT_DELETE_ROLE);
+ selenium.click(SUB_DELETE_ROLE);
selenium.waitForPageToLoad(PAGE_LOAD);
}
-
- protected void waitBlock(){
- try {
- Thread.sleep(2000);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+
+ private void searchSimple(String name, String count) {
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=Members");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(LNK_USERTAB);
+ clickIfVisible(LNK_USERMAIN);
+ clickIfVisible(LNK_USERMANG_MAIN);
+
+ selenium.click(LNK_SEARCH_USER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.select(SEL_SEARCHUSER_LIMIT, "label=" + count);
+ //waitFor(SEARCH_TIMEOUT);
+ selenium.type(INP_SEARCH_USER, name);
+ selenium.click(SUB_SEARCH_USER);
+ waitFor(SEARCH_TIMEOUT);
+
}
}
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -1,5 +1,9 @@
package org.jboss.portal.test.selenium;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
@@ -11,28 +15,44 @@
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
public class JBossPortalSeleniumTestCase {
- public static final String LINK_LOGOUT = "link=Logout";
- public static final String SUBMIT_LOGIN = "login";
- public static final String ADDR_PORTAL = "/portal/";
- public static final String FRAME_LOGIN_CONTENT = "login-content";
- public static final String LINK_LOGIN = "link=Login";
- public static final String INPUT_PASSWORD = "j_password";
- public static final String INPUT_USERNAME = "j_username";
+
+ private String casePfx = "portal.";
+
+ static {
+ try {
+ props = getProperties();
+ } catch (Exception e) {
+ // TODO: handle exception
+ }
+ }
+
+ public final String LINK_LOGOUT = getProp(casePfx + "link.logout", "link=Logout");
+ public final String SUBMIT_LOGIN = getProp(casePfx + "submit.login", "login");
+ public final String ADDR_PORTAL = getProp(casePfx + "addr.portal", "/portal/");
+ public final String FRAME_LOGIN_CONTENT = getProp(casePfx + "frame.login.content", "login-content");
+ public final String LINK_LOGIN = getProp(casePfx + "link.login", "link=Login");
+ public final String INPUT_PASSWORD = getProp(casePfx + "input.password", "j_password");
+ public final String INPUT_USERNAME = getProp(casePfx + "input.username", "j_username");
+
+ protected static Properties props;
protected Selenium selenium;
// Generic timeout in miliseconds
- protected static final String PAGE_LOAD = "900000";
+ protected static final String PAGE_LOAD = "2400000";
// Element timeout in seconds
- protected static final int ELEM_TIMEOUT = 120;
+ protected static final int ELEM_TIMEOUT = 220;
@BeforeClass
public void setupChromeForLogin() throws Exception {
-
+
String browser = System.getProperty("browser");
selenium = new DefaultSelenium("127.0.0.1", 44444, browser, "http://localhost:8080/portal/");
+
+ JBossSeleniumTestListener.selenium = selenium;
selenium.start();
+ selenium.setTimeout(PAGE_LOAD);
}
@AfterClass
@@ -40,40 +60,46 @@
selenium.stop();
}
- protected void clickIfVisible(String id) {
+ private static Properties getProperties() throws IOException {
+ ClassLoader cl = ClassLoader.getSystemClassLoader();
+ InputStream is = cl.getResourceAsStream("org/jboss/portal/test/selenium/locator.properties");
+ Properties props = new Properties();
+ props.load(is);
+ if (props == null){
+ is = JBossPortalSeleniumTestCase.class.getResourceAsStream("org/jboss/portal/test/selenium/locator.properties");
+ props.load(is);
+ }
+ if (props == null){
+ // System.out.println("still null");
+ }
+
+ return props;
+ }
- if (selenium.isElementPresent(id)) {
- selenium.click(id);
+ protected String getProp(String prop, String subst) {
+
+ if (subst == null || "".equals(subst)) {
+ subst = "Locator not set";
+ }
- selenium.waitForPageToLoad(PAGE_LOAD);
+ if (props == null) {
+ // System.out.println("props null");
+ return subst;
+ } else {
+// System.out.println("! props null");
+ return props.getProperty(prop) != null ? props.getProperty(prop) : subst;
}
}
- protected void clickIfVisible(String id, String awaited) {
+ protected void clickIfVisible(String id) {
if (selenium.isElementPresent(id)) {
selenium.click(id);
+
selenium.waitForPageToLoad(PAGE_LOAD);
}
- Assert.assertTrue(selenium.isTextPresent(awaited));
}
- @Deprecated
- protected boolean findLink(String id) {
- for (String link : selenium.getAllLinks()) {
- if (link.equals(id)) {
- return true;
- }
- }
- for (String link : selenium.getAllFields()) {
- if (link.equals(id)) {
- return true;
- }
- }
-
- return false;
- }
-
protected int findTableRow(String tableLocation, String searchName, int searchCol) {
return Integer.valueOf(selenium.getEval("selenium.findTableRow(\"" + tableLocation + "\",'" + searchName + "'," + searchCol + ")"));
}
@@ -100,8 +126,9 @@
}
}
- if (isAvailable)
+ if (isAvailable) {
break;
+ }
} catch (Exception e) {
}
waitFor(1000);
@@ -145,32 +172,48 @@
protected void waitForElement(String locator) {
for (int second = 0;; second++) {
if (second >= ELEM_TIMEOUT) {
- selenium.captureScreenshot("err.jpg");
Assert.fail("Element " + locator + " not found.");
}
try {
- if (selenium.isElementPresent(locator))
+ if (selenium.isElementPresent(locator)) {
break;
+ }
} catch (Exception e) {
}
waitFor(1000);
}
}
+ protected void waitForElement(String locatorElem, String locatorLink, long timeToWait, long n) {
+ for (int i = 0;; i++) {
+ if (i >= n) {
+ Assert.fail("Element " + locatorElem + " not found.");
+ }
+ try {
+ if (selenium.isElementPresent(locatorElem)) {
+ break;
+ }
+ } catch (Exception e) {
+ }
+ waitFor(1000);
+ }
+ }
+
public void waitForText(String text) {
for (int second = 0;; second++) {
if (second >= ELEM_TIMEOUT) {
Assert.fail("Text '" + text + "' not found.");
}
try {
- if (selenium.isTextPresent(text))
+ if (selenium.isTextPresent(text)) {
break;
+ }
} catch (Exception e) {
}
- waitFor(1000);
+ waitFor(100);
}
}
-
+
protected void login(String username, String password) {
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
Copied: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSelenium.java (from rev 12964, branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSelenium.java)
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSelenium.java (rev 0)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSelenium.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -0,0 +1,172 @@
+package org.jboss.portal.test.selenium;
+
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+
+import com.thoughtworks.selenium.DefaultSelenium;
+import com.thoughtworks.selenium.SeleniumException;
+
+public class JBossSelenium extends DefaultSelenium {
+
+ protected static String PAGE_LOAD= "500000";
+ protected static int count;
+
+ @Override
+ public void click(String locator) {
+ try {
+ try {
+ super.click(locator);
+ }
+ catch (SeleniumException e){
+
+ String name = "E_";
+ Pattern methodname = Pattern.compile("^org.jboss.portal.test.selenium\\S+test\\S+\\(\\S+\\)");
+ for(int i=0;i<e.getStackTrace().length;i++){
+ String input = e.getStackTrace()[i].toString();
+ Matcher match = methodname.matcher(input);
+ if (match.matches()){
+ input = input.replace("org.jboss.portal.test.selenium","");
+ input = input.replaceAll("\\(.*\\)","");
+ name += input;
+ }
+ }
+ name += "."+count;
+ try {
+ PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(name+".html")));
+ out.println(getHtmlSource());
+ out.close();
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ }
+ try {
+ windowMaximize();
+ captureScreenshot(name + ".jpg");
+ } catch (SeleniumException e2) {
+ e2.printStackTrace();
+ }
+ count++;
+
+ throw new SeleniumException(e);
+ }
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void open(String locator) {
+ try {
+ super.open(locator);
+ }
+ catch (SeleniumException e){
+ try {
+ PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("html"+count+".html")));
+ out.println(getHtmlSource());
+ out.close();
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ }
+ windowMaximize();
+ captureScreenshot("shot"+ count +".jpg");
+ count++;
+ throw new SeleniumException(e);
+ }
+ }
+
+ @Override
+ public boolean isElementPresent(String locator){
+ try {
+ return super.isElementPresent(locator);
+ }
+ catch (SeleniumException e){
+ try {
+ PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("html"+count+".html")));
+ out.println(getHtmlSource());
+ out.close();
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ }
+ windowMaximize();
+ captureScreenshot("shot"+ count +".jpg");
+ count++;
+ throw new SeleniumException(e);
+ }
+ }
+
+
+
+ public JBossSelenium(String serverHost, int serverPort, String browserStartCommand, String browserURL, String timeout) {
+ super(serverHost, serverPort, browserStartCommand, browserURL);
+ PAGE_LOAD = timeout;
+ }
+
+ public JBossSelenium(String serverHost, int serverPort, String browserStartCommand, String browserURL) {
+ super(serverHost, serverPort, browserStartCommand, browserURL);
+ }
+
+ protected void clickAndWait(String locator) {
+ click(locator);
+ waitForPageToLoad(PAGE_LOAD);
+ }
+
+ protected void clickAndWait(String locator, String timeout) {
+ click(locator);
+ waitForPageToLoad(timeout);
+ }
+
+ protected void clickAndWaitIfVisible(String id) {
+
+ if (isElementPresent(id)) {
+ click(id);
+
+ waitForPageToLoad(PAGE_LOAD);
+ }
+ }
+
+ public void clickIfVisible(String id) {
+
+ if (isElementPresent(id)){
+ click(id);
+
+ waitForPageToLoad(PAGE_LOAD);
+ }
+ }
+ protected boolean findLink(String id) {
+ for (String link : getAllLinks()) {
+ if (link.equals(id)) {
+ return true;
+ }
+ }
+ for (String link : getAllFields()) {
+ if (link.equals(id)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ protected int findTableRow(String tableLocation, String searchName, int searchCol) {
+ return Integer.valueOf(getEval("selenium.findTableRow(\"" + tableLocation + "\",'" + searchName + "'," + searchCol + ")"));
+ }
+
+ protected int countTableRows(String tableLocation) {
+ return Integer.valueOf(getEval("selenium.countTableRows(\"" + tableLocation + "\")"));
+ }
+
+ protected void waitFor(long time){
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+}
Copied: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSeleniumTestListener.java (from rev 12964, branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSeleniumTestListener.java)
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSeleniumTestListener.java (rev 0)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossSeleniumTestListener.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -0,0 +1,64 @@
+package org.jboss.portal.test.selenium;
+
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import org.testng.ITestResult;
+import org.testng.TestListenerAdapter;
+
+import com.thoughtworks.selenium.Selenium;
+import com.thoughtworks.selenium.SeleniumException;
+
+public class JBossSeleniumTestListener extends TestListenerAdapter {
+
+ protected static Selenium selenium;
+ protected static int count;
+ protected static boolean screenshot = false;
+ protected static boolean htmlSource = false;
+ protected static String outputDir = "";
+
+ static {
+ String ss = System.getProperty("screenshot");
+ if ("true".equals(ss)) {
+ screenshot = true;
+ }
+
+ String sh = System.getProperty("html-src");
+ if ("true".equals(sh)) {
+ htmlSource = true;
+ }
+
+ String so = System.getProperty("output-dir");
+ if (so != null) {
+ outputDir = so;
+ }
+ }
+
+ @Override
+ public void onTestFailure(ITestResult tr) {
+
+ String name = outputDir +"/"+ "F_" + tr.getName() + "-" + count;
+
+ if (htmlSource) {
+ try {
+ PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(name + ".html")));
+ out.println(selenium.getHtmlSource());
+ out.close();
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ }
+ }
+ if (screenshot) {
+ try {
+ selenium.windowMaximize();
+ selenium.captureScreenshot(name + ".jpg");
+ } catch (SeleniumException e2) {
+ e2.printStackTrace();
+ }
+ }
+ count++;
+ }
+
+}
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortletUserCreationTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortletUserCreationTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortletUserCreationTestCase.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -9,24 +9,21 @@
@Test(groups = { "portlet_user_creation" }, enabled = true)
public class PortletUserCreationTestCase extends JBossPortalSeleniumTestCase {
- private static final String SUBMIT_CREATE_CONF = "//input[contains(@id,'confirm-form:user')]";
- public static final String SUBMIT_CREATE_CONF_EDIT = "//input[contains(@id,'//input[contains(@id,'confirm-form:revise')]";
+
+ public String casePfx = "user.crea.port.";
+
+ private final String SUBMIT_CREATE_CONF = getProp(casePfx+"submit.create.conf","//input[contains(@id,'confirm-form:user')]");
+ public final String SUBMIT_CREATE_CONF_EDIT = getProp(casePfx+"submit.create.conf.edit","//input[contains(@id,'//input[contains(@id,'confirm-form:revise')]");
+ private final String SUBMIT_CREATE_USER = getProp(casePfx+"submit.create.user","//input[contains(@id,'register-form:submit')]");
+ private final String SUBMIT_CREATE_USER_CANCEL = getProp(casePfx+"submit.create.user.cancel","//input[contains(@id,'register-form:cancel')]");
+ private final String INPUT_USERPASSWDCONF = getProp(casePfx+"input.userpasswdconf","//input[contains(@id,'register-form:passwordCheckv");
+ private final String INPUT_USERPASSWD = getProp(casePfx+"input.userpasswd","//input[contains(@id,'register-form:password')]");
+ private final String INPUT_USERMAIL = getProp(casePfx+"input.usermail","//input[contains(@id,'register-form:email')]");
+ private final String INPUT_USERNAME = getProp(casePfx+"input.username","//input[contains(@id,'register-form:username')]");
+ private final String LINK_CREATE_USER = getProp(casePfx+"link.create.user","//a[contains(@id,'create-account-form:register')]");
+ private final String TAB_WELCOME = getProp(casePfx+"tab.welcome","//a[contains(@id,'register-temp-form:start-link')]");
- private static final String SUBMIT_CREATE_USER = "//input[contains(@id,'register-form:submit')]";
- private static final String SUBMIT_CREATE_USER_CANCEL = "//input[contains(@id,'register-form:cancel')]";
- private static final String INPUT_USERPASSWDCONF = "//input[contains(@id,'register-form:passwordCheckv";
-
- private static final String INPUT_USERPASSWD = "//input[contains(@id,'register-form:password')]";
-
- private static final String INPUT_USERMAIL = "//input[contains(@id,'register-form:email')]";
-
- private static final String INPUT_USERNAME = "//input[contains(@id,'register-form:username')]";
-
- private static final String LINK_CREATE_USER = "//a[contains(@id,'create-account-form:register')]";
-
- private static final String TAB_WELCOME = "//a[contains(@id,'register-temp-form:start-link')]";
-
@Test(enabled = true, description = "Simple user creation.")
public void userCreationTest() {
selenium.open("/portal");
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserInterceptorPortletTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserInterceptorPortletTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserInterceptorPortletTestCase.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -1,8 +1,6 @@
package org.jboss.portal.test.selenium;
-import java.text.DateFormat;
import java.text.ParseException;
-import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Vector;
@@ -14,6 +12,9 @@
@Test(groups = { "cms_user_interceptor" }, enabled = true, description = "Checking the log of logging of users.")
public class UserInterceptorPortletTestCase extends JBossPortalSeleniumTestCase {
+ private static final String LNK_USER_DETAILS = "link=UsersDetailPage";
+ private static final String DIV_LOGINFO = "//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div";
+
@Test(enabled = true, description = "Checking the logging dates for user.")
public void testTestUserLogger() throws ParseException {
@@ -26,7 +27,6 @@
}
private int dateDiff(String name, String passwd, int ind) throws ParseException {
- DateFormat df = new SimpleDateFormat("E MMM dd HH:mm:ss z yyyy");
Vector<String> vs;
String logInfo;
@@ -34,25 +34,25 @@
logout();
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=UsersDetailPage");
+ selenium.click(LNK_USER_DETAILS);
selenium.waitForPageToLoad(PAGE_LOAD);
- logInfo = selenium.getText("//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div");
+ logInfo = selenium.getText(DIV_LOGINFO);
vs = parseUserInterceptorString(logInfo);
- Date d1 = new Date(Long.valueOf(vs.get(ind)));//df.parse(vs.get(ind));
+ Date d1 = new Date(Long.valueOf(vs.get(ind)));
login(name, passwd);
logout();
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=UsersDetailPage");
+ selenium.click(LNK_USER_DETAILS);
selenium.waitForPageToLoad(PAGE_LOAD);
- logInfo = selenium.getText("//div[@id='regionB']/div/table/tbody/tr[2]/td[2]/div");
+ logInfo = selenium.getText(DIV_LOGINFO);
vs = parseUserInterceptorString(logInfo);
- Date d2 = new Date(Long.valueOf(vs.get(ind)));//df.parse(vs.get(ind));
+ Date d2 = new Date(Long.valueOf(vs.get(ind)));
return d2.compareTo(d1);
}
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserLoginTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserLoginTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/UserLoginTestCase.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -4,109 +4,197 @@
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;
+
/**
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
@Test(groups = { "login" }, enabled = true)
public class UserLoginTestCase extends JBossPortalSeleniumTestCase {
-
+
+ public final String casePfx = "user.login.";
+
+ private final String ADR_PORTAL = getProp(casePfx+"adr.portal","/portal");
+ private final String FRM_MAIN = getProp(casePfx+"frm.main","relative=up");
+ private final String SUB_CANCEL = getProp(casePfx+"sub.portal","cancel");
+ private final String LNK_LOGOUT = getProp(casePfx+"lnk.logout","link=Logout");
+ private final String SUB_LOGIN = getProp(casePfx+"sub.login","login");
+ private final String INP_PASSWORD = getProp(casePfx+"inp.password","xpath=id('j_password')");
+ private final String INP_USERNAME = getProp(casePfx+"inp.username","xpath=id('j_username')");
+ private final String FRM_LOGINFORM = getProp(casePfx+"frm.login","login-content");
+ private final String LNK_LOGIN = getProp(casePfx+"lnk.login","link=Login");
+
@AfterClass(enabled = true)
public void logoutIfNeeded()
{
- selenium.open("/portal");
+ selenium.open(ADR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- if (selenium.isElementPresent("link=Logout")){
- selenium.click("link=Logout");
+ if (selenium.isElementPresent(LNK_LOGOUT)){
+ selenium.click(LNK_LOGOUT);
selenium.waitForPageToLoad(PAGE_LOAD);
}
-
}
@Test(enabled = true, description = "login as default user 'user' with password 'user'.")
public void testDefaultUserLogin() throws Exception {
- selenium.open("/portal");
+ final String loginName = "user";
+ final String loginPass = "user";
+
+ selenium.open(ADR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isElementPresent("link=Login"), "Expected DOM element for login link does not exist.");
- Assert.assertEquals(selenium.getText("link=Login"), "Login", "Login button doesn't exist.");
+ Assert.assertTrue(selenium.isElementPresent(LNK_LOGIN), "Expected DOM element for login link does not exist.");
+ Assert.assertEquals(selenium.getText(LNK_LOGIN), "Login", "Login button doesn't exist.");
- selenium.click("link=Login");
- selenium.selectFrame("login-content");
+ selenium.click(LNK_LOGIN);
+ selenium.selectFrame(FRM_LOGINFORM);
- Assert.assertTrue(selenium.isElementPresent("xpath=id('j_username')"), "Expected input DOM element for username doesn't exist.");
- selenium.type("j_username", "user");
- Assert.assertTrue(selenium.isElementPresent("xpath=id('j_password')"), "Expected input DOM element for password doesn't exist.");
- selenium.type("j_password", "user");
- selenium.click("login");
+ waitForElement(INP_USERNAME);
+ waitForElement(INP_PASSWORD);
+
+ Assert.assertTrue(selenium.isElementPresent(INP_USERNAME), "Expected input DOM element for username doesn't exist.");
+ selenium.type(INP_USERNAME, loginName);
+ Assert.assertTrue(selenium.isElementPresent(INP_PASSWORD), "Expected input DOM element for password doesn't exist.");
+
+ selenium.type(INP_PASSWORD, loginPass);
+ selenium.click(SUB_LOGIN);
+
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("Logged in as: user"), "\"Logged in as\" message missing.");
+ Assert.assertTrue(selenium.isTextPresent("Logged in as: "+loginName), "\"Logged in as\" message missing.");
- Assert.assertTrue(selenium.isElementPresent("link=Logout"), "Expected DOM element for login link does not exist.");
- Assert.assertEquals(selenium.getText("link=Logout"), "Logout", "Logout has wrong label.");
+ Assert.assertTrue(selenium.isElementPresent(LNK_LOGOUT), "Expected DOM element for login link does not exist.");
+ Assert.assertEquals(selenium.getText(LNK_LOGOUT), "Logout", "Logout has wrong label.");
- selenium.click("link=Logout");
+ selenium.click(LNK_LOGOUT);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertFalse(selenium.isTextPresent("Logged in as:"), "\"Logged in as:\" message with no user logged in is missing.");
}
@Test(enabled = true, description = "login as admin user 'admin' with password 'admin'.")
public void testAdminLogin() throws Exception {
- selenium.open("/portal");
+ final String loginName = "admin";
+ final String loginPass = "admin";
+
+ selenium.open(ADR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
+ waitForElement(LNK_LOGIN);
+ Assert.assertTrue(selenium.isElementPresent(LNK_LOGIN), "Expected DOM element for login link does not exist.");
+ Assert.assertEquals(selenium.getText(LNK_LOGIN), "Login", "Login button doesn't exist.");
- Assert.assertTrue(selenium.isElementPresent("link=Login"), "Expected DOM element for login link does not exist.");
- Assert.assertEquals(selenium.getText("link=Login"), "Login", "Login button doesn't exist.");
+ selenium.click(LNK_LOGIN);
+ selenium.selectFrame(FRM_LOGINFORM);
- selenium.click("link=Login");
- selenium.selectFrame("login-content");
+ waitForElement(INP_USERNAME);
+ waitForElement(INP_PASSWORD);
+
+ Assert.assertTrue(selenium.isElementPresent(INP_USERNAME), "Expected input DOM element for username doesn't exist.");
+ selenium.type(INP_USERNAME, loginName);
+ Assert.assertTrue(selenium.isElementPresent(INP_PASSWORD), "Expected input DOM element for password doesn't exist.");
+ selenium.type(INP_PASSWORD, loginPass);
+ selenium.click(SUB_LOGIN);
- Assert.assertTrue(selenium.isElementPresent("xpath=id('j_username')"), "Expected input DOM element for username doesn't exist.");
- selenium.type("j_username", "admin");
- Assert.assertTrue(selenium.isElementPresent("xpath=id('j_password')"), "Expected input DOM element for password doesn't exist.");
- selenium.type("j_password", "admin");
- selenium.click("login");
-
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Logged in as: admin"), "\"Logged in as\" message missing.");
- Assert.assertTrue(selenium.isElementPresent("link=Logout"), "Expected DOM element for login link does not exist.");
- Assert.assertEquals(selenium.getText("link=Logout"), "Logout", "Logout has wrong label.");
+ Assert.assertTrue(selenium.isElementPresent(LNK_LOGOUT), "Expected DOM element for login link does not exist.");
+ Assert.assertEquals(selenium.getText(LNK_LOGOUT), "Logout", "Logout has wrong label.");
- selenium.click("link=Logout");
+ selenium.click(LNK_LOGOUT);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertFalse(selenium.isTextPresent("Logged in as:"), "\"Logged in as:\" message with no user logged in is missing.");
}
@Test(enabled = true, description = "canceling of the login form.")
public void testUserLoginCancel() throws Exception {
- selenium.open("/portal");
+ final String loginName = "saki";
+ final String loginPass = "paki";
+
+ selenium.open(ADR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertFalse(selenium.isTextPresent("Logged in as:"), "\"Logged in as:\" message with no user logged in is missing.");
- Assert.assertTrue(selenium.isElementPresent("link=Login"), "DOM element for login link not found.");
- Assert.assertEquals(selenium.getText("link=Login"), "Login", "Login button doesn't exist.");
+ Assert.assertTrue(selenium.isElementPresent(LNK_LOGIN), "DOM element for login link not found.");
+ Assert.assertEquals(selenium.getText(LNK_LOGIN), "Login", "Login button doesn't exist.");
- selenium.click("link=Login");
- selenium.selectFrame("login-content");
+ selenium.click(LNK_LOGIN);
+ selenium.selectFrame(FRM_LOGINFORM);
- Assert.assertTrue(selenium.isElementPresent("xpath=id('j_username')"), "Expected input DOM element for username doesn't exist.");
- selenium.type("j_username", "saki");
- Assert.assertTrue(selenium.isElementPresent("xpath=id('j_password')"), "Expected input DOM element for password doesn't exist.");
- selenium.type("j_password", "paki");
+ waitForElement(INP_USERNAME);
+ waitForElement(INP_PASSWORD);
+
+ Assert.assertTrue(selenium.isElementPresent(INP_USERNAME), "Expected input DOM element for username doesn't exist.");
+ selenium.type(INP_USERNAME, loginName);
+ Assert.assertTrue(selenium.isElementPresent(INP_PASSWORD), "Expected input DOM element for password doesn't exist.");
+ selenium.type(INP_PASSWORD, loginPass);
- selenium.click("cancel");
- selenium.selectFrame("relative=up");
+ selenium.click(SUB_CANCEL);
+ selenium.selectFrame(FRM_MAIN);
- Assert.assertTrue(selenium.isElementPresent("link=Login"), "DOM element for login link not found.");
- Assert.assertEquals(selenium.getText("link=Login"), "Login", "Login button doesn't exist.");
+ Assert.assertTrue(selenium.isElementPresent(LNK_LOGIN), "DOM element for login link not found.");
+ Assert.assertEquals(selenium.getText(LNK_LOGIN), "Login", "Login button doesn't exist.");
Assert.assertFalse(selenium.isTextPresent("Logged in as:"), "\"Logged in as:\" message with no user logged in is missing.");
}
+
+ @Test(enabled = true, description = "login as 'us2er' which does not exist.")
+ public void testFalseNameLogin() throws Exception {
+ final String loginName = "us2er";
+ final String loginPass = "user";
+
+ selenium.open(ADR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isElementPresent(LNK_LOGIN), "Expected DOM element for login link does not exist.");
+ Assert.assertEquals(selenium.getText(LNK_LOGIN), "Login", "Login button doesn't exist.");
+
+ selenium.click(LNK_LOGIN);
+ selenium.selectFrame(FRM_LOGINFORM);
+
+ waitForElement(INP_USERNAME);
+ waitForElement(INP_PASSWORD);
+
+ Assert.assertTrue(selenium.isElementPresent(INP_USERNAME), "Expected input DOM element for username doesn't exist.");
+ selenium.type(INP_USERNAME, loginName);
+ Assert.assertTrue(selenium.isElementPresent(INP_PASSWORD), "Expected input DOM element for password doesn't exist.");
+ selenium.type(INP_PASSWORD, loginPass);
+ selenium.click(SUB_LOGIN);
+
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent("The user doesn't exist or the password is incorrect "), "\"Logged in as\" message missing.");
+ }
+
+ @Test(enabled = true, description = "login as 'user' with wrong password 'us2er'.")
+ public void testFalsePasswordLogin() throws Exception {
+ final String loginName = "user";
+ final String loginPass = "us2er";
+
+ selenium.open(ADR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isElementPresent(LNK_LOGIN), "Expected DOM element for login link does not exist.");
+ Assert.assertEquals(selenium.getText(LNK_LOGIN), "Login", "Login button doesn't exist.");
+
+ selenium.click(LNK_LOGIN);
+ selenium.selectFrame(FRM_LOGINFORM);
+
+ waitForElement(INP_USERNAME);
+ waitForElement(INP_PASSWORD);
+
+ Assert.assertTrue(selenium.isElementPresent(INP_USERNAME), "Expected input DOM element for username doesn't exist.");
+ selenium.type(INP_USERNAME, loginName);
+ Assert.assertTrue(selenium.isElementPresent(INP_PASSWORD), "Expected input DOM element for password doesn't exist.");
+ selenium.type(INP_PASSWORD, loginPass);
+ selenium.click(SUB_LOGIN);
+
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent("The user doesn't exist or the password is incorrect "), "\"Logged in as\" message missing.");
+ }
+
}
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -11,50 +11,47 @@
*/
@Test(groups = { "cms_wsrp" }, enabled = true, description = "WSRP test case.")
public class WSRPTestCase extends JBossPortalSeleniumTestCase {
- private static final String INP_CONSUMER_NAME = "//input[contains(@id,'edit-cons-form:id')]";
- private static final String SUBMIT_REFRESH_CANCEL = "//a[contains(@id,'edit-cons-form:list-cons-link')]";
- private static final String SUBMIT_PROD_SAVE = "//input[contains(@id,'producer-form:save-producer')]";
- private static final String SUBMIT_CONSDEL_CONF = "//a[contains(@id,'confirm-delete-form:destroy-link')]";
- private static final String SUBMIT_CONS_REGVAL = "//input[contains(@id,'edit-cons-form:refresh-cons-link')]";
- private static final String SUBMIT_REFRESHFINAL = "//input[contains(@id,'edit-cons-form:refresh-cons-link')]";
+ public static String casePfx = "test.wsrp.";
- private static final String INPUT_CONS_REGVALUE = "//input[contains(@id,'edit-cons-form:existingProps:0:prop-value-input')]";
- private static final String SUBMIT_REFRESHSAVE = "//input[contains(@id,'edit-cons-form:refresh-cons-link')]";
- private static final String INPUT_CONSWSDL = "//input[contains(@id,'edit-cons-form:wsdl')]";
- private static final String INPUT_CACHEEXP = "//input[contains(@id,'edit-cons-form:cache')]";
- private static final String SUBMIT_ADDPROP_INIT = "//a[contains(@id,'producer-form:add-reg-prop')]";
- private static final String SUBMIT_ADDPROP = "//a[contains(@id,'producer-form:add-reg-prop')]";
- private static final String INPUT_PROPHINT = "//input[contains(@id,'producer-form:reg-properties:0:hint')]";
- private static final String INPUT_PROPLABEL = "//input[contains(@id,'producer-form:reg-properties:0:label')]";
- private static final String INPUT_PROPNAME = "//input[contains(@id,'producer-form:reg-properties:0:name')]";
- private static final String SUBMIT_CREATECONS = "//input[contains(@id,'createConsumer:createConsumerButton')]";
- private static final String INPUT_CREATECONS = "//input[contains(@id,'createConsumer:consumerName')]";
- private static final String ID_LINK_PRODCONF = "//a[contains(@id,'cons-temp-form:producer-link')]";
- private static final String ID_LINK_CONSCONF = "//a[contains(@id,'producer-temp-form:consumersTab')]";
- private static final String LINK_CONSUMER_HOME ="//a[contains(@id,'cons-temp-form1:list-cons-link')]";
+ private final String INP_CONSUMER_NAME = getProp(casePfx+"inp.consumer.name","//input[contains(@id,'edit-cons-form:id')]");
+ private final String SUB_REFRESH_CANCEL = getProp(casePfx+"submit.refresh.cancel","//a[contains(@id,'edit-cons-form:list-cons-link')]");
+ private final String SUB_PROD_SAVE = getProp(casePfx+"submit.prod.save","//input[contains(@id,'producer-form:save-producer')]");
+ private final String SUB_CONSDEL_CONF = getProp(casePfx+"submit.consdel.conf","//a[contains(@id,'confirm-delete-form:destroy-link')]");
+ private final String SUB_CONS_REGVAL = getProp(casePfx+"submit.cons.regval","//input[contains(@id,'edit-cons-form:refresh-cons-link')]");
+ private final String SUB_REFRESHFINAL = getProp(casePfx+"submit.refreshfinal","//input[contains(@id,'edit-cons-form:refresh-cons-link')]");
+ private final String INPUT_CONS_REGVALUE = getProp(casePfx+"input.cons.regvalue","//input[contains(@id,'edit-cons-form:existingProps:0:prop-value-input')]");
+ private final String SUBMIT_REFRESHSAVE = getProp(casePfx+"submit.refreshsave","//input[contains(@id,'edit-cons-form:refresh-cons-link')]");
+ private final String INPUT_CONSWSDL = getProp(casePfx+"input.conswsdl","//input[contains(@id,'edit-cons-form:wsdl')]");
+ private final String INPUT_CACHEEXP = getProp(casePfx+"input.cacheexp","//input[contains(@id,'edit-cons-form:cache')]");
+ private final String SUBMIT_ADDPROP_INIT = getProp(casePfx+"submit.addprop.init","//a[contains(@id,'producer-form:add-reg-prop')]");
+ private final String SUBMIT_ADDPROP = getProp(casePfx+"submit.addprop","//a[contains(@id,'producer-form:add-reg-prop')]");
+ private final String INPUT_PROPHINT = getProp(casePfx+"input.prophint","//input[contains(@id,'producer-form:reg-properties:0:hint')]");
+ private final String INPUT_PROPLABEL = getProp(casePfx+"input.proplabel","//input[contains(@id,'producer-form:reg-properties:0:label')]");
+ private final String INPUT_PROPNAME = getProp(casePfx+"input.propname","//input[contains(@id,'producer-form:reg-properties:0:name')]");
+ private final String SUBMIT_CREATECONS = getProp(casePfx+"submit.createcons","//input[contains(@id,'createConsumer:createConsumerButton')]");
+ private final String INPUT_CREATECONS = getProp(casePfx+"input.createcons","//input[contains(@id,'createConsumer:consumerName')]");
+ private final String ID_LINK_PRODCONF = getProp(casePfx+"id.link.prodconf","//a[contains(@id,'cons-temp-form:producer-link')]");
+ private final String ID_LINK_CONSCONF = getProp(casePfx+"id.link.consconf","//a[contains(@id,'producer-temp-form:consumersTab')]");
+ private final String LINK_CONSUMER_HOME =getProp(casePfx+"link.consumer.home","//a[contains(@id,'cons-temp-form1:list-cons-link')]");
+ private final String LINK_T_CONS_CON=getProp(casePfx+"link.t.cons.con","//a[contains(@id,''consumer-list-form:consumersList:{0}:configure'')]");
+ private final String LINK_T_CONS_REF=getProp(casePfx+"link.t.cons.ref","//a[contains(@id,''consumer-list-form:consumersList:{0}:refresh'')]");
+ private final String LINK_T_CONS_ACT=getProp(casePfx+"link.t.cons.act","//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]");
+ private final String LINK_T_CONS_DEA=getProp(casePfx+"link.t.cons.dea","//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]");
+ private final String LINK_T_CONS_REG=getProp(casePfx+"link.t.cons.reg","//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]");
+ private final String LINK_T_CONS_DER=getProp(casePfx+"link.t.cons.der","//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]");
+ private final String LINK_T_CONS_DEL=getProp(casePfx+"link.t.cons.del","//a[contains(@id,''consumer-list-form:consumersList:{0}:delete'')]");
+ private final String WSRP_CONSUMER_TABLE = getProp(casePfx+"link.wsrp.consumer.table","//table[contains(@id,':consumer-list-form:consumersList')]");
- private static final String LINK_T_CONS_CON="//a[contains(@id,''consumer-list-form:consumersList:{0}:configure'')]";
- private static final String LINK_T_CONS_REF="//a[contains(@id,''consumer-list-form:consumersList:{0}:refresh'')]";
- private static final String LINK_T_CONS_ACT="//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]";
- private static final String LINK_T_CONS_DEA="//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]";
- private static final String LINK_T_CONS_REG="//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]";
- private static final String LINK_T_CONS_DER="//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]";
- private static final String LINK_T_CONS_DEL="//a[contains(@id,''consumer-list-form:consumersList:{0}:delete'')]";
-
-
-
-
- public static String WSRP_CONSUMER_TABLE = "//table[contains(@id,':consumer-list-form:consumersList')]";
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
-
+ logoutIfPossible();
login("admin", "admin");
}
@AfterMethod(groups = { "log" })
public void logoutAfterTest() {
- logout();
+ //logout();
}
@Test(enabled = true, description = "Creating a standard BEA consumer.")
@@ -80,10 +77,10 @@
Assert.assertTrue(selenium.isTextPresent("Missing value"));
selenium.type(INPUT_CONS_REGVALUE, "public");
- selenium.click(SUBMIT_CONS_REGVAL);
+ selenium.click(SUB_CONS_REGVAL);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Refresh was successful."));
- selenium.click(SUBMIT_REFRESHFINAL);
+ selenium.click(SUB_REFRESHFINAL);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("BEA"));
}
@@ -129,7 +126,7 @@
selenium.click(MessageFormat.format(LINK_T_CONS_DER,r));
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click(SUBMIT_REFRESH_CANCEL);
+ selenium.click(SUB_REFRESH_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertEquals(selenium.getText(MessageFormat.format(LINK_T_CONS_DER,r)), "Register");
@@ -209,7 +206,7 @@
Assert.assertTrue(selenium.isTextPresent("Delete 'BEAdel' consumer?"));
- clickAndWait(SUBMIT_CONSDEL_CONF);
+ clickAndWait(SUB_CONSDEL_CONF);
Assert.assertFalse(selenium.isTextPresent("BEAdel"));
}
@@ -223,15 +220,15 @@
selenium.click("link=WSRP");
selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(ID_LINK_PRODCONF,"Producer configuration");
-
+ clickIfVisible(ID_LINK_PRODCONF);
+ Assert.assertTrue(selenium.isTextPresent("Producer configuration"));
clickAndWait(SUBMIT_ADDPROP_INIT);
selenium.type(INPUT_PROPNAME, "testProp");
selenium.type(INPUT_PROPLABEL, "testProp label");
selenium.type(INPUT_PROPHINT, "tetsPropHint");
- selenium.click(SUBMIT_PROD_SAVE);
+ selenium.click(SUB_PROD_SAVE);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Producer configuration successfully saved!"));
@@ -282,6 +279,7 @@
clickIfVisible(ID_LINK_CONSCONF);
clickIfVisible(LINK_CONSUMER_HOME);
+ waitForElement(WSRP_CONSUMER_TABLE);
r = findTableRow(WSRP_CONSUMER_TABLE, name, 0);
Assert.assertTrue(r<0, "Renamed consumer still in table");
@@ -301,19 +299,18 @@
selenium.click(SUBMIT_CREATECONS);
selenium.waitForPageToLoad(PAGE_LOAD);
- //selenium.setSpeed("5000");
-
+ waitForElement(INPUT_CACHEEXP);
selenium.type(INPUT_CACHEEXP, timeout);
+ waitForElement(INPUT_CONSWSDL);
selenium.type(INPUT_CONSWSDL, address);
selenium.click(SUBMIT_REFRESHSAVE);
selenium.waitForPageToLoad(PAGE_LOAD);
+ waitForElement(INPUT_CONS_REGVALUE);
selenium.type(INPUT_CONS_REGVALUE, "public");
- selenium.click(SUBMIT_CONS_REGVAL);
+ selenium.click(SUB_CONS_REGVAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- //selenium.setSpeed("0");
-
- selenium.click(SUBMIT_REFRESHFINAL);
+ selenium.click(SUB_REFRESHFINAL);
selenium.waitForPageToLoad(PAGE_LOAD);
}
}
\ No newline at end of file
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -12,39 +12,46 @@
@Test(groups = { "cms_archive_upload" }, enabled = true)
public class CMSArchiveUploadTestCase extends JBossPortalSeleniumTestCase {
-
- private static final String ARCHIVE_WAITING = "90000";
- /* uncomment following lines and set the right path to the workspace in the case
- * you want to use this test case locally from eclipse */
+
+ private static final Integer ARCHIVE_WAITING = 5000;
+ private static final int n = 50;
/*
+ * uncomment following lines and set the right path to the workspace in the
+ * case you want to use this test case locally from eclipse
+ */
+/*
{
- System.setProperty("workspace","/home/vrockai/workspace/selenium/selenium/");
+ System.setProperty("workspace", "/home/vrockai/workspace/p2.7tests/ui-tests/");
}
- */
- private static final String SUB_CANCEL_ARCH_UPLOAD = "cancel";
- private static final String LNK_ADMIN = "link=Admin";
- private static final String LNK_CMS = "link=CMS";
- private static final String SUB_SEND_ARCHIVE = "submit";
- private static final String INP_ARCHIVE_FILE = "response";
- private static final String DIV_ARCHIVE_STATUS = "//div[@id='center']/div/div/table/tbody/tr[2]/td/font";
- private static final String SEL_ACTION = "//div[@id='center']/div/div/div[1]/div/select";
+*/
+
+ private final String casePfx = "cms.arch.";
+ private final String SUB_CANCEL_ARCH_UPLOAD = getProp(casePfx+"sub.cancel.arch.upload","cancel");
+ private final String LNK_ADMIN = getProp(casePfx+"lnk.admin","link=Admin");
+ private final String LNK_CMS = getProp(casePfx+"lnk.cms","link=CMS");
+ private final String SUB_SEND_ARCHIVE = getProp(casePfx+"sub.send.archive","submit");
+ private final String INP_ARCHIVE_FILE = getProp(casePfx+"inp.archive.file","response");
+ private final String DIV_ARCHIVE_STATUS = getProp(casePfx+"div.archive.status","//div[@id='center']/div/div/table/tbody/tr[2]/td/font");
+ private final String SEL_ACTION = getProp(casePfx+"sel.action","//div[@id='center']/div/div/div[1]/div/select");
+
private final String WORKSPACE = System.getProperty("workspace");
- @BeforeMethod( groups = { "log" })
+ @BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
+ logoutIfPossible();
login("admin", "admin");
+ // timeout hack
+ selenium.setSpeed("10000");
}
- @AfterMethod( groups = { "log" })
+ @AfterMethod(groups = { "log" })
public void logoutAfterTest() {
- logout();
+
}
@Test(enabled = true, description = "Test archive consisting of two files upload.")
public void testArchiveUpload() {
- //System.out.println("archive adress:" + WORKSPACE);
// canceling at the first stage
-
selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CMS);
@@ -54,18 +61,18 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
selenium.type(INP_ARCHIVE_FILE, WORKSPACE + "/test_files/archive.zip");
-
+
selenium.click(SUB_CANCEL_ARCH_UPLOAD);
selenium.waitForPageToLoad(PAGE_LOAD);
-
-
- Assert.assertFalse(selenium.isTextPresent("Your archive has been accepted for processing"));
- Assert.assertFalse(selenium.isElementPresent("link=archive"));
-
+
+ Assert.assertFalse(selenium.isTextPresent("Your archive has been accepted for processing"),
+ "archive was accepted for processing afte cancelling the upload");
+ Assert.assertFalse(selenium.isElementPresent("link=archive"), "not uploaded (upload cancelled) archive found #1");
+
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertFalse(selenium.isElementPresent("link=archive"));
-
+ Assert.assertFalse(selenium.isElementPresent("link=archive"), "not uploaded (upload cancelled) archive found #2");
+
// really uploading the file now
selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -76,33 +83,38 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
selenium.type(INP_ARCHIVE_FILE, WORKSPACE + "/test_files/archive.zip");
-
+
selenium.click(SUB_SEND_ARCHIVE);
selenium.waitForPageToLoad(PAGE_LOAD);
- //
-
- selenium.waitForPageToLoad(PAGE_LOAD);
+
Assert.assertEquals(selenium.getText(DIV_ARCHIVE_STATUS),
"Your archive has been accepted for processing. The resources will appear in your Folder once the processing is finished");
- selenium.setSpeed(ARCHIVE_WAITING);
- selenium.click("link=Home");
- selenium.setSpeed("0");
- selenium.waitForPageToLoad(PAGE_LOAD);
-
- Assert.assertEquals(selenium.getText("link=archive"), "archive");
+ for (int i = 0;; i++) {
+ selenium.click("link=Home");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ if (i >= n) {
+ Assert.assertTrue(selenium.isElementPresent("link=archive"), "uploaded archive not found");
+ break;
+ }
+
+ if (selenium.isElementPresent("link=archive"))
+ break;
+
+ waitFor(ARCHIVE_WAITING);
+ }
+
selenium.click("link=archive");
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertEquals(selenium.getText("link=readme.txt"), "readme.txt");
- Assert.assertEquals(selenium.getText("link=jbosslogo.png"), "jbosslogo.png");
+ Assert.assertTrue(selenium.isElementPresent("link=readme.txt"), "content of uploaded file not found #1");
+ Assert.assertTrue(selenium.isElementPresent("link=jbosslogo.png"), "content of uploaded file not found #2");
}
-
+
@Test(enabled = true, description = "Test archive consisting of > 100 files upload.")
public void testManyFilesArchiveUpload() {
- //System.out.println("archive adress:" + WORKSPACE);
-
+
selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CMS);
@@ -112,32 +124,39 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
selenium.type(INP_ARCHIVE_FILE, WORKSPACE + "/test_files/many_files.zip");
-
+
selenium.click(SUB_SEND_ARCHIVE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertEquals(selenium.getText(DIV_ARCHIVE_STATUS),
"Your archive has been accepted for processing. The resources will appear in your Folder once the processing is finished");
- selenium.setSpeed(ARCHIVE_WAITING);
selenium.click("link=Home");
- selenium.setSpeed("0");
selenium.waitForPageToLoad(PAGE_LOAD);
-
- Assert.assertTrue(selenium.isElementPresent("link=many_files"));
+ for (int i = 0;; i++) {
+ selenium.click("link=Home");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ if (i >= n) {
+ Assert.assertTrue(selenium.isElementPresent("link=many_files"), "uploaded archive not found");
+ break;
+ }
+
+ if (selenium.isElementPresent("link=many_files"))
+ break;
+
+ waitFor(ARCHIVE_WAITING);
+ }
+
selenium.click("link=many_files");
selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isElementPresent("link=file31.txt"), "content of uploaded archive not found");
+ }
- //TODO assert all files
-
- Assert.assertTrue(selenium.isElementPresent("link=file31.txt"));
- }
-
@Test(enabled = true, description = "Test archive consisting of 21MB file upload.")
public void testBigArchiveUpload() {
- //System.out.println("archive adress:" + WORKSPACE);
-
+
selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CMS);
@@ -147,19 +166,30 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
selenium.type(INP_ARCHIVE_FILE, WORKSPACE + "/test_files/big_archive.zip");
-
+
selenium.click(SUB_SEND_ARCHIVE);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertEquals(selenium.getText(DIV_ARCHIVE_STATUS),
"Your archive has been accepted for processing. The resources will appear in your Folder once the processing is finished");
- selenium.setSpeed(ARCHIVE_WAITING);
selenium.click("link=Home");
- selenium.setSpeed("0");
selenium.waitForPageToLoad(PAGE_LOAD);
-
- Assert.assertTrue(selenium.isElementPresent("link=bigfile"));
+ for (int i = 0;; i++) {
+ selenium.click("link=Home");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ if (i >= n) {
+ Assert.assertTrue(selenium.isElementPresent("link=bigfile"), "uploaded archive not found");
+ break;
+ }
+
+ if (selenium.isElementPresent("link=bigfile"))
+ break;
+
+ waitFor(ARCHIVE_WAITING);
+ }
+
}
}
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSDirectoryTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSDirectoryTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSDirectoryTestCase.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -12,31 +12,33 @@
@Test(groups = { "cms_directory" }, enabled = true)
public class CMSDirectoryTestCase extends JBossPortalSeleniumTestCase {
+ private final String casePfx = "cms.dir.";
+ private final String SEL_CMS_ACTION = getProp(casePfx + "sel.cms.action", "//div[@id='center']/div/div/div[1]/div/select");
+ private final String ADR_CMS_INTERFACE = getProp(casePfx + "adr.cms.interface", "/portal/auth/portal/admin/CMS");
- private static final String SEL_CMS_ACTION = "//div[@id='center']/div/div/div[1]/div/select";
- private static final String ADR_CMS_INTERFACE = "/portal/auth/portal/admin/CMS";
private final String defaultDirName = "default";
private final String tempDirName = "tempDir";
private final String copyDirName = "copySrc";
private final String moveDirName = "moveSrc";
- private final String CMS_FILE_TABLE = "//div[@id='center']/div/div/div[3]/table";
+ private final String CMS_FILE_TABLE = getProp(casePfx + "cms.file.table", "//div[@id='center']/div/div/div[3]/table");
- @BeforeMethod( groups = { "log" })
+ @BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
+ logoutIfPossible();
login("admin", "admin");
}
@AfterMethod(groups = { "log" })
public void logoutAfterTest() {
- logout();
+
}
- @Test(enabled = true, description="Directory creation.")
+ @Test(enabled = true, description = "Directory creation.")
public void testCreateDirectory() {
-
+
// cancelling of creating
-
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
@@ -44,7 +46,7 @@
selenium.open(ADR_CMS_INTERFACE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertFalse(selenium.isTextPresent(tempDirName), "Test folder is already present.");
selenium.select(SEL_CMS_ACTION, "label=Create Folder");
@@ -53,11 +55,11 @@
selenium.type("newcollectionname", tempDirName);
selenium.type("newcollectiondescription", "test folder");
selenium.click("cancel");
-
+
// really creating
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
@@ -65,7 +67,7 @@
selenium.open(ADR_CMS_INTERFACE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertFalse(selenium.isTextPresent(tempDirName), "Test folder is already present.");
selenium.select(SEL_CMS_ACTION, "label=Create Folder");
@@ -74,9 +76,9 @@
selenium.type("newcollectionname", tempDirName);
selenium.type("newcollectiondescription", "test folder");
selenium.click("submit");
-
+
// assuring that the directory is deleted
-
+
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isElementPresent("//div[@id='center']/div/div/ul/li[3]"));
Assert.assertEquals(tempDirName, selenium.getText("//div[@id='center']/div/div/ul/li[3]"));
@@ -86,16 +88,16 @@
}
- @Test(enabled = true, dependsOnMethods = "testCreateDirectory",description="Directory delete.")
+ @Test(enabled = true, dependsOnMethods = "testCreateDirectory", description = "Directory delete.")
public void testDeleteDirectory() {
-
+
// firstly cancel the delete process
-
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertTrue(selenium.isElementPresent("link=" + tempDirName));
selenium.select(takeAction(tempDirName) + "/select", "label=Delete");
selenium.click(takeAction(tempDirName) + "/select/option[4]");
@@ -108,10 +110,10 @@
Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this resource?"));
selenium.click("cancel");
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
// really deleting
selenium.open(ADDR_PORTAL);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
@@ -132,16 +134,16 @@
// assuring that the deletition was processed
selenium.open(ADDR_PORTAL);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertFalse(selenium.isElementPresent("link=" + tempDirName));
}
- @Test(enabled = true, dependsOnMethods = "testCreateDirectory",description="Copying of directory.")
+ @Test(enabled = true, dependsOnMethods = "testCreateDirectory", description = "Copying of directory.")
public void testCopyDirectory() {
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -173,7 +175,6 @@
selenium.click("link=" + defaultDirName);
selenium.click("submit");
selenium.waitForPageToLoad(PAGE_LOAD);
-
Assert.assertEquals("copySrc", selenium.getText("//div[@id='center']/div/div/ul/li[5]"));
Assert.assertTrue(selenium.isElementPresent("link=" + defaultDirName));
selenium.click("link=Home");
@@ -185,9 +186,9 @@
}
- @Test(enabled = true, dependsOnMethods = "testCreateDirectory",description="Canceling of copying of directory.")
+ @Test(enabled = true, dependsOnMethods = "testCreateDirectory", description = "Canceling of copying of directory.")
public void testCopyCancelDirectory() {
- String copyCancelDirName = "L"+ "copyLDirName" + "Cancel";
+ String copyCancelDirName = "L" + "copyLDirName" + "Cancel";
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -226,9 +227,9 @@
}
- @Test(enabled = true, dependsOnMethods = "testCreateDirectory",description="Moving a directory.")
+ @Test(enabled = true, dependsOnMethods = "testCreateDirectory", description = "Moving a directory.")
public void testMoveDirectory() {
- //selenium.setSpeed("3000");
+ // selenium.setSpeed("3000");
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
@@ -273,7 +274,7 @@
}
- @Test(enabled = true, dependsOnMethods = "testCreateDirectory", description="Canceling of moving a directory.")
+ @Test(enabled = true, dependsOnMethods = "testCreateDirectory", description = "Canceling of moving a directory.")
public void testMoveCancelDirectory() {
String moveCancelDirName = "X" + "moveXDirName" + "Cancel";
@@ -311,10 +312,10 @@
selenium.click("link=Home");
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click("link=" + defaultDirName);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertFalse(selenium.isElementPresent("link=" + moveCancelDirName));
}
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileTestCase.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -13,18 +13,21 @@
@Test(groups = { "cms_file" }, enabled = true)
public class CMSFileTestCase extends JBossPortalSeleniumTestCase {
- private static final String TBL_CMS_FILEVER = "//div[@id='center']/div/div/table";
- public static final String TBL_CMS_FILE = "//div[@id='center']/div/div/div[3]/table";
- public static final String TBL_FILE_PENDING = "//div[@id='center']/div/div/table[2]";
+ private final String casePfx = "cms.file.";
+
+ private final String TBL_CMS_FILEVER = getProp(casePfx+"tbl.cms.filever","//div[@id='center']/div/div/table");
+ public final String TBL_CMS_FILE = getProp(casePfx+"tbl.cms.file","//div[@id='center']/div/div/div[3]/table");
+ public final String TBL_FILE_PENDING = getProp(casePfx+"tbl.file.pending","//div[@id='center']/div/div/table[2]");
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
+ logoutIfPossible();
login("admin", "admin");
}
@AfterMethod( groups = { "log" })
public void logoutAfterTest() {
- logout();
+
}
@Test(enabled = true, description = "Common file structure browsing test.")
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileUploadTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileUploadTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileUploadTestCase.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -19,17 +19,20 @@
System.setProperty("workspace","/home/vrockai/workspace/selenium/selenium/"
); }
*/
- private final String CMS_FILE_TABLE = "//div[@id='center']/div/div/div[3]/table";
+ private final String casePfx = "cms.file.up.";
+
+ private final String CMS_FILE_TABLE = getProp(casePfx+"cms.file.table","//div[@id='center']/div/div/div[3]/table");
private final String WORKSPACE = System.getProperty("workspace");
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
+ logoutIfPossible();
login("admin", "admin");
}
@AfterMethod(groups = { "log" })
public void logoutAfterTest() {
- logout();
+
}
@Test(enabled = true, description = "canceling of file upload")
@@ -88,8 +91,6 @@
selenium.type("title", "file to upload");
selenium.select("language", "label=Afar");
- //System.out.println(WORKSPACE);
-
selenium.type("response", WORKSPACE + "/test_files/testFile.txt");
selenium.click("submit");
selenium.waitForPageToLoad(PAGE_LOAD);
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowTestCase.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -1,5 +1,7 @@
package org.jboss.portal.test.selenium.cms;
+import java.text.MessageFormat;
+
import org.jboss.portal.test.selenium.JBossPortalSeleniumTestCase;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
@@ -13,25 +15,44 @@
@Test(groups = { "cms_file_workflow" }, enabled = true)
public class CMSFileWorkflowTestCase extends JBossPortalSeleniumTestCase {
- private static final String SELECT_CMS_MAIN = "//div[@id='center']/div/div/div[1]/div/select";
+ private static final String SUB_MOVE = "submit";
- private final String CMS_FILE_TABLE = "//div[@id='center']/div/div/div[3]/table";
+ public final String casePfx = "cms.file.work.";
+
+ private final String LAB_LANG_CZECH = getProp(casePfx+"lab.lang.czech","label=Czech");
+ private final String LNK_DENY = getProp(casePfx+"lnk.deny","link=Deny");
+ private final String LNK_PREVIEW = getProp(casePfx+"lnk.preview","link=Preview");
+ private final String LNK_APPROVE = getProp(casePfx+"lnk.approve","link=Approve");
+ private final String SUB_FILE_CREATE = getProp(casePfx+"sub.file.create","save");
+ private final String SUB_FILE_CREATE_CANCEL = getProp(casePfx+"sub.file.create.cancel","cancel");
+ private final String SEL_LANG = getProp(casePfx+"sel.lang","language");
+ private final String INP_TITLE = getProp(casePfx+"inp.title","title");
+ private final String INP_DESC = getProp(casePfx+"inp.desc","description");
+ private final String INP_FILENAME = getProp(casePfx+"inp.filename","filename");
+ private final String LAB_CREATE_FILE = getProp(casePfx+"lab.create.file","label=Create File");
+ private final String LNK_CMS = getProp(casePfx+"lnk.cms","link=CMS");
+ private final String LNK_ADMIN = getProp(casePfx+"lnk.admin","link=Admin");
+
+ public final String SELECT_CMS_MAIN = getProp(casePfx+"select.cms.main","//div[@id='center']/div/div/div[1]/div/select");
+ public final String CMS_FILE_TABLE = getProp(casePfx+"cms.file.table","//div[@id='center']/div/div/div[3]/table");
+
+ public final String CMS_T_SELECT = getProp(casePfx+"cms.t.select","//div[@id=''center'']/div/div/div[3]/table/tbody/tr[{0}]/td[2]/form/select");
+ public final String CMS_T_SUBMIT = getProp(casePfx+"cms.t.submit","//div[@id=''center'']/div/div/div[3]/table/tbody/tr[{0}]/td[2]/form/input");
+
+ public final String CMS_WF_TABLE = getProp(casePfx+"cms.wf.table","//div[@id='center']/div/div/table[2]");
+ public final String CMS_FV_TABLE = getProp(casePfx+"cms.fv.table","//div[@id='center']/div/div/table");
+ public final String CMS_T_VER = getProp(casePfx+"cms.t.ver","//div[@id=''center'']/div/div/table/tbody/tr[{0}]/td[1]/a");
+ public final String WYSIWYG_EDITOR_LOCATOR = getProp(casePfx+"wysiwyg.editor.locator","mce_editor_0");
- // file workflow table in CMS
- private final String CMS_WF_TABLE = "//div[@id='center']/div/div/table[2]";
-
- // file version table in CMS
- private final String CMS_FV_TABLE = "//div[@id='center']/div/div/table";
- public static String WYSIWYG_EDITOR_LOCATOR = "mce_editor_0";
-
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
+ logoutIfPossible();
login("admin", "admin");
}
@AfterMethod( groups = { "log" })
public void logoutAfterTest() {
- logout();
+
}
@Test(enabled = true, description = "Simple file creation.")
@@ -39,50 +60,50 @@
// canceling first
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SELECT_CMS_MAIN, "label=Create File");
+ selenium.select(SELECT_CMS_MAIN, LAB_CREATE_FILE);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
- selenium.type("filename", "newFile");
- selenium.type("description", "newFile description");
- selenium.type("title", "newFile title");
- selenium.select("language", "label=Czech");
+ selenium.type(INP_FILENAME, "newFile");
+ selenium.type(INP_DESC, "newFile description");
+ selenium.type(INP_TITLE, "newFile title");
+ selenium.select(SEL_LANG, LAB_LANG_CZECH);
- selenium.click("cancel");
+ selenium.click(SUB_FILE_CREATE_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
// saving
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SELECT_CMS_MAIN, "label=Create File");
+ selenium.select(SELECT_CMS_MAIN, LAB_CREATE_FILE);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
- selenium.type("filename", "newFile");
- selenium.type("description", "newFile description");
- selenium.type("title", "newFile title");
- selenium.select("language", "label=Czech");
+ selenium.type(INP_FILENAME, "newFile");
+ selenium.type(INP_DESC, "newFile description");
+ selenium.type(INP_TITLE, "newFile title");
+ selenium.select(SEL_LANG, LAB_LANG_CZECH);
- selenium.click("save");
+ selenium.click(SUB_FILE_CREATE);
selenium.waitForPageToLoad(PAGE_LOAD);
int row = countTableRows(CMS_WF_TABLE) - 1;
Assert.assertEquals(row, 1, "More instances of newly created document exists.");
Assert.assertTrue(selenium.isTextPresent("Pending Approval Queue"));
- Assert.assertTrue(selenium.isElementPresent("link=Preview"));
- Assert.assertTrue(selenium.isElementPresent("link=Approve"));
- Assert.assertTrue(selenium.isElementPresent("link=Deny"));
+ Assert.assertTrue(selenium.isElementPresent(LNK_PREVIEW));
+ Assert.assertTrue(selenium.isElementPresent(LNK_APPROVE));
+ Assert.assertTrue(selenium.isElementPresent(LNK_DENY));
- selenium.click("link=Approve");
+ selenium.click(LNK_APPROVE);
selenium.waitForPageToLoad(PAGE_LOAD);
row = countTableRows(CMS_FV_TABLE) - 1;
@@ -92,29 +113,29 @@
@Test(enabled = true, description = "Simple file creation.")
public void testCreateFileDeny() {
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SELECT_CMS_MAIN, "label=Create File");
+ selenium.select(SELECT_CMS_MAIN, LAB_CREATE_FILE);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
- selenium.type("filename", "newFileDeny");
- selenium.type("description", "newFileDeny description");
- selenium.type("title", "newFileDeny title");
- selenium.select("language", "label=Czech");
- selenium.click("save");
+ selenium.type(INP_FILENAME, "newFileDeny");
+ selenium.type(INP_DESC, "newFileDeny description");
+ selenium.type(INP_TITLE, "newFileDeny title");
+ selenium.select(SEL_LANG, LAB_LANG_CZECH);
+ selenium.click(SUB_FILE_CREATE);
selenium.waitForPageToLoad(PAGE_LOAD);
int row = countTableRows(CMS_WF_TABLE) - 1;
Assert.assertEquals(row, 1, "More instances of newly created document exists.");
Assert.assertTrue(selenium.isTextPresent("Pending Approval Queue"));
- Assert.assertTrue(selenium.isElementPresent("link=Preview"));
- Assert.assertTrue(selenium.isElementPresent("link=Approve"));
- Assert.assertTrue(selenium.isElementPresent("link=Deny"));
+ Assert.assertTrue(selenium.isElementPresent(LNK_PREVIEW));
+ Assert.assertTrue(selenium.isElementPresent(LNK_APPROVE));
+ Assert.assertTrue(selenium.isElementPresent(LNK_DENY));
- selenium.click("link=Deny");
+ selenium.click(LNK_DENY);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertFalse(selenium.isTextPresent("newFileDeny"));
@@ -126,24 +147,24 @@
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Home");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SELECT_CMS_MAIN, "label=Create File");
+ selenium.select(SELECT_CMS_MAIN, LAB_CREATE_FILE);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
- selenium.type("filename", name);
- selenium.type("description", name + " description");
- selenium.type("title", "existingFile title");
- selenium.select("language", "label=Czech");
+ selenium.type(INP_FILENAME, name);
+ selenium.type(INP_DESC, name + " description");
+ selenium.type(INP_TITLE, "existingFile title");
+ selenium.select(SEL_LANG, LAB_LANG_CZECH);
fillInEditor("vivat!");
- selenium.click("save");
+ selenium.click(SUB_FILE_CREATE);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Preview");
+ selenium.click(LNK_PREVIEW);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Pending Approval Queue"));
@@ -153,36 +174,35 @@
@Test(enabled = true, dependsOnMethods = "testCreateFileApprove", description = "Simple file delete Cancel in first step, and then delete.")
public void testDeleteFile() {
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
int row = findTableRow(CMS_FILE_TABLE, "newFile", 0) + 1;
- selenium.select("//div[@id='center']/div/div/div[3]/table/tbody/tr["+row+"]/td[2]/form/select", "label=Delete");
- selenium.click("//div[@id='center']/div/div/div[3]/table/tbody/tr["+row+"]/td[2]/form/select/option[4]");
- selenium.click("//div[@id='center']/div/div/div[3]/table/tbody/tr["+row+"]/td[2]/form/input");
+ selenium.select(MessageFormat.format(CMS_T_SELECT,row), "label=Delete");
+ selenium.click(MessageFormat.format(CMS_T_SUBMIT,row));
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Confirm Deletion of /newFile"));
Assert.assertTrue(selenium.isTextPresent("WARNING! You will not be able to undo these change!"));
Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this resource?"));
- selenium.click("cancel");
+ selenium.click(SUB_FILE_CREATE_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
row = findTableRow(CMS_FILE_TABLE, "newFile", 0) + 1;
- selenium.select(CMS_FILE_TABLE + "/tbody/tr["+row+"]/td[2]/form/select", "label=Delete");
- selenium.click(CMS_FILE_TABLE + "/tbody/tr["+row+"]/td[2]/form/select/option[4]");
- selenium.click(CMS_FILE_TABLE + "/tbody/tr["+row+"]/td[2]/form/input");
+ selenium.select(MessageFormat.format(CMS_T_SELECT,row), "label=Delete");
+ selenium.click(MessageFormat.format(CMS_T_SUBMIT,row));
+
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Confirm Deletion of /newFile"));
Assert.assertTrue(selenium.isTextPresent("WARNING! You will not be able to undo these change!"));
Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this resource?"));
- selenium.click("submit");
+ selenium.click(SUB_MOVE);
selenium.waitForPageToLoad(PAGE_LOAD);
}
@@ -192,18 +212,17 @@
//canceling first
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
int row = findTableRow(CMS_FILE_TABLE, "fileToMove", 0) + 1;
-
- selenium.select(CMS_FILE_TABLE + "/tbody/tr[" + row + "]/td[2]/form/select", "label=Move");
- selenium.click(CMS_FILE_TABLE + "/tbody/tr[" + row + "]/td[2]/form/select/option[3]");
- selenium.click(CMS_FILE_TABLE + "/tbody/tr[" + row + "]/td[2]/form/input");
+ ;
+ selenium.select(MessageFormat.format(CMS_T_SELECT,row), "label=Move");
+ selenium.click(MessageFormat.format(CMS_T_SUBMIT,row));
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=default");
- selenium.click("cancel");
+ selenium.click(SUB_FILE_CREATE_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
// assuming file is not moved
@@ -221,18 +240,17 @@
// really moving file
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
row = findTableRow(CMS_FILE_TABLE, "fileToMove", 0) + 1;
- selenium.select(CMS_FILE_TABLE + "/tbody/tr[" + row + "]/td[2]/form/select", "label=Move");
- selenium.click(CMS_FILE_TABLE + "/tbody/tr[" + row + "]/td[2]/form/select/option[3]");
- selenium.click(CMS_FILE_TABLE + "/tbody/tr[" + row + "]/td[2]/form/input");
+ selenium.select(MessageFormat.format(CMS_T_SELECT,row), "label=Move");
+ selenium.click(MessageFormat.format(CMS_T_SUBMIT,row));
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=default");
- selenium.click("submit");
+ selenium.click(SUB_MOVE);
selenium.waitForPageToLoad(PAGE_LOAD);
// assuming file is moved
@@ -251,18 +269,17 @@
@Test(enabled = true, dependsOnMethods = "testCreateFileApprove", description = "File creation and copying to default directory.")
public void testCopyFile() {
createFile("file2copy","");
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
int row = findTableRow(CMS_FILE_TABLE, "file2copy", 0) + 1;
- selenium.select(CMS_FILE_TABLE + "/tbody/tr[" + row + "]/td[2]/form/select", "label=Copy");
- selenium.click(CMS_FILE_TABLE + "/tbody/tr[" + row + "]/td[2]/form/select/option[3]");
- selenium.click(CMS_FILE_TABLE + "/tbody/tr[" + row + "]/td[2]/form/input");
+ selenium.select(MessageFormat.format(CMS_T_SELECT,row), "label=Copy");
+ selenium.click(MessageFormat.format(CMS_T_SUBMIT,row));
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=default");
- selenium.click("submit");
+ selenium.click(SUB_MOVE);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=default");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -285,27 +302,27 @@
// canceling for the first time
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link="+file);
selenium.waitForPageToLoad(PAGE_LOAD);
row = findTableRow(CMS_FV_TABLE, "1.1", 2) + 1;
- selenium.click(CMS_FV_TABLE + "/tbody/tr["+row+"]/td[1]/a");
+ selenium.click(MessageFormat.format(CMS_T_VER, row));
selenium.waitForPageToLoad(PAGE_LOAD);
fillInEditor("contentstring2");
- selenium.click("cancel");
+ selenium.click(SUB_FILE_CREATE_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
// really creating and approving
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Home");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -314,29 +331,29 @@
selenium.waitForPageToLoad(PAGE_LOAD);
row = findTableRow(CMS_FV_TABLE, "1.1", 2) + 1;
- selenium.click(CMS_FV_TABLE + "/tbody/tr["+row+"]/td[1]/a");
+ selenium.click(MessageFormat.format(CMS_T_VER, row));
selenium.waitForPageToLoad(PAGE_LOAD);
fillInEditor("contentstring2");
- selenium.click("save");
+ selenium.click(SUB_FILE_CREATE);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Approve");
+ selenium.click(LNK_APPROVE);
selenium.waitForPageToLoad(PAGE_LOAD);
row = findTableRow(CMS_FV_TABLE, "1.3", 2) + 1;
- selenium.click(CMS_FV_TABLE + "/tbody/tr["+row+"]/td[1]/a");
+ selenium.click(MessageFormat.format(CMS_T_VER, row));
selenium.waitForPageToLoad(PAGE_LOAD);
fillInEditor("contentstring3");
- selenium.click("save");
+ selenium.click(SUB_FILE_CREATE);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Deny");
+ selenium.click(LNK_DENY);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertFalse(selenium.isTextPresent("1.5"));
row = findTableRow(CMS_FV_TABLE, "1.3", 2) + 1;
- selenium.click(CMS_FV_TABLE + "/tbody/tr["+row+"]/td[1]/a");
+ selenium.click(MessageFormat.format(CMS_T_VER, row));
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("contentstring2"));
@@ -348,24 +365,24 @@
// save and approve
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Admin");
+ selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=CMS");
+ selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Home");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SELECT_CMS_MAIN, "label=Create File");
+ selenium.select(SELECT_CMS_MAIN, LAB_CREATE_FILE);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
- selenium.type("filename", name);
- selenium.type("description", name + " description");
- selenium.type("title", "existingFile title");
- selenium.select("language", "label=Czech");
+ selenium.type(INP_FILENAME, name);
+ selenium.type(INP_DESC, name + " description");
+ selenium.type(INP_TITLE, "existingFile title");
+ selenium.select(SEL_LANG, LAB_LANG_CZECH);
- selenium.click("save");
+ selenium.click(SUB_FILE_CREATE);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Approve");
+ selenium.click(LNK_APPROVE);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Home");
selenium.waitForPageToLoad(PAGE_LOAD);
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -15,26 +15,44 @@
@Test(groups = { "cms_secure" }, enabled = true, description = "Setting permissions on the default portlet.")
public class CMSSecureTestCase extends JBossPortalSeleniumTestCase {
+ private final String casePfx = "cms.sec.";
- private static final String LNK_EXPLORE = "//area[@href='/portal/content/default/epp.html']";
- private static final String LNK_CMS_EXPLORE = "Link=epp.html";
- private static final String LNK_SUPPORT_HTML = "//area[@href='/portal/content/default/project.html']";
- private static final String LNK_CMS_SUPPORT_HTML = "Link=project.html";
- private static final String LNK_MEMBERS = "link=Members";
- private static final String SUB_SECURITY_SET = "//input[contains(@name,'submit')]";
- private static final String SEL_SECUREUSERS_MANAGE = "//select[contains(@name,'secureusers:manage')]";
- private static final String SEL_SECUREROLES_MANAGE = "//select[contains(@name,'secureroles:manage')]";
- private static final String SEL_SECUREUSERS_WRITE = "//select[contains(@name,'secureusers:write')]";
- private static final String SEL_SECUREROLES_WRITE = "//select[contains(@name,'secureroles:write')]";
- private static final String SEL_SECUREUSERS_READ = "//select[contains(@name,'secureusers:read')]";
- private static final String SEL_SECUREROLES_READ = "//select[contains(@name,'secureroles:read')]";
- private static final String LNK_INDEX_HTML = "link=index.html";
- private static final String LNK_DEFAULT = "link=default";
- private static final String LNK_CMS = "link=CMS";
- private static final String LNK_ADMIN = "link=Admin";
- private static final String LNK_LOGOUT = "link=Logout";
- private static final String SEL_CMS_ACTION = "//div[@id='center']/div/div/div[1]/div/select";
+ private final String LNK_EXPLORE = getProp(casePfx + "lnk.explore", "//area[@href='/portal/content/default/epp.html']");
+ private final String LNK_CMS_EXPLORE = getProp(casePfx + "lnk.cms.explore", "Link=epp.html");
+ private final String LNK_MEMBERS = getProp(casePfx + "lnk.members", "link=Members");
+ private final String SUB_SECURITY_SET = getProp(casePfx + "sub.security.set", "//input[contains(@name,'submit')]");
+ private final String SEL_SECUREUSERS_MANAGE = getProp(casePfx + "sel.secureusers.manage", "//select[contains(@name,'secureusers:manage')]");
+ private final String SEL_SECUREROLES_MANAGE = getProp(casePfx + "sel.secureroles.manage", "//select[contains(@name,'secureroles:manage')]");
+ private final String SEL_SECUREUSERS_WRITE = getProp(casePfx + "sel.secureusers.write", "//select[contains(@name,'secureusers:write')]");
+ private final String SEL_SECUREROLES_WRITE = getProp(casePfx + "sel.secureroles.write", "//select[contains(@name,'secureroles:write')]");
+ private final String SEL_SECUREUSERS_READ = getProp(casePfx + "sel.secureusers.read", "//select[contains(@name,'secureusers:read')]");
+ private final String SEL_SECUREROLES_READ = getProp(casePfx + "sel.secureroles.read", "//select[contains(@name,'secureroles:read')]");
+ private final String LNK_INDEX_HTML = getProp(casePfx + "lnk.index.html", "link=index.html");
+ private final String LNK_DEFAULT = getProp(casePfx + "lnk.default", "link=default");
+ private final String LNK_CMS = getProp(casePfx + "lnk.cms", "link=CMS");
+ private final String LNK_ADMIN = getProp(casePfx + "lnk.admin", "link=Admin");
+ private final String LNK_LOGOUT = getProp(casePfx + "lnk.logout", "link=Logout");
+ private final String SEL_CMS_ACTION = getProp(casePfx + "sel.cms.action", "//div[@id='center']/div/div/div[1]/div/select");
+ public String caseIPfx = "iden.man.";
+ public final String LNK_ROLETAB = getProp(caseIPfx + "lnk.roletab", "//a[contains(@id,'user-temp-form:role-mgm-link')]");
+ public final String LNK_ROLEMAIN = getProp(caseIPfx + "lnk.rolemain", "//a[contains(@id, 'role-temp-form1:role-admin-link')]");
+ public final String LNK_ROLE_CREATE = getProp(caseIPfx + "lnk.role.create", "//a[contains(@id, 'create-role-form:create-role-link')]");
+ public final String INP_ROLEDISNAME = getProp(caseIPfx + "inp.roledisname", "//input[contains(@id,'create-role-form:roledisplayname')]");
+ public final String INP_ROLENAME = getProp(caseIPfx + "inp.rolename", "//input[contains(@id,'create-role-form:rolename')]");
+ public final String SUB_ROLE_CREATE = getProp(caseIPfx + "sub.role.create", "//input[contains(@id,'create-role-form:submit')]");
+ public final String SUB_ASSIGN_ROLE = getProp(caseIPfx + "sub.assign.role", "//input[contains(@id,'assign-roles-form:submit')]");
+ public final String CHK_ROLE = getProp(caseIPfx + "chk.role", "//input[contains(@name,''assign-roles-form:roles'') and @value=''{0}'']");
+ public final String LNK_USERTAB = getProp(caseIPfx + "lnk.usertab", "//a[contains(@id,'role-temp-form:manage-users')]");
+ public final String LNK_USERMAIN = getProp(caseIPfx + "lnk.usermain", "//a[contains(@id,'user-temp-form1:user-adm-link')]");
+ public final String LNK_USERMANG_MAIN = getProp(caseIPfx + "lnk.usermang.main", "//a[contains(@id,'user-temp-form1:assign-role-link')]");
+ public final String SUB_SEARCH_USER = getProp(caseIPfx + "sub.search.user", "//input[contains(@id,'search-user-form:search') and @type='submit']");
+ public final String INP_SEARCH_USER = getProp(caseIPfx + "inp.search.user", "//input[contains(@id,'search-user-form:searchString')]");
+ public final String LNK_SEARCH_USER = getProp(caseIPfx + "lnk.search.user", "//a[contains(@id,'user-form:search-user-link')]");
+ public final String TBL_USERLIST = getProp(caseIPfx + "tbl.userlist", "//table[contains(@id,'search-user-form1:userlist')]");
+ public final String LNK_T_USRLIST_ROLES = getProp(caseIPfx + "lnk.t.usrlist.roles",
+ "//a[contains(@id,''search-user-form1:userlist:{0}:assign-role-link'')]");
+
@AfterMethod(groups = { "log" })
public void logoutAfterTestIfPossible() {
@@ -83,15 +101,15 @@
selenium.click(LNK_MEMBERS);
selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(IdentityAdminTestCase.ID_LINK_ROLETAB);
- clickIfVisible(IdentityAdminTestCase.ID_LINK_ROLEMAIN);
+ clickIfVisible(LNK_ROLETAB);
+ clickIfVisible(LNK_ROLEMAIN);
- selenium.click(IdentityAdminTestCase.ID_BUT_ROLE_CREATE);
+ selenium.click(LNK_ROLE_CREATE);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(IdentityAdminTestCase.ID_INPUT_ROLENAME, roleName);
- selenium.type(IdentityAdminTestCase.ID_INPUT_ROLEDISNAME, roleDisplayName);
- selenium.click(IdentityAdminTestCase.ID_SUBMIT_ROLE_CREATE);
+ selenium.type(INP_ROLENAME, roleName);
+ selenium.type(INP_ROLEDISNAME, roleDisplayName);
+ selenium.click(SUB_ROLE_CREATE);
selenium.waitForPageToLoad(PAGE_LOAD);
logout();
}
@@ -165,8 +183,6 @@
login("admin", "admin");
Assert.assertFalse(selenium.isTextPresent("Access to this resource is denied "), "Non secured resource is not visible.#1");
- //Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"),
- // "Non secured resource is not visible.#2");
selenium.click(LNK_ADMIN);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -228,7 +244,7 @@
}
- @Test(enabled = true, description = "Set admin/secRole read permissions, login as user w/o secRole.")
+ @Test(enabled = true, dependsOnMethods = { "testSetRoleReadPer1" }, description = "Set admin/secRole read permissions, login as user w/o secRole.")
public void testSetRoleReadPer2() {
login("admin", "admin");
@@ -290,14 +306,16 @@
logout();
}
- @Test(enabled = true, description = "Subpage permission test")
+ @Test(enabled = true, dependsOnMethods = { "testSetRoleReadPer1" }, description = "Subpage permission test")
public void testSubpageSecurity() {
selenium.open("/portal/portal/default");
selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertFalse(selenium.isTextPresent("Enteprise Portal Platform"));
Assert.assertTrue(selenium.isElementPresent("//img[@alt='JBoss Portal 2.7: Go Faster!']"));
selenium.click(LNK_EXPLORE);
selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("Enteprise Portal Platform"));
Assert.assertFalse(selenium.isElementPresent("//img[@alt='JBoss Portal 2.7: Go Faster!']"));
login("admin", "admin");
@@ -321,12 +339,14 @@
selenium.waitForPageToLoad(PAGE_LOAD);
logout();
+ Assert.assertFalse(selenium.isTextPresent("Enteprise Portal Platform"));
Assert.assertTrue(selenium.isElementPresent("//img[@alt='JBoss Portal 2.7: Go Faster!']"));
selenium.open("/portal/portal/default");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_EXPLORE);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isElementPresent("//img[@alt='JBoss Portal 2.7: Go Faster!']"));
+ Assert.assertFalse(selenium.isTextPresent("Enteprise Portal Platform"));
+ Assert.assertFalse(selenium.isElementPresent("//img[@alt='JBoss Portal 2.7: Go Faster!']"));
}
@@ -338,12 +358,13 @@
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent(roleDisplay), "Role display name: " + roleDisplay + " not found on the page.");
- final String CHECK_ROLE = MessageFormat.format(IdentityAdminTestCase.ID_CHECK_ROLE, role);
- selenium.click(CHECK_ROLE);
+ final String CHECK_ROLE = MessageFormat.format(CHK_ROLE, role);
+ if (!selenium.isChecked(CHECK_ROLE)) {
+ selenium.click(CHECK_ROLE);
- selenium.click(IdentityAdminTestCase.ID_SUBMIT_ASSIGN_ROLE);
- selenium.waitForPageToLoad(PAGE_LOAD);
-
+ selenium.click(SUB_ASSIGN_ROLE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
searchUser(user, email);
selenium.click(butUsrRol_id(user));
@@ -361,11 +382,13 @@
Assert.assertTrue(selenium.isTextPresent(roleDisplay), "Role display name: " + roleDisplay + " not found on the page.");
// check the tempRole check box
- final String CHECK_ROLE = MessageFormat.format(IdentityAdminTestCase.ID_CHECK_ROLE, role);
- selenium.click(CHECK_ROLE);
+ final String CHECK_ROLE = MessageFormat.format(CHK_ROLE, role);
+ if (selenium.isChecked(CHECK_ROLE)) {
+ selenium.click(CHECK_ROLE);
- selenium.click(IdentityAdminTestCase.ID_SUBMIT_ASSIGN_ROLE);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(SUB_ASSIGN_ROLE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
searchUser(user, email);
selenium.click(butUsrRol_id(user));
@@ -383,19 +406,19 @@
selenium.click("link=Members");
selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(IdentityAdminTestCase.ID_LINK_USERTAB);
- clickIfVisible(IdentityAdminTestCase.ID_LINK_USERMAIN);
- clickIfVisible(IdentityAdminTestCase.LINK_USERMANG_MAIN);
+ clickIfVisible(LNK_USERTAB);
+ clickIfVisible(LNK_USERMAIN);
+ clickIfVisible(LNK_USERMANG_MAIN);
- selenium.click(IdentityAdminTestCase.LINK_SEARCH_USER);
+ selenium.click(LNK_SEARCH_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
+ //selenium.setSpeed("5000");
+ selenium.type(INP_SEARCH_USER, username);
+ //System.out.println(SUB_SEARCH_USER);
+ selenium.click(SUB_SEARCH_USER);
- selenium.type(IdentityAdminTestCase.ID_INPUT_SEARCH_USER, username);
- selenium.click(IdentityAdminTestCase.ID_SUBMIT_SEARCH_USER);
- // selenium.waitForPageToLoad(PAGE_LOAD);
-
try {
- Thread.sleep(5000);
+ Thread.sleep(10000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -403,11 +426,12 @@
Assert.assertTrue(selenium.isTextPresent(username), "Username was not found.");
Assert.assertTrue(selenium.isTextPresent(email), "User email adress was not found.");
+ //selenium.setSpeed("0");
}
private String butUsrRol_id(String userName) {
- String table = IdentityAdminTestCase.TABLE_USERLIST;
+ String table = TBL_USERLIST;
int r = findTableRow(table, userName, 0);
- return MessageFormat.format(IdentityAdminTestCase.LINK_T_USRLIST_ROLES, r - 1);
+ return MessageFormat.format(LNK_T_USRLIST_ROLES, r - 1);
}
}
Copied: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties (from rev 12964, branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties)
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties (rev 0)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/locator.properties 2009-03-06 23:23:00 UTC (rev 12987)
@@ -0,0 +1,430 @@
+# JBossPortalSeleniumTestCase
+
+portal.lnk.logout=link=Logout
+portal.sub.login=login
+portal.adr.portal=/portal/
+portal.frm.login.content=login-content
+portal.inp.password=//input[contains(@id,'j_password')]
+portal.inp.username=//input[contains(@id,'j_username')]
+portal.lnk.login=link=Login
+
+# UserLoginTestCase
+
+user.login.adr.portal=/portal
+user.login.frm.main=relative=up
+user.login.sub.portal=cancel
+user.login.lnk.logout=link=Logout
+user.login.sub.login=login
+user.login.inp.password=//input[contains(@id,'j_password')]
+user.login.inp.username=//input[contains(@id,'j_username')]
+user.login.frm.login=login-content
+user.login.lnk.login=link=Login
+
+# IdentityAdminTestCase
+inp.user.search.prev=//input[contains(@id,'search-user-form1:prev-page')]
+inp.user.search.next=//input[contains(@id,'search-user-form1:next-page')]
+iden.man.sel.searchuser.limit=//select[contains(@id,'search-user-form:limit')]
+iden.man.sub.edit.prof=//input[contains(@id,'profile-form:submit')]
+iden.man.sub.pagin.left=//input[contains(@id,'search-user-form1:prev-page')]
+iden.man.sub.pagin.right=//input[contains(@id,'search-user-form1:next-page')]
+iden.man.sub.edit.user.email.cancel=//input[contains(@id,'profile-form:cancel')]
+iden.man.inp.edit.user.email=//input[contains(@id,'profile-form:email')]
+iden.man.sub.role.search.user=//input[contains(@id,'search-user-form:search') and @type='submit']
+iden.man.inp.role.search.user=//input[contains(@id,'search-user-form:searchString')]
+iden.man.sub.edit.role.submit=//input[contains(@id,'edit-role-link:submit')]
+iden.man.sub.edit.role.cancel=//input[contains(@id,'edit-role-link:cancel')]
+iden.man.inp.edit.role.name=//input[contains(@id,'edit-role-link:display-name')]
+iden.man.sub.pass.change.submit=//input[contains(@name,'change-pwd-form:j_id31')]
+iden.man.sub.pass.change.cancel=//input[contains(@id,'change-pwd-form:cancel')]
+iden.man.inp.pass.change.p2=//input[contains(@id,':change-pwd-form:passwordCheck')]
+iden.man.inp.pass.change.p1=//input[contains(@id,':change-pwd-form:password')]
+iden.man.lnk.change.pass=//a[contains(@id,':profile-form:change-pwd-adm-link')]
+iden.man.tbl.userlist=//table[contains(@id,'search-user-form1:userlist')]
+iden.man.lnk.t.usrlist.del=//a[contains(@id,''search-user-form1:userlist:{0}:delete-user-link'')]
+iden.man.lnk.t.usrlist.roles=//a[contains(@id,''search-user-form1:userlist:{0}:assign-role-link'')]
+iden.man.lnk.t.usrlist.dis=//a[contains(@id,''search-user-form1:userlist:{0}:enable-user-link'')]
+iden.man.lnk.t.usrlist.edit=//a[contains(@id,''search-user-form1:userlist:{0}:rename-link'')]
+iden.man.tbl.rolelist=//table[contains(@id,'roles-form:userlist')]
+iden.man.lnk.t.rollist.del=//a[contains(@id,''roles-form:userlist:{0}:delete-role-link'')]
+iden.man.lnk.t.rollist.members=//a[contains(@id,''roles-form:userlist:{0}:view-role-link'')]
+iden.man.lnk.t.rollist.edit=//a[contains(@id,''roles-form:userlist:{0}:edit-role-link'')]
+iden.man.tbl.rolemembers=//table[contains(@id,'role-members-form:role-data-table')]
+iden.man.sub.conf.create.user=//input[contains(@id,'confirm-form:admin')]
+iden.man.sub.delete.role=//input[contains(@id,'delete-role-form:confirm')]
+iden.man.sub.role.create=//input[contains(@id,'create-role-form:submit')]
+iden.man.inp.roledisname=//input[contains(@id,'create-role-form:roledisplayname')]
+iden.man.inp.rolename=//input[contains(@id,'create-role-form:rolename')]
+iden.man.lnk.role.create=//a[contains(@id, 'create-role-form:create-role-link')]
+iden.man.sub.del.user=//input[contains(@id,'delete-user-form:submit')]
+iden.man.sub.assign.role=//input[contains(@id,'assign-roles-form:submit')]
+iden.man.sub.user.role=//input[contains(@id,'register-role-form:submit')]
+iden.man.sub.create.user=//input[contains(@id,'register-form:submit')]
+iden.man.inp.password.chk=//input[contains(@id,'register-form:passwordCheck')]
+iden.man.inp.password=//input[contains(@id,'register-form:password')]
+iden.man.inp.useremail=//input[contains(@id,'register-form:email')]
+iden.man.inp.username=//input[contains(@id,'register-form:username')]
+iden.man.sub.search.user=//input[contains(@id,'search-user-form:search') and @type='submit']
+iden.man.inp.search.user=//input[contains(@id,'search-user-form:searchString')]
+iden.man.lnk.search.user=//a[contains(@id,'user-form:search-user-link')]
+iden.man.lnk.usertab=//a[contains(@id,'role-temp-form:manage-users')]
+iden.man.lnk.usermain=//a[contains(@id,'user-temp-form1:user-adm-link')]
+iden.man.lnk.roletab=//a[contains(@id,'user-temp-form:role-mgm-link')]
+iden.man.lnk.rolemain=//a[contains(@id, 'role-temp-form1:role-admin-link')]
+iden.man.lnk.usermang.main=//a[contains(@id,'user-temp-form1:assign-role-link')]
+iden.man.lnk.usermang.main2=//a[contains(@id,'user-temp-form1:user-mgm-link')]
+iden.man.lnk.create.user=//a[contains(@id,':user-form:create-user-link')]
+iden.man.chk.role=//input[contains(@name,''assign-roles-form:roles'') and @value=''{0}'']
+
+# DashboardTestCase
+
+dash.sub.layout.update=//input[contains(@name,'dashboardLayoutForm:j_id12')]
+dash.sub.page.rename=//form[contains(@id,'renameForm')]/input[@type='submit']
+dash.inp.page.rename=//input[contains(@id,'renameForm:newName')]
+dash.link.weather.portlet=link=*WeatherPortlet*
+dash.link.portl2=link=*Who's online portlet*
+dash.link.portl1=link=*Welcome portlet*
+dash.opt.portl2=CurrentUsersPortletWindow
+dash.opt.portl1=JSPPortletWindow
+dash.sel.content.type=//select[contains(@id,'contentTypesForm:instanceId')]
+dash.sub.del.from.center.region=//input[contains(@id,'layoutForm:l_center')]
+dash.sub.down.center.region=//input[contains(@id,'layoutForm:d_center')]
+dash.sub.up.center.region=//input[contains(@id,'layoutForm:u_center')]
+dash.sel.center.region=//select[contains(@id,'layoutForm:selectMany_center')]
+dash.sub.addcenter=//input[contains(@id,'layoutForm:a_center')]
+dash.sub.addleft=//input[contains(@id,'layoutForm:a_left')]
+dash.lnk.configure.dashboard=link=Configure dashboard
+dash.lnk.dashboard=link=Dashboard
+dash.sel.page=//select[contains(@id,'pageNameSelector')]
+dash.inp.pagename=//input[contains(@id,':pageName')]
+dash.sub.createpage=//form[contains(@id,'j_id3')]/input[@type='submit']
+dash.sel.layout=//select[contains(@id,'dashboardLayoutForm:layoutSelector')]
+dash.sel.theme=//select[contains(@id,'dashboardThemeForm:themeSelector')]
+dash.sub.themesel=//form[contains(@id,'dashboardThemeForm')]/input[@type='submit']
+
+# PortletUserCreationTestCase
+
+user.crea.port.submit.create.conf=//input[contains(@id,'confirm-form:user')]
+user.crea.port.submit.create.conf.edit=//input[contains(@id,'//input[contains(@id,'confirm-form:revise')]
+user.crea.port.submit.create.user=//input[contains(@id,'register-form:submit')]
+user.crea.port.submit.create.user.cancel=//input[contains(@id,'register-form:cancel')]
+user.crea.port.input.userpasswdconf=//input[contains(@id,'register-form:passwordCheckv
+user.crea.port.input.userpasswd=//input[contains(@id,'register-form:password')]
+user.crea.port.input.usermail=//input[contains(@id,'register-form:email')]
+user.crea.port.input.username=//input[contains(@id,'register-form:username')]
+user.crea.port.link.create.user=//a[contains(@id,'create-account-form:register')]
+user.crea.port.tab.welcome=//a[contains(@id,'register-temp-form:start-link')]
+
+# WSRPTestCase
+
+test.wsrp.inp.consumer.name=//input[contains(@id,'edit-cons-form:id')]
+test.wsrp.submit.refresh.cancel=//a[contains(@id,'edit-cons-form:list-cons-link')]
+test.wsrp.submit.prod.save=//input[contains(@id,'producer-form:save-producer')]
+test.wsrp.submit.consdel.conf=//a[contains(@id,'confirm-delete-form:destroy-link')]
+test.wsrp.submit.cons.regval=//input[contains(@id,'edit-cons-form:refresh-cons-link')]
+test.wsrp.submit.refreshfinal=//input[contains(@id,'edit-cons-form:refresh-cons-link')]
+test.wsrp.input.cons.regvalue=//input[contains(@id,'edit-cons-form:existingProps:0:prop-value-input')]
+test.wsrp.submit.refreshsave=//input[contains(@id,'edit-cons-form:refresh-cons-link')]
+test.wsrp.input.conswsdl=//input[contains(@id,'edit-cons-form:wsdl')]
+test.wsrp.input.cacheexp=//input[contains(@id,'edit-cons-form:cache')]
+test.wsrp.submit.addprop.init=//a[contains(@id,'producer-form:add-reg-prop')]
+test.wsrp.submit.addprop=//a[contains(@id,'producer-form:add-reg-prop')]
+test.wsrp.input.prophint=//input[contains(@id,'producer-form:reg-properties:0:hint')]
+test.wsrp.input.proplabel=//input[contains(@id,'producer-form:reg-properties:0:label')]
+test.wsrp.input.propname=//input[contains(@id,'producer-form:reg-properties:0:name')]
+test.wsrp.submit.createcons=//input[contains(@id,'createConsumer:createConsumerButton')]
+test.wsrp.input.createcons=//input[contains(@id,'createConsumer:consumerName')]
+test.wsrp.id.link.prodconf=//a[contains(@id,'cons-temp-form:producer-link')]
+test.wsrp.id.link.consconf=//a[contains(@id,'producer-temp-form:consumersTab')]
+test.wsrp.link.consumer.home=//a[contains(@id,'cons-temp-form1:list-cons-link')]
+test.wsrp.link.t.cons.con=//a[contains(@id,''consumer-list-form:consumersList:{0}:configure'')]
+test.wsrp.link.t.cons.ref=//a[contains(@id,''consumer-list-form:consumersList:{0}:refresh'')]
+test.wsrp.link.t.cons.act=//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]
+test.wsrp.link.t.cons.dea=//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]
+test.wsrp.link.t.cons.reg=//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]
+test.wsrp.link.t.cons.der=//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]
+test.wsrp.link.t.cons.del=//a[contains(@id,''consumer-list-form:consumersList:{0}:delete'')]
+test.wsrp.link.wsrp.consumer.table=//table[contains(@id,':consumer-list-form:consumersList')]
+
+# CMSArchiveUploadTestCase
+
+cms.arch.sub.cancel.arch.upload=cancel
+cms.arch.lnk.admin=link=Admin
+cms.arch.lnk.cms=link=CMS
+cms.arch.sub.send.archive=submit
+cms.arch.inp.archive.file=response
+cms.arch.div.archive.status=//div[@id='center']/div/div/table/tbody/tr[2]/td/font
+cms.arch.sel.action=//div[@id='center']/div/div/div[1]/div/select
+
+# CMSDirectoryTestCase
+
+cms.dir.sel.cms.action=//div[@id='center']/div/div/div[1]/div/select
+cms.dir.adr.cms.interface=/portal/auth/portal/admin/CMS
+cms.dir.cms.file.table=//div[@id='center']/div/div/div[3]/table
+
+# CMSFileTestCase
+
+cms.file.tbl.cms.filever=//div[@id='center']/div/div/table
+cms.file.tbl.cms.file=//div[@id='center']/div/div/div[3]/table
+cms.file.tbl.file.pending=//div[@id='center']/div/div/table[2]
+
+# CMSFileUploadTestCase
+
+cms.file.up.cms.file.table=//div[@id='center']/div/div/div[3]/table
+
+# CMSFileWorkflowTestCase
+
+cms.file.work.lab.lang.czech=label=Czech
+cms.file.work.lnk.deny=link=Deny
+cms.file.work.lnk.preview=link=Preview
+cms.file.work.lnk.approve=link=Approve
+cms.file.work.sub.file.create=save
+cms.file.work.sub.file.create.cancel=cancel
+cms.file.work.sel.lang=language
+cms.file.work.inp.title=title
+cms.file.work.inp.desc=description
+cms.file.work.inp.filename=filename
+cms.file.work.lab.create.file=label=Create File
+cms.file.work.lnk.cms=link=CMS
+cms.file.work.lnk.admin=link=Admin
+cms.file.work.select.cms.main=//div[@id='center']/div/div/div[1]/div/select
+cms.file.work.cms.file.table=//div[@id='center']/div/div/div[3]/table
+cms.file.work.cms.t.select=//div[@id=''center'']/div/div/div[3]/table/tbody/tr[{0}]/td[2]/form/select
+cms.file.work.cms.t.submit=//div[@id=''center'']/div/div/div[3]/table/tbody/tr[{0}]/td[2]/form/input
+cms.file.work.cms.wf.table=//div[@id='center']/div/div/table[2]
+cms.file.work.cms.fv.table=//div[@id='center']/div/div/table
+cms.file.work.cms.t.ver=//div[@id=''center'']/div/div/table/tbody/tr[{0}]/td[1]/a
+cms.file.work.wysiwyg.editor.locator=mce_editor_0
+
+# CMSSecureTestCase
+
+cms.sec.lnk.explore=//area[@href='/portal/content/default/epp.html']
+cms.sec.lnk.cms.explore=Link=epp.html
+cms.sec.lnk.members=link=Members
+cms.sec.sub.security.set=//input[contains(@name,'submit')]
+cms.sec.sel.secureusers.manage=//select[contains(@name,'secureusers:manage')]
+cms.sec.sel.secureroles.manage=//select[contains(@name,'secureroles:manage')]
+cms.sec.sel.secureusers.write=//select[contains(@name,'secureusers:write')]
+cms.sec.sel.secureroles.write=//select[contains(@name,'secureroles:write')]
+cms.sec.sel.secureusers.read=//select[contains(@name,'secureusers:read')]
+cms.sec.sel.secureroles.read=//select[contains(@name,'secureroles:read')]
+cms.sec.lnk.index.html=link=index.html
+cms.sec.lnk.default=link=default
+cms.sec.lnk.cms=link=CMS
+cms.sec.lnk.admin=link=Admin
+cms.sec.lnk.logout=link=Logout
+cms.sec.sel.cms.action=//div[@id='center']/div/div/div[1]/div/select
+
+# AdminPortalTestCase
+
+portal.admin.sub.layout.add.center=//input[contains(@id,'layoutForm:a_center')]
+portal.admin.inp.window.name=//input[contains(@id,'windowForm:windowName')]
+portal.admin.submit.rename.portal=//input[contains(@id,'renameForm:rename')]
+portal.admin.input.rename.portal=//input[contains(@id,'renameForm:newName')]
+portal.admin.submit.delete.portal.conf=//input[contains(@id,'delete-view:confirm-form:delete')]
+portal.admin.input.submit.pagecreate=//input[contains(@id,'create-page-form:create-page')]
+portal.admin.input.pagename=//input[contains(@id,'create-page-form:pageName')]
+portal.admin.input.portalname=//input[contains(@id,'create-portal-form:name')]
+portal.admin.input.submit.createportal=//input[contains(@id,'create-portal-form:create-portal')]
+portal.admin.tab.portalobj.id=Link=Admin
+portal.admin.link.portals.id=link=*Portal Objects*
+portal.admin.link.portal.home=//a[contains(@id,'obj-temp-form:object-link-0')]
+portal.admin.table.portal.admin=//table[contains(@id,'obj-nav-form:portal-datatable')]
+portal.admin.por.tl.main=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]
+portal.admin.por.tl.security=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]
+portal.admin.por.tl.properties=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]
+portal.admin.por.tl.theme=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]
+portal.admin.por.tl.rename=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]
+portal.admin.por.tl.delete=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]
+portal.admin.por.tl.makedef=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]
+portal.admin.table.portalpage.admin=//table[contains(@id,'obj-nav-form:pages-datatable')]
+portal.admin.pag.tl.main=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]
+portal.admin.pag.tl.layout=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]
+portal.admin.pag.tl.security=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]
+portal.admin.pag.tl.properties=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]
+portal.admin.pag.tl.theme=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]
+portal.admin.pag.tl.rename=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link'')]
+portal.admin.pag.tl.display=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]
+portal.admin.pag.tl.delete=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]
+portal.admin.pag.tl.makedef=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]
+
+portal.admin.lnk.pp.prop.delete=//a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]
+portal.admin.sub.pp.propval.update=//input[contains(@id,'common-manage-prop-form:update')]
+portal.admin.inp.pp.prop.val=//input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:prop-value-input'')]
+portal.admin.sub.ppa.form.update=//input[contains(@id,'common-edit-page-error-form:update')]
+portal.admin.inp.ppa.res.select=//input[contains(@id,'common-edit-page-error-form:page-res-select')]
+portal.admin.sel.ppa.nf.select=//select[contains(@id,'common-edit-page-error-form:page-not-found-select')]
+portal.admin.sel.ppa.internal.select=//select[contains(@id,'common-edit-page-error-form:page-internal-select')]
+portal.admin.sel.ppa.error.select=//select[contains(@id,'common-edit-page-error-form:page-error-select')]
+portal.admin.sel.ppa.control.select=//select[contains(@id,'common-edit-page-error-form:page-control-select')]
+portal.admin.sel.ppa.access.select=//select[contains(@id,'common-edit-page-error-form:page-access-select')]
+portal.admin.chk.ppa.res.check=//input[contains(@id,'common-edit-page-error-form:page-res-check')]
+portal.admin.chk.ppa.nf.check=//input[contains(@id,'common-edit-page-error-form:page-not-found-check')]
+portal.admin.chk.ppa.internal.check=//input[contains(@id,'common-edit-page-error-form:page-internal-check')]
+portal.admin.chk.ppa.error.check=//input[contains(@id,'common-edit-page-error-form:page-error-check')]
+portal.admin.chk.ppa.control.check=//input[contains(@id,'common-edit-page-error-form:page-control-check')]
+portal.admin.chk.ppa.access.check=//input[contains(@id,'common-edit-page-error-form:page-access-check')]
+portal.admin.sub.pp.error.form.update=//input[contains(@id,'common-edit-portal-error-form:update')]
+portal.admin.inp.pp.res.input=//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]
+portal.admin.sel.pp.nf.select=//select[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]
+portal.admin.sel.pp.internal.select=//select[contains(@id,'common-edit-portal-error-form:portal-internal-select')]
+portal.admin.sel.pp.error.select=//select[contains(@id,'common-edit-portal-error-form:portal-error-select')]
+portal.admin.sel.pp.unavail.select=//select[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]
+portal.admin.sel.pp.access.select=//select[contains(@id,'common-edit-portal-error-form:portal-access-select')]
+portal.admin.chk.pp.res.check=//input[contains(@id,'common-edit-portal-error-form:portal-res-check')]
+portal.admin.chk.pp.nf.check=//input[contains(@id,'common-edit-portal-error-form:portal-not-found-check')]
+portal.admin.chk.pp.internal.check=//input[contains(@id,'common-edit-portal-error-form:portal-internal-check')]
+portal.admin.chk.pp.error.check=//input[contains(@id,'common-edit-portal-error-form:portal-error-check')]
+portal.admin.chk.pp.access.check=//input[contains(@id,'common-edit-portal-error-form:portal-access-check')]
+portal.admin.chk.pp.unavail.check=//input[contains(@id,'common-edit-portal-error-form:portal-unavail-check')]
+portal.admin.sub.pp.propadd=//input[contains(@id,'common-edit-prop-form:add-property')]
+portal.admin.inp.pp.propname=//input[contains(@id,'common-edit-prop-form:property')]
+portal.admin.sub.pp.listener=//input[contains(@id,'edit-prop-form:update')]
+portal.admin.sel.pp.listener=//select[contains(@id,'edit-prop-form:listener')]
+portal.admin.tbl.pp.props=//table[contains(@id,'common-manage-prop-form:prop-data-table')]
+
+# DashboardsTestCase
+
+portal.dash.t.dh.sub.update=//form[contains(@id,'common-edit-theme-form')]/input[@type='submit']
+portal.dash.t.dh.sel.renderset=//select[contains(@id,'common-edit-theme-form:renderSet')]
+portal.dash.t.dh.sel.theme=//select[contains(@id,'common-edit-theme-form:theme')]
+portal.dash.t.dh.sel.layout=//select[contains(@id,'common-edit-theme-form:layout')]
+portal.dash.t.pa.sub.update=//input[contains(@id,'common-edit-page-error-form:update')]
+portal.dash.t.po.sub.update=//input[contains(@id,'common-edit-portal-error-form:update')]
+portal.dash.t.pa.inp.pageadd=//input[contains(@id,'common-edit-page-error-form:page-res-select')]
+portal.dash.t.po.inp.pageadd=//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]
+portal.dash.t.pa.sel.pnf=//select[contains(@id,'common-edit-page-error-form:page-not-found-select')]
+portal.dash.t.pa.sel.intern=//select[contains(@id,'common-edit-page-error-form:page-internal-select')]
+portal.dash.t.pa.sel.error=//select[contains(@id,'common-edit-page-error-form:page-error-select')]
+portal.dash.t.pa.sel.control=//select[contains(@id,'common-edit-page-error-form:page-control-select')]
+portal.dash.t.pa.sel.access=//select[contains(@id,'common-edit-page-error-form:page-access-select')]
+portal.dash.t.po.sel.pnf=//select[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]
+portal.dash.t.po.sel.unavail=//select[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]
+portal.dash.t.po.sel.access=//select[contains(@id,'common-edit-portal-error-form:portal-access-select')]
+portal.dash.submit.update.value=//input[contains(@id,'common-manage-prop-form:update')]
+portal.dash.table.props=//table[contains(@id,'common-manage-prop-form:prop-data-table')]
+portal.dash.t.props.input.value=//input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:prop-value-input'')]
+portal.dash.t.props.link.del=//a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]
+portal.dash.table.pa.err=//form[@id='common-edit-page-error-form']/table
+portal.dash.table.po.err=//form[@id='common-edit-portal-error-form']/table
+portal.dash.table.dh.thm=//form[@id='common-edit-theme-form']/table
+portal.dash.input.prop.name=//input[contains(@id,'common-edit-prop-form:property')]
+portal.dash.submit.add.prop=//input[contains(@id,'common-edit-prop-form:add-property')]
+portal.dash.link.admin=link=Admin
+portal.dash.link.tab.dash=//a[contains(@id,'admin-subtab-form:dashboard-link')]
+
+# PortletDefinitionsTestCase
+
+portal.port.def.t.link.pref=//a[contains(@id,''def-list:portlet-pref-{0}'')]
+portal.port.def.submit.create.inst=//input[contains(@name,'add_instance_form:j_id19')]
+portal.port.def.input.instance.name=//input[contains(@id,'add_instance_form:instanceId')]
+portal.port.def.t.link.create=//a[contains(@id,''def-list:create-instance-{0}'')]
+portal.port.def.submit.provider.view=//input[contains(@id,'definition-form:view-portlets')]
+portal.port.def.select.provider=//select[contains(@id,'definition-form:menu')]
+portal.port.def.table.portlet=//form[contains(@id,'def-list')]/table
+portal.port.def.link.name.admin.port=//a[contains(@id,'common-show-portlet-detail-form:field1:select')]
+portal.port.def.link.admin.port=//a[contains(@id,'def-list:portlet-def-0')]
+portal.port.def.link.admin=link=Admin
+portal.port.def.link.tab.pd=//a[contains(@id,'admin-subtab-form:portlet-def-link')]
+portal.port.def.link.pd.main=//a[contains(@id,'man-form:def-link')]
+
+# PortletInstancesTestCase
+
+portal.port.ins.tab.portlet.instances=//table[contains(@id,'instancesTable2')]
+portal.port.ins.ul.paginator=//ul[@class='pagination property-container']
+portal.port.ins.submit.security.update=//input[contains(@id,'common-edit-security-form:update')]
+portal.port.ins.submit.security.cancel=//input[contains(@id,'common-edit-security-form:cancel')]
+portal.port.ins.link.20.page=link=20
+portal.port.ins.link.pref.welcomeport=//a[contains(@id,'security-JSPPortletInstance')]
+portal.port.ins.table.pref.key=//form[contains(@id,'common-edit-pref-form')]/table
+portal.port.ins.submit.pref.delete=//input[contains(@id,'common-edit-exisiting-form:row_0')]
+portal.port.ins.link.pref.guestnum=//a[contains(@id,'common-edit-pref-form:pref-link-0')]
+portal.port.ins.input.pref.newval=//input[contains(@id,'common-append-form:new_value')]
+portal.port.ins.submit.pref.update=//input[contains(@id,'common-append-form:append-button')]
+portal.port.ins.submit.pref.save=//input[contains(@id,':save')]
+portal.port.ins.input.pref.update=//input[contains(@id,'common-edit-exisiting-form:update')]
+portal.port.ins.input.pref.append=//input[contains(@id,'common-edit-exisiting-form:pref-input-0')]
+portal.port.ins.submit.pref.cancel=//input[contains(@id,':cancel')]
+portal.port.ins.link.curuser.preferences=//a[contains(@id,'instances-form:preference-CurrentUsersPortletInstance')]
+portal.port.ins.link.del.exceptport=//a[contains(@id,'instances-form:delete-GoogleMapPortletInstance')]
+portal.port.ins.submit.pi.delete.conf=//input[contains(@id,'confirm-delete-form1:delete')]
+portal.port.ins.submit.pi.delete.canc=//input[contains(@id,'confirm-delete-form1:cancel')]
+portal.port.ins.t.link.deletename=//a[contains(@id,''instance-display-form:locale-datatable:{0}:delete-link'')]
+portal.port.ins.t.link.modifyname=//a[contains(@id,''instance-display-form:locale-datatable:{0}:edit-link'')]
+portal.port.ins.link.countport=//a[contains(@id,'instances-form:CurrentUsersPortletInstance')]
+portal.port.ins.name.countport=CurrentUsersPortletInstance
+portal.port.ins.submit.modify.name=//input[contains(@id,'add-display-name-form:addDisplay')]
+portal.port.ins.input.name=//input[contains(@id,'add-display-name-form:newName')]
+portal.port.ins.select.language=//select[contains(@id,'add-display-name-form:locales')]
+portal.port.ins.link.admin=link=Admin
+portal.port.ins.link.tab.pi=//a[contains(@id,'admin-subtab-form:portlet-instance-link')]
+portal.port.ins.link.pi.main=//a[contains(@id,'instance-form1:instance-link')]
+portal.port.ins.table.dispnames=//table[contains(@id,'instance-display-form:locale-datatable')]
+portal.port.ins.lnk.sec.button=//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''Security'')]
+portal.port.ins.lnk.pref.button=//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''actionPreferences'')]
+portal.port.ins.lnk.del.button=//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''actionDeleteInstance'')]
+portal.port.ins.lnk.instance.button=//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td[1]/a[1]
+
+# EndToEndBeaPortlet
+
+e2e.wsrp.inp.consumer.name=//input[contains(@id,'edit-cons-form:id')]
+e2e.wsrp.submit.refresh.cancel=//a[contains(@id,'edit-cons-form:list-cons-link')]
+e2e.wsrp.submit.prod.save=//input[contains(@id,'producer-form:save-producer')]
+e2e.wsrp.submit.consdel.conf=//a[contains(@id,'confirm-delete-form:destroy-link')]
+e2e.wsrp.submit.cons.regval=//input[contains(@id,'edit-cons-form:refresh-cons-link')]
+e2e.wsrp.submit.refreshfinal=//input[contains(@id,'edit-cons-form:refresh-cons-link')]
+e2e.wsrp.input.cons.regvalue=//input[contains(@id,'edit-cons-form:existingProps:0:prop-value-input')]
+e2e.wsrp.submit.refreshsave=//input[contains(@id,'edit-cons-form:refresh-cons-link')]
+e2e.wsrp.input.conswsdl=//input[contains(@id,'edit-cons-form:wsdl')]
+e2e.wsrp.input.cacheexp=//input[contains(@id,'edit-cons-form:cache')]
+e2e.wsrp.submit.addprop.init=//a[contains(@id,'producer-form:add-reg-prop')]
+e2e.wsrp.submit.addprop=//a[contains(@id,'producer-form:add-reg-prop')]
+e2e.wsrp.input.prophint=//input[contains(@id,'producer-form:reg-properties:0:hint')]
+e2e.wsrp.input.proplabel=//input[contains(@id,'producer-form:reg-properties:0:label')]
+e2e.wsrp.input.propname=//input[contains(@id,'producer-form:reg-properties:0:name')]
+e2e.wsrp.submit.createcons=//input[contains(@id,'createConsumer:createConsumerButton')]
+e2e.wsrp.input.createcons=//input[contains(@id,'createConsumer:consumerName')]
+e2e.wsrp.id.link.prodconf=//a[contains(@id,'cons-temp-form:producer-link')]
+e2e.wsrp.id.link.consconf=//a[contains(@id,'producer-temp-form:consumersTab')]
+e2e.wsrp.link.consumer.home=//a[contains(@id,'cons-temp-form1:list-cons-link')]
+e2e.wsrp.link.t.cons.con=//a[contains(@id,''consumer-list-form:consumersList:{0}:configure'')]
+e2e.wsrp.link.t.cons.ref=//a[contains(@id,''consumer-list-form:consumersList:{0}:refresh'')]
+e2e.wsrp.link.t.cons.act=//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]
+e2e.wsrp.link.t.cons.dea=//a[contains(@id,''consumer-list-form:consumersList:{0}:activate'')]
+e2e.wsrp.link.t.cons.reg=//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]
+e2e.wsrp.link.t.cons.der=//a[contains(@id,''consumer-list-form:consumersList:{0}:register'')]
+e2e.wsrp.link.t.cons.del=//a[contains(@id,''consumer-list-form:consumersList:{0}:delete'')]
+
+# EndtoEndPortalAdminTestCase
+
+portal.e2e.sel.portlet.type=//select[contains(@id,'windowForm:instanceId')]
+portal.e2e.sub.layout.add.center=//input[contains(@id,'layoutForm:a_center')]
+portal.e2e.inp.window.name=//input[contains(@id,'windowForm:windowName')]
+portal.e2e.sub.rename.portal=//input[contains(@id,'renameForm:rename')]
+portal.e2e.inp.rename.portal=//input[contains(@id,'renameForm:newName')]
+portal.e2e.sub.delete.portal.conf=//input[contains(@id,'delete-view:confirm-form:delete')]
+portal.e2e.inp.submit.pagecreate=//input[contains(@id,'create-page-form:create-page')]
+portal.e2e.inp.pagename=//input[contains(@id,'create-page-form:pageName')]
+portal.e2e.inp.portalname=//input[contains(@id,'create-portal-form:name')]
+portal.e2e.inp.submit.createportal=//input[contains(@id,'create-portal-form:create-portal')]
+portal.e2e.tab.portalobj.id=Link=Admin
+portal.e2e.lnk.portals.id=link=*Portal Objects*
+portal.e2e.lnk.portal.home=//a[contains(@id,'obj-temp-form:object-link-0')]
+portal.e2e.tbl.portal.admin=//table[contains(@id,'obj-nav-form:portal-datatable')]
+portal.e2e.por.tl.main=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]
+portal.e2e.por.tl.security=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]
+portal.e2e.por.tl.properties=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]
+portal.e2e.por.tl.theme=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]
+portal.e2e.por.tl.rename=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]
+portal.e2e.por.tl.delete=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]
+portal.e2e.por.tl.makedef=//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]
+portal.e2e.tbl.portalpage.admin=//table[contains(@id,'obj-nav-form:pages-datatable')]
+portal.e2e.pag.tl.main=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]
+portal.e2e.pag.tl.layout=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]
+portal.e2e.pag.tl.security=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]
+portal.e2e.pag.tl.properties=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]
+portal.e2e.pag.tl.theme=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]
+portal.e2e.pag.tl.rename=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link'')]
+portal.e2e.pag.tl.display=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]
+portal.e2e.pag.tl.delete=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]
+portal.e2e.pag.tl.makedef=//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]
+portal.e2e.div.por.cont=content-container
\ No newline at end of file
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -14,49 +14,82 @@
@Test(groups = { "admin_portal" }, enabled = true, description = "Partal administrating.")
public class AdminPortalTestCase extends JBossPortalSeleniumTestCase {
- private static final String SUB_LAYOUT_ADD_CENTER = "//input[contains(@id,'layoutForm:a_center')]";
- private static final String INP_WINDOW_NAME = "//input[contains(@id,'windowForm:windowName')]";
- private static final String SUBMIT_RENAME_PORTAL = "//input[contains(@id,'renameForm:rename')]";
- private static final String INPUT_RENAME_PORTAL = "//input[contains(@id,'renameForm:newName')]";
- private static final String SUBMIT_DELETE_PORTAL_CONF = "//input[contains(@id,'delete-view:confirm-form:delete')]";
- private static final String INPUT_SUBMIT_PAGECREATE = "//input[contains(@id,'create-page-form:create-page')]";
- private static final String INPUT_PAGENAME = "//input[contains(@id,'create-page-form:pageName')]";
- private static final String INPUT_PORTALNAME = "//input[contains(@id,'create-portal-form:name')]";
- private static final String INPUT_SUBMIT_CREATEPORTAL = "//input[contains(@id,'create-portal-form:create-portal')]";
+ public final String casePfx = "portal.admin.";
- private final String TAB_PORTALOBJ_ID = "Link=Admin";
+ private final String LNK_PP_PROP_DELETE = getProp(casePfx+"lnk.pp.prop.delete","//a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]");
+ private final String SUB_PP_PROPVAL_UPDATE = getProp(casePfx+"sub.pp.propval.update","//input[contains(@id,'common-manage-prop-form:update')]");
+ private final String INP_PP_PROP_VAL = getProp(casePfx+"inp.pp.prop.val","//input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:prop-value-input'')]");
+ private final String SUB_PPA_FORM_UPDATE = getProp(casePfx+"sub.ppa.form.update","//input[contains(@id,'common-edit-page-error-form:update')]");
+ private final String INP_PPA_RES_SELECT = getProp(casePfx+"inp.ppa.res.select","//input[contains(@id,'common-edit-page-error-form:page-res-select')]");
+ private final String SEL_PPA_NF_SELECT = getProp(casePfx+"sel.ppa.nf.select","//select[contains(@id,'common-edit-page-error-form:page-not-found-select')]");
+ private final String SEL_PPA_INTERNAL_SELECT = getProp(casePfx+"sel.ppa.internal.select","//select[contains(@id,'common-edit-page-error-form:page-internal-select')]");
+ private final String SEL_PPA_ERROR_SELECT = getProp(casePfx+"sel.ppa.error.select","//select[contains(@id,'common-edit-page-error-form:page-error-select')]");
+ private final String SEL_PPA_CONTROL_SELECT = getProp(casePfx+"sel.ppa.control.select","//select[contains(@id,'common-edit-page-error-form:page-control-select')]");
+ private final String SEL_PPA_ACCESS_SELECT = getProp(casePfx+"sel.ppa.access.select","//select[contains(@id,'common-edit-page-error-form:page-access-select')]");
+ private final String CHK_PPA_RES_CHECK = getProp(casePfx+"chk.ppa.res.check","//input[contains(@id,'common-edit-page-error-form:page-res-check')]");
+ private final String CHK_PPA_NF_CHECK = getProp(casePfx+"chk.ppa.nf.check","//input[contains(@id,'common-edit-page-error-form:page-not-found-check')]");
+ private final String CHK_PPA_INTERNAL_CHECK = getProp(casePfx+"chk.ppa.internal.check","//input[contains(@id,'common-edit-page-error-form:page-internal-check')]");
+ private final String CHK_PPA_ERROR_CHECK = getProp(casePfx+"chk.ppa.error.check","//input[contains(@id,'common-edit-page-error-form:page-error-check')]");
+ private final String CHK_PPA_CONTROL_CHECK = getProp(casePfx+"chk.ppa.control.check","//input[contains(@id,'common-edit-page-error-form:page-control-check')]");
+ private final String CHK_PPA_ACCESS_CHECK = getProp(casePfx+"chk.ppa.access.check","//input[contains(@id,'common-edit-page-error-form:page-access-check')]");
+ private final String SUB_PP_ERROR_FORM_UPDATE = getProp(casePfx+"sub.pp.error.form.update","//input[contains(@id,'common-edit-portal-error-form:update')]");
+ private final String INP_PP_RES_INPUT = getProp(casePfx+"inp.pp.res.input","//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]");
+ private final String SEL_PP_NF_SELECT = getProp(casePfx+"sel.pp.nf.select","//select[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]");
+ private final String SEL_PP_INTERNAL_SELECT = getProp(casePfx+"sel.pp.internal.select","//select[contains(@id,'common-edit-portal-error-form:portal-internal-select')]");
+ private final String SEL_PP_ERROR_SELECT = getProp(casePfx+"sel.pp.error.select","//select[contains(@id,'common-edit-portal-error-form:portal-error-select')]");
+ private final String SEL_PP_UNAVAIL_SELECT = getProp(casePfx+"sel.pp.unavail.select","//select[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]");
+ private final String SEL_PP_ACCESS_SELECT = getProp(casePfx+"sel.pp.access.select","//select[contains(@id,'common-edit-portal-error-form:portal-access-select')]");
+ private final String CHK_PP_RES_CHECK = getProp(casePfx+"chk.pp.res.check","//input[contains(@id,'common-edit-portal-error-form:portal-res-check')]");
+ private final String CHK_PP_NF_CHECK = getProp(casePfx+"chk.pp.nf.check","//input[contains(@id,'common-edit-portal-error-form:portal-not-found-check')]");
+ private final String CHK_PP_INTERNAL_CHECK = getProp(casePfx+"chk.pp.internal.check","//input[contains(@id,'common-edit-portal-error-form:portal-internal-check')]");
+ private final String CHK_PP_ERROR_CHECK = getProp(casePfx+"chk.pp.error.check","//input[contains(@id,'common-edit-portal-error-form:portal-error-check')]");
+ private final String CHK_PP_ACCESS_CHECK = getProp(casePfx+"chk.pp.access.check","//input[contains(@id,'common-edit-portal-error-form:portal-access-check')]");
+ private final String CHK_PP_UNAVAIL_CHECK = getProp(casePfx+"chk.pp.unavail.check","//input[contains(@id,'common-edit-portal-error-form:portal-unavail-check')]");
+ private final String SUB_PP_PROPADD = getProp(casePfx+"sub.pp.propadd","//input[contains(@id,'common-edit-prop-form:add-property')]");
+ private final String INP_PP_PROPNAME = getProp(casePfx+"inp.pp.propname","//input[contains(@id,'common-edit-prop-form:property')]");
+ private final String SUB_PP_LISTENER = getProp(casePfx+"sub.pp.listener","//input[contains(@id,'edit-prop-form:update')]");
+ private final String SEL_PP_LISTENER = getProp(casePfx+"sel.pp.listener","//select[contains(@id,'edit-prop-form:listener')]");
+ private final String TBL_PP_PROPS = getProp(casePfx+"tbl.pp.props","//table[contains(@id,'common-manage-prop-form:prop-data-table')]");
- private final String LINK_PORTALS_ID = "link=*Portal Objects*";
- private final String LINK_PORTAL_HOME = "//a[contains(@id,'obj-temp-form:object-link-0')]";
-
- private final String TABLE_PORTAL_ADMIN = "//table[contains(@id,'obj-nav-form:portal-datatable')]";
- private final String POR_TL_MAIN = "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]";
- private final String POR_TL_SECURITY = "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]";
- private final String POR_TL_PROPERTIES = "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]";
- private final String POR_TL_THEME = "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]";
- private final String POR_TL_RENAME = "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]";
- private final String POR_TL_DELETE = "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]";
- private final String POR_TL_MAKEDEF = "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]";
+ private final String SUB_LAYOUT_ADD_CENTER = getProp(casePfx + "sub.layout.add.center", "//input[contains(@id,'layoutForm:a_center')]");
+ private final String INP_WINDOW_NAME = getProp(casePfx + "inp.window.name", "//input[contains(@id,'windowForm:windowName')]");
+ private final String SUBMIT_RENAME_PORTAL = getProp(casePfx + "submit.rename.portal", "//input[contains(@id,'renameForm:rename')]");
+ private final String INPUT_RENAME_PORTAL = getProp(casePfx + "input.rename.portal", "//input[contains(@id,'renameForm:newName')]");
+ private final String SUBMIT_DELETE_PORTAL_CONF = getProp(casePfx + "submit.delete.portal.conf", "//input[contains(@id,'delete-view:confirm-form:delete')]");
+ private final String INPUT_SUBMIT_PAGECREATE = getProp(casePfx + "input.submit.pagecreate", "//input[contains(@id,'create-page-form:create-page')]");
+ private final String INPUT_PAGENAME = getProp(casePfx + "input.pagename", "//input[contains(@id,'create-page-form:pageName')]");
+ private final String INPUT_PORTALNAME = getProp(casePfx + "input.portalname", "//input[contains(@id,'create-portal-form:name')]");
+ private final String INPUT_SUBMIT_CREATEPORTAL = getProp(casePfx + "input.submit.createportal", "//input[contains(@id,'create-portal-form:create-portal')]");
+ private final String TAB_PORTALOBJ_ID = getProp(casePfx + "tab.portalobj.id", "Link=Admin");
+ private final String LINK_PORTALS_ID = getProp(casePfx + "link.portals.id", "link=*Portal Objects*");
+ private final String LINK_PORTAL_HOME = getProp(casePfx + "link.portal.home", "//a[contains(@id,'obj-temp-form:object-link-0')]");
+ private final String TABLE_PORTAL_ADMIN = getProp(casePfx + "table.portal.admin", "//table[contains(@id,'obj-nav-form:portal-datatable')]");
+ private final String POR_TL_MAIN = getProp(casePfx + "por.tl.main", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]");
+ private final String POR_TL_SECURITY = getProp(casePfx + "por.tl.security", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]");
+ private final String POR_TL_PROPERTIES = getProp(casePfx + "por.tl.properties", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]");
+ private final String POR_TL_THEME = getProp(casePfx + "por.tl.theme", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]");
+ private final String POR_TL_RENAME = getProp(casePfx + "por.tl.rename", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]");
+ private final String POR_TL_DELETE = getProp(casePfx + "por.tl.delete", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]");
+ private final String POR_TL_MAKEDEF = getProp(casePfx + "por.tl.makedef", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]");
+ private final String TABLE_PORTALPAGE_ADMIN = getProp(casePfx + "table.portalpage.admin", "//table[contains(@id,'obj-nav-form:pages-datatable')]");
+ private final String PAG_TL_MAIN = getProp(casePfx + "pag.tl.main", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]");
+ private final String PAG_TL_LAYOUT = getProp(casePfx + "pag.tl.layout", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]");
+ private final String PAG_TL_SECURITY = getProp(casePfx + "pag.tl.security", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]");
+ private final String PAG_TL_PROPERTIES = getProp(casePfx + "pag.tl.properties", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]");
+ private final String PAG_TL_THEME = getProp(casePfx + "pag.tl.theme", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]");
+ private final String PAG_TL_RENAME = getProp(casePfx + "pag.tl.rename", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link'')]");
+ private final String PAG_TL_DISPLAY = getProp(casePfx + "pag.tl.display", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]");
+ private final String PAG_TL_DELETE = getProp(casePfx + "pag.tl.delete", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]");
+ private final String PAG_TL_MAKEDEF = getProp(casePfx + "pag.tl.makedef", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]");
- private final String TABLE_PORTALPAGE_ADMIN = "//table[contains(@id,'obj-nav-form:pages-datatable')]";
- private final String PAG_TL_MAIN = "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]";
- private final String PAG_TL_LAYOUT = "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]";
- private final String PAG_TL_SECURITY = "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]";
- private final String PAG_TL_PROPERTIES = "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]";
- private final String PAG_TL_THEME = "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]";
- private final String PAG_TL_RENAME = "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link'')]";
- private final String PAG_TL_DISPLAY = "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]";
- private final String PAG_TL_DELETE = "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]";
- private final String PAG_TL_MAKEDEF = "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]";
-
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
+ logoutIfPossible();
login("admin", "admin");
}
@AfterMethod(groups = { "log" })
public void logoutAfterTest() {
- logout();
}
@Test(enabled = true)
@@ -64,19 +97,19 @@
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
-
clickIfVisible(TAB_PORTALOBJ_ID);
clickIfVisible(LINK_PORTALS_ID);
- Assert.assertFalse(selenium.isTextPresent("TestPortal"), "Not created page already exist.");
+ final String portalName = "TestPortal";
+ Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already exist.");
- selenium.type(INPUT_PORTALNAME, "TestPortal");
+ selenium.type(INPUT_PORTALNAME, portalName);
selenium.click(INPUT_SUBMIT_CREATEPORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("TestPortal"));
+ Assert.assertTrue(selenium.isTextPresent(portalName));
- int r = findTableRow(TABLE_PORTAL_ADMIN, "TestPortal", 0) - 1;
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(POR_TL_MAIN, r)));
Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(POR_TL_SECURITY, r)));
@@ -88,61 +121,100 @@
@Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
public void testPortalRename() {
+ // first create a portal
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
clickIfVisible(TAB_PORTALOBJ_ID);
clickIfVisible(LINK_PORTALS_ID);
- Assert.assertTrue(selenium.isTextPresent("TestPortal"));
- Assert.assertFalse(selenium.isTextPresent("AestPortal"), "Not created page already exist.");
+ final String portalName = "TestRenPortal";
+ Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already exist.");
- int r = findTableRow(TABLE_PORTAL_ADMIN, "TestPortal", 0) - 1;
+ selenium.type(INPUT_PORTALNAME, portalName);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ // then rename it
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+
+ final String portalToRename = "TestRenPortal";
+ Assert.assertTrue(selenium.isTextPresent(portalToRename));
+ final String portalRenamed = "AestPortal";
+ Assert.assertFalse(selenium.isTextPresent(portalRenamed), "Not created page already exist.");
+
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalToRename, 0) - 1;
+
selenium.click(MessageFormat.format(POR_TL_RENAME, r));
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(INPUT_RENAME_PORTAL, "AestPortal");
+ selenium.type(INPUT_RENAME_PORTAL, portalRenamed);
selenium.click(SUBMIT_RENAME_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertFalse(selenium.isTextPresent("TestPortal"));
- Assert.assertTrue(selenium.isTextPresent("AestPortal"));
+ Assert.assertFalse(selenium.isTextPresent(portalToRename));
+ Assert.assertTrue(selenium.isTextPresent(portalRenamed));
}
@Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
public void testPortalDelete() {
+ // first create a portal
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
clickIfVisible(TAB_PORTALOBJ_ID);
clickIfVisible(LINK_PORTALS_ID);
- selenium.type(INPUT_PORTALNAME, "TestDelete");
+ final String portalName = "TestDelete";
+ Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already exist.");
+
+ selenium.type(INPUT_PORTALNAME, portalName);
selenium.click(INPUT_SUBMIT_CREATEPORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("TestDelete"));
+ // then delete it
- int r = findTableRow(TABLE_PORTAL_ADMIN, "TestDelete", 0) - 1;
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+
+ final String portalToDelete = "TestDelete";
+ selenium.type(INPUT_PORTALNAME, portalToDelete);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent(portalToDelete));
+
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalToDelete, 0) - 1;
+
selenium.click(MessageFormat.format(POR_TL_DELETE, r));
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("WARNING! You are about to delete the TestDelete portal from the context!"));
+ Assert.assertTrue(selenium.isTextPresent("WARNING! You are about to delete the " + portalToDelete + " portal from the context!"));
Assert.assertTrue(selenium.isTextPresent("Delete portal"));
Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this portal?"));
selenium.click(SUBMIT_DELETE_PORTAL_CONF);
selenium.waitForPageToLoad(PAGE_LOAD);
- //Assert.assertTrue(selenium.isTextPresent("TestDelete has successfully been destroyed"));
+ // Assert.assertTrue(selenium.isTextPresent(
+ // "TestDelete has successfully been destroyed"));
clickIfVisible("link=Admin");
clickIfVisible(TAB_PORTALOBJ_ID);
- Assert.assertFalse(selenium.isTextPresent("TestDelete"));
+ Assert.assertFalse(selenium.isTextPresent(portalToDelete));
}
- @Test(enabled = true)
- public void testAddPage() {
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
+ public void testPortalProperties() {
+ // first create a portal
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -150,18 +222,206 @@
clickIfVisible(TAB_PORTALOBJ_ID);
clickIfVisible(LINK_PORTALS_ID);
- final String portalName = "TestAddPortal";
- final String portalPage = "tPage";
+ final String portalName = "TestProperties";
+ Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already exist.");
selenium.type(INPUT_PORTALNAME, portalName);
selenium.click(INPUT_SUBMIT_CREATEPORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
+ // then property it
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+
+ selenium.type(INPUT_PORTALNAME, portalName);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent(portalName));
+
int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+ selenium.click(MessageFormat.format(POR_TL_PROPERTIES, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // Event Listener Binding
+
+ selenium.select(SEL_PP_LISTENER, "label=release_sessions_listener_self");
+ selenium.click(SUB_PP_LISTENER);
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PP_LISTENER, "label=user_listener");
+ selenium.click(SUB_PP_LISTENER);
+ selenium.waitForPageToLoad("30000");
+
+ // Properties
+
+ final String propName1 = "viliamProp";
+ final String propVal1 = "hier!";
+ final String propName2 = "danielProp";
+ final String propVal2 = "ohne!";
+
+ selenium.type(INP_PP_PROPNAME, propName1);
+ selenium.click(SUB_PP_PROPADD);
+ selenium.waitForPageToLoad("30000");
+
+ r = findTableRow(TBL_PP_PROPS, propName1, 0) - 1;
+
+ selenium.type(MessageFormat.format(INP_PP_PROP_VAL,r), propVal1);
+ selenium.click(SUB_PP_PROPVAL_UPDATE);
+ selenium.waitForPageToLoad("30000");
+ selenium.type(INP_PP_PROPNAME, propName2);
+ selenium.click(SUB_PP_PROPADD);
+ selenium.waitForPageToLoad("30000");
+
+ r = findTableRow(TBL_PP_PROPS, propName2, 0) - 1;
+
+ selenium.type(MessageFormat.format(INP_PP_PROP_VAL,r), propVal2);
+ selenium.click(SUB_PP_PROPVAL_UPDATE);
+ selenium.waitForPageToLoad("30000");
+
+ r = findTableRow(TBL_PP_PROPS, propName1, 0) - 1;
+
+ selenium.click(MessageFormat.format(LNK_PP_PROP_DELETE,r));
+ selenium.waitForPageToLoad("30000");
+
+ // Portal & Page Error Handling
+
+ selenium.click(CHK_PP_UNAVAIL_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.click(CHK_PP_ACCESS_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.click(CHK_PP_ERROR_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.click(CHK_PP_INTERNAL_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.click(CHK_PP_NF_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.click(CHK_PP_RES_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PP_ACCESS_SELECT, "label=Redirect to the specified resource");
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PP_UNAVAIL_SELECT, "label=Redirect to the specified resource");
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PP_ERROR_SELECT, "label=Display the default error message");
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PP_INTERNAL_SELECT, "label=Display the default error message");
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PP_NF_SELECT, "label=Redirect to the specified resource");
+ selenium.waitForPageToLoad("30000");
+ selenium.type(INP_PP_RES_INPUT, "/WEB-INF/jsp/error/portalx.jsp");
+ selenium.click(SUB_PP_ERROR_FORM_UPDATE);
+ selenium.waitForPageToLoad("30000");
+
+ selenium.click(CHK_PPA_ACCESS_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.click(CHK_PPA_CONTROL_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.click(CHK_PPA_ERROR_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.click(CHK_PPA_INTERNAL_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.click(CHK_PPA_NF_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.click(CHK_PPA_RES_CHECK);
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PPA_ACCESS_SELECT, "label=Redirect to the specified resource");
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PPA_CONTROL_SELECT, "label=Redirect to the specified resource");
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PPA_ERROR_SELECT, "label=Display the default error message");
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PPA_INTERNAL_SELECT, "label=Display the default error message");
+ selenium.waitForPageToLoad("30000");
+ selenium.select(SEL_PPA_NF_SELECT, "label=Redirect to the specified resource");
+ selenium.waitForPageToLoad("30000");
+ selenium.type(INP_PPA_RES_SELECT, "/WEB-INF/jsp/error/pagey.jsp");
+ selenium.click(SUB_PPA_FORM_UPDATE);
+ selenium.waitForPageToLoad("30000");
+
+ // logout login and property again
+
+ logout();
+ login("admin","admin");
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+
+ selenium.type(INPUT_PORTALNAME, portalName);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent(portalName));
+
+ r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ selenium.click(MessageFormat.format(POR_TL_PROPERTIES, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // assert time!
+
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PP_LISTENER),"user_listener");
+
+ r = findTableRow(TBL_PP_PROPS, propName1, 0) - 1;
+ Assert.assertFalse(r>0, propName1+" was deleted previously but now it's found in property table");
+ r = findTableRow(TBL_PP_PROPS, propName2, 0) - 1;
+ Assert.assertEquals(selenium.getValue(MessageFormat.format(INP_PP_PROP_VAL,r)), propVal2, "previously changed value other than expected");
+
+ Assert.assertFalse(selenium.isChecked(CHK_PP_UNAVAIL_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PP_ACCESS_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PP_ERROR_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PP_INTERNAL_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PP_NF_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PP_RES_CHECK));
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PP_ACCESS_SELECT),"Redirect to the specified resource");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PP_UNAVAIL_SELECT),"Redirect to the specified resource");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PP_ERROR_SELECT),"Display the default error message");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PP_INTERNAL_SELECT),"Display the default error message");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PP_NF_SELECT),"Redirect to the specified resource");
+ Assert.assertEquals(selenium.getValue(INP_PP_RES_INPUT),"/WEB-INF/jsp/error/portalx.jsp");
+
+ Assert.assertFalse(selenium.isChecked(CHK_PPA_ACCESS_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PPA_CONTROL_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PPA_ERROR_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PPA_INTERNAL_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PPA_NF_CHECK));
+ Assert.assertFalse(selenium.isChecked(CHK_PPA_RES_CHECK));
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PPA_ACCESS_SELECT),"Redirect to the specified resource");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PPA_CONTROL_SELECT),"Redirect to the specified resource");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PPA_ERROR_SELECT),"Display the default error message");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PPA_INTERNAL_SELECT),"Display the default error message");
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_PPA_NF_SELECT),"Redirect to the specified resource");
+ Assert.assertEquals(selenium.getValue(INP_PPA_RES_SELECT),"/WEB-INF/jsp/error/pagey.jsp");
+
+ }
+
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate" })
+ public void testAddPage() {
+
+ final String portalName = "TestAddPagePortal";
+ final String portalPage = "tToAddPage";
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+
+ selenium.type(INPUT_PORTALNAME, portalName);
+ selenium.click(INPUT_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
selenium.click(MessageFormat.format(POR_TL_MAIN, r));
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertFalse(selenium.isTextPresent(portalPage), "Portal page already present");
Assert.assertTrue(selenium.isTextPresent("Create a page named:"));
@@ -171,17 +431,21 @@
Assert.assertTrue(selenium.isTextPresent(portalPage));
}
- @Test(enabled = true, dependsOnMethods = { "testAddPage" })
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate", "testAddPage" })
public void testRemovePage() {
- final String portalName = "TestAddPortal";
- final String portalPage = "tPage";
+ final String portalName = "TestRemovePagePortal";
+ final String portalPage = "tRemPage";
+ createPortal(portalName);
+ createPage(portalName, portalPage);
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
clickIfVisible(TAB_PORTALOBJ_ID);
clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
@@ -199,7 +463,7 @@
}
- @Test(enabled = true)
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate", "testAddPage" })
public void testCreateWindow() {
final String portalName = "toAddWindowPortal";
@@ -227,38 +491,43 @@
// click on the page layout
selenium.click(MessageFormat.format(PAG_TL_LAYOUT, r));
+
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ selenium.click("link=Who's online portlet");
selenium.waitForPageToLoad(PAGE_LOAD);
-
- selenium.click("link=Who's online portlet");
- selenium.waitForPageToLoad("30000");
-
selenium.type(INP_WINDOW_NAME, windowName);
-
+
selenium.click(SUB_LAYOUT_ADD_CENTER);
- selenium.waitForPageToLoad("30000");
+ selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent(windowName));
selenium.open("/portal/auth/portal/mimikry");
Assert.assertTrue(selenium.isTextPresent("Current users"));
}
-
- @Test(enabled = true, dependsOnMethods={"testPortalCreate"})
- public void testPageRename(){
+
+ @Test(enabled = true, dependsOnMethods = { "testPortalCreate", "testAddPage" })
+ public void testPageRename() {
String portalName = "TestPortal";
String pageName = "PageToRename";
-
+
createPage("TestPortal", "PageToRename");
-
+
openAndWait("/portal");
clickAndWait("link=Admin");
clickIfVisible(TAB_PORTALOBJ_ID);
clickIfVisible(LINK_PORTALS_ID);
- //selenium.setSpeed("8000");
- clickIfVisible(LINK_PORTAL_HOME ,"Create a portal named:");
-
+ // selenium.setSpeed("8000");
+ clickIfVisible(LINK_PORTAL_HOME);
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
@@ -270,20 +539,17 @@
}
@Test(enabled = false)
- public void testPageSecurity(){
-
+ public void testPageSecurity() {
}
-
+
@Test(enabled = false)
- public void testPageTheme(){
-
+ public void testPageTheme() {
}
-
+
@Test(enabled = false)
- public void testPageLayout(){
-
+ public void testPageLayout() {
}
-
+
private void createPortal(String name) {
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -318,5 +584,4 @@
selenium.waitForPageToLoad(PAGE_LOAD);
}
-
}
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -10,44 +10,47 @@
public class DashboardsTestCase extends JBossPortalSeleniumTestCase {
- private static final String T_DH_SUB_UPDATE = "//form[contains(@id,'common-edit-theme-form')]/input[@type='submit']";
- private static final String T_DH_SEL_RENDERSET = "//select[contains(@id,'common-edit-theme-form:renderSet')]";
- private static final String T_DH_SEL_THEME = "//select[contains(@id,'common-edit-theme-form:theme')]";
- private static final String T_DH_SEL_LAYOUT = "//select[contains(@id,'common-edit-theme-form:layout')]";
- private static final String T_PA_SUB_UPDATE = "//input[contains(@id,'common-edit-page-error-form:update')]";
- private static final String T_PO_SUB_UPDATE = "//input[contains(@id,'common-edit-portal-error-form:update')]";
- private static final String T_PA_INP_PAGEADD = "//input[contains(@id,'common-edit-page-error-form:page-res-select')]";
- private static final String T_PO_INP_PAGEADD = "//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]";
- private static final String T_PA_SEL_PNF = "//select[contains(@id,'common-edit-page-error-form:page-not-found-select')]";
- private static final String T_PA_SEL_INTERN = "//select[contains(@id,'common-edit-page-error-form:page-internal-select')]";
- private static final String T_PA_SEL_ERROR = "//select[contains(@id,'common-edit-page-error-form:page-error-select')]";
- private static final String T_PA_SEL_CONTROL = "//select[contains(@id,'common-edit-page-error-form:page-control-select')]";
- private static final String T_PA_SEL_ACCESS = "//select[contains(@id,'common-edit-page-error-form:page-access-select')]";
- private static final String T_PO_SEL_PNF = "//select[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]";
- private static final String T_PO_SEL_UNAVAIL = "//select[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]";
- private static final String T_PO_SEL_ACCESS = "//select[contains(@id,'common-edit-portal-error-form:portal-access-select')]";
- private static final String SUBMIT_UPDATE_VALUE = "//input[contains(@id,'common-manage-prop-form:update')]";
- private static final String TABLE_PROPS = "//table[contains(@id,'common-manage-prop-form:prop-data-table')]";
- private static final String T_PROPS_INPUT_VALUE = "//input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:prop-value-input'')]";
- private static final String T_PROPS_LINK_DEL = "//a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]";
+ public final String casePfx = "portal.dash.";
+
+ private final String T_DH_SUB_UPDATE = getProp(casePfx+"t.dh.sub.update","//form[contains(@id,'common-edit-theme-form')]/input[@type='submit']");
+ private final String T_DH_SEL_RENDERSET = getProp(casePfx+"t.dh.sel.renderset","//select[contains(@id,'common-edit-theme-form:renderSet')]");
+ private final String T_DH_SEL_THEME = getProp(casePfx+"t.dh.sel.theme","//select[contains(@id,'common-edit-theme-form:theme')]");
+ private final String T_DH_SEL_LAYOUT = getProp(casePfx+"t.dh.sel.layout","//select[contains(@id,'common-edit-theme-form:layout')]");
+ private final String T_PA_SUB_UPDATE = getProp(casePfx+"t.pa.sub.update","//input[contains(@id,'common-edit-page-error-form:update')]");
+ private final String T_PO_SUB_UPDATE = getProp(casePfx+"t.po.sub.update","//input[contains(@id,'common-edit-portal-error-form:update')]");
+ private final String T_PA_INP_PAGEADD = getProp(casePfx+"t.pa.inp.pageadd","//input[contains(@id,'common-edit-page-error-form:page-res-select')]");
+ private final String T_PO_INP_PAGEADD = getProp(casePfx+"t.po.inp.pageadd","//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]");
+ private final String T_PA_SEL_PNF = getProp(casePfx+"t.pa.sel.pnf","//select[contains(@id,'common-edit-page-error-form:page-not-found-select')]");
+ private final String T_PA_SEL_INTERN = getProp(casePfx+"t.pa.sel.intern","//select[contains(@id,'common-edit-page-error-form:page-internal-select')]");
+ private final String T_PA_SEL_ERROR = getProp(casePfx+"t.pa.sel.error","//select[contains(@id,'common-edit-page-error-form:page-error-select')]");
+ private final String T_PA_SEL_CONTROL = getProp(casePfx+"t.pa.sel.control","//select[contains(@id,'common-edit-page-error-form:page-control-select')]");
+ private final String T_PA_SEL_ACCESS = getProp(casePfx+"t.pa.sel.access","//select[contains(@id,'common-edit-page-error-form:page-access-select')]");
+ private final String T_PO_SEL_PNF = getProp(casePfx+"t.po.sel.pnf","//select[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]");
+ private final String T_PO_SEL_UNAVAIL = getProp(casePfx+"t.po.sel.unavail","//select[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]");
+ private final String T_PO_SEL_ACCESS = getProp(casePfx+"t.po.sel.access","//select[contains(@id,'common-edit-portal-error-form:portal-access-select')]");
+ private final String SUBMIT_UPDATE_VALUE = getProp(casePfx+"submit.update.value","//input[contains(@id,'common-manage-prop-form:update')]");
+ private final String TABLE_PROPS = getProp(casePfx+"table.props","//table[contains(@id,'common-manage-prop-form:prop-data-table')]");
+ private final String T_PROPS_INPUT_VALUE = getProp(casePfx+"t.props.input.value","//input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:prop-value-input'')]");
+ private final String T_PROPS_LINK_DEL = getProp(casePfx+"t.props.link.del","//a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]");
+ private final String TABLE_PA_ERR = getProp(casePfx+"table.pa.err","//form[@id='common-edit-page-error-form']/table");
+ private final String TABLE_PO_ERR = getProp(casePfx+"table.po.err","//form[@id='common-edit-portal-error-form']/table");
+ private final String TABLE_DH_THM = getProp(casePfx+"table.dh.thm","//form[@id='common-edit-theme-form']/table");
+ private final String INPUT_PROP_NAME = getProp(casePfx+"input.prop.name","//input[contains(@id,'common-edit-prop-form:property')]");
+ private final String SUBMIT_ADD_PROP = getProp(casePfx+"submit.add.prop","//input[contains(@id,'common-edit-prop-form:add-property')]");
+ private final String LINK_ADMIN = getProp(casePfx+"link.admin","link=Admin");
+ private final String LINK_TAB_DASH = getProp(casePfx+"link.tab.dash","//a[contains(@id,'admin-subtab-form:dashboard-link')]");
- private static final String TABLE_PA_ERR = "//form[@id='common-edit-page-error-form']/table";
- private static final String TABLE_PO_ERR = "//form[@id='common-edit-portal-error-form']/table";
- private static final String TABLE_DH_THM = "//form[@id='common-edit-theme-form']/table";
- private static final String INPUT_PROP_NAME = "//input[contains(@id,'common-edit-prop-form:property')]";
- private static final String SUBMIT_ADD_PROP = "//input[contains(@id,'common-edit-prop-form:add-property')]";
- private static final String LINK_ADMIN = "link=Admin";
- private static final String LINK_TAB_DASH = "//a[contains(@id,'admin-subtab-form:dashboard-link')]";
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
+ logoutIfPossible();
login("admin", "admin");
goToDash();
}
@AfterMethod(groups = { "log" })
public void logoutAfterTest() {
- logout();
+
}
@Test(enabled = true)
Copied: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java (from rev 12964, branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java)
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java (rev 0)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -0,0 +1,282 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.jboss.portal.test.selenium.portal;
+
+import java.text.MessageFormat;
+import org.jboss.portal.test.selenium.JBossPortalSeleniumTestCase;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
+ */
+@Test(groups = { "end2end" }, enabled = true, description = "Creating of new portal with content.")
+public class EndtoEndPortalAdminTestCase extends JBossPortalSeleniumTestCase {
+
+
+ public static String casePfx = "portal.e2e.";
+
+ private final String ADR_PORTAL = getProp(casePfx + "adr.home","/portal");
+ public final String SEL_PORTLET_TYPE = getProp(casePfx + "sel.portlet.type","//select[contains(@id,'windowForm:instanceId')]");
+ private final String SUB_LAYOUT_ADD_CENTER = getProp(casePfx + "sub.layout.add.center", "//input[contains(@id,'layoutForm:a_center')]");
+ private final String INP_WINDOW_NAME = getProp(casePfx + "inp.window.name", "//input[contains(@id,'windowForm:windowName')]");
+ private final String SUB_RENAME_PORTAL = getProp(casePfx + "sub.rename.portal", "//input[contains(@id,'renameForm:rename')]");
+ private final String INP_RENAME_PORTAL = getProp(casePfx + "inp.rename.portal", "//input[contains(@id,'renameForm:newName')]");
+ private final String SUB_DELETE_PORTAL_CONF = getProp(casePfx + "sub.delete.portal.conf", "//input[contains(@id,'delete-view:confirm-form:delete')]");
+ private final String INP_SUBMIT_PAGECREATE = getProp(casePfx + "inp.submit.pagecreate", "//input[contains(@id,'create-page-form:create-page')]");
+ private final String INP_PAGENAME = getProp(casePfx + "inp.pagename", "//input[contains(@id,'create-page-form:pageName')]");
+ private final String INP_PORTALNAME = getProp(casePfx + "inp.portalname", "//input[contains(@id,'create-portal-form:name')]");
+ private final String INP_SUBMIT_CREATEPORTAL = getProp(casePfx + "inp.submit.createportal", "//input[contains(@id,'create-portal-form:create-portal')]");
+ private final String TAB_PORTALOBJ_ID = getProp(casePfx + "tab.portalobj.id", "Link=Admin");
+ private final String LNK_PORTALS_ID = getProp(casePfx + "lnk.portals.id", "link=*Portal Objects*");
+ private final String LNK_PORTAL_HOME = getProp(casePfx + "lnk.portal.home", "//a[contains(@id,'obj-temp-form:object-link-0')]");
+ private final String TBL_PORTAL_ADMIN = getProp(casePfx + "tbl.portal.admin", "//table[contains(@id,'obj-nav-form:portal-datatable')]");
+ private final String POR_TL_MAIN = getProp(casePfx + "por.tl.main", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]");
+ private final String POR_TL_SECURITY = getProp(casePfx + "por.tl.security", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]");
+ private final String POR_TL_PROPERTIES = getProp(casePfx + "por.tl.properties", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]");
+ private final String POR_TL_THEME = getProp(casePfx + "por.tl.theme", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]");
+ private final String POR_TL_RENAME = getProp(casePfx + "por.tl.rename", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]");
+ private final String POR_TL_DELETE = getProp(casePfx + "por.tl.delete", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]");
+ private final String POR_TL_MAKEDEF = getProp(casePfx + "por.tl.makedef", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]");
+ private final String TBL_PORTALPAGE_ADMIN = getProp(casePfx + "tbl.portalpage.admin", "//table[contains(@id,'obj-nav-form:pages-datatable')]");
+ private final String PAG_TL_MAIN = getProp(casePfx + "pag.tl.main", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]");
+ private final String PAG_TL_LAYOUT = getProp(casePfx + "pag.tl.layout", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]");
+ private final String PAG_TL_SECURITY = getProp(casePfx + "pag.tl.security", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]");
+ private final String PAG_TL_PROPERTIES = getProp(casePfx + "pag.tl.properties", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]");
+ private final String PAG_TL_THEME = getProp(casePfx + "pag.tl.theme", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]");
+ private final String PAG_TL_RENAME = getProp(casePfx + "pag.tl.rename", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link'')]");
+ private final String PAG_TL_DISPLAY = getProp(casePfx + "pag.tl.display", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]");
+ private final String PAG_TL_DELETE = getProp(casePfx + "pag.tl.delete", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]");
+ private final String PAG_TL_MAKEDEF = getProp(casePfx + "pag.tl.makedef", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]");
+ private final String DIV_PORT_CONTENT = getProp(casePfx + "div.por.cont", "conrrerertent-container");
+ private final String INP_GOO_SEARCH = getProp(casePfx + "inp.goo.search", "//div[contains(@id,'directory_search_div')]/form/input[@name='query']");
+ private final String SUB_GOO_SEARCH = getProp(casePfx + "sup.goo.search", "//div[contains(@id,'directory_search_div')]/form/input[@type='submit']");
+ private final String INP_NET_SEARCH = getProp(casePfx + "inp.goo.search", "//div[contains(@id,'directory_search_div')]/form/input[@name='query']");
+ private final String SUB_NET_SEARCH = getProp(casePfx + "sub.goo.search", "//div[contains(@id,'directory_search_div')]/form/input[@type='submit']");
+
+ /*
+ * - create a new portal - add couple of page to the portal - add few
+ * portlets of different kinds (csm, widget, regular portlets) in each page
+ * - verify that new portal, pages and portlets get added correctly. - Make
+ * the new portal default and verify that it becomes default portal
+ */
+
+ @BeforeMethod(groups = { "log" })
+ public void loginBeforeTest() {
+ logoutIfPossible();
+ login("admin", "admin");
+ }
+
+ @AfterMethod(groups = { "log" })
+ public void logoutAfterTest() {
+ }
+
+ final String portalName = "UseCasePortal";
+ final String page1Name = "firstPage";
+ final String page2Name = "anotherPage";
+ final String page3Name = "lastPage with whitespace";
+ final String page4Name = "dseer";
+ final String page5Name = "cemese";
+ final String PORTLET1 = "Cart Portlet";
+ final String por1str = "Cart Portlet";
+ final String PORTLET2 = "Band Culinaria";
+ final String por2str = "Band Culinaria";
+ final String PORTLET3 = "Cahuete.com";
+ final String por3str = "Cahuete.com";
+ final String PORTLET4 = "dir1/foo.txt";
+ final String por4str = "File Portlet";
+ final String PORTLET5 = "default/project.html";
+ final String por5str = "Our wiki knowledge base";
+
+ @Test(enabled = true, description = "Usecase for creating small portal with content.")
+ public void testCreatePortalUsecase() {
+ createPortal(portalName);
+
+ addPage(page1Name);
+ addPage(page2Name);
+ addPage(page3Name);
+ addPage(page4Name);
+ addPage(page5Name);
+
+ addPortlet(portalName, page1Name, PORTLET1, "portlet");
+ addPortlet(portalName, page2Name, PORTLET2, "widget/google");
+ addPortlet(portalName, page3Name, PORTLET3, "widget/netvibes");
+ addPortlet(portalName, page4Name, PORTLET4, "filesystem");
+ addPortlet(portalName, page5Name, PORTLET5, "cms");
+
+ makeDefaultPortal(portalName);
+
+ // Assert the portal is default
+ selenium.open(ADR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertEquals("", selenium.getText(DIV_PORT_CONTENT));
+ Assert.assertTrue(selenium.isElementPresent("link=" + page1Name));
+ Assert.assertTrue(selenium.isElementPresent("link=" + page2Name));
+ Assert.assertTrue(selenium.isElementPresent("link=" + page3Name));
+ Assert.assertTrue(selenium.isElementPresent("link=" + page4Name));
+ Assert.assertTrue(selenium.isElementPresent("link=" + page5Name));
+
+ // Assert pages contain what they should
+ assertPageContains(page1Name, por1str);
+ assertPageContains(page2Name, por2str);
+ assertPageContains(page3Name, por3str);
+ assertPageContains(page4Name, por4str);
+ assertPageContains(page5Name, por5str);
+
+ }
+
+ public void testManagePortal(){
+
+ }
+
+ private void assertPageContains(String pageName, String awaitStr) {
+ selenium.open(ADR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=" + pageName);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent(awaitStr));
+ }
+
+ private void createPortal(String portalName) {
+ selenium.open(ADR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LNK_PORTALS_ID);
+ clickIfVisible(LNK_PORTAL_HOME);
+
+ Assert.assertFalse(selenium.isTextPresent(portalName), "Not created page already exist.");
+
+ selenium.type(INP_PORTALNAME, portalName);
+ selenium.click(INP_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isTextPresent(portalName));
+ }
+
+ private void addPage(String pageName) {
+ selenium.open(ADR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LNK_PORTALS_ID);
+ clickIfVisible(LNK_PORTAL_HOME);
+
+ selenium.type(INP_PORTALNAME, portalName);
+ selenium.click(INP_SUBMIT_CREATEPORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int r = findTableRow(TBL_PORTAL_ADMIN, portalName, 0) - 1;
+
+ selenium.click(MessageFormat.format(POR_TL_MAIN, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertFalse(selenium.isTextPresent(pageName), "Portal page already present");
+ Assert.assertTrue(selenium.isTextPresent("Create a page named:"));
+
+ selenium.type(INP_PAGENAME, pageName);
+ selenium.click(INP_SUBMIT_PAGECREATE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent(pageName));
+ }
+
+ private void addPortlet(String portalName, String pageName, String portletName, String type) {
+ selenium.open(ADR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LNK_PORTALS_ID);
+ clickIfVisible(LNK_PORTAL_HOME);
+
+ int r = findTableRow(TBL_PORTAL_ADMIN, portalName, 0) - 1;
+ selenium.click(MessageFormat.format(POR_TL_MAIN, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ r = findTableRow(TBL_PORTALPAGE_ADMIN, pageName, 0) - 1;
+
+ // click on the page layout
+ selenium.click(MessageFormat.format(PAG_TL_LAYOUT, r));
+
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ // hack
+ selenium.select(SEL_PORTLET_TYPE, "label=" + "cms");
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ selenium.select(SEL_PORTLET_TYPE, "label=" + type);
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ if ("portlet".equals(type)) {
+
+ } else if ("widget/google".equals(type)) {
+ selenium.type(INP_GOO_SEARCH, portletName);
+ selenium.click(SUB_GOO_SEARCH);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ } else if ("widget/netvibes".equals(type)) {
+ selenium.type(INP_NET_SEARCH, portletName);
+ selenium.click(SUB_NET_SEARCH);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ } else if ("cms".equals(type)) {
+ String[] links = portletName.split("/");
+ selenium.click("link="+links[0]);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ portletName = links[1];
+ } else if ("filesystem".equals(type)) {
+ String[] links = portletName.split("/");
+ selenium.click("link="+links[0]);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ portletName = links[1];
+ }
+
+ selenium.click("link=*" + portletName+"*");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(SUB_LAYOUT_ADD_CENTER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+
+ }
+
+ private void makeDefaultPortal(String portalName) {
+ selenium.open(ADR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LNK_PORTALS_ID);
+ clickIfVisible(LNK_PORTAL_HOME);
+
+ int r = findTableRow(TBL_PORTAL_ADMIN, portalName, 0) - 1;
+
+ selenium.click(MessageFormat.format(POR_TL_MAKEDEF, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
+}
Copied: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PageCoordinationTestCase.java (from rev 12964, branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PageCoordinationTestCase.java)
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PageCoordinationTestCase.java (rev 0)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PageCoordinationTestCase.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -0,0 +1,360 @@
+package org.jboss.portal.test.selenium.portal;
+
+import java.text.MessageFormat;
+
+import org.jboss.portal.test.selenium.JBossPortalSeleniumTestCase;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+public class PageCoordinationTestCase extends JBossPortalSeleniumTestCase {
+ private final String INP_ALIAS_REN = "//input[contains(@name,'renameForm:newName')]";
+ private final String SUB_ALIAS_RENAME_SUBMIT = "//input[contains(@name,'renameForm:j_id35')]";
+ private final String SUB_ALIAS_REN_CANCEL = "//input[contains(@name,'renameForm:j_id36')]";
+ private final String TBL_ALIASES = "//div[@id='aliasBindings']/form/div/table";
+ private final String LNK_T_ALIAS_RENAME = "//div[@id=''aliasBindings'']/form[2]/div/table/tbody/tr[{0}]/td[2]/table/tbody/tr/td[1]/a/span";
+ private final String LNK_T_ALIAS_DELETE = "//div[@id=''aliasBindings'']/form[2]/div/table/tbody/tr[{0}]/td[2]/table/tbody/tr/td[2]/a/span";
+ private final String SUB_ALIAS_DEL_SUBMIT = "_jbpnsAdminPortletWindowsnpbj:j_id47:j_id34:j_id40:j_id41";
+ private final String SUB_ALIAS_DEL_CANCEL = "_jbpnsAdminPortletWindowsnpbj:j_id47:j_id34:j_id40:j_id42";
+ private final String CHK_EXPL_WIR = "//input[contains(@id,'useExplicitEvents')]";
+ private final String CHK_PARAM_BIND = "//input[contains(@id,'useExplicitBinding')]";
+ private final String SUB_CREATE_ALIAS = "//input[contains(@name,'create-alias-form') and @type='submit'][1]";
+ private final String SUB_CREATE_ALIAS_CANCEL = "//input[contains(@name,'create-alias-form') and @type='submit'][2]";
+ private final String INP_ALIAS_NAME = "//input[contains(@id,'create-alias-form:aliasName')]";
+ private final String LIS_RENDER_PAR = "//select[contains(@id,'create-alias-form:alias')]";
+
+ public final String casePfx = "portal.admin.";
+
+ private final String LNK_PP_PROP_DELETE = getProp(casePfx+"lnk.pp.prop.delete","//a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]");
+ private final String SUB_PP_PROPVAL_UPDATE = getProp(casePfx+"sub.pp.propval.update","//input[contains(@id,'common-manage-prop-form:update')]");
+ private final String INP_PP_PROP_VAL = getProp(casePfx+"inp.pp.prop.val","//input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:prop-value-input'')]");
+ private final String SUB_PPA_FORM_UPDATE = getProp(casePfx+"sub.ppa.form.update","//input[contains(@id,'common-edit-page-error-form:update')]");
+ private final String INP_PPA_RES_SELECT = getProp(casePfx+"inp.ppa.res.select","//input[contains(@id,'common-edit-page-error-form:page-res-select')]");
+ private final String SEL_PPA_NF_SELECT = getProp(casePfx+"sel.ppa.nf.select","//select[contains(@id,'common-edit-page-error-form:page-not-found-select')]");
+ private final String SEL_PPA_INTERNAL_SELECT = getProp(casePfx+"sel.ppa.internal.select","//select[contains(@id,'common-edit-page-error-form:page-internal-select')]");
+ private final String SEL_PPA_ERROR_SELECT = getProp(casePfx+"sel.ppa.error.select","//select[contains(@id,'common-edit-page-error-form:page-error-select')]");
+ private final String SEL_PPA_CONTROL_SELECT = getProp(casePfx+"sel.ppa.control.select","//select[contains(@id,'common-edit-page-error-form:page-control-select')]");
+ private final String SEL_PPA_ACCESS_SELECT = getProp(casePfx+"sel.ppa.access.select","//select[contains(@id,'common-edit-page-error-form:page-access-select')]");
+ private final String CHK_PPA_RES_CHECK = getProp(casePfx+"chk.ppa.res.check","//input[contains(@id,'common-edit-page-error-form:page-res-check')]");
+ private final String CHK_PPA_NF_CHECK = getProp(casePfx+"chk.ppa.nf.check","//input[contains(@id,'common-edit-page-error-form:page-not-found-check')]");
+ private final String CHK_PPA_INTERNAL_CHECK = getProp(casePfx+"chk.ppa.internal.check","//input[contains(@id,'common-edit-page-error-form:page-internal-check')]");
+ private final String CHK_PPA_ERROR_CHECK = getProp(casePfx+"chk.ppa.error.check","//input[contains(@id,'common-edit-page-error-form:page-error-check')]");
+ private final String CHK_PPA_CONTROL_CHECK = getProp(casePfx+"chk.ppa.control.check","//input[contains(@id,'common-edit-page-error-form:page-control-check')]");
+ private final String CHK_PPA_ACCESS_CHECK = getProp(casePfx+"chk.ppa.access.check","//input[contains(@id,'common-edit-page-error-form:page-access-check')]");
+ private final String SUB_PP_ERROR_FORM_UPDATE = getProp(casePfx+"sub.pp.error.form.update","//input[contains(@id,'common-edit-portal-error-form:update')]");
+ private final String INP_PP_RES_INPUT = getProp(casePfx+"inp.pp.res.input","//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]");
+ private final String SEL_PP_NF_SELECT = getProp(casePfx+"sel.pp.nf.select","//select[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]");
+ private final String SEL_PP_INTERNAL_SELECT = getProp(casePfx+"sel.pp.internal.select","//select[contains(@id,'common-edit-portal-error-form:portal-internal-select')]");
+ private final String SEL_PP_ERROR_SELECT = getProp(casePfx+"sel.pp.error.select","//select[contains(@id,'common-edit-portal-error-form:portal-error-select')]");
+ private final String SEL_PP_UNAVAIL_SELECT = getProp(casePfx+"sel.pp.unavail.select","//select[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]");
+ private final String SEL_PP_ACCESS_SELECT = getProp(casePfx+"sel.pp.access.select","//select[contains(@id,'common-edit-portal-error-form:portal-access-select')]");
+ private final String CHK_PP_RES_CHECK = getProp(casePfx+"chk.pp.res.check","//input[contains(@id,'common-edit-portal-error-form:portal-res-check')]");
+ private final String CHK_PP_NF_CHECK = getProp(casePfx+"chk.pp.nf.check","//input[contains(@id,'common-edit-portal-error-form:portal-not-found-check')]");
+ private final String CHK_PP_INTERNAL_CHECK = getProp(casePfx+"chk.pp.internal.check","//input[contains(@id,'common-edit-portal-error-form:portal-internal-check')]");
+ private final String CHK_PP_ERROR_CHECK = getProp(casePfx+"chk.pp.error.check","//input[contains(@id,'common-edit-portal-error-form:portal-error-check')]");
+ private final String CHK_PP_ACCESS_CHECK = getProp(casePfx+"chk.pp.access.check","//input[contains(@id,'common-edit-portal-error-form:portal-access-check')]");
+ private final String CHK_PP_UNAVAIL_CHECK = getProp(casePfx+"chk.pp.unavail.check","//input[contains(@id,'common-edit-portal-error-form:portal-unavail-check')]");
+ private final String SUB_PP_PROPADD = getProp(casePfx+"sub.pp.propadd","//input[contains(@id,'common-edit-prop-form:add-property')]");
+ private final String INP_PP_PROPNAME = getProp(casePfx+"inp.pp.propname","//input[contains(@id,'common-edit-prop-form:property')]");
+ private final String SUB_PP_LISTENER = getProp(casePfx+"sub.pp.listener","//input[contains(@id,'edit-prop-form:update')]");
+ private final String SEL_PP_LISTENER = getProp(casePfx+"sel.pp.listener","//select[contains(@id,'edit-prop-form:listener')]");
+ private final String TBL_PP_PROPS = getProp(casePfx+"tbl.pp.props","//table[contains(@id,'common-manage-prop-form:prop-data-table')]");
+
+ private final String SUB_LAYOUT_ADD_CENTER = getProp(casePfx + "sub.layout.add.center", "//input[contains(@id,'layoutForm:a_center')]");
+ private final String INP_WINDOW_NAME = getProp(casePfx + "inp.window.name", "//input[contains(@id,'windowForm:windowName')]");
+ private final String SUBMIT_RENAME_PORTAL = getProp(casePfx + "submit.rename.portal", "//input[contains(@id,'renameForm:rename')]");
+ private final String INPUT_RENAME_PORTAL = getProp(casePfx + "input.rename.portal", "//input[contains(@id,'renameForm:newName')]");
+ private final String SUBMIT_DELETE_PORTAL_CONF = getProp(casePfx + "submit.delete.portal.conf", "//input[contains(@id,'delete-view:confirm-form:delete')]");
+ private final String INPUT_SUBMIT_PAGECREATE = getProp(casePfx + "input.submit.pagecreate", "//input[contains(@id,'create-page-form:create-page')]");
+ private final String INPUT_PAGENAME = getProp(casePfx + "input.pagename", "//input[contains(@id,'create-page-form:pageName')]");
+ private final String INPUT_PORTALNAME = getProp(casePfx + "input.portalname", "//input[contains(@id,'create-portal-form:name')]");
+ private final String INPUT_SUBMIT_CREATEPORTAL = getProp(casePfx + "input.submit.createportal", "//input[contains(@id,'create-portal-form:create-portal')]");
+ private final String TAB_PORTALOBJ_ID = getProp(casePfx + "tab.portalobj.id", "Link=Admin");
+ private final String LINK_PORTALS_ID = getProp(casePfx + "link.portals.id", "link=*Portal Objects*");
+ private final String LINK_PORTAL_HOME = getProp(casePfx + "link.portal.home", "//a[contains(@id,'obj-temp-form:object-link-0')]");
+ private final String TABLE_PORTAL_ADMIN = getProp(casePfx + "table.portal.admin", "//table[contains(@id,'obj-nav-form:portal-datatable')]");
+ private final String POR_TL_MAIN = getProp(casePfx + "por.tl.main", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:object-iid-link'')]");
+ private final String POR_TL_SECURITY = getProp(casePfx + "por.tl.security", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:security-link'')]");
+ private final String POR_TL_PROPERTIES = getProp(casePfx + "por.tl.properties", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:prop-link'')]");
+ private final String POR_TL_THEME = getProp(casePfx + "por.tl.theme", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:theme-link'')]");
+ private final String POR_TL_RENAME = getProp(casePfx + "por.tl.rename", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:rename'')]");
+ private final String POR_TL_DELETE = getProp(casePfx + "por.tl.delete", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:delete'')]");
+ private final String POR_TL_MAKEDEF = getProp(casePfx + "por.tl.makedef", "//a[contains(@id,''obj-nav-form:portal-datatable:{0}:default-link'')]");
+ private final String TABLE_PORTALPAGE_ADMIN = getProp(casePfx + "table.portalpage.admin", "//table[contains(@id,'obj-nav-form:pages-datatable')]");
+ private final String PAG_TL_MAIN = getProp(casePfx + "pag.tl.main", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:object-link'')]");
+ private final String PAG_TL_LAYOUT = getProp(casePfx + "pag.tl.layout", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:edit-page-layout'')]");
+ private final String PAG_TL_SECURITY = getProp(casePfx + "pag.tl.security", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:security-link'')]");
+ private final String PAG_TL_PROPERTIES = getProp(casePfx + "pag.tl.properties", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:prop-link'')]");
+ private final String PAG_TL_COORDINATION = getProp(casePfx + "pag.tl.coord", "//a[contains(@id,''pages-datatable:{0}:edit-coord'')]");
+ private final String PAG_TL_THEME = getProp(casePfx + "pag.tl.theme", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:theme-link'')]");
+ private final String PAG_TL_RENAME = getProp(casePfx + "pag.tl.rename", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-link'')]");
+ private final String PAG_TL_DISPLAY = getProp(casePfx + "pag.tl.display", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:rename-display'')]");
+ private final String PAG_TL_DELETE = getProp(casePfx + "pag.tl.delete", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:delete-link'')]");
+ private final String PAG_TL_MAKEDEF = getProp(casePfx + "pag.tl.makedef", "//a[contains(@id,''obj-nav-form:pages-datatable:{0}:default-link'')]");
+
+ @BeforeMethod(groups = { "log" })
+ public void loginBeforeTest() {
+ logoutIfPossible();
+ login("admin", "admin");
+ }
+
+ @AfterMethod(groups = { "log" })
+ public void logoutAfterTest() {
+ }
+
+
+ @Test(enabled = true)
+ public void testDefaultPageCoordination(){
+ openAndWait("/portal/auth/portal/default/Coordination+Samples");
+ Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):null"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):null"));
+
+ openAndWait("/portal/auth/portal/default/Coordination+Samples?zipcode=10101");
+ Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):null"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):10101"));
+
+ openAndWait("/portal/auth/portal/default/Coordination+Samples?zip=10102");
+ Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):10102"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):10102"));
+
+ openAndWait("/portal/auth/portal/default/Coordination+Samples?zipcode=10103");
+ Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):10102"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):10103"));
+ }
+
+ @Test(enabled = true)
+ public void testPageCoordination(){
+ String portalName = "default";
+ String pageName = "Coordination Samples";
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(PAG_TL_COORDINATION, r));
+
+ // create alias
+ selenium.addSelection(LIS_RENDER_PAR, "label=zipcode");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INP_ALIAS_NAME, "aliasBindTest");
+ selenium.click(SUB_CREATE_ALIAS_CANCEL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.addSelection(LIS_RENDER_PAR, "label=zipcode");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INP_ALIAS_NAME, "aliasBindTest");
+ selenium.click(SUB_CREATE_ALIAS);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ openAndWait("/portal/auth/portal/default/Coordination+Samples?aliasBindTest=222333");
+ Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):null"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):222333"));
+
+ }
+
+ @Test(enabled = true)
+ public void testDeleteAlias(){
+ String portalName = "default";
+ String pageName = "Coordination Samples";
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(PAG_TL_COORDINATION, r));
+ // selenium.setSpeed("5000");
+ // create delete alias
+ selenium.addSelection(LIS_RENDER_PAR, "label={urn:jboss:portal:samples:coor}zipcode");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INP_ALIAS_NAME, "aliasBindDelete");
+
+ selenium.click(SUB_CREATE_ALIAS);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // delete alias
+ r = findTableRow(TBL_ALIASES, "aliasBindDelete", 0);
+
+ selenium.click(MessageFormat.format(LNK_T_ALIAS_DELETE,r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(SUB_ALIAS_DEL_CANCEL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ r = findTableRow(TBL_ALIASES, "aliasBindDelete", 0);
+
+ selenium.click(MessageFormat.format(LNK_T_ALIAS_DELETE,r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(SUB_ALIAS_DEL_SUBMIT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ openAndWait("/portal/auth/portal/default/Coordination+Samples?zip=222333");
+ Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):222333"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):222333"));
+
+ openAndWait("/portal/auth/portal/default/Coordination+Samples?aliasBindDelete=222334");
+ Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):222333"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):222333"));
+ }
+
+ @Test(enabled = true)
+ public void testRenameAlias(){
+ String portalName = "default";
+ String pageName = "Coordination Samples";
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(PAG_TL_COORDINATION, r));
+
+ // create rename alias
+ selenium.addSelection(LIS_RENDER_PAR, "label={urn:jboss:portal:samples:coor}zipcode");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INP_ALIAS_NAME, "aliasBingRename");
+
+ selenium.click(SUB_CREATE_ALIAS);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // rename alias
+ r = findTableRow(TBL_ALIASES, "aliasBingRename", 0);
+
+ selenium.click(MessageFormat.format(LNK_T_ALIAS_RENAME,r));
+
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click(SUB_ALIAS_REN_CANCEL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ r = findTableRow(TBL_ALIASES, "aliasBingRename", 0);
+
+ selenium.click(MessageFormat.format(LNK_T_ALIAS_RENAME,r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(INP_ALIAS_REN, "aliasBindWasRenamed");
+ selenium.click(SUB_ALIAS_RENAME_SUBMIT);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ openAndWait("/portal/auth/portal/default/Coordination+Samples?zip=222333");
+ Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):222333"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):222333"));
+
+ openAndWait("/portal/auth/portal/default/Coordination+Samples?aliasBindWasRenamed=222334");
+ Assert.assertTrue(selenium.isTextPresent("Weather for (my_zipcode):222334"));
+ Assert.assertTrue(selenium.isTextPresent("Map for (your_zipcode):222333"));
+ }
+
+ @Test(enabled = true)
+ public void testParamBinding(){
+ String portalName = "default";
+ String pageName = "Coordination Samples";
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(PAG_TL_COORDINATION, r));
+
+ // parameter binding
+ selenium.click(CHK_PARAM_BIND);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ logout();
+ login("admin","admin");
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
+ r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(PAG_TL_COORDINATION, r));
+
+ Assert.assertTrue(selenium.isChecked(CHK_PARAM_BIND));
+ }
+
+ @Test(enabled = true)
+ public void testExplicitWiring(){
+ String portalName = "default";
+ String pageName = "Coordination Samples";
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
+ int r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(PAG_TL_COORDINATION, r));
+
+ // explicit wiring
+ selenium.click(CHK_EXPL_WIR);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ logout();
+ login("admin","admin");
+
+ openAndWait("/portal");
+ clickAndWait("link=Admin");
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+ clickIfVisible(LINK_PORTAL_HOME);
+ Assert.assertTrue(selenium.isTextPresent("Create a portal named:"));
+ r = findTableRow(TABLE_PORTAL_ADMIN, portalName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(POR_TL_MAIN, r));
+
+ r = findTableRow(TABLE_PORTALPAGE_ADMIN, pageName, 0) - 1;
+
+ clickAndWait(MessageFormat.format(PAG_TL_COORDINATION, r));
+
+ Assert.assertTrue(selenium.isChecked(CHK_EXPL_WIR));
+ }
+}
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletDefinitionsTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletDefinitionsTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletDefinitionsTestCase.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -10,21 +10,25 @@
public class PortletDefinitionsTestCase extends JBossPortalSeleniumTestCase{
- private static final String T_LINK_PREF = "//a[contains(@id,''def-list:portlet-pref-{0}'')]";
- private static final String SUBMIT_CREATE_INST = "//input[contains(@name,'add_instance_form:j_id19')]";
- private static final String INPUT_INSTANCE_NAME = "//input[contains(@id,'add_instance_form:instanceId')]";
- private static final String T_LINK_CREATE = "//a[contains(@id,''def-list:create-instance-{0}'')]";
- private static final String SUBMIT_PROVIDER_VIEW = "//input[contains(@id,'definition-form:view-portlets')]";
- private static final String SELECT_PROVIDER = "//select[contains(@id,'definition-form:menu')]";
- private static final String TABLE_PORTLET = "//form[contains(@id,'def-list')]/table";
- private static final String LINK_NAME_ADMIN_PORT = "//a[contains(@id,'common-show-portlet-detail-form:field1:select')]";
- private static final String LINK_ADMIN_PORT = "//a[contains(@id,'def-list:portlet-def-0')]";
- private static final String LINK_ADMIN = "link=Admin";
- private static final String LINK_TAB_PD = "//a[contains(@id,'admin-subtab-form:portlet-def-link')]";
- private static final String LINK_PD_MAIN = "//a[contains(@id,'man-form:def-link')]";
+ public final String casePfx = "portal.port.def.";
+ private final String T_LINK_PREF = getProp(casePfx+"t.link.pref","//a[contains(@id,''def-list:portlet-pref-{0}'')]");
+ private final String SUBMIT_CREATE_INST = getProp(casePfx+"submit.create.inst","//input[contains(@name,'add_instance_form:j_id19')]");
+ private final String INPUT_INSTANCE_NAME = getProp(casePfx+"input.instance.name","//input[contains(@id,'add_instance_form:instanceId')]");
+ private final String T_LINK_CREATE = getProp(casePfx+"t.link.create","//a[contains(@id,''def-list:create-instance-{0}'')]");
+ private final String SUBMIT_PROVIDER_VIEW = getProp(casePfx+"submit.provider.view","//input[contains(@id,'definition-form:view-portlets')]");
+ private final String SELECT_PROVIDER = getProp(casePfx+"select.provider","//select[contains(@id,'definition-form:menu')]");
+ private final String TABLE_PORTLET = getProp(casePfx+"table.portlet","//form[contains(@id,'def-list')]/table");
+ private final String LINK_NAME_ADMIN_PORT = getProp(casePfx+"link.name.admin.port","//a[contains(@id,'common-show-portlet-detail-form:field1:select')]");
+ private final String LINK_ADMIN_PORT = getProp(casePfx+"link.admin.port","//a[contains(@id,'def-list:portlet-def-0')]");
+ private final String LINK_ADMIN = getProp(casePfx+"link.admin","link=Admin");
+ private final String LINK_TAB_PD = getProp(casePfx+"link.tab.pd","//a[contains(@id,'admin-subtab-form:portlet-def-link')]");
+ private final String LINK_PD_MAIN = getProp(casePfx+"link.pd.main","//a[contains(@id,'man-form:def-link')]");
+
+
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
+ logoutIfPossible();
login("admin", "admin");
goToPD();
}
@@ -60,6 +64,20 @@
}
@Test(enabled = true)
+ public void testCreateInstanceUncommonName(){
+
+ int r = findTableRow(TABLE_PORTLET, "Administration Portlet", 0);
+
+ selenium.click(MessageFormat.format(T_LINK_CREATE,r-1));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.type(INPUT_INSTANCE_NAME, "str.nge.n.me");
+ selenium.click(SUBMIT_CREATE_INST);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("str.nge.n.me"+" portlet details"));
+ }
+
+ @Test(enabled = true)
public void testPreferences(){
int r = findTableRow(TABLE_PORTLET, "Current Users Portlet", 0);
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/PortletInstancesTestCase.java 2009-03-06 23:23:00 UTC (rev 12987)
@@ -10,53 +10,66 @@
public class PortletInstancesTestCase extends JBossPortalSeleniumTestCase {
- private static final String SUBMIT_SECURITY_UPDATE = "common-edit-security-form:update";
- private static final String SUBMIT_SECURITY_CANCEL = "common-edit-security-form:cancel";
+ public final String casePfx = "portal.port.ins.";
- private static final String LINK_PREF_WELCOMEPORT = "instances-form:security-JSPPortletInstance";
+ private final String TAB_PORTLET_INSTANCES = getProp(casePfx + "tab.portlet.instances", "//table[contains(@id,'instancesTable2')]");
+ private final String UL_PAGINATOR = getProp(casePfx + "ul.paginator", "//ul[@class='pagination property-container']");
+ private final String SUBMIT_SECURITY_UPDATE = getProp(casePfx + "submit.security.update", "//input[contains(@id,'common-edit-security-form:update')]");
+ private final String SUBMIT_SECURITY_CANCEL = getProp(casePfx + "submit.security.cancel", "//input[contains(@id,'common-edit-security-form:cancel')]");
+ private final String LINK_20_PAGE = getProp(casePfx + "link.20.page", "link=20");
+ private final String LINK_PREF_WELCOMEPORT = getProp(casePfx + "link.pref.welcomeport", "//a[contains(@id,'security-JSPPortletInstance')]");
+ private final String TABLE_PREF_KEY = getProp(casePfx + "table.pref.key", "//form[contains(@id,'common-edit-pref-form')]/table");
+ private final String SUBMIT_PREF_DELETE = getProp(casePfx + "submit.pref.delete", "//input[contains(@id,'common-edit-exisiting-form:row_0')]");
+ private final String LINK_PREF_GUESTNUM = getProp(casePfx + "link.pref.guestnum", "//a[contains(@id,'common-edit-pref-form:pref-link-0')]");
+ private final String INPUT_PREF_NEWVAL = getProp(casePfx + "input.pref.newval", "//input[contains(@id,'common-append-form:new_value')]");
+ private final String SUBMIT_PREF_UPDATE = getProp(casePfx + "submit.pref.update", "//input[contains(@id,'common-append-form:append-button')]");
+ private final String SUBMIT_PREF_SAVE = getProp(casePfx + "submit.pref.save", "//input[contains(@id,':save')]");
+ private final String INPUT_PREF_UPDATE = getProp(casePfx + "input.pref.update", "//input[contains(@id,'common-edit-exisiting-form:update')]");
+ private final String INPUT_PREF_APPEND = getProp(casePfx + "input.pref.append", "//input[contains(@id,'common-edit-exisiting-form:pref-input-0')]");
+ private final String SUBMIT_PREF_CANCEL = getProp(casePfx + "submit.pref.cancel", "//input[contains(@id,':cancel')]");
+ private final String LINK_CURUSER_PREFERENCES = getProp(casePfx + "link.curuser.preferences","//a[contains(@id,'instances-form:preference-CurrentUsersPortletInstance')]");
+ private final String LINK_DEL_EXCEPTPORT = getProp(casePfx + "link.del.exceptport", "//a[contains(@id,'instances-form:delete-GoogleMapPortletInstance')]");
+ private final String SUBMIT_PI_DELETE_CONF = getProp(casePfx + "submit.pi.delete.conf", "//input[contains(@id,'confirm-delete-form1:delete')]");
+ private final String SUBMIT_PI_DELETE_CANC = getProp(casePfx + "submit.pi.delete.canc", "//input[contains(@id,'confirm-delete-form1:cancel')]");
+ private final String T_LINK_DELETENAME = getProp(casePfx + "t.link.deletename","//a[contains(@id,''instance-display-form:locale-datatable:{0}:delete-link'')]");
+ private final String T_LINK_MODIFYNAME = getProp(casePfx + "t.link.modifyname","//a[contains(@id,''instance-display-form:locale-datatable:{0}:edit-link'')]");
+ private final String LINK_COUNTPORT = getProp(casePfx + "link.countport", "//a[contains(@id,'instances-form:CurrentUsersPortletInstance')]");
+ private final String NAME_COUNTPORT = getProp(casePfx + "name.countport", "CurrentUsersPortletInstance");
+ private final String SUBMIT_MODIFY_NAME = getProp(casePfx + "submit.modify.name", "//input[contains(@id,'add-display-name-form:addDisplay')]");
+ private final String INPUT_NAME = getProp(casePfx + "input.name", "//input[contains(@id,'add-display-name-form:newName')]");
+ private final String SELECT_LANGUAGE = getProp(casePfx + "select.language", "//select[contains(@id,'add-display-name-form:locales')]");
+ private final String LINK_ADMIN = getProp(casePfx + "link.admin", "link=Admin");
+ private final String LINK_TAB_PI = getProp(casePfx + "link.tab.pi", "//a[contains(@id,'admin-subtab-form:portlet-instance-link')]");
+ private final String LINK_PI_MAIN = getProp(casePfx + "link.pi.main", "//a[contains(@id,'instance-form1:instance-link')]");
+ private final String TABLE_DISPNAMES = getProp(casePfx + "table.dispnames", "//table[contains(@id,'instance-display-form:locale-datatable')]");
+ private final String LNK_SEC_BUTTON = getProp(casePfx + "lnk.sec.button","//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''Security'')]");
+ private final String LNK_PREF_BUTTON = getProp(casePfx + "lnk.pref.button","//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''actionPreferences'')]");
+ private final String LNK_DEL_BUTTON = getProp(casePfx + "lnk.del.button","//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td/table/tbody/tr/td/a[contains(@class,''actionDeleteInstance'')]");
+ private final String LNK_INSTANCE_BUTTON = getProp(casePfx + "lnk.instance.button", "//table[contains(@id,''instancesTable2'')]/tbody/tr[{0}]/td[1]/a[1]");
- private static final String TABLE_PREF_KEY = "//form[@id='common-edit-pref-form']/table";
+ // private final String LNK_PREF_WELCOMEPORT =
+ // "//a[contains(@id,'security-JSPPortletInstance')]";
- private static final String SUBMIT_PREF_DELETE = "common-edit-exisiting-form:row_0";
- private static final String LINK_PREF_GUESTNUM = "common-edit-pref-form:pref-link-0";
- private static final String INPUT_PREF_NEWVAL = "common-append-form:new_value";
- private static final String SUBMIT_PREF_UPDATE = "common-append-form:append-button";
- private static final String SUBMIT_PREF_SAVE = "_id919jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:save";
- private static final String INPUT_PREF_UPDATE = "common-edit-exisiting-form:update";
- private static final String INPUT_PREF_APPEND = "common-edit-exisiting-form:pref-input-0";
- private static final String SUBMIT_PREF_CANCEL = "_id458jbpns_2fadmin_2fdefault_2fAdminPortletWindowsnpbj:cancel";
- private static final String LINK_CURUSER_PREFERENCES = "instances-form:preference-CurrentUsersPortletInstance";
- private static final String LINK_DEL_EXCEPTPORT = "instances-form:delete-ExceptionPortletInstance";
- private static final String SUBMIT_PI_DELETE_CONF = "confirm-delete-form1:delete";
- private static final String SUBMIT_PI_DELETE_CANC = "confirm-delete-form1:cancel";
- private static final String T_LINK_DELETENAME = "displaynamecontainer:instance-display-form:locale-data-table:{0}:delete-link";
- private static final String T_LINK_MODIFYNAME = "displaynamecontainer:instance-display-form:locale-data-table:{0}:edit-link";
- private static final String LINK_COUNTPORT = "instances-form:CounterPortletInstance";
- private static final String SUBMIT_MODIFY_NAME = "displaynamecontainer:displayNameForm:addDisplay";
- private static final String INPUT_NAME = "displaynamecontainer:displayNameForm:newName";
- private static final String SELECT_LANGUAGE = "displaynamecontainer:displayNameForm:locales";
- private static final String LINK_ADMIN = "link=Admin";
- private static final String LINK_TAB_PI = "admin-subtab-form:portlet-instance-link";
- private static final String LINK_PI_MAIN = "instance-form1:instance-link";
- private static final String TABLE_DISPNAMES = "displaynamecontainer:instance-display-form:locale-data-table";
-
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
+ logoutIfPossible();
login("admin", "admin");
goToPI();
}
@AfterMethod(groups = { "log" })
public void logoutAfterTest() {
- logout();
+
}
@Test(enabled = true)
public void testAddName() {
- clickAndWait(LINK_COUNTPORT);
-
- safeSelect(SELECT_LANGUAGE, "Czech");
- final String name = "Administracny";
+ int r = traversePortlets(NAME_COUNTPORT, 0);
+ clickAndWait(MessageFormat.format(LNK_INSTANCE_BUTTON, r));
+
+ safeSelect(SELECT_LANGUAGE, "English");
+
+ final String name = "Administracning";
selenium.type(INPUT_NAME, name);
clickAndWait(SUBMIT_MODIFY_NAME);
Assert.assertTrue(findTableRow(TABLE_DISPNAMES, name, 1) >= 0);
@@ -65,7 +78,9 @@
@Test(enabled = true)
public void testDeleteName() {
// adding the name
- selenium.click(LINK_COUNTPORT);
+ int r = traversePortlets(NAME_COUNTPORT, 0);
+ clickAndWait(MessageFormat.format(LNK_INSTANCE_BUTTON, r));
+
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.select(SELECT_LANGUAGE, "label=Japanese");
final String name = "Aduminu";
@@ -75,7 +90,7 @@
// deleting name
- int r = findTableRow(TABLE_DISPNAMES, name, 1);
+ r = findTableRow(TABLE_DISPNAMES, name, 1);
selenium.click(MessageFormat.format(T_LINK_DELETENAME, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -85,9 +100,9 @@
@Test(enabled = true)
public void testModifyName() {
- // adding the name
- selenium.click(LINK_COUNTPORT);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ int r = traversePortlets(NAME_COUNTPORT, 0);
+ clickAndWait(MessageFormat.format(LNK_INSTANCE_BUTTON, r));
+
selenium.select(SELECT_LANGUAGE, "label=Japanese");
final String name = "Adminisimo";
final String nameNew = "Adminiprisimo";
@@ -98,7 +113,7 @@
// midifying name
- int r = findTableRow(TABLE_DISPNAMES, name, 1);
+ r = findTableRow(TABLE_DISPNAMES, name, 1);
selenium.click(MessageFormat.format(T_LINK_MODIFYNAME, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -112,86 +127,137 @@
@Test(enabled = true)
public void testSecure() {
- // "common-edit-security-form:cancel"
- selenium.click(LINK_PREF_WELCOMEPORT);
- selenium.waitForPageToLoad("30000");
- selenium.click("//input[@name='common-edit-security-form:cars_2']");
- selenium.click("//input[@name='common-edit-security-form:cars_1']");
- selenium.click("//input[@name='common-edit-security-form:cars_0']");
- selenium.click("//input[@name='common-edit-security-form:cars_0' and @value='admin']");
- selenium.click("//input[@name='common-edit-security-form:cars_1' and @value='admin']");
- selenium.click("//input[@name='common-edit-security-form:cars_2' and @value='admin']");
+ String instance_name = "JSPPortletInstance";
+ // String table = TAB_PORTLET_INSTANCES;
+
+ // selenium.click(LINK_20_PAGE);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // int r = findTableRow(table, instance_name, 0);
+ int r = traversePortlets(instance_name, 0);
+ selenium.click(MessageFormat.format(LNK_SEC_BUTTON, r));
+
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("//input[contains(@name,'common-edit-security-form:cars_2')]");
+ selenium.click("//input[contains(@name,'common-edit-security-form:cars_1')]");
+ selenium.click("//input[contains(@name,'common-edit-security-form:cars_0')]");
+ selenium.click("//input[contains(@name,'common-edit-security-form:cars_0') and @value='admin']");
+ selenium.click("//input[contains(@name,'common-edit-security-form:cars_1') and @value='admin']");
+ selenium.click("//input[contains(@name,'common-edit-security-form:cars_2') and @value='admin']");
selenium.click(SUBMIT_SECURITY_UPDATE);
- selenium.waitForPageToLoad("30000");
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.open("/portal/auth/portal/default/");
- selenium.waitForPageToLoad("30000");
+ selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Greetings !"));
// then cancel
- selenium.click("link=Admin");
- selenium.waitForPageToLoad("30000");
- selenium.click(LINK_PREF_WELCOMEPORT);
- selenium.waitForPageToLoad("30000");
- selenium.click("//input[@name='common-edit-security-form:cars_0']");
- selenium.click("//input[@name='common-edit-security-form:cars_1' and @value='admin']");
- selenium.click("//input[@name='common-edit-security-form:cars_0' and @value='admin']");
- selenium.click("//input[@name='common-edit-security-form:cars_2' and @value='admin']");
- selenium.click("//input[@name='common-edit-security-form:cars_1']");
+
+ goToPI();
+ // selenium.click(LINK_20_PAGE);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // r = findTableRow(table, instance_name, 0);
+ r = traversePortlets(instance_name, 0);
+
+ selenium.click(MessageFormat.format(LNK_SEC_BUTTON, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("//input[contains(@name,'common-edit-security-form:cars_0')]");
+ selenium.click("//input[contains(@name,'common-edit-security-form:cars_1') and @value='admin']");
+ selenium.click("//input[contains(@name,'common-edit-security-form:cars_0') and @value='admin']");
+ selenium.click("//input[contains(@name,'common-edit-security-form:cars_2') and @value='admin']");
+ selenium.click("//input[contains(@name,'common-edit-security-form:cars_1')]");
selenium.click(SUBMIT_SECURITY_CANCEL);
- selenium.waitForPageToLoad("30000");
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.open("/portal/auth/portal/default/");
- selenium.waitForPageToLoad("30000");
+ selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Greetings !"));
// then really stop the greetings portlet
- selenium.click("link=Admin");
- selenium.waitForPageToLoad("30000");
- selenium.click(LINK_PREF_WELCOMEPORT);
- selenium.waitForPageToLoad("30000");
- selenium.click("//input[@name='common-edit-security-form:cars_0']");
- selenium.click("//input[@name='common-edit-security-form:cars_1' and @value='admin']");
- selenium.click("//input[@name='common-edit-security-form:cars_0' and @value='admin']");
- selenium.click("//input[@name='common-edit-security-form:cars_2' and @value='admin']");
- selenium.click("//input[@name='common-edit-security-form:cars_1']");
+ goToPI();
+ // selenium.setSpeed("5000");
+ // selenium.click(LINK_20_PAGE);
+ // selenium.waitForPageToLoad(PAGE_LOAD);
+ // r = findTableRow(table, instance_name, 0);
+ r = traversePortlets(instance_name, 0);
+ selenium.click(MessageFormat.format(LNK_SEC_BUTTON, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("//input[contains(@name,'common-edit-security-form:cars_0')]");
+ selenium.click("//input[contains(@name,'common-edit-security-form:cars_1') and @value='admin']");
+ selenium.click("//input[contains(@name,'common-edit-security-form:cars_0') and @value='admin']");
+ selenium.click("//input[contains(@name,'common-edit-security-form:cars_2') and @value='admin']");
+ selenium.click("//input[contains(@name,'common-edit-security-form:cars_1')]");
selenium.click(SUBMIT_SECURITY_UPDATE);
- selenium.waitForPageToLoad("30000");
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.open("/portal/auth/portal/default/");
- selenium.waitForPageToLoad("30000");
+ selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertFalse(selenium.isTextPresent("Greetings !"));
}
@Test(enabled = true)
public void testDeleteInstance() {
// cancel first
- Assert.assertTrue(selenium.isElementPresent(LINK_DEL_EXCEPTPORT), "Exception portlet not found.");
- selenium.click(LINK_DEL_EXCEPTPORT);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ String instance_name = "WeatherPortletInstance";
+ // selenium.setSpeed("5000");
+ int r = traversePortlets(instance_name, 1);
+
+ Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(LNK_INSTANCE_BUTTON, r)), instance_name + " portlet not found.");
+ clickAndWait(MessageFormat.format(LNK_DEL_BUTTON, r));
+
Assert.assertTrue(selenium.isTextPresent("WARNING!"));
Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this portlet instance ?"));
selenium.click(SUBMIT_PI_DELETE_CANC);
selenium.waitForPageToLoad(PAGE_LOAD);
+
// delete
goToPI();
- Assert.assertTrue(selenium.isElementPresent(LINK_DEL_EXCEPTPORT), "Exception portlet not found.");
- selenium.click(LINK_DEL_EXCEPTPORT);
- selenium.waitForPageToLoad(PAGE_LOAD);
+ r = traversePortlets(instance_name, 1);
+ Assert.assertTrue(selenium.isElementPresent(MessageFormat.format(LNK_INSTANCE_BUTTON, r)), instance_name + " portlet not found.");
+ clickAndWait(MessageFormat.format(LNK_DEL_BUTTON, r));
+
Assert.assertTrue(selenium.isTextPresent("WARNING!"));
Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this portlet instance ?"));
selenium.click(SUBMIT_PI_DELETE_CONF);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertFalse(selenium.isElementPresent(LINK_DEL_EXCEPTPORT), "Exception portlet found after deletition.");
+
+ r = traversePortlets(instance_name, 1);
+ Assert.assertFalse(selenium.isElementPresent(MessageFormat.format(LNK_INSTANCE_BUTTON, r)), "previously deleted " + instance_name + " portlet found.");
+
}
+
+ @Test(enabled = true)
+ public void testPaginator() {
+ int r = countTableRows(TAB_PORTLET_INSTANCES);
+
+ String pages[] = getPages(UL_PAGINATOR);
+ for (String page : pages) {
+ if ("".equals(page.trim()))
+ continue;
+ selenium.click("link=" + page);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ r = countTableRows(TAB_PORTLET_INSTANCES);
+
+ Assert.assertTrue(r>0,"on instances on paginator page");
+ }
+
+ }
+
@Test(enabled = true)
public void testPreferences() {
- int r;
- selenium.click(LINK_CURUSER_PREFERENCES);
+
+ int r = traversePortlets(NAME_COUNTPORT, 0);
+ clickAndWait(MessageFormat.format(LNK_PREF_BUTTON, r));
+ // selenium.click(LINK_CURUSER_PREFERENCES);
+
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(SUBMIT_PREF_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click(LINK_CURUSER_PREFERENCES);
+
+ r = traversePortlets(NAME_COUNTPORT, 0);
+ clickAndWait(MessageFormat.format(LNK_PREF_BUTTON, r));
+
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(findTableRow(TABLE_PREF_KEY, "guestNumber", 0) >= 0);
selenium.click(LINK_PREF_GUESTNUM);
@@ -218,8 +284,47 @@
Assert.assertEquals(selenium.getText(TABLE_PREF_KEY + "/tbody/tr[" + r + "]/td[4]"), "[viliam]");
selenium.click(SUBMIT_PREF_SAVE);
selenium.waitForPageToLoad(PAGE_LOAD);
+
}
+ // acquiring link names from paginator
+ private String[] getPages(String paginator_location) {
+
+ String pagi = selenium.getText(paginator_location);
+ String[] pages = pagi.split(" ");
+
+ return pages;
+ }
+
+ /*
+ * function for traversing the portles in the portles table. when a string
+ * in selected columns is not found, links form paginator are used to look
+ * to the next page
+ */
+ private int traversePortlets(String instance_name, int row) {
+
+ int r = -1;
+
+ r = findTableRow(TAB_PORTLET_INSTANCES, instance_name, row);
+
+ if (r >= 0)
+ return r;
+
+ String pages[] = getPages(UL_PAGINATOR);
+ for (String page : pages) {
+ if ("".equals(page.trim()))
+ continue;
+ selenium.click("link=" + page);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ r = findTableRow(TAB_PORTLET_INSTANCES, instance_name, row);
+
+ if (r >= 0)
+ break;
+ }
+
+ return r;
+ }
+
private void goToPI() {
selenium.open(ADDR_PORTAL);
clickIfVisible(LINK_ADMIN);
Modified: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/testng.xml
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/testng.xml 2009-03-06 23:22:50 UTC (rev 12986)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/testng.xml 2009-03-06 23:23:00 UTC (rev 12987)
@@ -1,6 +1,6 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="SeleniumTest">
-
+
<test verbose="2" name="org.jboss.portal.test.selenium.UserLoginTestCase" annotations="JDK">
<classes>
<class name="org.jboss.portal.test.selenium.UserLoginTestCase"/>
@@ -27,7 +27,37 @@
<classes>
<class name="org.jboss.portal.test.selenium.UserInterceptorPortletTestCase"></class></classes>
</test>
+
+ <test name="org.jboss.portal.test.selenium.DashboardTestCase"
+ verbose="2" annotations="JDK">
+ <classes>
+ <class name="org.jboss.portal.test.selenium.DashboardTestCase"></class></classes>
+ </test>
+ <test name="org.jboss.portal.test.selenium.portal.AdminPortalTestCase"
+ verbose="2" annotations="JDK">
+ <classes>
+ <class name="org.jboss.portal.test.selenium.portal.AdminPortalTestCase"></class></classes>
+ </test>
+
+ <test name="org.jboss.portal.test.selenium.portal.PortletDefinitionsTestCase"
+ verbose="2" annotations="JDK">
+ <classes>
+ <class name="org.jboss.portal.test.selenium.portal.PortletDefinitionsTestCase"></class></classes>
+ </test>
+
+ <test name="org.jboss.portal.test.selenium.portal.PortletInstancesTestCase"
+ verbose="2" annotations="JDK">
+ <classes>
+ <class name="org.jboss.portal.test.selenium.portal.PortletInstancesTestCase"></class></classes>
+ </test>
+
+ <test name="org.jboss.portal.test.selenium.portal.PageCoordinationTestCase"
+ verbose="2" annotations="JDK">
+ <classes>
+ <class name="org.jboss.portal.test.selenium.portal.PageCoordinationTestCase"></class></classes>
+ </test>
+
<test name="org.jboss.portal.test.selenium.cms.CMSFileTestCase"
verbose="2" annotations="JDK">
<classes>
@@ -45,7 +75,7 @@
<classes>
<class name="org.jboss.portal.test.selenium.cms.CMSDirectoryTestCase"></class></classes>
</test>
- -->
+
<test name="org.jboss.portal.test.selenium.cms.CMSFileUploadTestCase"
verbose="2" annotations="JDK">
<classes>
@@ -58,19 +88,20 @@
<class name="org.jboss.portal.test.selenium.cms.CMSArchiveUploadTestCase"></class></classes>
</test>
- <test name="org.jboss.portal.test.selenium.DashboardTestCase"
+ <test name="org.jboss.portal.test.selenium.portal.EndtoEndPortalAdminTestCase"
verbose="2" annotations="JDK">
<classes>
- <class name="org.jboss.portal.test.selenium.DashboardTestCase"></class></classes>
+ <class name="org.jboss.portal.test.selenium.portal.EndtoEndPortalAdminTestCase"></class></classes>
</test>
- <test name="org.jboss.portal.test.selenium.portal.AdminPortalTestCase"
+ <test name="org.jboss.portal.test.selenium.EndToEndBeaPortlet"
verbose="2" annotations="JDK">
<classes>
- <class name="org.jboss.portal.test.selenium.portal.AdminPortalTestCase"></class></classes>
+ <class name="org.jboss.portal.test.selenium.EndToEndBeaPortlet"></class></classes>
</test>
-<!--
+
<listeners>
- <listener class-name="org.testng.reporters.JUnitXMLReporter"></listener></listeners>
--->
+<!-- <listener class-name="org.testng.reporters.JUnitXMLReporter"></listener> -->
+ <listener class-name="org.jboss.portal.test.selenium.JBossSeleniumTestListener"/>
+</listeners>
</suite>
Copied: branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/usecaseng.xml (from rev 12964, branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/usecaseng.xml)
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/usecaseng.xml (rev 0)
+++ branches/JBoss_Portal_AS5_Deployer/testsuite/ui-tests/usecaseng.xml 2009-03-06 23:23:00 UTC (rev 12987)
@@ -0,0 +1,14 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="SeleniumTest">
+
+ <test verbose="2" name="org.jboss.portal.test.selenium.portal.EndtoEndPortalAdminTestCase" annotations="JDK">
+ <classes>
+ <class name="org.jboss.portal.test.selenium.portal.EndtoEndPortalAdminTestCase"/>
+ </classes>
+ </test>
+
+<listeners>
+<!-- <listener class-name="org.testng.reporters.JUnitXMLReporter"></listener> -->
+ <listener class-name="org.jboss.portal.test.selenium.JBossSeleniumTestListener"/>
+</listeners>
+</suite>
17 years, 1 month
JBoss Portal SVN: r12986 - in branches/JBoss_Portal_AS5_Deployer/wsrp: src/main/org/jboss/portal/test/wsrp/consumer and 12 other directories.
by portal-commits@lists.jboss.org
Author: mwringe
Date: 2009-03-06 18:22:50 -0500 (Fri, 06 Mar 2009)
New Revision: 12986
Added:
branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/handler/MockSOAPBody.java
branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/handler/WSRPExtensionHandlerTestCase.java
Modified:
branches/JBoss_Portal_AS5_Deployer/wsrp/.classpath
branches/JBoss_Portal_AS5_Deployer/wsrp/build.xml
branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ConsumerRegistryTestCase.java
branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java
branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java
branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/handler/MockSOAPMessage.java
branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/other/WSRPPortletURLTestCase.java
branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestCase.java
branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java
branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/WSRPActionURL.java
branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/WSRPPortletURL.java
branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java
branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerSessionInformation.java
branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/handler/WSRPExtensionHandler.java
branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java
branches/JBoss_Portal_AS5_Deployer/wsrp/src/resources/portal-wsrp-client-jar/META-INF/wsdl/wsrp_v1_types.xsd
branches/JBoss_Portal_AS5_Deployer/wsrp/src/resources/portal-wsrp-war/WEB-INF/wsdl/wsrp_v1_types.xsd
branches/JBoss_Portal_AS5_Deployer/wsrp/src/resources/webservice/wsrp_v1_types.xsd
Log:
Merge JBoss_Portal_Branch_2_7 changes (rev range 12254:12964) into JBoss_Portal_AS5_Deployer branch
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/.classpath
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/.classpath 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/.classpath 2009-03-06 23:22:50 UTC (rev 12986)
@@ -30,10 +30,10 @@
<classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/common/lib/portal-common-portal-lib.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/portlet/lib/portal-portlet-lib.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/portlet/lib/portal-portlet-federation-lib.jar"/>
- <classpathentry kind="lib" path="/thirdparty/sun-javamail/lib/mail.jar"/>
<classpathentry kind="lib" path="/thirdparty/apache-fileupload/lib/commons-fileupload.jar"/>
<classpathentry kind="lib" path="/tools/lib/xercesImpl.jar"/>
<classpathentry kind="lib" path="/thirdparty/portlet/lib/portlet-api.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/core"/>
+ <classpathentry kind="lib" path="/thirdparty/glassfish/javamail/lib/mail.jar"/>
<classpathentry kind="output" path="output/classes"/>
</classpath>
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/build.xml
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/build.xml 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/build.xml 2009-03-06 23:22:50 UTC (rev 12986)
@@ -107,13 +107,7 @@
<path refid="oswego.concurrent.classpath"/>
<path refid="junit.junit.classpath"/>
<path refid="sun.servlet.classpath"/>
- <path refid="sun.jaf.classpath"/>
- <!--<pathelement path="${jboss.home}/lib/jboss-common.jar"/>
- <pathelement path="${jboss.home}/lib/jboss-jmx.jar"/>
- <pathelement path="${jboss.home}/lib/jboss-system.jar"/>
- <pathelement path="${jboss.deploy.lib.dir}/jboss-j2ee.jar"/>
- <pathelement path="${jboss.deploy.lib.dir}/jboss-jaxrpc.jar"/>
- <pathelement path="${jboss.deploy.lib.dir}/jboss-saaj.jar"/>-->
+ <path refid="glassfish.jaf.classpath"/>
<pathelement path="${jbossas/core.libs.lib}/jboss-common.jar"/>
<pathelement path="${jbossas/core.libs.lib}/jboss-jmx.jar"/>
<pathelement path="${jbossas/core.libs.lib}/jboss-system.jar"/>
@@ -121,6 +115,7 @@
<pathelement path="${jbossas/core.libs.lib}/jboss-jaxrpc.jar"/>
<pathelement path="${jbossas/core.libs.lib}/jboss-saaj.jar"/>
+
<!-- needed to compile on JDK 1.4 -->
<pathelement path="${jbossas/core.libs.lib}/namespace.jar"/>
@@ -130,7 +125,7 @@
<path refid="apache.httpclient.classpath"/>
<path refid="hibernate.hibernate.classpath"/>
<path refid="apache.fileupload.classpath"/>
- <path refid="sun.javamail.classpath"/>
+ <path refid="glassfish.javamail.classpath"/>
</path>
<!-- Libraries required for tests -->
@@ -180,6 +175,7 @@
<pathelement path="${jboss.aop.lib}/jboss-aop.jar"/>
<path refid="javassist.javassist.classpath"/>
+ <path refid="jboss/jboss.mdr.classpath"/>
<path refid="oswego.concurrent.classpath"/>
<path refid="trove.trove.classpath"/>
<path refid="qdox.qdox.classpath"/>
@@ -872,6 +868,7 @@
<test todir="${test.reports}"
name="org.jboss.portal.test.wsrp.other.RegistrationPropertyDescriptionTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.wsrp.handler.RequestHeaderClientHandlerTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.wsrp.handler.WSRPExtensionHandlerTestCase"/>
</x-test>
<x-sysproperty>
<!--<jvmarg value="-Xdebug"/>
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ConsumerRegistryTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ConsumerRegistryTestCase.java 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ConsumerRegistryTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -31,6 +31,7 @@
import org.jboss.portal.wsrp.consumer.ConsumerRegistry;
import org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo;
import org.jboss.portal.wsrp.consumer.ProducerInfo;
+import org.jboss.portal.wsrp.consumer.RegistrationInfo;
import java.util.Collection;
@@ -77,7 +78,8 @@
assertNotNull(endpoint);
assertEquals(EndpointConfigurationInfo.UNSET, endpoint.getServiceDescriptionURL());
assertEquals(EndpointConfigurationInfo.UNSET, endpoint.getMarkupURL());
- assertNull(info.getRegistrationInfo());
+ RegistrationInfo regInfo = info.getRegistrationInfo();
+ assertTrue(regInfo.isUndetermined());
TransactionAssert.commitTransaction();
TransactionAssert.beginTransaction();
@@ -103,7 +105,7 @@
assertNotNull(endpoint);
assertEquals(EndpointConfigurationInfo.UNSET, endpoint.getServiceDescriptionURL());
assertEquals(EndpointConfigurationInfo.UNSET, endpoint.getMarkupURL());
- assertNull(info.getRegistrationInfo());
+ assertTrue(info.getRegistrationInfo().isUndetermined());
assertNull(registry.getConsumer("inexistent"));
Collection consumers = registry.getConfiguredConsumers();
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -152,7 +152,8 @@
public void testRefreshAndRegistration() throws Exception
{
assertFalse(info.isRegistered());
- assertNull(info.getRegistrationInfo());
+ RegistrationInfo regInfo = info.getRegistrationInfo();
+ assertTrue(regInfo.isUndetermined());
ServiceDescriptionBehavior sd = new ServiceDescriptionBehavior();
sd.setRequiresRegistration(true);
@@ -173,7 +174,8 @@
public void testGetRegistrationContext() throws Exception
{
assertFalse(info.isRegistered());
- assertNull(info.getRegistrationInfo());
+ RegistrationInfo regInfo = info.getRegistrationInfo();
+ assertTrue(regInfo.isUndetermined());
ServiceDescriptionBehavior sd = new ServiceDescriptionBehavior();
sd.setRequiresRegistration(true);
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java 2009-03-06 23:22:50 UTC (rev 12986)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -56,13 +56,7 @@
*/
public MockConsumerRegistry()
{
- consumers.put(CONSUMER1, new MockWSRPConsumer(CONSUMER1));
- MockWSRPConsumer consumer = new MockWSRPConsumer(CONSUMER2);
- consumer.getProducerInfo().setActive(true);
- EndpointConfigurationInfo info = consumer.getProducerInfo().getEndpointConfigurationInfo();
- info.setServiceDescriptionURL(MOCK_SERVICE_DESCRIPTION);
- info.setMarkupURL(MOCK_MARKUP);
- consumers.put(CONSUMER2, consumer);
+ reloadConsumers();
}
public List<WSRPConsumer> getConfiguredConsumers()
@@ -118,4 +112,16 @@
{
// do nothing
}
+
+ public void reloadConsumers()
+ {
+ consumers.clear();
+ consumers.put(CONSUMER1, new MockWSRPConsumer(CONSUMER1));
+ MockWSRPConsumer consumer = new MockWSRPConsumer(CONSUMER2);
+ consumer.getProducerInfo().setActive(true);
+ EndpointConfigurationInfo info = consumer.getProducerInfo().getEndpointConfigurationInfo();
+ info.setServiceDescriptionURL(MOCK_SERVICE_DESCRIPTION);
+ info.setMarkupURL(MOCK_MARKUP);
+ consumers.put(CONSUMER2, consumer);
+ }
}
Copied: branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/handler/MockSOAPBody.java (from rev 12964, branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/handler/MockSOAPBody.java)
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/handler/MockSOAPBody.java (rev 0)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/handler/MockSOAPBody.java 2009-03-06 23:22:50 UTC (rev 12986)
@@ -0,0 +1,57 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.portal.test.wsrp.handler;
+
+import org.jboss.util.xml.DOMUtils;
+import org.w3c.dom.Element;
+
+import javax.xml.soap.SOAPBody;
+import java.io.IOException;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class MockSOAPBody implements InvocationHandler
+{
+ Element body;
+
+ public MockSOAPBody(Element body)
+ {
+ this.body = body;
+ }
+
+ public static SOAPBody newInstance(String body) throws IOException
+ {
+ return (SOAPBody)Proxy.newProxyInstance(MockSOAPBody.class.getClassLoader(), new Class[]{SOAPBody.class},
+ new MockSOAPBody(DOMUtils.parse(body)));
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ return method.invoke(body, args);
+ }
+}
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/handler/MockSOAPMessage.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/handler/MockSOAPMessage.java 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/handler/MockSOAPMessage.java 2009-03-06 23:22:50 UTC (rev 12986)
@@ -25,6 +25,7 @@
import javax.xml.soap.AttachmentPart;
import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
@@ -42,8 +43,8 @@
public class MockSOAPMessage extends SOAPMessage
{
MimeHeaders headers;
+ String messageBody;
-
public MockSOAPMessage()
{
headers = new MimeHeaders();
@@ -54,6 +55,24 @@
this.headers = headers;
}
+ public void setMessageBody(String messageBody)
+ {
+ this.messageBody = messageBody;
+ }
+
+ @Override
+ public SOAPBody getSOAPBody() throws SOAPException
+ {
+ try
+ {
+ return MockSOAPBody.newInstance(messageBody);
+ }
+ catch (IOException e)
+ {
+ throw new SOAPException(e);
+ }
+ }
+
public MimeHeaders getMimeHeaders()
{
return headers;
Copied: branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/handler/WSRPExtensionHandlerTestCase.java (from rev 12964, branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/handler/WSRPExtensionHandlerTestCase.java)
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/handler/WSRPExtensionHandlerTestCase.java (rev 0)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/handler/WSRPExtensionHandlerTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
@@ -0,0 +1,239 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.portal.test.wsrp.handler;
+
+import junit.framework.TestCase;
+import org.jboss.portal.wsrp.handler.WSRPExtensionHandler;
+
+import javax.xml.rpc.handler.HandlerInfo;
+import javax.xml.rpc.handler.soap.SOAPMessageContext;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPException;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class WSRPExtensionHandlerTestCase extends TestCase
+{
+ private WSRPExtensionHandler handler;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ handler = new WSRPExtensionHandler();
+
+ HandlerInfo info = new HandlerInfo();
+ Map<String, String> config = new HashMap<String, String>();
+ config.put("debug", "false");
+ config.put("removeExtensions", "true");
+ info.setHandlerConfig(config);
+ handler.init(info);
+ }
+
+ public void testRemoveExtensions() throws SOAPException
+ {
+ MockSOAPMessage message = new MockSOAPMessage();
+ message.setMessageBody("<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'\n" +
+ "\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'\n" +
+ "\txmlns:xsd='http://www.w3.org/2001/XMLSchema'\n" +
+ "\txmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>\n" +
+ "\t<env:Body>\n" +
+ "\t\t<ns0:getMarkup xmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t<ns0:registrationContext\n" +
+ "\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t<ns0:registrationHandle\n" +
+ "\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t17\n" +
+ "\t\t\t\t</ns0:registrationHandle>\n" +
+ "\t\t\t\t<ns0:registrationState\n" +
+ "\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types' />\n" +
+ "\t\t\t</ns0:registrationContext>\n" +
+ "\t\t\t<ns0:portletContext\n" +
+ "\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t<ns0:portletHandle\n" +
+ "\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t_18\n" +
+ "\t\t\t\t</ns0:portletHandle>\n" +
+ "\t\t\t\t<ns0:portletState\n" +
+ "\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types' />\n" +
+ "\t\t\t</ns0:portletContext>\n" +
+ "\t\t\t<ns0:runtimeContext\n" +
+ "\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t<ns0:userAuthentication xmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\twsrp:none\n" +
+ "\t\t\t\t</ns0:userAuthentication>\n" +
+ "\t\t\t\t<ns0:portletInstanceKey\n" +
+ "\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t949994222\n" +
+ "\t\t\t\t</ns0:portletInstanceKey>\n" +
+ "\t\t\t\t<ns0:namespacePrefix\n" +
+ "\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t__ns949994222_\n" +
+ "\t\t\t\t</ns0:namespacePrefix>\n" +
+ "\t\t\t</ns0:runtimeContext>\n" +
+ "\t\t\t<ns0:userContext\n" +
+ "\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t<ns0:userContextKey\n" +
+ "\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\twsrp:minimal\n" +
+ "\t\t\t\t</ns0:userContextKey>\n" +
+ "\t\t\t\t<ns0:profile\n" +
+ "\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types' />\n" +
+ "\t\t\t</ns0:userContext>\n" +
+ "\t\t\t<ns0:markupParams\n" +
+ "\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t<ns0:secureClientCommunication xmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\tfalse\n" +
+ "\t\t\t\t\t</ns0:secureClientCommunication>\n" +
+ "\t\t\t\t\t<ns0:locales\n" +
+ "\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\ten-US\n" +
+ "\t\t\t\t\t</ns0:locales>\n" +
+ "\t\t\t\t\t<ns0:mimeTypes\n" +
+ "\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\ttext/html\n" +
+ "\t\t\t\t\t</ns0:mimeTypes>\n" +
+ "\t\t\t\t\t<ns0:mimeTypes\n" +
+ "\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\ttext/xml\n" +
+ "\t\t\t\t\t</ns0:mimeTypes>\n" +
+ "\t\t\t\t\t<ns0:mimeTypes\n" +
+ "\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\ttext/vnd.oracle.mobilexml\n" +
+ "\t\t\t\t\t</ns0:mimeTypes>\n" +
+ "\t\t\t\t\t<ns0:mimeTypes\n" +
+ "\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\t*\n" +
+ "\t\t\t\t\t</ns0:mimeTypes>\n" +
+ "\t\t\t\t\t<ns0:mode\n" +
+ "\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\twsrp:view\n" +
+ "\t\t\t\t\t</ns0:mode>\n" +
+ "\t\t\t\t\t<ns0:windowState\n" +
+ "\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\twsrp:normal\n" +
+ "\t\t\t\t\t</ns0:windowState>\n" +
+ "\t\t\t\t\t<ns0:clientData\n" +
+ "\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\t<ns0:userAgent\n" +
+ "\t\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\t\tMozilla/5.0 (Windows; U; Windows NT 5.1;\n" +
+ "\t\t\t\t\t\t\ten-US; rv:1.9.0.3) Gecko/2008092417\n" +
+ "\t\t\t\t\t\t\tFirefox/3.0.3\n" +
+ "\t\t\t\t\t\t</ns0:userAgent>\n" +
+ "\t\t\t\t\t\t<ns0:extensions\n" +
+ "\t\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\t\t<ns1:GenericExtension\n" +
+ "\t\t\t\t\t\t\t\txmlns:ns1='http://xmlns.oracle.com/portal/wsrp/v1'>\n" +
+ "\t\t\t\t\t\t\t\t<ns0:NamedString name='CONNECTION'\n" +
+ "\t\t\t\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\t\t\t\t<ns0:value\n" +
+ "\t\t\t\t\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\t\t\t\t\tkeep-alive\n" +
+ "\t\t\t\t\t\t\t\t\t</ns0:value>\n" +
+ "\t\t\t\t\t\t\t\t</ns0:NamedString>\n" +
+ "\t\t\t\t\t\t\t\t<ns0:NamedString name='ACCEPT-ENCODING'\n" +
+ "\t\t\t\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\t\t\t\t<ns0:value xmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\t\t\t\t\tgzip,deflate\n" +
+ "\t\t\t\t\t\t\t\t\t\t</ns0:value>\n" +
+ "\t\t\t\t\t\t\t\t</ns0:NamedString>\n" +
+ "\t\t\t\t\t\t\t\t<ns0:NamedString name='KEEP-ALIVE'\n" +
+ "\t\t\t\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\t\t\t\t<ns0:value xmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\t\t\t\t\t300\n" +
+ "\t\t\t\t\t\t\t\t\t</ns0:value>\n" +
+ "\t\t\t\t\t\t\t\t</ns0:NamedString>\n" +
+ "\t\t\t\t\t\t\t\t<ns0:NamedString name='HOST'\n" +
+ "\t\t\t\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\t\t\t\t<ns0:value xmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\t\t\t\t\t127.0.0.1:8988\n" +
+ "\t\t\t\t\t\t\t\t\t</ns0:value>\n" +
+ "\t\t\t\t\t\t\t\t</ns0:NamedString>\n" +
+ "\t\t\t\t\t\t\t</ns1:GenericExtension>\n" +
+ "\t\t\t\t\t\t</ns0:extensions>\n" +
+ "\t\t\t\t\t</ns0:clientData>\n" +
+ "\t\t\t\t\t<ns0:markupCharacterSets\n" +
+ "\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\tUTF-8\n" +
+ "\t\t\t\t\t</ns0:markupCharacterSets>\n" +
+ "\t\t\t\t\t<ns0:validNewModes\n" +
+ "\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\twsrp:view\n" +
+ "\t\t\t\t\t</ns0:validNewModes>\n" +
+ "\t\t\t\t\t<ns0:validNewModes\n" +
+ "\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\turn:javax:portlet:mode:custo m:edit_defaults\n" +
+ "\t\t\t\t\t</ns0:validNewModes>\n" +
+ "\t\t\t\t\t<ns0:validNewModes\n" +
+ "\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\twsrp:edit\n" +
+ "\t\t\t\t\t</ns0:validNewModes>\n" +
+ "\t\t\t\t\t<ns0:validNewModes\n" +
+ "\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\twsrp:help\n" +
+ "\t\t\t\t\t</ns0:validNewModes>\n" +
+ "\t\t\t\t\t<ns0:validNewModes\n" +
+ "\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\turn:javax:portlet:mode:custo m:about\n" +
+ "\t\t\t\t\t</ns0:validNewModes>\n" +
+ "\t\t\t\t\t<ns0:validNewModes\n" +
+ "\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\turn:javax:portlet:mode:custo m:print\n" +
+ "\t\t\t\t\t</ns0:validNewModes>\n" +
+ "\t\t\t\t\t<ns0:validNewModes\n" +
+ "\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\turn:javax:portlet:mode:custo m:config\n" +
+ "\t\t\t\t\t</ns0:validNewModes>\n" +
+ "\t\t\t\t\t<ns0:validNewWindowStates\n" +
+ "\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\twsrp:normal\n" +
+ "\t\t\t\t\t</ns0:validNewWindowStates>\n" +
+ "\t\t\t\t\t<ns0:validNewWindowStates\n" +
+ "\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\twsrp:maximized\n" +
+ "\t\t\t\t\t</ns0:validNewWindowStates>\n" +
+ "\t\t\t\t\t<ns0:validNewWindowStates\n" +
+ "\t\t\t\t\t\txmlns:ns0='urn:oasis:names:tc:wsrp:v1:types'>\n" +
+ "\t\t\t\t\t\twsrp:minimized\n" +
+ "\t\t\t\t\t</ns0:validNewWindowStates>\n" +
+ "\t\t\t</ns0:markupParams>\n" +
+ "\t\t</ns0:getMarkup>\n" +
+ "\t</env:Body>\n" +
+ "</env:Envelope>");
+
+
+ SOAPMessageContext msgContext = MockSOAPMessageContext.createMessageContext(message, getClass().getClassLoader());
+
+ handler.handleRequest(msgContext);
+
+ SOAPBody body = msgContext.getMessage().getSOAPBody();
+ String asString = body.toString();
+ assertFalse(asString.contains("ns0:extensions"));
+ assertFalse(asString.contains("ns1:GenericExtensions"));
+ assertFalse(asString.contains("ACCEPT-ENCODING"));
+ }
+}
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/other/WSRPPortletURLTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/other/WSRPPortletURLTestCase.java 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/other/WSRPPortletURLTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -51,7 +51,7 @@
public void testResource()
{
String expected = "wsrp_rewrite?wsrp-urlType=resource&wsrp-url=http%3A%2F%2Ftest.com%2Fimages%2Ftest.gif" +
- "&wsrp-requiresRewrite=true/wsrp_rewrite";
+ "&wsrp-requiresRewrite=true/wsrp_rewrite";
WSRPPortletURL url = WSRPPortletURL.create(expected);
assertEquals("http://test.com/images/test.gif", url.toString());
@@ -61,7 +61,7 @@
public void testSecureInteraction()
{
String expected = "wsrp_rewrite?wsrp-urlType=blockingAction&wsrp-secureURL=true" +
- "&wsrp-navigationalState=a8h4K5JD9&wsrp-interactionState=fg4h923mdk/wsrp_rewrite";
+ "&wsrp-navigationalState=a8h4K5JD9&wsrp-interactionState=fg4h923mdk/wsrp_rewrite";
WSRPPortletURL url = WSRPPortletURL.create(expected);
assertTrue(url instanceof WSRPActionURL);
@@ -195,25 +195,27 @@
checkInvalidURL(invalid, "Should have detected invalid URL: ", "invalidURL");
}
- private void checkInvalidURL(String invalid, String message, String mustBeInException)
+ public void testNullURL()
{
try
{
- WSRPPortletURL.create(invalid);
- fail(message + mustBeInException);
+ WSRPPortletURL.create(null);
+ fail("Should have detected null URL");
}
catch (IllegalArgumentException e)
{
- assertTrue(e.getLocalizedMessage().contains(mustBeInException));
+ // expected
}
}
- public void testNullURL()
+ public void testInvalidURLType()
{
+ String wrongURLType = "wsrp_rewrite?wsrp-urlType=pipo&wsrp-mode=help/wsrp_rewrite";
+
try
{
- WSRPPortletURL.create(null);
- fail("Should have detected null URL");
+ WSRPPortletURL.create(wrongURLType);
+ fail("Should have detected wrong URL type");
}
catch (IllegalArgumentException e)
{
@@ -221,18 +223,36 @@
}
}
- public void testInvalidURLType()
+ public void testProperEndTokenInRelaxedMode()
{
- String wrongURLType = "wsrp_rewrite?wsrp-urlType=pipo&wsrp-mode=help/wsrp_rewrite";
+ WSRPPortletURL.setStrict(false);
+ WSRPPortletURL url = new WSRPPortletURL()
+ {
+ @Override
+ protected String getURLType()
+ {
+ return WSRPRewritingConstants.URL_TYPE_BLOCKING_ACTION;
+ }
+
+ @Override
+ protected void appendEnd(StringBuffer sb)
+ {
+ }
+ };
+ assertTrue(url.toString().contains(WSRPRewritingConstants.END_WSRP_REWRITE));
+ }
+
+ private void checkInvalidURL(String invalid, String message, String mustBeInException)
+ {
try
{
- WSRPPortletURL.create(wrongURLType);
- fail("Should have detected wrong URL type");
+ WSRPPortletURL.create(invalid);
+ fail(message + mustBeInException);
}
catch (IllegalArgumentException e)
{
- // expected
+ assertTrue(e.getLocalizedMessage().contains(mustBeInException));
}
}
}
\ No newline at end of file
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestCase.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestCase.java 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestCase.java 2009-03-06 23:22:50 UTC (rev 12986)
@@ -144,7 +144,7 @@
// now modify Producer's set of required registration info
String newPropName = "New Prop";
RegistrationPropertyDescription regProp = new RegistrationPropertyDescription(newPropName,
- new QName("urn:oasis:names:tc:wsrp:v1:types", "LocalizedString", "ns1"));
+ new QName("urn:oasis:names:tc:wsrp:v1:types", "LocalizedString", "ns1"));
regProp.setDefaultLabel("New Registration Property");
producer.getProducerRegistrationRequirements().addRegistrationProperty(regProp);
@@ -184,10 +184,20 @@
// remove registration context, try again and check that we get new registration info
gs.setRegistrationContext(null);
PropertyDescription[] pds = serviceDescriptionService.getServiceDescription(gs)
- .getRegistrationPropertyDescription().getPropertyDescriptions();
+ .getRegistrationPropertyDescription().getPropertyDescriptions();
ExtendedAssert.assertEquals(2, pds.length);
- assertEquals(WSRPUtils.convertToPropertyDescription(regProp), pds[1]);
+ // Check that one of the returned property description is equal to the one we just added
+ PropertyDescription description = pds[1];
+ if (description.getName().startsWith("New"))
+ {
+ assertEquals(WSRPUtils.convertToPropertyDescription(regProp), description);
+ }
+ else
+ {
+ assertEquals(WSRPUtils.convertToPropertyDescription(regProp), pds[0]);
+ }
+
// Update registration data
RegistrationData regData = createBaseRegData();
org.jboss.portal.wsrp.core.Property[] props = regData.getRegistrationProperties();
@@ -211,7 +221,7 @@
// now modify Producer's set of required registration info
String newPropName = "New Prop";
RegistrationPropertyDescription regProp = new RegistrationPropertyDescription(newPropName,
- new QName("urn:oasis:names:tc:wsrp:v1:types", "LocalizedString", "ns1"));
+ new QName("urn:oasis:names:tc:wsrp:v1:types", "LocalizedString", "ns1"));
regProp.setDefaultLabel("New Registration Property");
producer.getProducerRegistrationRequirements().addRegistrationProperty(regProp);
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java 2009-03-06 23:22:50 UTC (rev 12986)
@@ -117,16 +117,16 @@
ExtendedAssert.assertEquals(1, markupTypes.length);
MarkupType markupType = markupTypes[0];
assertEquals(new MarkupType("text/html", new String[]{WSRPConstants.VIEW_MODE},
- new String[]{WSRPConstants.NORMAL_WINDOW_STATE, WSRPConstants.MAXIMIZED_WINDOW_STATE, WSRPConstants.MINIMIZED_WINDOW_STATE},
- new String[]{"en"}, null), markupType);
+ new String[]{WSRPConstants.NORMAL_WINDOW_STATE, WSRPConstants.MAXIMIZED_WINDOW_STATE, WSRPConstants.MINIMIZED_WINDOW_STATE},
+ new String[]{"en"}, null), markupType);
}
protected ServiceDescription checkServiceDescriptionWithOnlyBasicPortlet(GetServiceDescription gs)
- throws Exception
+ throws Exception
{
deploy("test-basic-portlet.war");
//Invoke the Web Service
- ServiceDescription sd = serviceDescriptionService.getServiceDescription(gs);
+ ServiceDescription sd = serviceDescriptionService.getServiceDescription(gs);
ExtendedAssert.assertNotNull("sd != null", sd);
@@ -149,7 +149,7 @@
}
protected RegistrationContext registerConsumer()
- throws org.jboss.portal.wsrp.core.MissingParametersFault, org.jboss.portal.wsrp.core.OperationFailedFault, java.rmi.RemoteException
+ throws org.jboss.portal.wsrp.core.MissingParametersFault, org.jboss.portal.wsrp.core.OperationFailedFault, java.rmi.RemoteException
{
RegistrationData registrationData = createBaseRegData();
return registrationService.register(registrationData);
@@ -173,7 +173,7 @@
{
// fix-me: http://jira.jboss.com/jira/browse/JBPORTAL-821
RegistrationPropertyDescription regProp = new RegistrationPropertyDescription("regProp",
- new QName("urn:oasis:names:tc:wsrp:v1:types", "LocalizedString", "ns1"));
+ new QName("urn:oasis:names:tc:wsrp:v1:types", "LocalizedString", "ns1"));
regProp.setDefaultLabel("Registration Property");
producer.getProducerRegistrationRequirements().addRegistrationProperty(regProp);
@@ -246,7 +246,7 @@
protected static void assertEquals(PropertyDescription expected, PropertyDescription tested)
{
- String message = "Expected: <" + expected + ">, got: <" + tested + ">. Failed on: ";
+ String message = "Expected: <" + expected + ">, got: <" + tested + ">. Failed on ";
if (expected != tested)
{
@@ -255,16 +255,18 @@
ExtendedAssert.fail(message + "Different classes or not both null.");
}
- ExtendedAssert.assertEquals(expected.getExtensions(), tested.getExtensions(), false, message + "Extensions");
- assertEquals(message + "Hint", expected.getHint(), tested.getHint());
- assertEquals(message + "Label", expected.getLabel(), tested.getLabel());
- ExtendedAssert.assertEquals(message + "Name", expected.getName(), tested.getName());
- ExtendedAssert.assertEquals(message + "Type", expected.getType(), tested.getType());
+ ExtendedAssert.assertEquals(expected.getExtensions(), tested.getExtensions(), false, message + "extensions.");
+ assertEquals(message + "hint.", expected.getHint(), tested.getHint());
+ assertEquals(message + "label.", expected.getLabel(), tested.getLabel());
+ ExtendedAssert.assertEquals(message + "name.", expected.getName(), tested.getName());
+ ExtendedAssert.assertEquals(message + "type.", expected.getType(), tested.getType());
}
}
protected static void assertEquals(String message, LocalizedString expected, LocalizedString tested)
{
+ String precise = "Expected: <" + expected + ">, got: <" + tested + ">. Failed on ";
+
if (expected != tested)
{
if (expected == null || tested == null)
@@ -272,9 +274,9 @@
ExtendedAssert.fail(message + ": Different classes or not both null.");
}
- ExtendedAssert.assertEquals(expected.getLang(), tested.getLang());
- ExtendedAssert.assertEquals(expected.getResourceName(), tested.getResourceName());
- ExtendedAssert.assertEquals(expected.getValue(), tested.getValue());
+ ExtendedAssert.assertEquals(precise + "lang.", expected.getLang(), tested.getLang());
+ ExtendedAssert.assertEquals(precise + "resource name.", expected.getResourceName(), tested.getResourceName());
+ ExtendedAssert.assertEquals(precise + "value.", expected.getValue(), tested.getValue());
}
}
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/WSRPActionURL.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/WSRPActionURL.java 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/WSRPActionURL.java 2009-03-06 23:22:50 UTC (rev 12986)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -20,6 +20,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
******************************************************************************/
+
package org.jboss.portal.wsrp;
import org.jboss.portal.Mode;
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/WSRPPortletURL.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/WSRPPortletURL.java 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/WSRPPortletURL.java 2009-03-06 23:22:50 UTC (rev 12986)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -347,13 +347,13 @@
//
if (mode != null)
{
- createURLParameter(sb, WSRPRewritingConstants.MODE, mode.toString());
+ createURLParameter(sb, WSRPRewritingConstants.MODE, WSRPUtils.getWSRPNameFromJSR168PortletMode(mode));
}
//
if (windowState != null)
{
- createURLParameter(sb, WSRPRewritingConstants.WINDOW_STATE, windowState.toString());
+ createURLParameter(sb, WSRPRewritingConstants.WINDOW_STATE, WSRPUtils.getWSRPNameFromJSR168WindowState(windowState));
}
// todo: not sure how to deal with authenticated
@@ -369,19 +369,15 @@
else
{
// we're in relaxed mode so we need to deal with extra params if they exist
- StringBuffer extras = null;
if (extraParams != null && !extraParams.isEmpty())
{
- extras = new StringBuffer();
+ StringBuffer extras = new StringBuffer();
for (Map.Entry<String, String> entry : extraParams.entrySet())
{
createURLParameter(extras, entry.getKey(), entry.getValue());
}
- }
- // if we had extra params, we need to figure out where thwy should be positioned wrt end token
- if (extras != null)
- {
+ // if we had extra params, we need to figure out where thwy should be positioned wrt end token
if (extraParamsAfterEndToken)
{
sb.append(WSRPRewritingConstants.END_WSRP_REWRITE);
@@ -393,6 +389,10 @@
sb.append(WSRPRewritingConstants.END_WSRP_REWRITE);
}
}
+ else
+ {
+ sb.append(WSRPRewritingConstants.END_WSRP_REWRITE);
+ }
}
return sb.toString();
}
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java 2009-03-06 23:22:50 UTC (rev 12986)
@@ -1,24 +1,25 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
package org.jboss.portal.wsrp.consumer;
@@ -60,4 +61,6 @@
void registerOrDeregisterConsumerWith(String id, boolean register) throws ConsumerException;
void destroyConsumer(String id) throws ConsumerException;
+
+ void reloadConsumers();
}
\ No newline at end of file
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2009-03-06 23:22:50 UTC (rev 12986)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -262,7 +262,11 @@
{
InitialContext initialContext = new InitialContext();
sessionFactory = (SessionFactory)initialContext.lookup(sessionFactoryJNDIName);
+ reloadConsumers();
+ }
+ public void reloadConsumers()
+ {
// load the configured consumers
consumers = new TreeMap<String, WSRPConsumer>();
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2009-03-06 23:22:50 UTC (rev 12986)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -123,6 +123,7 @@
public ProducerInfo()
{
persistentEndpointInfo = new EndpointConfigurationInfo(this);
+ persistentRegistrationInfo = RegistrationInfo.createUndeterminedRegistration(this);
}
public ConsumerRegistry getRegistry()
@@ -176,10 +177,7 @@
public RegistrationInfo getRegistrationInfo()
{
// update parent since it might not be set when unfrozen from Hibernate
- if (persistentRegistrationInfo != null)
- {
- persistentRegistrationInfo.setParent(this);
- }
+ persistentRegistrationInfo.setParent(this);
return persistentRegistrationInfo;
}
@@ -190,35 +188,30 @@
public boolean isRegistered()
{
- if (persistentRegistrationInfo != null)
+ Boolean valid = persistentRegistrationInfo.isRegistrationValid();
+ if (valid == null)
{
- Boolean valid = persistentRegistrationInfo.isRegistrationValid();
- if (valid == null)
- {
- return persistentRegistrationInfo.getRegistrationHandle() != null;
- }
- else
- {
- return valid;
- }
+ return persistentRegistrationInfo.getRegistrationHandle() != null;
}
-
- return false;
+ else
+ {
+ return valid;
+ }
}
public boolean isRegistrationRequired()
{
- return persistentRegistrationInfo != null && persistentRegistrationInfo.isRegistrationDeterminedRequired();
+ return persistentRegistrationInfo.isRegistrationDeterminedRequired();
}
public boolean isRegistrationChecked()
{
- return persistentRegistrationInfo != null && persistentRegistrationInfo.isRegistrationRequired() != null;
+ return persistentRegistrationInfo.isRegistrationRequired() != null;
}
public boolean hasLocalRegistrationInfo()
{
- return persistentRegistrationInfo != null && persistentRegistrationInfo.hasLocalInfo();
+ return persistentRegistrationInfo.hasLocalInfo();
}
/**
@@ -250,7 +243,7 @@
public boolean isModifyRegistrationRequired()
{
- return isModifyRegistrationRequired || (persistentRegistrationInfo != null && persistentRegistrationInfo.isModifyRegistrationNeeded());
+ return isModifyRegistrationRequired || persistentRegistrationInfo.isModifyRegistrationNeeded();
}
// FIX-ME: remove when a better dirty management is in place at property level
@@ -345,7 +338,7 @@
try
{
// if we don't yet have registration information, get an unregistered service description
- serviceDescription = getUnmanagedServiceDescription(persistentRegistrationInfo == null);
+ serviceDescription = getUnmanagedServiceDescription(persistentRegistrationInfo.isUndetermined());
result.setServiceDescription(serviceDescription);
}
catch (OperationFailedFault operationFailedFault)
@@ -409,7 +402,7 @@
}
private RefreshResult refreshInfo(boolean forceRefresh, ServiceDescription serviceDescription, RefreshResult result)
- throws PortletInvokerException
+ throws PortletInvokerException
{
// do we need to call initCookie or not?
requiresInitCookie = serviceDescription.getRequiresInitCookie();
@@ -542,8 +535,8 @@
if (info.isUsesMethodGet())
{
log.warn("Portlet '" + portletHandle
- + "' uses the GET method in forms. Since we don't handle this, this portlet will be excluded from " +
- "the list of offered portlets for producer " + persistentId);
+ + "' uses the GET method in forms. Since we don't handle this, this portlet will be excluded from " +
+ "the list of offered portlets for producer " + persistentId);
}
else
{
@@ -616,7 +609,7 @@
catch (Exception e)
{
log.debug("Couldn't get portlet via getPortletDescription for producer '" + persistentId
- + "'. Attempting to retrieve it from the service description as this producer might not support the PortletManagement interface.", e);
+ + "'. Attempting to retrieve it from the service description as this producer might not support the PortletManagement interface.", e);
justRefreshed = refresh(true);
portlet = getPortletFromCaches(portletHandle, justRefreshed);
@@ -686,7 +679,7 @@
private boolean isCacheExpired()
{
boolean result = !useCache() || System.currentTimeMillis() > expirationTimeMillis || popsMap == null
- || portletGroups == null;
+ || portletGroups == null;
if (result)
{
log.debug("Cache expired or not used");
@@ -765,7 +758,7 @@
{
Throwable cause = e.getCause();
throw new InvokerUnavailableException("Problem getting service description for producer "
- + persistentId + ", please see the logs for more information. ", cause == null ? e : cause);
+ + persistentId + ", please see the logs for more information. ", cause == null ? e : cause);
}
private GetServiceDescription getServiceDescriptionRequest(boolean asUnregistred) throws PortletInvokerException
@@ -787,7 +780,7 @@
public RegistrationContext getRegistrationContext() throws PortletInvokerException
{
- if (persistentRegistrationInfo == null)
+ if (persistentRegistrationInfo.isUndetermined())
{
refresh(false);
}
@@ -797,10 +790,7 @@
public void resetRegistration() throws PortletInvokerException
{
- if (persistentRegistrationInfo != null)
- {
- persistentRegistrationInfo.resetRegistration();
- }
+ persistentRegistrationInfo.resetRegistration();
invalidateCache();
registry.updateProducerInfo(this);
@@ -835,7 +825,7 @@
throw new RuntimeException("Couldn't reset registration", e);
}
throw new IllegalArgumentException("Couldn't get property descriptions for portlet '" + portletHandle
- + "' because the provided registration is invalid!");
+ + "' because the provided registration is invalid!");
}
catch (Exception e)
{
@@ -863,11 +853,6 @@
*/
private RefreshResult register(ServiceDescription serviceDescription, boolean forceRefresh) throws PortletInvokerException
{
- if (persistentRegistrationInfo == null)
- {
- persistentRegistrationInfo = new RegistrationInfo(this);
- }
-
if (!isRegistered())
{
persistentEndpointInfo.refresh();
@@ -887,7 +872,7 @@
{
log.debug("Attempting registration");
RegistrationContext registrationContext = persistentEndpointInfo.getRegistrationService()
- .register(persistentRegistrationInfo.getRegistrationData());
+ .register(persistentRegistrationInfo.getRegistrationData());
if (registrationContext == null)
{
@@ -897,7 +882,7 @@
persistentRegistrationInfo.setRegistrationContext(registrationContext);
String msg = "Consumer with id '" + persistentId + "' successfully registered with handle: '"
- + registrationContext.getRegistrationHandle() + "'";
+ + registrationContext.getRegistrationHandle() + "'";
log.debug(msg);
RefreshResult res = new RefreshResult();
res.setRegistrationResult(result);
@@ -955,7 +940,7 @@
public void modifyRegistration() throws PortletInvokerException
{
- if (persistentRegistrationInfo != null && persistentRegistrationInfo.getRegistrationHandle() != null)
+ if (persistentRegistrationInfo.getRegistrationHandle() != null)
{
persistentEndpointInfo.refresh();
@@ -963,7 +948,7 @@
{
RegistrationContext registrationContext = getRegistrationContext();
ModifyRegistration modifyRegistration = WSRPTypeFactory.createModifyRegistration(registrationContext,
- persistentRegistrationInfo.getRegistrationData());
+ persistentRegistrationInfo.getRegistrationData());
RegistrationState state = persistentEndpointInfo.getRegistrationService().modifyRegistration(modifyRegistration);
// force refresh of internal RegistrationInfo state
@@ -993,7 +978,7 @@
else
{
throw new IllegalStateException("Cannot modify registration for producer '" + persistentId
- + "' as it's not registered");
+ + "' as it's not registered");
}
}
@@ -1007,13 +992,8 @@
private RefreshResult internalRefreshRegistration(ServiceDescription serviceDescription, boolean mergeWithLocalInfo, boolean forceRefresh, boolean forceCheckOfExtraProps) throws PortletInvokerException
{
- if (persistentRegistrationInfo == null)
- {
- persistentRegistrationInfo = new RegistrationInfo(this);
- }
-
RefreshResult result =
- persistentRegistrationInfo.refresh(serviceDescription, persistentId, mergeWithLocalInfo, forceRefresh, forceCheckOfExtraProps);
+ persistentRegistrationInfo.refresh(serviceDescription, persistentId, mergeWithLocalInfo, forceRefresh, forceCheckOfExtraProps);
log.debug("Refreshed registration information for consumer with id '" + persistentId + "'");
@@ -1023,9 +1003,8 @@
public boolean isRefreshNeeded(boolean considerCache)
{
boolean result = (considerCache && isCacheExpired())
- || persistentRegistrationInfo == null
- || persistentRegistrationInfo.isRefreshNeeded()
- || persistentEndpointInfo.isRefreshNeeded();
+ || persistentRegistrationInfo.isRefreshNeeded()
+ || persistentEndpointInfo.isRefreshNeeded();
if (result)
{
log.debug("Refresh needed for producer '" + persistentId + "'");
@@ -1042,7 +1021,7 @@
public void eraseRegistrationInfo()
{
- persistentRegistrationInfo = null;
+ persistentRegistrationInfo = RegistrationInfo.createUndeterminedRegistration(this);
registry.updateProducerInfo(this);
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerSessionInformation.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerSessionInformation.java 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerSessionInformation.java 2009-03-06 23:22:50 UTC (rev 12986)
@@ -30,6 +30,7 @@
import org.jboss.portal.wsrp.WSRPConstants;
import org.jboss.portal.wsrp.core.SessionContext;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -43,7 +44,7 @@
* @version $Revision$
* @since 2.4 (May 30, 2006)
*/
-public class ProducerSessionInformation
+public class ProducerSessionInformation implements Serializable
{
private static Logger log = Logger.getLogger(ProducerSessionInformation.class);
@@ -63,7 +64,7 @@
private Cookie[] userCookie;
/** Parent SessionHandler so that session mappings can be updated */
- private SessionHandler parent;
+ private transient SessionHandler parent;
/** The identifier of the Session containing this ProducerSessionInformation */
private String parentSessionId;
@@ -464,7 +465,7 @@
}
}
- private class SessionInfo
+ private class SessionInfo implements Serializable
{
private SessionContext sessionContext;
private long lastInvocationTime;
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2009-03-06 23:22:50 UTC (rev 12986)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -68,6 +68,12 @@
private transient boolean modifyRegistrationNeeded;
private transient ProducerInfo parent;
+ /**
+ * Marker string to identify a RegistrationInfo created for a producer that might not require registration as a work
+ * around https://jira.jboss.org/jira/browse/JBPORTAL-2284
+ */
+ private static final String UNDETERMINED_REGISTRATION = "__JBP__UNDETERMINED__REGISTRATION__";
+
public RegistrationInfo(ProducerInfo producerInfo)
{
this();
@@ -76,6 +82,18 @@
parent = producerInfo;
}
+ static RegistrationInfo createUndeterminedRegistration(ProducerInfo producerInfo)
+ {
+ RegistrationInfo info = new RegistrationInfo(producerInfo);
+ info.setConsumerName(UNDETERMINED_REGISTRATION);
+ return info;
+ }
+
+ public boolean isUndetermined()
+ {
+ return UNDETERMINED_REGISTRATION.equals(persistentConsumerName);
+ }
+
public RegistrationInfo(ProducerInfo producerInfo, boolean requiresRegistration)
{
this(producerInfo);
@@ -379,6 +397,12 @@
if (forceRefresh || isRefreshNeeded())
{
+ // if we were previously undetermined, become determined! :)
+ if (isUndetermined())
+ {
+ setConsumerName(WSRPConstants.DEFAULT_CONSUMER_NAME);
+ }
+
// get a service description if we don't already have one
if (serviceDescription == null && parent != null)
{
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/handler/WSRPExtensionHandler.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/handler/WSRPExtensionHandler.java 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/handler/WSRPExtensionHandler.java 2009-03-06 23:22:50 UTC (rev 12986)
@@ -23,23 +23,18 @@
package org.jboss.portal.wsrp.handler;
import org.jboss.logging.Logger;
-import org.jboss.util.xml.DOMUtils;
-import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
import javax.xml.namespace.QName;
import javax.xml.rpc.handler.GenericHandler;
import javax.xml.rpc.handler.HandlerInfo;
import javax.xml.rpc.handler.MessageContext;
import javax.xml.rpc.handler.soap.SOAPMessageContext;
-import javax.xml.soap.Node;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPMessage;
-import java.util.Iterator;
-//$Id$
-
/**
- * JAX-RPC Handler that strips the SOAP Message of any WSRP extensions. Right now, only operates on response messages.
+ * JAX-RPC Handler that strips the SOAP Message of any WSRP extensions.
*
* @author <a href="mailto:Anil.Saldhana@jboss.org">Anil Saldhana</a>
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
@@ -93,31 +88,7 @@
if (removeExtensions)
{
SOAPBody soapBody = soapMessage.getSOAPBody();
- Element firstEl = DOMUtils.getFirstChildElement(soapBody);
- Iterator iter = DOMUtils.getChildElements(firstEl);
- while (iter.hasNext())
- {
- Element elt = (Element)iter.next();
- String nodeName = elt.getNodeName();
- if (EXTENSIONS.equals(nodeName))
- {
- removeChildrenOf(elt);
- }
- else
- {
- Iterator extensions = DOMUtils.getChildElements(elt, EXTENSIONS);
- if (extensions.hasNext())
- {
- log.debug("extensions exist on " + nodeName);
- Element exts = (Element)extensions.next();
- removeChildrenOf(exts);
- if (debug)
- {
- soapMessage.writeTo(System.out);
- }
- }
- }
- }
+ traverseAndRemoveExtensions(soapBody);
}
}
catch (Exception e)
@@ -126,27 +97,39 @@
}
}
- private void removeChildrenOf(Element element)
+ /**
+ * Remove extensions nodes recursively, depth-first.
+ *
+ * @param node
+ */
+ private void traverseAndRemoveExtensions(org.w3c.dom.Node node)
{
- Iterator children = DOMUtils.getChildElements(element);
- while (children.hasNext())
+ NodeList children = node.getChildNodes();
+ int childrenNb = children.getLength();
+ for (int i = 0; i < childrenNb; i++)
{
- Node node = (Node)children.next();
- element.removeChild(node);
- }
- }
+ org.w3c.dom.Node child = children.item(i);
- /*private boolean shouldRemoveWSRPExtensions(SOAPHeader soapHeader)
- {
- boolean result = false;
- if (soapHeader != null)
- {
- Iterator iter = DOMUtils.getChildElements(soapHeader, "jboss_wsrp_remove_extension");
- if (iter.hasNext())
+ // only process elements
+ if (org.w3c.dom.Node.ELEMENT_NODE == child.getNodeType())
{
- result = true;
+ String name = child.getLocalName();
+
+ // if we found an extension, remove it or continue
+ if (EXTENSIONS.equals(name))
+ {
+ if (debug)
+ {
+ log.debug("Extensions removed on " + name);
+ }
+ node.removeChild(child);
+ break;
+ }
+ else
+ {
+ traverseAndRemoveExtensions(child);
+ }
}
}
- return result;
- }*/
+ }
}
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2009-03-06 23:22:50 UTC (rev 12986)
@@ -456,33 +456,12 @@
*/
Registration getRegistrationOrFailIfInvalid(RegistrationContext registrationContext) throws InvalidRegistrationFault, OperationFailedFault
{
- Registration registration = getRegistrationFrom(registrationContext);
- isRegistrationValid(registration, true);
+ Registration registration = registrationHandler.getRegistrationFrom(registrationContext);
+ registrationHandler.isRegistrationValid(registration, true);
return registration;
}
- /**
- * @param registration
- * @param throwExceptionIfInvalid
- * @return
- * @since 2.6.2
- */
- boolean isRegistrationValid(Registration registration, boolean throwExceptionIfInvalid) throws InvalidRegistrationFault
- {
- return registrationHandler.isRegistrationValid(registration, throwExceptionIfInvalid);
- }
-
- /**
- * @param registrationContext
- * @return
- * @since 2.6.2
- */
- Registration getRegistrationFrom(RegistrationContext registrationContext)
- {
- return registrationHandler.getRegistrationFrom(registrationContext);
- }
-
private Boolean remotableByDefault;
public Boolean isRemotableByDefault()
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java 2009-03-06 23:22:50 UTC (rev 12986)
@@ -73,13 +73,16 @@
private static DefaultSchemaResolver RESOLVER;
+ private static final String PRODUCER_NAMESPACE = "urn:jboss:portal:wsrp:producer:v2_7";
+ private static final String PRODUCER_XSD = "jboss-wsrp-producer_2_7.xsd";
+
static
{
RESOLVER = new DefaultSchemaResolver();
RESOLVER.setCacheResolvedSchemas(true);
RESOLVER.addSchemaLocation("http://www.w3.org/XML/1998/namespace", "xsd/xml.xsd");
RESOLVER.addSchemaLocation("urn:jboss:portal:wsrp:producer:v2_6", "xsd/jboss-wsrp-producer_2_6.xsd");
- RESOLVER.addSchemaLocation("urn:jboss:portal:wsrp:producer:v2_7", "xsd/jboss-wsrp-producer_2_7.xsd");
+ RESOLVER.addSchemaLocation(PRODUCER_NAMESPACE, "xsd/" + PRODUCER_XSD);
}
public String getConfigLocation()
@@ -111,8 +114,27 @@
{
throw new RuntimeException("Couldn't locate server data dir!", e);
}
- config = new File(dataDir, "portal/wsrp-producer-config.xml");
+ // if "portal" directory doesn't exist already in data, create it (JBPORTAL-2229)
+ File portalDir = new File(dataDir, "portal");
+ if (!portalDir.exists())
+ {
+ if (!portalDir.mkdir())
+ {
+ throw new RuntimeException("Couldn't create 'portal' directory in " + dataDir.getAbsolutePath());
+ }
+ }
+ else
+ {
+ if (!portalDir.isDirectory())
+ {
+ throw new RuntimeException("Was expecting a directory named 'portal' in " + dataDir.getAbsolutePath()
+ + ", not a simple file! Cannot continue.");
+ }
+ }
+
+ config = new File(portalDir, "wsrp-producer-config.xml");
+
reloadConfiguration();
}
@@ -129,7 +151,7 @@
if (config.exists())
{
log.debug("Configuration saved at " + config.getCanonicalPath()
- + " is not loading properly. Falling back to default configuration.");
+ + " is not loading properly. Falling back to default configuration.");
config.delete(); // delete improper config so that we retrieve the default configuration
loadConfigurationAt(getConfigLocationURL());
}
@@ -229,7 +251,7 @@
StringWriter xmlOutput = new StringWriter();
// get the XML Schema source
- InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("xsd/jboss-wsrp-producer_2_6.xsd");
+ InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("xsd/" + PRODUCER_XSD);
Reader xsReader = new InputStreamReader(is);
@@ -239,15 +261,15 @@
marshaller.setSchemaResolver(RESOLVER);
// we need to specify what elements are top most (roots) providing namespace URI, prefix and local name
- marshaller.addRootElement("urn:jboss:portal:wsrp:producer:v2_6", "", "producer-configuration");
+ marshaller.addRootElement(PRODUCER_NAMESPACE, "", "producer-configuration");
// declare default namespace
- marshaller.declareNamespace("wpc", "urn:jboss:portal:wsrp:producer:v2_6");
+ marshaller.declareNamespace("wpc", PRODUCER_NAMESPACE);
// add schema location by declaring xsi namespace and adding xsi:schemaLocation attribute
marshaller.declareNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
marshaller.addAttribute("xsi", "schemaLocation", "string",
- "urn:jboss:portal:wsrp:producer:v2_6 http://www.jboss.org/portal/xsd/jboss-wsrp-producer_2_6.xsd");
+ PRODUCER_NAMESPACE + " http://www.jboss.org/portal/xsd/" + PRODUCER_XSD);
// create an instance of Object Model Provider
ObjectModelProvider provider = new ProducerConfigurationProvider();
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/src/resources/portal-wsrp-client-jar/META-INF/wsdl/wsrp_v1_types.xsd
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/resources/portal-wsrp-client-jar/META-INF/wsdl/wsrp_v1_types.xsd 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/resources/portal-wsrp-client-jar/META-INF/wsdl/wsrp_v1_types.xsd 2009-03-06 23:22:50 UTC (rev 12986)
@@ -50,8 +50,8 @@
<complexType name="Extension">
<sequence>
- <!-- JBoss modification: added processContents="lax" to better process extensions. -->
- <any namespace="##other" processContents="lax"/>
+ <!-- JBoss modification: added processContents="skip" to better process extensions. -->
+ <any namespace="##other" processContents="skip"/>
</sequence>
</complexType>
@@ -502,8 +502,8 @@
<sequence>
<!-- Would prefer this to be a choice ... Axis and JAX-RPC failed to handle that -->
<element name="stringValue" type="xsd:string" minOccurs="0"/>
- <!-- JBoss modification: added processContents="lax" to better process extensions. -->
- <any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
+ <!-- JBoss modification: added processContents="skip" to better process extensions. -->
+ <any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
<!-- end prefer this to be a choice -->
</sequence>
<attribute name="name" type="xsd:string" use="required"/>
@@ -536,8 +536,8 @@
<complexType name="ModelTypes">
<sequence>
- <!-- JBoss modification: added processContents="lax" to better process extensions. -->
- <any namespace="##other" processContents="lax"/>
+ <!-- JBoss modification: added processContents="skip" to better process extensions. -->
+ <any namespace="##other" processContents="skip"/>
</sequence>
</complexType>
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/src/resources/portal-wsrp-war/WEB-INF/wsdl/wsrp_v1_types.xsd
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/resources/portal-wsrp-war/WEB-INF/wsdl/wsrp_v1_types.xsd 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/resources/portal-wsrp-war/WEB-INF/wsdl/wsrp_v1_types.xsd 2009-03-06 23:22:50 UTC (rev 12986)
@@ -50,8 +50,8 @@
<complexType name="Extension">
<sequence>
- <!-- JBoss modification: added processContents="lax" to better process extensions. -->
- <any namespace="##other" processContents="lax"/>
+ <!-- JBoss modification: added processContents="skip" to better process extensions. -->
+ <any namespace="##other" processContents="skip"/>
</sequence>
</complexType>
@@ -502,8 +502,8 @@
<sequence>
<!-- Would prefer this to be a choice ... Axis and JAX-RPC failed to handle that -->
<element name="stringValue" type="xsd:string" minOccurs="0"/>
- <!-- JBoss modification: added processContents="lax" to better process extensions. -->
- <any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
+ <!-- JBoss modification: added processContents="skip" to better process extensions. -->
+ <any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
<!-- end prefer this to be a choice -->
</sequence>
<attribute name="name" type="xsd:string" use="required"/>
@@ -536,8 +536,8 @@
<complexType name="ModelTypes">
<sequence>
- <!-- JBoss modification: added processContents="lax" to better process extensions. -->
- <any namespace="##other" processContents="lax"/>
+ <!-- JBoss modification: added processContents="skip" to better process extensions. -->
+ <any namespace="##other" processContents="skip"/>
</sequence>
</complexType>
Modified: branches/JBoss_Portal_AS5_Deployer/wsrp/src/resources/webservice/wsrp_v1_types.xsd
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/wsrp/src/resources/webservice/wsrp_v1_types.xsd 2009-03-06 23:22:39 UTC (rev 12985)
+++ branches/JBoss_Portal_AS5_Deployer/wsrp/src/resources/webservice/wsrp_v1_types.xsd 2009-03-06 23:22:50 UTC (rev 12986)
@@ -50,8 +50,8 @@
<complexType name="Extension">
<sequence>
- <!-- JBoss modification: added processContents="lax" to better process extensions. -->
- <any namespace="##other" processContents="lax"/>
+ <!-- JBoss modification: added processContents="skip" to better process extensions. -->
+ <any namespace="##other" processContents="skip"/>
</sequence>
</complexType>
@@ -502,8 +502,8 @@
<sequence>
<!-- Would prefer this to be a choice ... Axis and JAX-RPC failed to handle that -->
<element name="stringValue" type="xsd:string" minOccurs="0"/>
- <!-- JBoss modification: added processContents="lax" to better process extensions. -->
- <any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
+ <!-- JBoss modification: added processContents="skip" to better process extensions. -->
+ <any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
<!-- end prefer this to be a choice -->
</sequence>
<attribute name="name" type="xsd:string" use="required"/>
@@ -536,8 +536,8 @@
<complexType name="ModelTypes">
<sequence>
- <!-- JBoss modification: added processContents="lax" to better process extensions. -->
- <any namespace="##other" processContents="lax"/>
+ <!-- JBoss modification: added processContents="skip" to better process extensions. -->
+ <any namespace="##other" processContents="skip"/>
</sequence>
</complexType>
17 years, 1 month
JBoss Portal SVN: r12985 - in branches/JBoss_Portal_AS5_Deployer/core-samples: src/main/org/jboss/portal/core/samples/basic and 11 other directories.
by portal-commits@lists.jboss.org
Author: mwringe
Date: 2009-03-06 18:22:39 -0500 (Fri, 06 Mar 2009)
New Revision: 12985
Added:
branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/classes/Resource_pt_BR.properties
branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-news-samples-war/WEB-INF/classes/NewsResource_pt_BR.properties
branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_pt_BR.properties
branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-weather-samples-war/WEB-INF/classes/WeatherResource_pt_BR.properties
Modified:
branches/JBoss_Portal_AS5_Deployer/core-samples/build.xml
branches/JBoss_Portal_AS5_Deployer/core-samples/src/main/org/jboss/portal/core/samples/basic/HeaderContentPortlet.java
branches/JBoss_Portal_AS5_Deployer/core-samples/src/main/org/jboss/portal/core/samples/basic/PageParameterPortlet.java
branches/JBoss_Portal_AS5_Deployer/core-samples/src/main/org/jboss/portal/core/samples/basic/PortletSessionPortlet.java
branches/JBoss_Portal_AS5_Deployer/core-samples/src/main/org/jboss/portal/core/samples/basic/RepeatRefreshPortlet.java
branches/JBoss_Portal_AS5_Deployer/core-samples/src/main/org/jboss/portal/core/samples/jsp/JSPPortlet.java
branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-basic-samples-war/WEB-INF/default-object.xml
branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-basic-samples-war/WEB-INF/jsp/ajax/repeatrefresh.jsp
branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml
branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-catalog-samples-war/WEB-INF/jsp/catalog/index.jsp
branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-catalog-samples-war/WEB-INF/jsp/catalog/sitemap.jsp
branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/jsp/view.jsp
branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/jsp/view_fr.jsp
branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/portlet.xml
branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-news-samples-war/WEB-INF/classes/NewsResource_it.properties
branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_it.properties
branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/help.jsp
branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/noUser.jsp
branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/users.jsp
branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-weather-samples-war/WEB-INF/classes/WeatherResource.properties
Log:
Merge JBoss_Portal_Branch_2_7 changes (rev range 12254:12964) into JBoss_Portal_AS5_Deployer branch
Modified: branches/JBoss_Portal_AS5_Deployer/core-samples/build.xml
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/build.xml 2009-03-06 23:22:30 UTC (rev 12984)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/build.xml 2009-03-06 23:22:39 UTC (rev 12985)
@@ -102,10 +102,10 @@
<path refid="apache.fileupload.classpath"/>
<path refid="jakarta.io.classpath"/>
<path refid="oswego.concurrent.classpath"/>
- <path refid="sun.javamail.classpath"/>
+ <path refid="glassfish.javamail.classpath"/>
<path refid="jwebunit.jwebunit.classpath"/>
<path refid="dbunit.dbunit.classpath"/>
- <path refid="sun.jaf.classpath"/>
+ <path refid="glassfish.jaf.classpath"/>
<path refid="portals.bridges.classpath"/>
<path refid="beanshell.beanshell.classpath"/>
<path refid="facelets.facelets.classpath"/>
Modified: branches/JBoss_Portal_AS5_Deployer/core-samples/src/main/org/jboss/portal/core/samples/basic/HeaderContentPortlet.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/main/org/jboss/portal/core/samples/basic/HeaderContentPortlet.java 2009-03-06 23:22:30 UTC (rev 12984)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/main/org/jboss/portal/core/samples/basic/HeaderContentPortlet.java 2009-03-06 23:22:39 UTC (rev 12985)
@@ -24,9 +24,16 @@
import javax.portlet.GenericPortlet;
import javax.portlet.PortletException;
+import javax.portlet.PortletURL;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.portlet.ResourceURL;
+import javax.portlet.WindowState;
+
import java.io.IOException;
+import java.io.PrintWriter;
import java.io.Writer;
/*
@@ -45,9 +52,35 @@
res.setContentType("text/html");
Writer writer = res.getWriter();
+ ResourceURL url = res.createResourceURL();
+ writer.write("<div><a href=\"" + url.toString() + "\">Resource URL</a></div>");
writer.write("<div id='Introducing-HeaderContent'/>");
writer.write("<div class=\"portlet-section-body\"><p id='rewrite-js'><button id=\"Introducing-HeaderContentInput\" class=\"portlet-form-button\" type='button' onClick='injectJS()'>Call injected javascript</button></p></div>");
+
+
writer.flush();
writer.close();
}
+
+ @Override
+ public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws PortletException, IOException
+ {
+ resourceResponse.setProperty("Expires", "0");
+ resourceResponse.setProperty("Content-Disposition", "attachment; filename=vcard.vcf ");
+ resourceResponse.setContentType("text/x-vcard");
+ PrintWriter writer = resourceResponse.getWriter();
+
+ writer.print("BEGIN:VCARD\n");
+ writer.print("VERSION:3.0\n");
+ writer.print("FN:Thomas Heute\n");
+ writer.print("N:Heute;Thomas;;;\n");
+ writer.print("EMAIL;TYPE=INTERNET;TYPE=WORK:theute@redhat.com\n");
+ writer.print("TITLE:JBoss Portal Project Lead\n");
+ writer.print("ORG:Red Hat\n");
+ writer.print("END:VCARD\n");
+
+ writer.flush();
+ writer.close();
+ }
+
}
Modified: branches/JBoss_Portal_AS5_Deployer/core-samples/src/main/org/jboss/portal/core/samples/basic/PageParameterPortlet.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/main/org/jboss/portal/core/samples/basic/PageParameterPortlet.java 2009-03-06 23:22:30 UTC (rev 12984)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/main/org/jboss/portal/core/samples/basic/PageParameterPortlet.java 2009-03-06 23:22:39 UTC (rev 12985)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -24,11 +24,11 @@
import org.jboss.portal.api.node.PortalNode;
import org.jboss.portal.api.node.PortalNodeURL;
+import org.jboss.portlet.JBossActionRequest;
+import org.jboss.portlet.JBossActionResponse;
+import org.jboss.portlet.JBossPortlet;
import org.jboss.portlet.JBossRenderRequest;
-import org.jboss.portlet.JBossPortlet;
import org.jboss.portlet.JBossRenderResponse;
-import org.jboss.portlet.JBossActionRequest;
-import org.jboss.portlet.JBossActionResponse;
import javax.portlet.PortletException;
import javax.portlet.PortletSecurityException;
@@ -64,7 +64,7 @@
PrintWriter writer = resp.getWriter();
//
- for (Enumeration<String> e = getPortletConfig().getPublicRenderParameterNames();e.hasMoreElements();)
+ for (Enumeration<String> e = getPortletConfig().getPublicRenderParameterNames(); e.hasMoreElements();)
{
String parameterName = e.nextElement();
@@ -74,9 +74,9 @@
//
writer.println("<div class=\"portlet-font\">Page parameters can be bound to coordination aliases. Out of the box, the request parameters" +
- " are themselves bound to page parameters. Setting a value below, will modify the URL by adding a request parameter.<br/>" +
- "This can be particulary intersting to use URL request parameters to set values usable by a portlet.</div>");
-
+ " are themselves bound to page parameters. Setting a value below, will modify the URL by adding a request parameter.<br/>" +
+ "This can be particulary interesting to pass values that can then be used by portlets.</div>");
+
//
writer.println("<form action=\"" + resp.createActionURL() + "\" method=\"POST\"><table>");
writer.println("<tr><td>Page parameter name:</td><td><input type=\"text\" name=\"name\" width=\"36\" value=\"\"/></td></tr>");
Modified: branches/JBoss_Portal_AS5_Deployer/core-samples/src/main/org/jboss/portal/core/samples/basic/PortletSessionPortlet.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/main/org/jboss/portal/core/samples/basic/PortletSessionPortlet.java 2009-03-06 23:22:30 UTC (rev 12984)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/main/org/jboss/portal/core/samples/basic/PortletSessionPortlet.java 2009-03-06 23:22:39 UTC (rev 12985)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -85,11 +85,19 @@
}
//
- writer.println("<form action=\"" + purl.toString() + "\" method=\"post\">");
+// writer.println("<script type='text/javascript'>\n" +
+// "function processForm(value) {" +
+// "var form = document.getElementById('sessionForm');\n" +
+// "var hidden = document.getElementById('sessionHidden');\n" +
+// "hidden.value = value;\n" +
+// "form.submit();}\n" +
+// "</script>");
+ writer.println("<form id='sessionForm' action=\"" + purl.toString() + "\" method=\"post\">");
writer.println("<input type=\"text\" name=\"name\"/>");
writer.println("<input type=\"text\" name=\"value\"/>");
- writer.println("<input type=\"submit\" name=\"portlet\" value=\"Add to portlet scope\"/>");
- writer.println("<input type=\"submit\" name=\"application\" value=\"Add to application scope\"/>");
+ writer.println("<input type=\"submit\" name=\"portlet\" value=\"Add to portlet scope\" />");
+ writer.println("<input type=\"submit\" name=\"application\" value=\"Add to application scope\" />");
+ // writer.println("<input id='sessionHidden' name='scope' type='hidden'/>");
writer.println("</form><br/>");
//
Modified: branches/JBoss_Portal_AS5_Deployer/core-samples/src/main/org/jboss/portal/core/samples/basic/RepeatRefreshPortlet.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/main/org/jboss/portal/core/samples/basic/RepeatRefreshPortlet.java 2009-03-06 23:22:30 UTC (rev 12984)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/main/org/jboss/portal/core/samples/basic/RepeatRefreshPortlet.java 2009-03-06 23:22:39 UTC (rev 12985)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -22,22 +22,16 @@
******************************************************************************/
package org.jboss.portal.core.samples.basic;
-import java.io.IOException;
-import java.io.PrintWriter;
import javax.portlet.GenericPortlet;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
-import javax.portlet.PortletException;
import javax.portlet.ResourceRequest;
import javax.portlet.ResourceResponse;
-import javax.portlet.ResourceURL;
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletSecurityException;
-import javax.portlet.PortletURL;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.PortletContext;
+import java.io.IOException;
+import java.io.PrintWriter;
/**
* @author <a href="mailto:whales@redhat.com">Wesley Hales</a>
@@ -47,58 +41,50 @@
{
private static final String JSP_PATH = "/WEB-INF/jsp/ajax";
- public void processAction(ActionRequest req, ActionResponse resp) throws PortletException, PortletSecurityException, IOException
- {
-
- //String repeatText = req.getParameter("repeat");
- // set the text from form input
- //if (repeatText != null){
- //resp.setRenderParameter("repeat", repeatText);
- //}
- // request view
- //resp.setPortletMode(PortletMode.VIEW);
-
- }
public void render(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException
{
PortletContext context = getPortletContext();
PortletRequestDispatcher rd = context.getRequestDispatcher(JSP_PATH + "/repeatrefresh.jsp");
rd.include(renderRequest, renderResponse);
}
+
public void serveResource(ResourceRequest req, ResourceResponse resp) throws PortletException, IOException
{
String repeatText = req.getParameter("repeat");
String prodId = req.getParameter("prodId");
- String namespace =resp.getNamespace();
-
resp.setContentType("text/html");
PrintWriter writer = resp.getWriter();
- if (repeatText != null){
- writer.print("<div id=\"repeat-text\">"+ req.getPrivateParameterMap().get("repeat")[0] +"</div>");
+ if (repeatText != null)
+ {
+ writer.print("<div id=\"repeat-text\">" + req.getPrivateParameterMap().get("repeat")[0] + "</div>");
}
- if (prodId != null){
- if (prodId.equals("1")){
- writer.print("<div id=\"product-text\">Product ID: "+ prodId +"" +
- "<br/>" +
- " B BY BURTON ALPHA<br/>" +
- "Sale Price: $314.96 " +
- "</div>");
+ if (prodId != null)
+ {
+ if (prodId.equals("1"))
+ {
+ writer.print("<div id=\"product-text\">Product ID: " + prodId + "" +
+ "<br/>" +
+ " B BY BURTON ALPHA<br/>" +
+ "Sale Price: $314.96 " +
+ "</div>");
}
- if (prodId.equals("2")){
- writer.print("<div id=\"product-text\">Product ID: "+ prodId +"" +
- "<br/>" +
+ if (prodId.equals("2"))
+ {
+ writer.print("<div id=\"product-text\">Product ID: " + prodId + "" +
+ "<br/>" +
"FORUM DESTROYER LTD<br/>" +
"$319.99 " +
- "</div>");
+ "</div>");
}
- if (prodId.equals("3")){
- writer.print("<div id=\"product-text\">Product ID: "+ prodId +"" +
- "<br/>" +
- "\n" +
+ if (prodId.equals("3"))
+ {
+ writer.print("<div id=\"product-text\">Product ID: " + prodId + "" +
+ "<br/>" +
+ "\n" +
"SANTA CRUZ ALLSTAR<br/>" +
"$256.00 " +
- "</div>");
+ "</div>");
}
}
Modified: branches/JBoss_Portal_AS5_Deployer/core-samples/src/main/org/jboss/portal/core/samples/jsp/JSPPortlet.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/main/org/jboss/portal/core/samples/jsp/JSPPortlet.java 2009-03-06 23:22:30 UTC (rev 12984)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/main/org/jboss/portal/core/samples/jsp/JSPPortlet.java 2009-03-06 23:22:39 UTC (rev 12985)
@@ -26,8 +26,12 @@
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.UnavailableException;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.ByteArrayOutputStream;
import java.util.Locale;
/**
@@ -43,11 +47,12 @@
rResponse.setContentType("text/html");
Locale locale = rRequest.getLocale();
- javax.portlet.PortletRequestDispatcher pRD = null;
-
- if (this.getPortletContext().getResource(JSP_PATH + "/view_" + locale.getLanguage() + ".jsp") != null)
+ javax.portlet.PortletRequestDispatcher pRD;
+
+ String localizedView = JSP_PATH + "/view_" + locale.getLanguage() + ".jsp";
+ if (this.getPortletContext().getResource(localizedView) != null)
{
- pRD = this.getPortletContext().getRequestDispatcher(JSP_PATH + "/view_" + locale.getLanguage() + ".jsp");
+ pRD = this.getPortletContext().getRequestDispatcher(localizedView);
}
else
{
@@ -56,4 +61,28 @@
pRD.include(rRequest, rResponse);
}
+
+ @Override
+ public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws PortletException, IOException
+ {
+ String resourceID = resourceRequest.getResourceID();
+ InputStream asStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("images/" + resourceID + ".gif");
+ resourceResponse.setContentType("image/gif");
+ byte[] buffer = new byte[1024];
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ while (true)
+ {
+ int i = asStream.read(buffer);
+ if (i == 0)
+ {
+ continue;
+ }
+ if (i == -1)
+ {
+ break;
+ }
+ out.write(buffer, 0, i);
+ }
+ resourceResponse.getPortletOutputStream().write(out.toByteArray());
+ }
}
\ No newline at end of file
Modified: branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-basic-samples-war/WEB-INF/default-object.xml
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-basic-samples-war/WEB-INF/default-object.xml 2009-03-06 23:22:30 UTC (rev 12984)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-basic-samples-war/WEB-INF/default-object.xml 2009-03-06 23:22:39 UTC (rev 12985)
@@ -1,31 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ Copyright 2009, Red Hat Middleware, LLC, and individual
+ ~ contributors as indicated by the @authors tag. See the
+ ~ copyright.txt in the distribution for a full listing of
+ ~ individual contributors.
+ ~
+ ~ This is free software; you can redistribute it and/or modify it
+ ~ under the terms of the GNU Lesser General Public License as
+ ~ published by the Free Software Foundation; either version 2.1 of
+ ~ the License, or (at your option) any later version.
+ ~
+ ~ This software is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ ~ Lesser General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public
+ ~ License along with this software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!DOCTYPE deployments PUBLIC
"-//JBoss Portal//DTD Portal Object 2.6//EN"
"http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
-
+
<deployments>
<deployment>
<parent-ref>default</parent-ref>
@@ -424,38 +424,38 @@
<page-name>Page event test</page-name>
<listener>window_event_listener</listener>
<window>
- <window-name>CatalogPortletWindow1</window-name>
- <instance-ref>CatalogPortletInstance</instance-ref>
+ <window-name>EventPortletWindow1</window-name>
+ <instance-ref>EventPortletInstance</instance-ref>
<region>left</region>
<height>0</height>
</window>
<window>
- <window-name>CatalogPortletWindow2</window-name>
- <instance-ref>CatalogPortletInstance</instance-ref>
+ <window-name>EventPortletWindow2</window-name>
+ <instance-ref>EventPortletInstance</instance-ref>
<region>left</region>
<height>1</height>
</window>
<window>
- <window-name>CatalogPortletWindow3</window-name>
- <instance-ref>CatalogPortletInstance</instance-ref>
+ <window-name>EventPortletWindow3</window-name>
+ <instance-ref>EventPortletInstance</instance-ref>
<region>left</region>
<height>2</height>
</window>
<window>
- <window-name>CatalogPortletWindow4</window-name>
- <instance-ref>CatalogPortletInstance</instance-ref>
+ <window-name>EventPortletWindow4</window-name>
+ <instance-ref>EventPortletInstance</instance-ref>
<region>center</region>
<height>0</height>
</window>
<window>
- <window-name>CatalogPortletWindow5</window-name>
- <instance-ref>CatalogPortletInstance</instance-ref>
+ <window-name>EventPortletWindow5</window-name>
+ <instance-ref>EventPortletInstance</instance-ref>
<region>center</region>
<height>1</height>
</window>
<window>
- <window-name>CatalogPortletWindow6</window-name>
- <instance-ref>CatalogPortletInstance</instance-ref>
+ <window-name>EventPortletWindow6</window-name>
+ <instance-ref>EventPortletInstance</instance-ref>
<region>center</region>
<height>2</height>
</window>
Modified: branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-basic-samples-war/WEB-INF/jsp/ajax/repeatrefresh.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-basic-samples-war/WEB-INF/jsp/ajax/repeatrefresh.jsp 2009-03-06 23:22:30 UTC (rev 12984)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-basic-samples-war/WEB-INF/jsp/ajax/repeatrefresh.jsp 2009-03-06 23:22:39 UTC (rev 12985)
@@ -1,5 +1,5 @@
<%@ page import="javax.portlet.ResourceURL" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<!--This tag establishes three objects; renderRequest, renderResponse and portletConfig for use in this JSP page.-->
<portlet:defineObjects/>
Modified: branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml 2009-03-06 23:22:30 UTC (rev 12984)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-basic-samples-war/WEB-INF/portlet.xml 2009-03-06 23:22:39 UTC (rev 12985)
@@ -428,6 +428,9 @@
<name>user.name.nickName</name>
</user-attribute>
<user-attribute>
+ <name>user.login.id</name>
+ </user-attribute>
+ <user-attribute>
<name>user.business-info.online.email</name>
</user-attribute>
<user-attribute>
Modified: branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-catalog-samples-war/WEB-INF/jsp/catalog/index.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-catalog-samples-war/WEB-INF/jsp/catalog/index.jsp 2009-03-06 23:22:30 UTC (rev 12984)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-catalog-samples-war/WEB-INF/jsp/catalog/index.jsp 2009-03-06 23:22:39 UTC (rev 12985)
@@ -3,7 +3,7 @@
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Iterator" %>
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<portlet:defineObjects/>
Modified: branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-catalog-samples-war/WEB-INF/jsp/catalog/sitemap.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-catalog-samples-war/WEB-INF/jsp/catalog/sitemap.jsp 2009-03-06 23:22:30 UTC (rev 12984)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-catalog-samples-war/WEB-INF/jsp/catalog/sitemap.jsp 2009-03-06 23:22:39 UTC (rev 12985)
@@ -3,7 +3,7 @@
<%@ page import="org.jboss.portal.api.node.PortalNode" %>
<%@ page import="org.jboss.portal.api.node.PortalNodeURL" %>
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<portlet:defineObjects/>
Copied: branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/classes/Resource_pt_BR.properties (from rev 12964, branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/classes/Resource_pt_BR.properties)
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/classes/Resource_pt_BR.properties (rev 0)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/classes/Resource_pt_BR.properties 2009-03-06 23:22:39 UTC (rev 12985)
@@ -0,0 +1,2 @@
+javax.portlet.title=Sauda\u00E7\u00F5es\!
+javax.portlet.keywords=sample,test
\ No newline at end of file
Modified: branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/jsp/view.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/jsp/view.jsp 2009-03-06 23:22:30 UTC (rev 12984)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/jsp/view.jsp 2009-03-06 23:22:39 UTC (rev 12985)
@@ -22,7 +22,7 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ page isELIgnored="false" %>
<portlet:defineObjects/>
@@ -30,13 +30,13 @@
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<td align="center"><a href="http://portal.demo.jboss.com" target="_blank"><img
- src="<%= renderRequest.getContextPath() %>/images/dodemo.gif" border="0"
+ src="<portlet:resourceURL id='dodemo'/>" border="0"
alt="Try the latest release of JBoss Portal, live and online." /></a>
<a href="http://labs.jboss.com/portal/jbossportal/download/index.html" target="_blank"><img
- src="<%= renderRequest.getContextPath() %>/images/getcode.gif" border="0"
+ src="<portlet:resourceURL id='getcode'/>" border="0"
alt="Download JBoss Portal and have it up and running in minutes." /></a>
<a href="http://www.portletswap.com" target="_blank"><img
- src="<%= renderRequest.getContextPath() %>/images/accessorize.gif" border="0"
+ src="<portlet:resourceURL id='accessorize'/>" border="0"
alt="Download portlets and layouts for your new JBoss Portal installation." /></a></td>
</tr>
<tr>
@@ -44,15 +44,15 @@
</tr>
<tr>
<td class="portlet-section-alternate">
- <font class="portlet-font">This is a basic installation of <b><%= PortalConstants.VERSION %>
- </b>. You may
- log in at any time, using the <i>Login</i> link at the top-right of this page, with the following
- credentials:</font>
+ <p class="portlet-font">This is a basic installation of <strong><%= PortalConstants.VERSION %></strong>.
+ You may log in at any time, using the <span style="font-style:italic;">Login</span> link at the top-right
+ of this page, with the following credentials:
+ </p>
</td>
</tr>
<tr>
<td class="portlet-section-alternate" align="center">
- <b>user/user</b> or <b>admin/admin</b>
+ <strong>user/user</strong> or <strong>admin/admin</strong>
</td>
</tr>
<tr>
Modified: branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/jsp/view_fr.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/jsp/view_fr.jsp 2009-03-06 23:22:30 UTC (rev 12984)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/jsp/view_fr.jsp 2009-03-06 23:22:39 UTC (rev 12985)
@@ -22,7 +22,7 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ page isELIgnored="false" %>
<portlet:defineObjects/>
@@ -30,13 +30,13 @@
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<td align="center"><a href="http://portal.demo.jboss.com" target="_blank"><img
- src="<%= renderRequest.getContextPath() %>/images/dodemo.gif" border="0"
+ src="<portlet:resourceURL id='dodemo'/>" border="0"
alt="Try the latest release of JBoss Portal, live and online." /></a>
<a href="http://labs.jboss.com/portal/jbossportal/download/index.html" target="_blank"><img
- src="<%= renderRequest.getContextPath() %>/images/getcode.gif" border="0"
+ src="<portlet:resourceURL id='getcode'/>" border="0"
alt="Download JBoss Portal and have it up and running in minutes." /></a>
<a href="http://www.portletswap.com" target="_blank"><img
- src="<%= renderRequest.getContextPath() %>/images/accessorize.gif" border="0"
+ src="<portlet:resourceURL id='accessorize'/>" border="0"
alt="Download portlets and layouts for your new JBoss Portal installation." /></a></td>
</tr>
<tr>
@@ -44,18 +44,23 @@
</tr>
<tr>
<td class="portlet-section-alternate">
- <font class="portlet-font">Ceci est l'installation par défaut de <b><%= PortalConstants.VERSION %>
- </b>. Vous pouvez vous connecter en cliquant sur le lien <i>Login</i> en haut à droite de cette page, avec les identifiants suivants:</font>
+ <p class="portlet-font">
+ Ceci est l'installation par défaut de <strong><%= PortalConstants.VERSION %></strong>. Vous pouvez
+ vous connecter en cliquant sur le lien <span style="font-style:italic;">Login</span>
+ en haut à droite de cette page, avec les identifiants suivants:
+ </p>
</td>
</tr>
<tr>
<td class="portlet-section-alternate" align="center">
- <b>user/user</b> ou <b>admin/admin</b>
+ <strong>user/user</strong> ou <strong>admin/admin</strong>
</td>
</tr>
<tr>
<td align="center">
- Si vous avez besoin d'aide pour naviguer, configurer ou pour administrer le portail, veuillez vous référer <a href="http://labs.jboss.com/portal/jbossportal/docs/index.html" target="_blank">à la documentation </a>.
+ Si vous avez besoin d'aide pour naviguer, configurer ou pour administrer le portail, veuillez vous
+ référer
+ <a href="http://labs.jboss.com/portal/jbossportal/docs/index.html" target="_blank">à la documentation </a>.
</td>
</tr>
</table>
Modified: branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/portlet.xml 2009-03-06 23:22:30 UTC (rev 12984)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-jsp-samples-war/WEB-INF/portlet.xml 2009-03-06 23:22:39 UTC (rev 12985)
@@ -23,10 +23,10 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<portlet-app
- xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
- version="1.0">
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
<portlet>
<description>Simple JSP portlet</description>
<portlet-name>JSPPortlet</portlet-name>
Modified: branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-news-samples-war/WEB-INF/classes/NewsResource_it.properties
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-news-samples-war/WEB-INF/classes/NewsResource_it.properties 2009-03-06 23:22:30 UTC (rev 12984)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-news-samples-war/WEB-INF/classes/NewsResource_it.properties 2009-03-06 23:22:39 UTC (rev 12985)
@@ -23,4 +23,4 @@
javax.portlet.preference.name.RssXml=URL per RSS
javax.portlet.preference.name.expires=Scadenza
-org.jboss.portal.object.name.default.News=Novita'
\ No newline at end of file
+org.jboss.portal.object.name.default.News=Novit\u00e0
\ No newline at end of file
Copied: branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-news-samples-war/WEB-INF/classes/NewsResource_pt_BR.properties (from rev 12964, branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-news-samples-war/WEB-INF/classes/NewsResource_pt_BR.properties)
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-news-samples-war/WEB-INF/classes/NewsResource_pt_BR.properties (rev 0)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-news-samples-war/WEB-INF/classes/NewsResource_pt_BR.properties 2009-03-06 23:22:39 UTC (rev 12985)
@@ -0,0 +1,26 @@
+################################################################################
+# JBoss, a division of Red Hat #
+# Copyright 2006, Red Hat Middleware, LLC, and individual #
+# contributors as indicated by the @authors tag. See the #
+# copyright.txt in the distribution for a full listing of #
+# individual contributors. #
+# #
+# This is free software; you can redistribute it and/or modify it #
+# under the terms of the GNU Lesser General Public License as #
+# published by the Free Software Foundation; either version 2.1 of #
+# the License, or (at your option) any later version. #
+# #
+# This software is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
+# Lesser General Public License for more details. #
+# #
+# You should have received a copy of the GNU Lesser General Public #
+# License along with this software; if not, write to the Free #
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA #
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org. #
+################################################################################
+
+javax.portlet.preference.name.RssXml=URL do RSS
+javax.portlet.preference.name.expires=Tempo de expira\u00E7\u00E3o
+org.jboss.portal.object.name.default.News=Not\u00EDcias
\ No newline at end of file
Modified: branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_it.properties
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_it.properties 2009-03-06 23:22:30 UTC (rev 12984)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_it.properties 2009-03-06 23:22:39 UTC (rev 12985)
@@ -20,9 +20,11 @@
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA #
# 02110-1301 USA, or see the FSF site: http://www.fsf.org. #
################################################################################
+javax.portlet.title=Utenti online
+javax.portlet.keywords=esempio,test
NO_USER_ONLINE=Nessun utente \u00e8 online
-#ONE_USER_ONLINE=You are the only user online
+ONE_USER_ONLINE=Sei il solo utente online
USERS_ONLINE_0=Al momento ci sono <b>
USERS_ONLINE_1=</b> utenti online
USERS_ARE_0=<b>
Copied: branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_pt_BR.properties (from rev 12964, branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_pt_BR.properties)
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_pt_BR.properties (rev 0)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_pt_BR.properties 2009-03-06 23:22:39 UTC (rev 12985)
@@ -0,0 +1,34 @@
+################################################################################
+# JBoss, a division of Red Hat #
+# Copyright 2006, Red Hat Middleware, LLC, and individual #
+# contributors as indicated by the @authors tag. See the #
+# copyright.txt in the distribution for a full listing of #
+# individual contributors. #
+# #
+# This is free software; you can redistribute it and/or modify it #
+# under the terms of the GNU Lesser General Public License as #
+# published by the Free Software Foundation; either version 2.1 of #
+# the License, or (at your option) any later version. #
+# #
+# This software is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
+# Lesser General Public License for more details. #
+# #
+# You should have received a copy of the GNU Lesser General Public #
+# License along with this software; if not, write to the Free #
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA #
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org. #
+################################################################################
+javax.portlet.title=Usu\u00e1rios atuais
+javax.portlet.keywords=sample,test
+
+NO_USER_ONLINE=Nenhum usu\u00e1rio on-line
+ONE_USER_ONLINE=Voc\u00ea \u00e9 o \u00fanico usu\u00e1rio on-line
+USERS_ONLINE_0=Existem <b>
+USERS_ONLINE_1=</b> usu\u00e1rios on-line
+USERS_ARE_0=<b>
+USERS_ARE_1=</b>
+USERS_WHICH_0=Entre eles: <b>
+USERS_WHICH_1=</b> est\u00e1 conectado:
+USERS_WHICH_2=</b> est\u00e1 conectado:
Modified: branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/help.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/help.jsp 2009-03-06 23:22:30 UTC (rev 12984)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/help.jsp 2009-03-06 23:22:39 UTC (rev 12985)
@@ -21,7 +21,7 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<portlet:defineObjects />
Modified: branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/noUser.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/noUser.jsp 2009-03-06 23:22:30 UTC (rev 12984)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/noUser.jsp 2009-03-06 23:22:39 UTC (rev 12985)
@@ -23,7 +23,7 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ page isELIgnored="false" %>
<portlet:defineObjects/>
Modified: branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/users.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/users.jsp 2009-03-06 23:22:30 UTC (rev 12984)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/users.jsp 2009-03-06 23:22:39 UTC (rev 12985)
@@ -23,7 +23,7 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ page isELIgnored="false" %>
<portlet:defineObjects/>
Modified: branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-weather-samples-war/WEB-INF/classes/WeatherResource.properties
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-weather-samples-war/WEB-INF/classes/WeatherResource.properties 2009-03-06 23:22:30 UTC (rev 12984)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-weather-samples-war/WEB-INF/classes/WeatherResource.properties 2009-03-06 23:22:39 UTC (rev 12985)
@@ -23,6 +23,6 @@
javax.portlet.preference.name.RssXml=RSS feed URL
javax.portlet.preference.name.expires=Expiration time
-org.jboss.portal.object.name.Weather=Weather
+org.jboss.portal.object.name.default.Weather=Weather
org.jboss.portal.instance.name.WeatherPortletInstance=Weather Portlet
Copied: branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-weather-samples-war/WEB-INF/classes/WeatherResource_pt_BR.properties (from rev 12964, branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-weather-samples-war/WEB-INF/classes/WeatherResource_pt_BR.properties)
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-weather-samples-war/WEB-INF/classes/WeatherResource_pt_BR.properties (rev 0)
+++ branches/JBoss_Portal_AS5_Deployer/core-samples/src/resources/portal-weather-samples-war/WEB-INF/classes/WeatherResource_pt_BR.properties 2009-03-06 23:22:39 UTC (rev 12985)
@@ -0,0 +1,28 @@
+################################################################################
+# JBoss, a division of Red Hat #
+# Copyright 2006, Red Hat Middleware, LLC, and individual #
+# contributors as indicated by the @authors tag. See the #
+# copyright.txt in the distribution for a full listing of #
+# individual contributors. #
+# #
+# This is free software; you can redistribute it and/or modify it #
+# under the terms of the GNU Lesser General Public License as #
+# published by the Free Software Foundation; either version 2.1 of #
+# the License, or (at your option) any later version. #
+# #
+# This software is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
+# Lesser General Public License for more details. #
+# #
+# You should have received a copy of the GNU Lesser General Public #
+# License along with this software; if not, write to the Free #
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA #
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org. #
+################################################################################
+
+javax.portlet.preference.name.RssXml=URL do feed RSS
+javax.portlet.preference.name.expires=Tempo de expira\u00e7\u00e3o
+org.jboss.portal.object.name.Weather=Tempo
+
+org.jboss.portal.instance.name.WeatherPortletInstance=Tempo Portlet
17 years, 1 month
JBoss Portal SVN: r12984 - in branches/JBoss_Portal_AS5_Deployer/core-cms: src/main/org/jboss/portal/core/cms and 7 other directories.
by portal-commits@lists.jboss.org
Author: mwringe
Date: 2009-03-06 18:22:30 -0500 (Fri, 06 Mar 2009)
New Revision: 12984
Added:
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_ja.properties
Modified:
branches/JBoss_Portal_AS5_Deployer/core-cms/.classpath
branches/JBoss_Portal_AS5_Deployer/core-cms/build.xml
branches/JBoss_Portal_AS5_Deployer/core-cms/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactoryService.java
branches/JBoss_Portal_AS5_Deployer/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_it.properties
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_pt_BR.properties
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/default-object.xml
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/accessdenied.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmcopy.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmcreatecollection.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmdelete.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmmove.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/editbinary.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/exportarchive.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/exportarchive_pickup.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/exportarchive_pickup_error.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/folderlist.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/help.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/searchResults.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/securenode.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/upload.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/uploadarchive.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/edit.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp
branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/help.jsp
Log:
Merge JBoss_Portal_Branch_2_7 changes (rev range 12254:12964) into JBoss_Portal_AS5_Deployer branch
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/.classpath
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/.classpath 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/.classpath 2009-03-06 23:22:30 UTC (rev 12984)
@@ -24,8 +24,8 @@
<classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/common/lib/portal-common-portal-lib.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/portlet/lib/portal-portlet-lib.jar"/>
<classpathentry kind="lib" path="/thirdparty/portlet/lib/portlet-api.jar"/>
- <classpathentry kind="lib" path="/thirdparty/sun-jsf/lib/jsf-api.jar"/>
<classpathentry kind="lib" path="/thirdparty/jbpm/jpdl/lib/jbpm-jpdl.jar"/>
- <classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/cms/lib/cms-jackrabbit-trunk-SNAPSHOT.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/cms/lib/cms-jackrabbit.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/glassfish/jsf/lib/jsf-api.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/build.xml
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/build.xml 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/build.xml 2009-03-06 23:22:30 UTC (rev 12984)
@@ -105,10 +105,10 @@
<path refid="apache.fileupload.classpath"/>
<path refid="jakarta.io.classpath"/>
<path refid="oswego.concurrent.classpath"/>
- <path refid="sun.javamail.classpath"/>
+ <path refid="glassfish.javamail.classpath"/>
<path refid="jwebunit.jwebunit.classpath"/>
<path refid="dbunit.dbunit.classpath"/>
- <path refid="sun.jaf.classpath"/>
+ <path refid="glassfish.jaf.classpath"/>
<path refid="portals.bridges.classpath"/>
<path refid="beanshell.beanshell.classpath"/>
<path refid="facelets.facelets.classpath"/>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactoryService.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactoryService.java 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactoryService.java 2009-03-06 23:22:30 UTC (rev 12984)
@@ -168,7 +168,7 @@
if (e.toString().indexOf("Access to this resource is denied") != -1)
{
ParametersStateString parameters = ParametersStateString.create();
- parameters.setValue("path", requestPath);
+ parameters.setValue(CMSPortlet.RENDER_PARAMETER_PATH, requestPath);
return new InvokePortletWindowRenderCommand(targetWindowId, Mode.VIEW, null, parameters);
}
else
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2009-03-06 23:22:30 UTC (rev 12984)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -20,6 +20,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
******************************************************************************/
+
package org.jboss.portal.core.cms.ui.admin;
import org.apache.commons.fileupload.FileItem;
@@ -32,6 +33,7 @@
import org.jboss.portal.cms.impl.ContentImpl;
import org.jboss.portal.cms.impl.FileImpl;
import org.jboss.portal.cms.impl.FolderImpl;
+import org.jboss.portal.cms.impl.jcr.JCRCMS;
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
import org.jboss.portal.cms.model.Folder;
@@ -44,9 +46,9 @@
import org.jboss.portal.cms.util.NodeUtil;
import org.jboss.portal.cms.workflow.ApprovePublish;
import org.jboss.portal.cms.workflow.CMSWorkflowUtil;
-import org.jboss.portal.cms.impl.jcr.JCRCMS;
+import org.jboss.portal.common.util.ParameterValidation;
+import org.jboss.portal.core.cms.command.StreamContentCommand;
import org.jboss.portal.core.cms.ui.Util;
-import org.jboss.portal.core.cms.command.StreamContentCommand;
import org.jboss.portal.core.controller.ControllerContext;
import org.jboss.portal.identity.AnonymousRole;
import org.jboss.portal.identity.IdentityException;
@@ -77,7 +79,8 @@
import javax.portlet.PortletSession;
import javax.portlet.UnavailableException;
import java.io.IOException;
-import java.io.InputStream;
+import java.text.Format;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
@@ -85,11 +88,10 @@
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
+import java.util.ResourceBundle;
import java.util.Set;
import java.util.Vector;
-import java.util.ResourceBundle;
-import java.text.SimpleDateFormat;
-import java.text.Format;
+import java.util.regex.Pattern;
/**
* @author <a href="mailto:roy@jboss.org">Roy Russo</a>
@@ -105,6 +107,8 @@
private ApprovePublish approvePublish;
private AuthorizationManager authorizationManager;
private ResourceBundle resources = null;
+ private static final Pattern CHECK_FOR_XSS_PATTERN = ParameterValidation.XSS_CHECK;
+ private static final String SLASH = "/";
public void init() throws PortletException
@@ -136,22 +140,22 @@
throw new PortletException("Authorization Service not found");
}
- this.initializeApprovePublishWorkflow();
+ this.initializeApprovePublishWorkflow();
}
-
+
/**
- *
+ *
*/
public void init(PortletConfig config) throws PortletException
{
super.init(config);
-
+
//Get the Resource Bundle for this Portlet
this.resources = config.getResourceBundle(Locale.getDefault());
}
/**
- *
+ *
*/
protected void doView(final JBossRenderRequest rReq, final JBossRenderResponse rRes)
throws PortletException, IOException, UnavailableException
@@ -161,8 +165,8 @@
String datePattern = bundle.getString(CMSAdminConstants.CMS_DATE_PATTERN);
Format dateFormat = new SimpleDateFormat(datePattern, rReq.getLocale());
rReq.setAttribute(CMSAdminConstants.DATE_FORMAT, dateFormat);
-
-
+
+
//check and make sure the CMSAdminPortlet is accessible to the current user
if (!this.isPortletAccessible(rReq))
{
@@ -204,36 +208,44 @@
}
}
}
-
- /**
- *
- * @param renderResponse
- * @throws IOException
- */
+
+ /** @throws IOException */
private void showAccessDeniedScreen(JBossRenderRequest rReq, JBossRenderResponse rRes) throws IOException, PortletException
{
- try
- {
- String sPath = rReq.getParameter("path");
- String sOp = rReq.getParameter("returnOp");
-
-
- rRes.setContentType("text/html");
- rReq.setAttribute("path", sPath);
- rReq.setAttribute("returnOp", sOp);
- javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/accessdenied.jsp");
- prd.include(rReq, rRes);
- }
- catch(Exception e)
- {
- throw new PortletException(e);
- }
+ try
+ {
+ String sPath = rReq.getParameter("path");
+ String sOp = rReq.getParameter("returnOp");
+
+
+ rRes.setContentType("text/html");
+ rReq.setAttribute("path", sPath);
+ rReq.setAttribute("returnOp", sOp);
+ javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/accessdenied.jsp");
+ prd.include(rReq, rRes);
+ }
+ catch (Exception e)
+ {
+ throw new PortletException(e);
+ }
}
private void internalDoView(JBossRenderRequest rReq, JBossRenderResponse rRes)
throws CMSException, PortletException, IOException
{
String op = rReq.getParameter("op");
+ String sPath = rReq.getParameter("path");
+ if (sPath != null)
+ {
+ sPath = ParameterValidation.sanitizeFromPattern(sPath, CHECK_FOR_XSS_PATTERN, SLASH);
+ }
+
+ String sNavPath = rReq.getParameter("navpath");
+ if (sNavPath != null)
+ {
+ sNavPath = ParameterValidation.sanitizeFromPattern(sNavPath, CHECK_FOR_XSS_PATTERN, SLASH);
+ }
+
if (op == null)
{
op = CMSAdminConstants.OP_MAIN;
@@ -241,17 +253,35 @@
if (CMSAdminConstants.OP_MAIN.equals(op)) // list page.
{
- String sPath = rReq.getParameter("path");
if (sPath == null)
{
- sPath = "/";
+ sPath = SLASH;
}
-
+
JCRCMS.enableUISecurityFilter();
Command listCMD = CMSService.getCommandFactory().createFolderGetListCommand(sPath);
Folder mainFolder = (Folder)CMSService.execute(listCMD);
- List folders = mainFolder.getFolders();
- List files = mainFolder.getFiles();
+
+ List folders = new ArrayList();
+ List files = new ArrayList();
+
+ if (mainFolder != null)
+ {
+ folders = mainFolder.getFolders();
+ files = mainFolder.getFiles();
+ }
+ else
+ {
+ Object messages = rReq.getPortletSession().getAttribute("messages");
+ if (messages == null)
+ {
+ messages = new ArrayList();
+ rReq.getPortletSession().setAttribute("messages", messages);
+ }
+
+ ((List)messages).add(this.resources.getObject("CMS_MISSING_RESOURCE"));
+ }
+
JCRCMS.disableUISecurityFilter();
rRes.setContentType("text/html");
@@ -270,12 +300,13 @@
{
rReq.setAttribute("manageWorkflowAccessible", new Boolean(false));
}
-
+
//Messages
- if(rReq.getPortletSession().getAttribute("messages") != null)
+ if (rReq.getPortletSession().getAttribute("messages") != null)
{
Object messages = rReq.getPortletSession().getAttribute("messages");
rReq.getPortletSession().removeAttribute("messages");
+
rReq.setAttribute("messages", messages);
}
@@ -286,42 +317,42 @@
{
try
{
- String sNavPath = rReq.getParameter("navpath");
-
List folders = this.getFolderList(sNavPath);
- if((folders == null || folders.isEmpty()) &&
- (sNavPath != null && !sNavPath.equals("/")))
+ if ((folders == null || folders.isEmpty()) &&
+ (sNavPath != null && !sNavPath.equals(SLASH)))
{
sNavPath = NodeUtil.getParentPath(sNavPath);
folders = this.getFolderList(sNavPath);
}
-
+
rReq.setAttribute("folders", folders);
rRes.setContentType("text/html");
rReq.setAttribute("navpath", sNavPath);
-
- String sPath = rReq.getParameter("path");
+
rRes.setContentType("text/html");
rReq.setAttribute("createpath", sPath);
-
- if (rReq.getParameter("error:message") != null)
+
+ String parameter = rReq.getParameter("error:message");
+ if (parameter != null)
{
- rReq.setAttribute("error:message", rReq.getParameter("error:message"));
+ rReq.setAttribute("error:message", parameter);
}
- if (rReq.getParameter("error:newcollectionname") != null)
+ parameter = rReq.getParameter("error:newcollectionname");
+ if (parameter != null)
{
- rReq.setAttribute("error:newcollectionname", rReq.getParameter("error:newcollectionname"));
+ rReq.setAttribute("error:newcollectionname", parameter);
}
- if (rReq.getParameter("error:newcollectiondescription") != null)
+ parameter = rReq.getParameter("error:newcollectiondescription");
+ if (parameter != null)
{
- rReq.setAttribute("error:newcollectiondescription", rReq.getParameter("error:newcollectiondescription"));
+ rReq.setAttribute("error:newcollectiondescription", parameter);
}
-
-
+
+
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/confirmcreatecollection.jsp");
prd.include(rReq, rRes);
}
- catch(Exception e)
+ catch (Exception e)
{
throw new PortletException(e);
}
@@ -330,17 +361,15 @@
{
try
{
- String sPath = rReq.getParameter("path");
- String sNavPath = rReq.getParameter("navpath");
-
+
List folders = this.getFolderList(sNavPath);
- if((folders == null || folders.isEmpty()) &&
- (sNavPath != null && !sNavPath.equals("/")))
+ if ((folders == null || folders.isEmpty()) &&
+ (sNavPath != null && !sNavPath.equals(SLASH)))
{
sNavPath = NodeUtil.getParentPath(sNavPath);
folders = this.getFolderList(sNavPath);
}
-
+
rReq.setAttribute("folders", folders);
rRes.setContentType("text/html");
rReq.setAttribute("currpath", sPath);
@@ -349,15 +378,13 @@
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/upload.jsp");
prd.include(rReq, rRes);
}
- catch(Exception e)
+ catch (Exception e)
{
throw new PortletException(e);
}
}
else if (CMSAdminConstants.OP_VIEWFILE.equals(op))
{
- String sPath = rReq.getParameter("path");
-
Command fileGetList = CMSService.getCommandFactory().createFileGetListCommand(sPath);
List contentList = (List)CMSService.execute(fileGetList);
@@ -438,17 +465,15 @@
{
try
{
- String sPath = rReq.getParameter("path");
- String sNavPath = rReq.getParameter("navpath");
-
+
List folders = this.getFolderList(sNavPath);
- if((folders == null || folders.isEmpty()) &&
- (sNavPath != null && !sNavPath.equals("/")))
+ if ((folders == null || folders.isEmpty()) &&
+ (sNavPath != null && !sNavPath.equals(SLASH)))
{
sNavPath = NodeUtil.getParentPath(sNavPath);
folders = this.getFolderList(sNavPath);
}
-
+
rReq.setAttribute("folders", folders);
rRes.setContentType("text/html");
rReq.setAttribute("currpath", sPath);
@@ -456,7 +481,7 @@
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/uploadarchive.jsp");
prd.include(rReq, rRes);
}
- catch(Exception e)
+ catch (Exception e)
{
throw new PortletException(e);
}
@@ -465,18 +490,16 @@
{
try
{
- String sPath = rReq.getParameter("path");
- String sNavPath = rReq.getParameter("navpath");
String sType = rReq.getParameter("type");
-
+
List folders = this.getFolderList(sNavPath);
- if((folders == null || folders.isEmpty()) &&
- (sNavPath != null && !sNavPath.equals("/")))
+ if ((folders == null || folders.isEmpty()) &&
+ (sNavPath != null && !sNavPath.equals(SLASH)))
{
sNavPath = NodeUtil.getParentPath(sNavPath);
folders = this.getFolderList(sNavPath);
}
-
+
rReq.setAttribute("folders", folders);
rRes.setContentType("text/html");
rReq.setAttribute("currpath", sPath);
@@ -485,7 +508,7 @@
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/confirmcopy.jsp");
prd.include(rReq, rRes);
}
- catch(Exception e)
+ catch (Exception e)
{
throw new PortletException(e);
}
@@ -494,18 +517,16 @@
{
try
{
- String sPath = rReq.getParameter("path");
- String sNavPath = rReq.getParameter("navpath");
String sType = rReq.getParameter("type");
-
+
List folders = this.getFolderList(sNavPath);
- if((folders == null || folders.isEmpty()) &&
- (sNavPath != null && !sNavPath.equals("/")))
+ if ((folders == null || folders.isEmpty()) &&
+ (sNavPath != null && !sNavPath.equals(SLASH)))
{
sNavPath = NodeUtil.getParentPath(sNavPath);
folders = this.getFolderList(sNavPath);
}
-
+
rReq.setAttribute("folders", folders);
rRes.setContentType("text/html");
rReq.setAttribute("currpath", sPath);
@@ -514,14 +535,13 @@
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/confirmmove.jsp");
prd.include(rReq, rRes);
}
- catch(Exception e)
+ catch (Exception e)
{
throw new PortletException(e);
}
}
else if (CMSAdminConstants.OP_CONFIRMDELETE.equals(op))
{
- String sPath = rReq.getParameter("path");
rRes.setContentType("text/html");
rReq.setAttribute("currpath", sPath);
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/confirmdelete.jsp");
@@ -529,18 +549,16 @@
}
else if (CMSAdminConstants.OP_EDIT_BINARY.equals(op))
{
- String sPath = rReq.getParameter("path");
rRes.setContentType("text/html");
rReq.setAttribute("currpath", sPath);
- rReq.setAttribute("language", rReq.getParameter("language"));
+ String language = rReq.getParameter("language");
+ ParameterValidation.sanitizeFromPattern(language, CHECK_FOR_XSS_PATTERN, "en");
+ rReq.setAttribute("language", language);
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/editbinary.jsp");
prd.include(rReq, rRes);
}
- else
- if (CMSAdminConstants.OP_CREATENEWTEXT.equals(op) || CMSAdminConstants.OP_CREATEFILE_VALIDATION_ERROR.equals(op))
+ else if (CMSAdminConstants.OP_CREATENEWTEXT.equals(op) || CMSAdminConstants.OP_CREATEFILE_VALIDATION_ERROR.equals(op))
{
- String sPath = rReq.getParameter("path");
-
// get Base for editor
StringBuffer sbUrl = new StringBuffer();
sbUrl.append(rReq.getScheme());
@@ -567,32 +585,38 @@
rRes.setContentType("text/html");
rReq.setAttribute("currpath", sPath);
- rReq.setAttribute("document_base_url", sbUrl.toString() + this.buildURL(rReq, "/"));
+ rReq.setAttribute("document_base_url", sbUrl.toString() + this.buildURL(rReq, SLASH));
//If a validation error occurred, re-populate data already submitted
- if (rReq.getParameter("error:content") != null)
+ String parameter = rReq.getParameter("error:content");
+ if (parameter != null)
{
- rReq.setAttribute("error:content", rReq.getParameter("error:content"));
+ rReq.setAttribute("error:content", parameter);
}
- if (rReq.getParameter("error:description") != null)
+ parameter = rReq.getParameter("error:description");
+ if (parameter != null)
{
- rReq.setAttribute("error:description", rReq.getParameter("error:description"));
+ rReq.setAttribute("error:description", parameter);
}
- if (rReq.getParameter("error:title") != null)
+ parameter = rReq.getParameter("error:title");
+ if (parameter != null)
{
- rReq.setAttribute("error:title", rReq.getParameter("error:title"));
+ rReq.setAttribute("error:title", parameter);
}
- if (rReq.getParameter("error:language") != null)
+ parameter = rReq.getParameter("error:language");
+ if (parameter != null)
{
- rReq.setAttribute("error:language", rReq.getParameter("error:language"));
+ rReq.setAttribute("error:language", parameter);
}
- if (rReq.getParameter("error:filename") != null)
+ parameter = rReq.getParameter("error:filename");
+ if (parameter != null)
{
- rReq.setAttribute("error:filename", rReq.getParameter("error:filename"));
+ rReq.setAttribute("error:filename", parameter);
}
- if (rReq.getParameter("error:message") != null)
+ parameter = rReq.getParameter("error:message");
+ if (parameter != null)
{
- rReq.setAttribute("error:message", rReq.getParameter("error:message"));
+ rReq.setAttribute("error:message", parameter);
}
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/create.jsp");
@@ -600,8 +624,9 @@
}
else if (CMSAdminConstants.OP_EDIT.equals(op))
{
- String sPath = rReq.getParameter("path");
String sLanguage = rReq.getParameter("language");
+ ParameterValidation.sanitizeFromPattern(sLanguage, CHECK_FOR_XSS_PATTERN, "en");
+
String sVersion = rReq.getParameter("version");
StringBuffer sbUrl = new StringBuffer();
@@ -630,7 +655,7 @@
rRes.setContentType("text/html");
rReq.setAttribute("currpath", sPath);
- rReq.setAttribute("document_base_url", sbUrl.toString() + this.buildURL(rReq, "/"));
+ rReq.setAttribute("document_base_url", sbUrl.toString() + this.buildURL(rReq, SLASH));
Command getCommand;
@@ -659,17 +684,14 @@
{
try
{
- String sPath = rReq.getParameter("path");
- String sNavPath = rReq.getParameter("navpath");
-
List folders = this.getFolderList(sNavPath);
- if((folders == null || folders.isEmpty()) &&
- (sNavPath != null && !sNavPath.equals("/")))
+ if ((folders == null || folders.isEmpty()) &&
+ (sNavPath != null && !sNavPath.equals(SLASH)))
{
sNavPath = NodeUtil.getParentPath(sNavPath);
folders = this.getFolderList(sNavPath);
}
-
+
rReq.setAttribute("folders", folders);
rRes.setContentType("text/html");
rReq.setAttribute("currpath", sPath);
@@ -677,15 +699,15 @@
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/exportarchive.jsp");
prd.include(rReq, rRes);
}
- catch(Exception e)
+ catch (Exception e)
{
throw new PortletException(e);
}
}
else if (CMSAdminConstants.OP_EXPORTARCHIVE_PICKUP.equals(op))
{
- String sPath = rReq.getParameter("path");
String sPickupFile = rReq.getParameter("filepath");
+ ParameterValidation.sanitizeFromPattern(sPickupFile, CHECK_FOR_XSS_PATTERN, SLASH);
rRes.setContentType("text/html");
PortletRequestDispatcher prd = null;
@@ -704,7 +726,6 @@
}
else if (CMSAdminConstants.OP_CONFIRMSECURE.equals(op))
{
- String sPath = rReq.getParameter("path");
String sConfirm = rReq.getParameter("confirm");
String returnOp = rReq.getParameter("returnOp");
@@ -765,13 +786,11 @@
else if (CMSAdminConstants.OP_VIEWPENDING.equals(op))
{
boolean isWorkflowManagementAccessible = this.isWorkflowManagementAccessible(rReq);
- if(!isWorkflowManagementAccessible)
+ if (!isWorkflowManagementAccessible)
{
this.showAccessDeniedScreen(rReq, rRes);
return;
}
-
- String sPath = rReq.getParameter("path");
if (this.getApprovePublish() != null)
{
@@ -788,30 +807,29 @@
rRes.setContentType("text/html");
rReq.setAttribute("currpath", sPath);
-
+
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/pending_items.jsp");
prd.include(rReq, rRes);
}
else if (CMSAdminConstants.OP_VIEWPENDINGPREVIEW.equals(op))
{
String processId = rReq.getParameter("pid");
- String path = rReq.getParameter("path");
String contentPath = rReq.getParameter("contentPath");
-
+
boolean isWorkflowManagementAccessible = this.isWorkflowManagementAccessible(rReq);
- if(!isWorkflowManagementAccessible)
+ if (!isWorkflowManagementAccessible)
{
this.showAccessDeniedScreen(rReq, rRes);
return;
}
-
- boolean hasWriteAccess = this.hasWriteAccess(rReq, path);
- if(!hasWriteAccess)
+
+ boolean hasWriteAccess = this.hasWriteAccess(rReq, sPath);
+ if (!hasWriteAccess)
{
this.showAccessDeniedScreen(rReq, rRes);
return;
}
-
+
if (this.getApprovePublish() != null)
{
try
@@ -824,12 +842,12 @@
rReq.setAttribute("pendingQueue", null);
}
}
-
+
Content pendingContent = CMSWorkflowUtil.getPendingContent(Long.parseLong(processId), contentPath);
String viewableContent = Util.getViewableContent(rReq, rRes, pendingContent.getContentAsString());
-
+
rReq.setAttribute("pendingPreviewContent", viewableContent);
-
+
StringBuffer sbUrl = new StringBuffer();
sbUrl.append(rReq.getScheme());
sbUrl.append("://");
@@ -841,12 +859,12 @@
sbUrl.append(rReq.getServerPort());
}
rRes.setContentType("text/html");
- rReq.setAttribute("currpath", path);
- rReq.setAttribute("document_base_url", sbUrl.toString() + this.buildURL(rReq, "/"));
-
+ rReq.setAttribute("currpath", sPath);
+ rReq.setAttribute("document_base_url", sbUrl.toString() + this.buildURL(rReq, SLASH));
+
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/pending_items.jsp");
prd.include(rReq, rRes);
- }
+ }
}
public void processAction(final JBossActionRequest aReq, final JBossActionResponse aRes) throws PortletException
@@ -896,7 +914,7 @@
String sFolderDescription = aReq.getParameter("newcollectiondescription");
if (!"".equals(sCreatePath) && !"".equals(sFolderName))
{
- String sNewPath = FileUtil.cleanDoubleSlashes(sCreatePath + "/" + sFolderName);
+ String sNewPath = FileUtil.cleanDoubleSlashes(sCreatePath + SLASH + sFolderName);
Folder folder = new FolderImpl();
folder.setCreationDate(new Date());
@@ -911,9 +929,9 @@
Command saveCMD = CMSService.getCommandFactory().createFolderSaveCommand(folder);
CMSService.execute(saveCMD);
}
- catch(CMSException cme)
+ catch (CMSException cme)
{
- if(cme.hasPathFormatFailure())
+ if (cme.hasPathFormatFailure())
{
//Validation Error occurred
//FileName should not be empty
@@ -923,7 +941,7 @@
//used to remember the data already submitted by the user
aRes.setRenderParameter("error:message", CMSAdminConstants.CMS_FOLDERNAME_INVALID);
aRes.setRenderParameter("error:newcollectionname", aReq.getParameter("newcollectionname"));
- aRes.setRenderParameter("error:newcollectiondescription", aReq.getParameter("newcollectiondescription"));
+ aRes.setRenderParameter("error:newcollectiondescription", aReq.getParameter("newcollectiondescription"));
return;
}
@@ -935,7 +953,7 @@
aRes.setRenderParameter("op", CMSAdminConstants.OP_MAIN);
aRes.setRenderParameter("path", sNewPath);
- }
+ }
else
{
//Validation Error
@@ -945,7 +963,7 @@
//used to remember the data already submitted by the user
aRes.setRenderParameter("error:message", CMSAdminConstants.CMS_FOLDERNAME_INVALID);
aRes.setRenderParameter("error:newcollectionname", aReq.getParameter("newcollectionname"));
- aRes.setRenderParameter("error:newcollectiondescription", aReq.getParameter("newcollectiondescription"));
+ aRes.setRenderParameter("error:newcollectiondescription", aReq.getParameter("newcollectiondescription"));
}
}
else if (CMSAdminConstants.OP_UPLOADCONTENT.equals(op))
@@ -968,6 +986,8 @@
if (!item.isFormField())
{
String sFilename = item.getName();
+ sFilename = ParameterValidation.sanitizeFromPattern(sFilename, CHECK_FOR_XSS_PATTERN, "");
+
if (!"".equals(sFilename))
{
int backslashIndex = sFilename.lastIndexOf("\\");
@@ -977,7 +997,7 @@
}
else // unix
{
- backslashIndex = sFilename.lastIndexOf("/");
+ backslashIndex = sFilename.lastIndexOf(SLASH);
sFilename = sFilename.substring(backslashIndex + 1);
}
@@ -995,12 +1015,12 @@
content.setMimeType("application/octet-stream");
}
- String sBasePath = FileUtil.cleanDoubleSlashes(sPath + "/" + sFilename);
+ String sBasePath = FileUtil.cleanDoubleSlashes(sPath + SLASH + sFilename);
file.setBasePath(sBasePath);
content.setTitle(sTitle);
content.setDescription(sDescription);
- content.setBasePath(sBasePath + "/" + new Locale(sLanguage));
+ content.setBasePath(sBasePath + SLASH + new Locale(sLanguage));
content.setBytes(item.get());
file.setContent(new Locale(sLanguage), content);
@@ -1029,21 +1049,23 @@
else
{
String fieldName = item.getFieldName();
+ String itemValue = item.getString(aReq.getCharacterEncoding());
+ itemValue = ParameterValidation.sanitizeFromPattern(itemValue, CHECK_FOR_XSS_PATTERN, "");
if ("destination".equals(fieldName))
{
- sPath = item.getString(aReq.getCharacterEncoding());
+ sPath = itemValue;
}
else if ("description".equals(fieldName))
{
- sDescription = item.getString(aReq.getCharacterEncoding());
+ sDescription = itemValue;
}
else if ("title".equals(fieldName))
{
- sTitle = item.getString(aReq.getCharacterEncoding());
+ sTitle = itemValue;
}
else if ("language".equals(fieldName))
{
- sLanguage = item.getString(aReq.getCharacterEncoding());
+ sLanguage = itemValue;
}
}
}
@@ -1079,12 +1101,26 @@
if (!item.isFormField())
{
byte[] archiveBytes = item.get();
-
+
Command storearchiveCMD = CMSService.getCommandFactory().createAsyncStoreArchiveCommand(sPath, archiveBytes, sLanguage);
- CMSService.execute(storearchiveCMD);
-
+
List messages = new ArrayList();
- messages.add(this.resources.getObject("CMS_MSG_UPLOADARCHIVE_ASYNC"));
+
+ try
+ {
+ CMSService.execute(storearchiveCMD);
+ messages.add(this.resources.getObject("CMS_MSG_UPLOADARCHIVE_ASYNC"));
+ }
+ catch (CMSException cme)
+ {
+ String messageKey = cme.getMessageKey();
+ if (messageKey != null && messageKey.trim().length() > 0)
+ {
+ messages.add(this.resources.getObject(messageKey));
+ }
+ }
+
+
aReq.getPortletSession().setAttribute("messages", messages);
aRes.setRenderParameter("path", FileUtil.cleanDoubleSlashes(sPath));
@@ -1099,7 +1135,7 @@
else if ("language".equals(fieldName))
{
sLanguage = item.getString(aReq.getCharacterEncoding());
- }
+ }
}
}
}
@@ -1116,27 +1152,27 @@
String sType = aReq.getParameter("type");
if (!"".equals(sTo) && !"".equals(sFrom) && !"".equals(sType))
{
- String sNodeName = sFrom.substring(sFrom.lastIndexOf("/") + 1, sFrom.length());
- sTo = FileUtil.cleanDoubleSlashes(sTo + "/" + sNodeName);
-
+ String sNodeName = sFrom.substring(sFrom.lastIndexOf(SLASH) + 1, sFrom.length());
+ sTo = FileUtil.cleanDoubleSlashes(sTo + SLASH + sNodeName);
+
// check if destination already exists
Command existsCMD = CMSService.getCommandFactory().createItemExistsCommand(sTo);
Boolean bExists = (Boolean)CMSService.execute(existsCMD);
- if (bExists.booleanValue())
- {
- List messages = new ArrayList();
- messages.add(this.resources.getObject("CMS_MSG_DESTINATION_ALREADY_EXISTS"));
- aReq.getPortletSession().setAttribute("messages", messages);
- try
- {
- String sParentPath = NodeUtil.getParentPath(sFrom);
- aRes.setRenderParameter("path", sParentPath);
- }
- catch (Exception e)
- {
+ if (bExists.booleanValue())
+ {
+ List messages = new ArrayList();
+ messages.add(this.resources.getObject("CMS_MSG_DESTINATION_ALREADY_EXISTS"));
+ aReq.getPortletSession().setAttribute("messages", messages);
+ try
+ {
+ String sParentPath = NodeUtil.getParentPath(sFrom);
+ aRes.setRenderParameter("path", sParentPath);
+ }
+ catch (Exception e)
+ {
- }
- return;
+ }
+ return;
}
Command copyCommand = CMSService.getCommandFactory().createCopyCommand(sFrom, sTo);
@@ -1158,7 +1194,7 @@
String sTo = aReq.getParameter("destination");
String sFrom = aReq.getParameter("source");
String sType = aReq.getParameter("type");
-
+
if (sTo.startsWith(sFrom))
{
List messages = new ArrayList();
@@ -1175,33 +1211,33 @@
}
return;
}
-
+
if (!"".equals(sTo) && !"".equals(sFrom) && !"".equals(sType))
{
- String sNodeName = sFrom.substring(sFrom.lastIndexOf("/") + 1, sFrom.length());
- sTo = FileUtil.cleanDoubleSlashes(sTo + "/" + sNodeName);
-
+ String sNodeName = sFrom.substring(sFrom.lastIndexOf(SLASH) + 1, sFrom.length());
+ sTo = FileUtil.cleanDoubleSlashes(sTo + SLASH + sNodeName);
+
// check if destination already exists
Command existsCMD = CMSService.getCommandFactory().createItemExistsCommand(sTo);
Boolean bExists = (Boolean)CMSService.execute(existsCMD);
if (bExists.booleanValue())
- {
- List messages = new ArrayList();
- messages.add(this.resources.getObject("CMS_MSG_DESTINATION_ALREADY_EXISTS"));
- aReq.getPortletSession().setAttribute("messages", messages);
- try
- {
- String sParentPath = NodeUtil.getParentPath(sFrom);
- aRes.setRenderParameter("path", sParentPath);
- }
- catch (Exception e)
- {
+ {
+ List messages = new ArrayList();
+ messages.add(this.resources.getObject("CMS_MSG_DESTINATION_ALREADY_EXISTS"));
+ aReq.getPortletSession().setAttribute("messages", messages);
+ try
+ {
+ String sParentPath = NodeUtil.getParentPath(sFrom);
+ aRes.setRenderParameter("path", sParentPath);
+ }
+ catch (Exception e)
+ {
- }
- return;
+ }
+ return;
}
-
+
Command moveCommand = CMSService.getCommandFactory().createMoveCommand(sFrom, sTo);
CMSService.execute(moveCommand);
if ("fo".equalsIgnoreCase(sType))
@@ -1211,7 +1247,7 @@
else if ("fi".equalsIgnoreCase(sType))
{
aRes.setRenderParameter("op", CMSAdminConstants.OP_VIEWFILE);
- }
+ }
aRes.setRenderParameter("path", sTo);
}
@@ -1263,7 +1299,7 @@
}
else // unix
{
- backslashIndex = sFilename.lastIndexOf("/");
+ backslashIndex = sFilename.lastIndexOf(SLASH);
sFilename = sFilename.substring(backslashIndex + 1);
}
@@ -1284,7 +1320,7 @@
}
content.setTitle(sTitle);
content.setDescription(sDescription);
- content.setBasePath(sBasePath + "/" + sLanguage);
+ content.setBasePath(sBasePath + SLASH + sLanguage);
content.setBytes(item.get());
file.setContent(new Locale(sLanguage), content);
@@ -1361,7 +1397,7 @@
if (!"".equals(sFileName) && !"".equals(sDirectory))
{
String sContent = aReq.getParameter("elm1");
- String sNewFilePath = FileUtil.cleanDoubleSlashes(sDirectory + "/" + sFileName);
+ String sNewFilePath = FileUtil.cleanDoubleSlashes(sDirectory + SLASH + sFileName);
File file = new FileImpl();
Content content = new ContentImpl();
@@ -1382,7 +1418,7 @@
content.setTitle(sTitle);
content.setDescription(sDescription);
- content.setBasePath(sBasePath + "/" + new Locale(sLanguage));
+ content.setBasePath(sBasePath + SLASH + new Locale(sLanguage));
content.setBytes(sContent.getBytes());
file.setContent(new Locale(sLanguage), content);
@@ -1392,11 +1428,15 @@
Boolean bExists = null;
try
{
+ if (!CHECK_FOR_XSS_PATTERN.matcher(content.getBasePath()).matches())
+ {
+ throw new CMSException(content.getBasePath() + " is not a legal path element");
+ }
bExists = (Boolean)CMSService.execute(existsCMD);
}
- catch(CMSException cme)
+ catch (CMSException cme)
{
- if(cme.hasPathFormatFailure())
+ if (cme.hasPathFormatFailure())
{
//Validation Error occurred
//FileName should not be empty
@@ -1420,7 +1460,7 @@
throw cme;
}
}
-
+
if (bExists.booleanValue()) // if file exists, update contentNode
{
Command cmdUpdate = CMSService.getCommandFactory().createUpdateFileCommand(file, content, true);
@@ -1448,7 +1488,7 @@
sMakeLive = "on";
}
- if (!"".equals(sFilePath))
+ if (!"".equals(sFilePath) && CHECK_FOR_XSS_PATTERN.matcher(sFilePath).matches())
{
String sContent = aReq.getParameter("elm1");
@@ -1470,7 +1510,7 @@
content.setTitle(sTitle);
content.setDescription(sDescription);
- content.setBasePath(sFilePath + "/" + new Locale(sLanguage).getLanguage());
+ content.setBasePath(sFilePath + SLASH + new Locale(sLanguage).getLanguage());
content.setBytes(sContent.getBytes());
file.setContent(new Locale(sLanguage), content);
@@ -1550,11 +1590,11 @@
else if (CMSAdminConstants.OP_APPROVE.equals(op))
{
boolean hasWriteAccess = this.hasWriteAccess(aReq, aReq.getParameter("path"));
- if(!hasWriteAccess)
+ if (!hasWriteAccess)
{
throw new CMSException("Access to this resource is denied");
}
-
+
String sManager = aReq.getUser().getUserName();
String sPID = aReq.getParameter("pid");
try
@@ -1584,11 +1624,11 @@
else if (CMSAdminConstants.OP_DENY.equals(op))
{
boolean hasWriteAccess = this.hasWriteAccess(aReq, aReq.getParameter("path"));
- if(!hasWriteAccess)
+ if (!hasWriteAccess)
{
throw new CMSException("Access to this resource is denied");
}
-
+
String sManager = aReq.getUser().getUserName();
String sPID = aReq.getParameter("pid");
try
@@ -1612,45 +1652,45 @@
}
return;
}
-
+
String filePath = aReq.getParameter("path");
String parentPath = null;
try
{
parentPath = NodeUtil.getParentPath(filePath);
}
- catch(Exception e)
+ catch (Exception e)
{
- parentPath = "/";
+ parentPath = SLASH;
}
-
+
//Check if this file still exists
Command existsCmd = this.CMSService.getCommandFactory().createItemExistsCommand(filePath);
- boolean exists = ((Boolean)this.CMSService.execute(existsCmd)).booleanValue();
- if(exists)
+ boolean exists = ((Boolean)this.CMSService.execute(existsCmd)).booleanValue();
+ if (exists)
{
aRes.setRenderParameter("path", filePath);
aRes.setRenderParameter("op", CMSAdminConstants.OP_VIEWFILE);
}
else
- {
+ {
aRes.setRenderParameter("path", parentPath);
aRes.setRenderParameter("op", CMSAdminConstants.OP_MAIN);
}
}
- else if(CMSAdminConstants.OP_MODIFYANDAPPROVE.equals(op))
+ else if (CMSAdminConstants.OP_MODIFYANDAPPROVE.equals(op))
{
boolean hasWriteAccess = this.hasWriteAccess(aReq, aReq.getParameter("path"));
- if(!hasWriteAccess)
+ if (!hasWriteAccess)
{
throw new CMSException("Access to this resource is denied");
}
-
+
String modifiedContent = aReq.getParameter("elm1");
String processId = aReq.getParameter("pid");
String path = aReq.getParameter("path");
String sManager = aReq.getUser().getUserName();
-
+
try
{
//Apply this modifiedContent instead of the one published by the original author
@@ -1672,7 +1712,7 @@
aRes.setRenderParameter("op", from);
}
return;
- }
+ }
aRes.setRenderParameter("path", path);
aRes.setRenderParameter("op", CMSAdminConstants.OP_VIEWFILE);
}
@@ -1682,13 +1722,13 @@
String language = aReq.getParameter("language");
String version = aReq.getParameter("version");
- //Perform the change in live version here
+ //Perform the change in live version here
Command makeLiveCommand = CMSService.getCommandFactory().createMakeLiveVersionCommand(path, language, version);
CMSService.execute(makeLiveCommand);
aRes.setRenderParameter("path", path);
aRes.setRenderParameter("op", CMSAdminConstants.OP_VIEWFILE);
- }
+ }
}
else
{
@@ -1708,7 +1748,7 @@
{
if (sNavPath == null)
{
- sNavPath = "/";
+ sNavPath = SLASH;
}
Command listCMD = CMSService.getCommandFactory().createFolderGetListCommand(sNavPath);
Folder mainFolder = (Folder)CMSService.execute(listCMD);
@@ -1752,13 +1792,13 @@
(manageUsers == null || manageUsers.length == 0)
)
{
- //remove all direct permissions on this node
+ //remove all direct permissions on this node
String uri = this.authorizationManager.getProvider().getCriteriaURI("path", path);
this.authorizationManager.getProvider().removeSecurityBindings(uri);
return;
}
- //cleanup the old permissions on this node, before new ones are created
+ //cleanup the old permissions on this node, before new ones are created
String uri = this.authorizationManager.getProvider().getCriteriaURI("path", path);
this.authorizationManager.getProvider().removeSecurityBindings(uri);
@@ -1871,11 +1911,11 @@
if (portletRequest.getUserPrincipal() != null)
{
- if(portletRequest.getUserPrincipal().getName().equals(this.authorizationManager.getProvider().getRoot().getUserName()))
+ if (portletRequest.getUserPrincipal().getName().equals(this.authorizationManager.getProvider().getRoot().getUserName()))
{
return true;
}
-
+
//Not the Root User. so now make sure the Portlet is accessible to the User that is logged in
User user = this.userModule.findUserByUserName(portletRequest.getUserPrincipal().getName());
String uri = this.authorizationManager.getProvider().getUserURI(user.getUserName());
@@ -1923,7 +1963,6 @@
}
/**
- *
* @param portletRequest
* @return
*/
@@ -2030,26 +2069,26 @@
this.setApprovePublish(null);
}
}
-
+
private void filterResourceBySecurity(List resources, PortalCMSSecurityContext securityContext)
{
-
+
}
-
+
private boolean hasWriteAccess(PortletRequest request, String path)
{
boolean hasAccess = false;
-
+
User user = null;
- if(request instanceof JBossRenderRequest)
+ if (request instanceof JBossRenderRequest)
{
user = ((JBossRenderRequest)request).getUser();
}
- else if(request instanceof JBossActionRequest)
+ else if (request instanceof JBossActionRequest)
{
user = ((JBossActionRequest)request).getUser();
}
-
+
try
{
user = userModule.findUserById(user.getId());
@@ -2062,11 +2101,11 @@
PortalCMSSecurityContext securityContext = new PortalCMSSecurityContext(user);
File file = new FileImpl();
file.setBasePath(path);
- securityContext.setAttribute("command", CMSService.getCommandFactory().createFileUpdateCommand(file));
+ securityContext.setAttribute("command", CMSService.getCommandFactory().createFileUpdateCommand(file));
PortalPermission cmsPermission = new CMSPermission(securityContext);
hasAccess = this.authorizationManager.checkPermission(cmsPermission);
-
+
return hasAccess;
}
}
\ No newline at end of file
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2009-03-06 23:22:30 UTC (rev 12984)
@@ -71,7 +71,8 @@
<attribute name="DefaultContentLocation">portal/cms/conf/default-content/default/</attribute>
<attribute name="DefaultLocale">en</attribute>
<attribute name="RepositoryName">PortalRepository</attribute>
- <attribute name="HomeDir">${jboss.server.data.dir}${/}portal${/}cms${/}conf</attribute>
+ <attribute name="HomeDir">${jboss.server.data.dir}${/}portal${/}cms${/}conf</attribute>
+ <attribute name="CmsSessionFactory">java:/portal/cms/CMSSessionFactory</attribute>
<attribute name="Config">
<Repository>
<!--
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2009-03-06 23:22:30 UTC (rev 12984)
@@ -149,4 +149,7 @@
CMS_DATE_PATTERN=MM/dd/yy HH:mm
+INVALID_ARCHIVE_MESSAGE=The archive being uploaded is not a valid archive file
+CMS_MISSING_RESOURCE=Requested CMS Resource could not be Found
+
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_it.properties
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_it.properties 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_it.properties 2009-03-06 23:22:30 UTC (rev 12984)
@@ -121,8 +121,9 @@
CMS_HELP=La Portlet CMS visualizza e salva i contenuti di un file da dentro la finestra di una Portlet, o, nel caso di un contenuto binario, fuori della finestra
CMS_TO_MODIFY=Per modificare il comportamento di questa Portlet,
CMS_CLICK_HERE=clicca qui
+CMS_SELECT_ACTION=Seleziona un\'azione
-CMS_QUERYERROR=The query you entered is not valid
+CMS_QUERYERROR=La query che hai inserito non \u00e8 valida
CMS_ADMIN_SET_READ_PERMISSIONS=Configura i permessi in lettura
CMS_ADMIN_SET_WRITE_PERMISSIONS=Configura i permessi in scrittura
@@ -130,4 +131,19 @@
CMS_ADMIN_SELECT_ROLES=Seleziona i ruoli che hanno accesso a questo nodo.
CMS_ADMIN_SELECT_USERS=Seleziona gli utenti che hanno accesso a questo nodo.
CMS_ADMIN_YOU_CAN_SELECT_CTRL_ROLES=Puoi selezionare pi\u00f9 ruoli usando il CTRL+click sui nomi dei ruoli.
-CMS_ADMIN_YOU_CAN_SELECT_CTRL_USERS=Puoi selezionare pi\u00f9 utenti usando il CTRL+click sui nomi degli utenti.
\ No newline at end of file
+CMS_ADMIN_YOU_CAN_SELECT_CTRL_USERS=Puoi selezionare pi\u00f9 utenti usando il CTRL+click sui nomi degli utenti.
+
+CMS_ACCESS_DENIED=Accesso negato
+CMS_ACCESS_DENIED_DESCRIPTION=Non ti \u00e8 permesso accedere alla risorsa
+CMS_ACCESS_DENIED_DESCRIPTION_PATH=Non ti \u00e8 permesso accedere alla risorsa
+
+CMS_MISSING_DOCUMENT=404 - Pagina non trovata
+CMS_MISSING_DOCUMENT_DESCRIPTION=Il documento a cui hai tentato di accedere non \u00e8 disponibile
+
+CMS_FILENAME_INVALID=Il nome del File non \u00e8 valido. Non sono permessi caratteri quali '.', '/', ':', '[', ']', '*', ''', '"', '|' o lo spazio.
+CMS_FOLDERNAME_INVALID=Il nome della cartella non \u00e8 valido. Non sono permessi caratteri quali '.', '/', ':', '[', ']', '*', ''', '"', '|' o lo spazio.
+
+CMS_MSG_DESTINATION_ALREADY_EXISTS=Il comando non pu\u00F2 essere eseguito, perch\u00e8 la destinazione esiste gi\u00e0.
+CMS_CANT_MOVE_SAME_DESTINATION=Non puoi spostare la cartella nella stessa destinazione
+
+CMS_DATE_PATTERN=MM/dd/yy HH:mm
\ No newline at end of file
Copied: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_ja.properties (from rev 12964, branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_ja.properties)
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_ja.properties (rev 0)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_ja.properties 2009-03-06 23:22:30 UTC (rev 12984)
@@ -0,0 +1,154 @@
+################################################################################
+# JBoss, a division of Red Hat #
+# Copyright 2006, Red Hat Middleware, LLC, and individual #
+# contributors as indicated by the @authors tag. See the #
+# copyright.txt in the distribution for a full listing of #
+# individual contributors. #
+# #
+# This is free software; you can redistribute it and/or modify it #
+# under the terms of the GNU Lesser General Public License as #
+# published by the Free Software Foundation; either version 2.1 of #
+# the License, or (at your option) any later version. #
+# #
+# This software is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
+# Lesser General Public License for more details. #
+# #
+# You should have received a copy of the GNU Lesser General Public #
+# License along with this software; if not, write to the Free #
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA #
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org. #
+################################################################################
+
+org.jboss.portal.object.name.admin.CMS=\u30b3\u30f3\u30c6\u30f3\u30c4\u7ba1\u7406
+
+## CMS ADMIN PORTLET
+TITLE_HEAD=CMS \u7ba1\u7406
+TITLE_BROWSE=\u30c7\u30a3\u30ec\u30af\u30c8\u30ea \u30d6\u30e9\u30a6\u30b6
+TITLE_FILEBROWSE=\u30d5\u30a1\u30a4\u30eb \u30d6\u30e9\u30a6\u30b6
+TITLE_DELETECONFIRM=\u524a\u9664\u78ba\u8a8d
+TITLE_CREATECOLLCONFIRM=\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4f5c\u6210\u78ba\u8a8d
+TITLE_COPYCONFIRM=\u30ea\u30bd\u30fc\u30b9\u30b3\u30d4\u30fc\u78ba\u8a8d
+TITLE_MOVECONFIRM=\u30ea\u30bd\u30fc\u30b9\u79fb\u52d5\u78ba\u8a8d
+TITLE_VIEWFILE=\u89b3\u89a7\u30d5\u30a1\u30a4\u30eb\u30d7\u30ed\u30d1\u30c6\u30a3
+TITLE_EDIT=\u30d5\u30a1\u30a4\u30eb\u7de8\u96c6
+TITLE_CREATE=\u30d5\u30a1\u30a4\u30eb\u4f5c\u6210
+TITLE_UPLOAD=\u30d5\u30a1\u30a4\u30eb\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9
+TITLE_SECURECONFIRM=\u30bb\u30ad\u30e5\u30a2\u30ce\u30fc\u30c9
+
+CMS_SEARCH=\u691c\u7d22
+CMS_SEARCHNORESULT=\u691c\u7d22\u7d50\u679c\u304c\u3042\u308a\u307e\u305b\u3093
+CMS_MENU=\u30a2\u30af\u30b7\u30e7\u30f3\u30e1\u30cb\u30e5\u30fc
+CMS_ACTION=\u30a2\u30af\u30b7\u30e7\u30f3
+CMS_NAME=\u540d\u524d
+CMS_TYPE=\u30bf\u30a4\u30d7
+CMS_CREATED=\u4f5c\u6210
+CMS_MODIFIED=\u4fee\u6b63
+CMS_DESCRIPTION=\u8aac\u660e
+CMS_VIEW=\u89b3\u89a7
+CMS_COPY=\u30b3\u30d4\u30fc
+CMS_MOVE=\u79fb\u52d5
+CMS_DELETE=\u524a\u9664
+CMS_FOLDER=\u30d5\u30a9\u30eb\u30c0
+CMS_FILE=\u30d5\u30a1\u30a4\u30eb
+CMS_CREATE=\u4f5c\u6210
+CMS_CANCEL=\u30ad\u30e3\u30f3\u30bb\u30eb
+CMS_EDIT=\u7de8\u96c6
+CMS_UPLOAD=\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9
+CMS_MODIFY=\u4fee\u6b63
+CMS_CREATEFOLDER= \u30d5\u30a9\u30eb\u30c0\u4f5c\u6210
+CMS_CREATEFILE=\u30d5\u30a1\u30a4\u30eb\u4f5c\u6210
+CMS_UPLOADARCHIVE=\u30a2\u30fc\u30ab\u30a4\u30d6\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9
+CMS_UPLOADARCHIVE_ASYNC=\u975e\u540c\u671f\u30d7\u30ed\u30bb\u30b9
+CMS_BACKTOBROWSER=\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30d6\u30e9\u30a6\u30b6\u306b\u623b\u308b
+CMS_TRANSFER=\u30a4\u30f3\u30dd\u30fc\u30c8/\u30a8\u30af\u30b9\u30dd\u30fc\u30c8
+CMS_EXPORTARCHIVE=\u30d5\u30a9\u30eb\u30c0\u306e\u30a8\u30af\u30b9\u30dd\u30fc\u30c8
+CMS_SECURE=\u30bb\u30ad\u30e5\u30a2
+CMS_PREVIEW=\u30d7\u30ec\u30d3\u30e5\u30fc
+CMS_GO=Go
+
+CMS_CREATEFILEINDIR=\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210
+CMS_FILENAME=\u30d5\u30a1\u30a4\u30eb\u540d
+CMS_TITLE=\u30bf\u30a4\u30c8\u30eb
+CMS_LANGUAGE=\u8a00\u8a9e
+
+CMS_DELETEPATH=\u524a\u9664\u5bfe\u8c61\u306e\u78ba\u8a8d:
+CMS_DELETEWARN1=\u8b66\u544a! \u3053\u306e\u5909\u66f4\u3092\u3082\u3068\u306b\u623b\u3059\u3053\u3068\u306f\u51fa\u6765\u307e\u305b\u3093\!
+CMS_DELETEWARN2=\u3053\u306e\u30ea\u30bd\u30fc\u30b9\u3092\u672c\u5f53\u306b\u524a\u9664\u3057\u307e\u3059\u304b\?
+
+CMS_DESTINATION=\u5834\u6240
+CMS_SOURCE=\u30bd\u30fc\u30b9
+
+CMS_EDITING=\u30d5\u30a1\u30a4\u30eb\u7de8\u96c6
+CMS_LIVE=Make \"Live\"
+CMS_VERSION=\u30d0\u30fc\u30b8\u30e7\u30f3
+CMS_WYSIWYG=WYSIWYG \u30a8\u30c7\u30a3\u30bf
+
+CMS_LIVEVERSION=Live \u30d0\u30fc\u30b8\u30e7\u30f3
+CMS_SIZE=\u30b5\u30a4\u30ba
+
+CMS_CONTENT_DIR=\u30b3\u30f3\u30c6\u30f3\u30c4\u30c7\u30a3\u30ec\u30af\u30c8\u30ea
+CMS_CONTENT_DIR_USE=\u30dd\u30fc\u30bf\u30eb\u30d5\u30a9\u30eb\u30c0\u69cb\u9020\u3092\u64cd\u4f5c\u3059\u308b\u305f\u3081\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30c4\u30ea\u30fc\u3092\u5229\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002
+CMS_MAIN_USE=\u30dd\u30fc\u30bf\u30eb\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u7ba1\u7406\u3059\u308b\u305f\u3081\u306bCMS\u7ba1\u7406\u30dd\u30fc\u30c8\u30ec\u30c3\u30c8\u3092\u5229\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002
+CMS_MANAGE=\u7ba1\u7406\u30b3\u30f3\u30c6\u30f3\u30c4
+
+CMS_CREATED_BY=Created By
+CMS_APPROVE=\u627f\u8a8d
+CMS_DENY=\u5426\u8a8d
+CMS_APPROVAL=\u30da\u30f3\u30c7\u30a3\u30f3\u30b0\u30a2\u30a4\u30c6\u30e0
+CMS_PATH=\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3
+
+CMS_EMPTY_FOLDER=\u3053\u306e\u30d5\u30a9\u30eb\u30c0\u306f\u7a7a\u3067\u3059\u3002
+
+CMS_ERROR_UPLOADARCHIVE_ASYNC=\u30a2\u30fc\u30ab\u30a4\u30d6\u51e6\u7406\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002\u300e\u975e\u540c\u671f\u30d7\u30ed\u30bb\u30b9\u300f\u3092\u8d77\u52d5\u3055\u305b\u3082\u3046\u4e00\u5ea6\u305f\u3081\u3057\u3066\u304f\u3060\u3055\u3044\u3002
+CMS_MSG_UPLOADARCHIVE_ASYNC=\u30a2\u30fc\u30ab\u30a4\u30d6\u306f\u51e6\u7406\u4e2d\u3067\u3059\u3002\u51e6\u7406\u304c\u7d42\u308f\u308b\u3068\u30ea\u30bd\u30fc\u30b9\u3092\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002
+
+CMS_REQUIRED=\u5fc5\u9808
+CMS_LINK_TO_RESOURCES=\u30dd\u30fc\u30bf\u30eb\u5185\u306e\u30ea\u30bd\u30fc\u30b9\u30ea\u30f3\u30af\u306f\u53b3\u5bc6\u306b\u8a18\u8ff0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u4f8b\u3048\u3070 default/images/back.gif\u306b\u914d\u7f6e\u3055\u308c\u305f\u30a4\u30e1\u30fc\u30b8\u30d5\u30a1\u30a4\u30eb\u306e\u30ea\u30f3\u30af\u306f\u3053\u3053\u3067\u793a\u3055\u308c\u3066\u3044\u308b\u901a\u308a\u306b\u30bf\u30a4\u30d7\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3064\u307e\u308a\u30b9\u30e9\u30c3\u30b7\u30e5(/)\u3092\u30ea\u30bd\u30fc\u30b9\u30d1\u30b9\u306e\u5148\u982d\u306b\u8a18\u8ff0\u3057\u3066\u306f\u3044\u3051\u307e\u305b\u3093\u3002\u3042\u306a\u305f\u306f\u30a8\u30c7\u30a3\u30bf\u306ePreview\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3053\u3068\u3067\u30ea\u30f3\u30af\u304c\u6b63\u3057\u3044\u304b\u3092\u78ba\u8a8d\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002
+CMS_ERROR_PROCESSING=\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u51e6\u7406\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002
+CMS_ERROR_EXPORT=\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u51e6\u7406\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u308b\u30d5\u30a9\u30eb\u30c0\u304c\u7a7a\u3067\u306a\u3044\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002
+CMS_YOUR_EXPORT_0=\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u30d5\u30a9\u30eb\u30c0:
+CMS_YOUR_EXPORT_1=\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u6e96\u5099\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002
+CMS_CLICK_TO_DOWNLOAD=\u30af\u30ea\u30c3\u30af\u3057\u3066\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9
+CMS_ROOT_FOLDER=\u30eb\u30fc\u30c8\u30d5\u30a9\u30eb\u30c0
+CMS_MESSAGES=\u30e1\u30c3\u30bb\u30fc\u30b8
+CMS_HOME=\u30db\u30fc\u30e0
+CMS_ERROR=\u30a8\u30e9\u30fc
+CMS_PENDING_APPROVAL_QUEUE=\u627f\u8a8d\u4fdd\u7559\u4e2d\u30ad\u30e5\u30fc
+CMS_CONFIGURE_RESTRICTION=\u30ce\u30fc\u30c9\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5236\u9650\u3092\u8a2d\u5b9a
+CMS_SELECT_ACTION=\u30a2\u30af\u30b7\u30e7\u30f3\u9078\u629e...
+CMS_BROWSING=\u30d6\u30e9\u30a6\u30b8\u30f3\u30b0
+CMS_CONTENT_NOT_FOUND=\u30b3\u30f3\u30c6\u30f3\u30c4\u306f\u9078\u629e\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u898b\u3064\u3051\u308b\u4e8b\u304c\u51fa\u6765\u307e\u305b\u3093\u3067\u3057\u305f\u3002
+CMS_INTRODUCTION=\u7d39\u4ecb
+CMS_HELP=CMS \u30dd\u30fc\u30c8\u30ec\u30c3\u30c8\u306f\u3001\u30dd\u30fc\u30c8\u30ec\u30c3\u30c8\u30a6\u30a4\u30f3\u30c9\u30a6\u5185\u306e\u30d5\u30a1\u30a4\u30eb\u30b9\u30c8\u30a2\u3001\u3082\u3057\u304f\u306f\u3001\u30d0\u30a4\u30ca\u30ea\u30b3\u30f3\u30c6\u30f3\u30c4\u306e\u5834\u5408\u3001\u5b8c\u5168\u306b\u30dd\u30fc\u30c8\u30ec\u30c3\u30c8\u30a6\u30a4\u30f3\u30c9\u30a6\u306e\u5916\u5074\u306b\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u793a\u3057\u307e\u3059\u3002
+CMS_TO_MODIFY=\u3053\u306e\u30dd\u30fc\u30c8\u30ec\u30c3\u30c8\u306e\u6319\u52d5\u3092\u5909\u66f4\u3059\u308b\u306b\u306f\u3001
+CMS_CLICK_HERE=\u3053\u3053\u3092\u30af\u30ea\u30c3\u30af
+CMS_SELECT_ACTION=\u30a2\u30af\u30b7\u30e7\u30f3\u306e\u9078\u629e
+
+CMS_QUERYERROR=\u5165\u529b\u3055\u308c\u305f\u30af\u30a8\u30ea\u306f\u6709\u52b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002
+
+CMS_ADMIN_SET_READ_PERMISSIONS=\u8aad\u307f\u8fbc\u307f\u6a29\u9650\u3092\u8a2d\u5b9a
+CMS_ADMIN_SET_WRITE_PERMISSIONS=\u66f8\u304d\u8fbc\u307f\u6a29\u9650\u3092\u8a2d\u5b9a
+CMS_ADMIN_SET_MANAGE_PERMISSIONS=\u7ba1\u7406\u6a29\u9650\u3092\u8a2d\u5b9a
+CMS_ADMIN_SELECT_ROLES=\u3053\u306e\u30ce\u30fc\u30c9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u30ed\u30fc\u30eb\u3092\u9078\u629e
+CMS_ADMIN_SELECT_USERS=\u3053\u306e\u30ce\u30fc\u30c9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u30e6\u30fc\u30b6\u3092\u9078\u629e
+CMS_ADMIN_YOU_CAN_SELECT_CTRL_ROLES=CTRL+click\uff08Mac\u3067\u306fCMD+click\uff09\u3067\u8907\u6570\u306e\u5f79\u5272\u3092\u9078\u629e\u3067\u304d\u307e\u3059\u3002
+CMS_ADMIN_YOU_CAN_SELECT_CTRL_USERS=CTRL+click\uff08Mac\u3067\u306fCMD+click\uff09\u3067\u8907\u6570\u306e\u5f79\u5272\u3092\u9078\u629e\u3067\u304d\u307e\u3059\u3002
+
+CMS_ACCESS_DENIED=\u30a2\u30af\u30bb\u30b9\u62d2\u5426
+CMS_ACCESS_DENIED_DESCRIPTION=\u3042\u306a\u305f\u306f\u3053\u306e\u30ea\u30bd\u30fc\u30b9\u3078\u306e\u30a2\u30af\u30bb\u30b9\u3092\u8a31\u53ef\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002
+CMS_ACCESS_DENIED_DESCRIPTION_PATH=\u3042\u306a\u305f\u306f\u3053\u306e\u30ea\u30bd\u30fc\u30b9\u3078\u306e\u30a2\u30af\u30bb\u30b9\u3092\u8a31\u53ef\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002
+
+CMS_MISSING_DOCUMENT=404 - \u30da\u30fc\u30b8\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093
+CMS_MISSING_DOCUMENT_DESCRIPTION=\u3042\u306a\u305f\u304c\u30a2\u30af\u30bb\u30b9\u3057\u3088\u3046\u3068\u3057\u305f\u6587\u66f8\u306f\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002
+
+CMS_FILENAME_INVALID=\u30d5\u30a1\u30a4\u30eb\u540d\u304c\u7121\u52b9\u3067\u3059\u3002\u7121\u52b9\u306a\u6587\u5b57\u5217\uff08 '.', '/', ':', '[', ']', '*', ''', '"', '|'\uff09\u3084\u30b9\u30da\u30fc\u30b9\u304c\u4f7f\u308f\u308c\u3066\u3044\u306a\u3044\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002
+CMS_FOLDERNAME_INVALID=\u30d5\u30a9\u30eb\u30c0\u540d\u304c\u7121\u52b9\u3067\u3059\u3002\u7121\u52b9\u306a\u6587\u5b57\u5217\uff08 '.', '/', ':', '[', ']', '*', ''', '"', '|'\uff09\u3084\u30b9\u30da\u30fc\u30b9\u304c\u4f7f\u308f\u308c\u3066\u3044\u306a\u3044\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002
+
+CMS_MSG_DESTINATION_ALREADY_EXISTS=\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u3002
+CMS_CANT_MOVE_SAME_DESTINATION=\u540c\u3058\u30d5\u30a9\u30eb\u30c0\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u79fb\u52d5\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002
+
+CMS_DATE_PATTERN=yy/MM/dd HH:mm
+
+
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_pt_BR.properties
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_pt_BR.properties 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_pt_BR.properties 2009-03-06 23:22:30 UTC (rev 12984)
@@ -22,68 +22,134 @@
################################################################################
## CMS ADMIN PORTLET
-TITLE_HEAD=CMS Admin
-TITLE_BROWSE=Navegador de Diret�rios
-TITLE_FILEBROWSE=Navegador de Arquivos
-TITLE_DELETECONFIRM=Confirmar remo��o
-TITLE_CREATECOLLCONFIRM=Confirmar cria��o de diret�rio
-TITLE_COPYCONFIRM=Confirm Resource Copy
-TITLE_MOVECONFIRM=Confirm Resource Move
-TITLE_VIEWFILE=Visualizando Propriedades de Arquivo
+TITLE_HEAD=Administra\u00E7\u00E3o do CMS
+TITLE_BROWSE=Navegador do diret\u00F3rio
+TITLE_FILEBROWSE=Navegador do arquivo
+TITLE_DELETECONFIRM=Confirmar exclus\u00E3o
+TITLE_CREATECOLLCONFIRM=Confirmar Cria\u00E7\u00E3o de Diret\u00F3rio
+TITLE_COPYCONFIRM=Confirmar C\u00F3pia de Recurso
+TITLE_MOVECONFIRM=Confirmar Movimenta\u00E7\u00E3o de Recurso
+TITLE_VIEWFILE=Visualizando Propriedades do Arquivo
TITLE_EDIT=Editar Arquivo
TITLE_CREATE=Criar Arquivo
-TITLE_UPLOAD=Enviar Arquivo
+TITLE_UPLOAD=Upload de Arquivo
+TITLE_SECURECONFIRM=N\u00F3 Seguro
CMS_SEARCH=Pesquisar
-CMS_MENU=Menu de A��es
-CMS_ACTION=A��o
+CMS_SEARCHNORESULT=Nenhum resultado para esta pesquisa
+CMS_MENU=Menu de A\u00E7\u00E3o
+CMS_ACTION=A\u00E7\u00E3o
CMS_NAME=Nome
CMS_TYPE=Tipo
CMS_CREATED=Criado
-CMS_MODIFIED=Modificado
-CMS_DESCRIPTION=Descri��o
+CMS_MODIFIED=Alterado
+CMS_DESCRIPTION=Descri\u00E7\u00E3o
CMS_VIEW=Visualizar
-CMS_COPY=Copiar
+CMS_COPY=Copy
CMS_MOVE=Mover
-CMS_DELETE=Remover
+CMS_DELETE=Excluir
CMS_FOLDER=Pasta
CMS_FILE=Arquivo
CMS_CREATE=Criar
-CMS_CANCEL=Cancel
-CMS_RESET=Resetar
+CMS_CANCEL=Cancelar
CMS_EDIT=Editar
-CMS_UPLOAD=Enviar
-CMS_MODIFY=Modificar
+CMS_UPLOAD=Upload
+CMS_MODIFY=Alterar
CMS_CREATEFOLDER=Criar Pasta
-CMS_CREATEFILE=Criar Diret�rio
-CMS_UPLOADARCHIVE=Enviar Arquivo
-CMS_BACKTOBROWSER=Voltar ao Navegador de Diret�rios
+CMS_CREATEFILE=Criar Arquivo
+CMS_UPLOADARCHIVE=Upload de Arquivo
+CMS_UPLOADARCHIVE_ASYNC=Processar assincronamente
+CMS_BACKTOBROWSER=Voltar para o Navegador do Diret\u00F3rio
+CMS_TRANSFER=Importar/Exportar
+CMS_EXPORTARCHIVE=Exportar Pasta
+CMS_SECURE=Proteger
+CMS_PREVIEW=Prever
+CMS_GO=Ir
-CMS_CREATEFILEINDIR=Criando Arquivo em Diret�rio
+CMS_CREATEFILEINDIR=Criar Arquivo no Diret\u00F3rio
CMS_FILENAME=Nome do Arquivo
-CMS_TITLE=T�tulo
-CMS_LANGUAGE=L�ngua
+CMS_TITLE=T\u00EDtulo
+CMS_LANGUAGE=Linguagem
-CMS_DELETEPATH=Confirmar remo��o de
-CMS_DELETEWARN1=ATEN��O\! Voc� n�o poderar desfazer estas altera��es\!
-CMS_DELETEWARN2=Voc� tem certeza que deseja remover\?
+CMS_DELETEPATH=Confirmar Exclus\u00E3o de
+CMS_DELETEWARN1=ATEN\u00C7\u00C3O\! Voc\u00EA n\u00E3o ser\u00E1 capaz de desfazer essas altera\u00E7\u00F5es\!
+CMS_DELETEWARN2=Tem certeza de que deseja excluir este recurso?
CMS_DESTINATION=Destino
CMS_SOURCE=Fonte
CMS_EDITING=Editando Arquivo
-CMS_LIVE=Tornar \"Ativo\"
-CMS_VERSION=Vers�o
+CMS_LIVE=Tornar "Ativo"
+CMS_VERSION=Vers\u00E3o
+CMS_WYSIWYG=Editor WYSIWYG
-CMS_LIVEVERSION=Vers�o \"Ativa\"
+CMS_LIVEVERSION=Vers\u00E3o Ativa
CMS_SIZE=Tamanho
-CMS_CONTENT_DIR=Content Directory
-CMS_CONTENT_DIR_USE=Use the directory tree to navigate the portal folder structure.
-CMS_MAIN_USE=Use the CMS Administration portlet to manage the content of your portal.
-CMS_MANAGE=Manage Content
+CMS_CONTENT_DIR=Diret\u00F3rio de conte\u00FAdo
+CMS_CONTENT_DIR_USE=Use a \u00E1rvore de diret\u00F3rio para navegar na estrutura de p
+CMS_MAIN_USE=Utilize o portlet de Administra\u00E7\u00E3o do CMS para gerenciar o conte\u00FAdo de seu portal.
+CMS_MANAGE=Gerenciar Conte\u00FAdo
-CMS_CREATED_BY=Created By
-CMS_APPROVE=Approve
-CMS_DENY=Deny
-CMS_APPROVAL=Pending Items
+CMS_CREATED_BY=Criado por
+CMS_APPROVE=Aprovar
+CMS_DENY=N\u00E3o aprovar
+CMS_APPROVAL=Itens Pendentes
+CMS_PATH=Local
+
+CMS_EMPTY_FOLDER=Esta pasta est\u00E1 vazia.
+
+CMS_ERROR_UPLOADARCHIVE_ASYNC=Ocorreu um erro ao processar o arquivo. Tente novamente com a op\u00E7\u00E3o 'Processamento Ass\u00EDncrono' ativada
+CMS_MSG_UPLOADARCHIVE_ASYNC=Seu arquivo foi aceito para processamento. Os recursos ser\u00E3o exibidos na pasta assim que o processamento terminar
+
+CMS_REQUIRED=Obrigat\u00F3rio
+CMS_LINK_TO_RESOURCES\=Links para recursos no \u00E2mbito deste portal devem ser absolutos. Por exemplo\: Um link para uma imagem localizada em default/images/back.gif deve ser digitado exatamente como mostrado aqui. N\u00E3o prefixando uma barra (/) no caminho do recurso. Voc\u00EA pode verificar se o link est\u00E1 correto, clicando no bot\u00E3o visualizar no editor
+CMS_ERROR_PROCESSING=Erro ao processar o pedido de exporta\u00E7\u00E3o
+CMS_ERROR_EXPORT=Ocorreu um erro durante a opera\u00E7\u00E3o de Exporta\u00E7\u00E3o. Tenha certeza de que a pasta a ser exportada n\u00E3o est\u00E1 vazia
+CMS_YOUR_EXPORT_0=Sua exporta\u00E7\u00E3o de
+CMS_YOUR_EXPORT_1=est\u00E1 pronta para download
+CMS_CLICK_TO_DOWNLOAD=Clique para Download
+CMS_ROOT_FOLDER=Pasta raiz
+CMS_MESSAGES=Mensagens
+CMS_HOME=In\u00EDcio
+CMS_ERROR=Erro
+CMS_PENDING_APPROVAL_QUEUE=Fila de Aprova\u00E7\u00F5es Pendentes
+CMS_CONFIGURE_RESTRICTION=Configurar restri\u00E7\u00F5es de seguran\u00E7a no n\u00F3asta do portal.
+CMS_SELECT_ACTION=Selecionar A\u00E7\u00E3o
+CMS_BROWSING=Navega\u00E7\u00E3o
+CMS_CONTENT_NOT_FOUND=Conte\u00FAdo n\u00E3o p\u00F4de ser encontrado para o arquivo selecionado
+CMS_INTRODUCTION=Introdu\u00E7\u00E3o
+CMS_HELP=O Portlet de CMS exibe o conte\u00FAdo do arquivo dentro de uma janela de portlet, ou, no caso de conte\u00FAdo bin\u00E1rio, de fora da janela de portlet totalmente
+CMS_TO_MODIFY=Para modificar o comportamento desse portlet, por favor
+CMS_CLICK_HERE=clique aqui
+CMS_SELECT_ACTION=Selecionar A\u00e7\u00e3o...
+
+CMS_QUERYERROR=A pesquisa que voc\u00EA digitou n\u00E3o \u00E9 v\u00E1lida
+
+CMS_ADMIN_SET_READ_PERMISSIONS=Definir Permiss\u00F5es de Leitura
+CMS_ADMIN_SET_WRITE_PERMISSIONS=Definir Permiss\u00F5es de Escrita
+CMS_ADMIN_SET_MANAGE_PERMISSIONS=Definir Permiss\u00F5es de Gerenciamento
+CMS_ADMIN_SELECT_ROLES=Selecione os Perfis que t\u00EAm acesso a esse n\u00F3.
+CMS_ADMIN_SELECT_USERS=Selecionar Usu\u00E1rios que t\u00EAm acesso a esse n\u00F3.
+CMS_ADMIN_YOU_CAN_SELECT_CTRL_ROLES=Voc\u00EA pode selecionar m\u00FAltiplos perfis usando CTRL+clique (CMD+clique no Mac) sobre os nomes dos perfis.
+CMS_ADMIN_YOU_CAN_SELECT_CTRL_USERS=Voc\u00EA pode selecionar v\u00E1rios usu\u00E1rios, usando CTRL+clique (CMD+clique no Mac) sobre os nomes dos usu\u00E1rios.
+
+CMS_ACCESS_DENIED=Acesso Negado
+CMS_ACCESS_DENIED_DESCRIPTION=Voc\u00EA n\u00E3o tem permiss\u00E3o para acessar esse recurso
+CMS_ACCESS_DENIED_DESCRIPTION_PATH=Voc\u00EA n\u00E3o tem permiss\u00E3o para acessar o recurso
+
+CMS_MISSING_DOCUMENT=404 - P\u00E1gina N\u00E3o Encontrada
+CMS_MISSING_DOCUMENT_DESCRIPTION=O documento que voc\u00EA tentou acessar n\u00E3o est\u00E1 dispon\u00EDvel
+
+CMS_FILENAME_INVALID=Nome do arquivo \u00E9 inv\u00E1lido. N\u00E3o pode conter caracteres ilegais, tais como '.', '/', '\:', '[', ']', '*','' ',' " ',' | ', Ou qualquer caractere branco.
+CMS_FOLDERNAME_INVALID=Nome da pasta \u00E9 inv\u00E1lido. N\u00E3o pode conter caracteres ilegais, tais como '.', '/', '\:', '[', ']', '*','' ',' " ',' | ', Ou qualquer caractere branco.
+
+CMS_MSG_DESTINATION_ALREADY_EXISTS=O comando n\u00E3o foi realizado, porque o destino j\u00E1 existe.
+CMS_CANT_MOVE_SAME_DESTINATION=Voc\u00EA n\u00E3o pode mover uma pasta para o mesmo local
+
+CMS_DATE_PATTERN=dd/MM/yy HH:mm
+
+INVALID_ARCHIVE_MESSAGE=O arquivo enviado n\u00E3o \u00E9 um arquivo v\u00E1lido
+CMS_MISSING_RESOURCE=Recurso CMS solicitado n\u00E3o p\u00F4de ser encontrado
+
+
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/default-object.xml
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/default-object.xml 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/default-object.xml 2009-03-06 23:22:30 UTC (rev 12984)
@@ -31,6 +31,9 @@
<parent-ref>admin</parent-ref>
<page>
<page-name>CMS</page-name>
+ <supported-locale>en</supported-locale>
+ <supported-locale>ja</supported-locale>
+ <resource-bundle>Resource</resource-bundle>
<window>
<window-name>CMSAdminPortletWindow</window-name>
<instance-ref>CMSAdminPortletInstance</instance-ref>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/accessdenied.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/accessdenied.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/accessdenied.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -1,6 +1,6 @@
<%@ page import="org.jboss.portal.core.cms.ui.admin.CMSAdminConstants" %>
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored="false" %>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmcopy.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmcopy.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmcopy.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -1,5 +1,7 @@
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ page import="org.jboss.portal.common.text.EntityEncoder" %>
+
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored="false" %>
@@ -27,7 +29,7 @@
<table>
<tr>
<td>${n:i18n("CMS_SOURCE")}:</td>
- <td><%= sCurrPath %>
+ <td><%= EntityEncoder.FULL.encode(sCurrPath) %>
</td>
</tr>
<tr>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmcreatecollection.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmcreatecollection.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmcreatecollection.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -1,5 +1,5 @@
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored="false" %>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmdelete.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmdelete.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmdelete.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -1,7 +1,9 @@
<%@ page import="org.jboss.portal.cms.util.NodeUtil" %>
<%@ page import="org.jboss.portal.core.cms.ui.admin.CMSAdminConstants" %>
+<%@ page import="org.jboss.portal.common.text.EntityEncoder" %>
+
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored="false" %>
@@ -24,7 +26,7 @@
<tr>
<td align="center">
- <font class="portlet-font">${n:i18n("CMS_DELETEPATH")} <%= sCurrPath %>
+ <font class="portlet-font">${n:i18n("CMS_DELETEPATH")} <%= EntityEncoder.FULL.encode(sCurrPath) %>
</font>
<br><br>
<font class="portlet-font" style="color:red"><b>${n:i18n("CMS_DELETEWARN1")}</b></font>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmmove.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmmove.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/confirmmove.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -1,8 +1,10 @@
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored="false" %>
+<%@ page import="org.jboss.portal.common.text.EntityEncoder" %>
+
<%
String sCurrPath = (String)request.getAttribute("currpath");
String OP = CMSAdminConstants.OP_CONFIRMMOVE;
@@ -31,7 +33,7 @@
<table>
<tr>
<td>${n:i18n("CMS_SOURCE")}:</td>
- <td><%= sCurrPath %>
+ <td><%= EntityEncoder.FULL.encode(sCurrPath) %>
</td>
</tr>
<tr>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -2,7 +2,9 @@
org.jboss.portal.core.cms.ui.admin.CMSAdminConstants,
java.util.Locale" %>
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ page import="org.jboss.portal.common.text.EntityEncoder" %>
+
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored="false" %>
@@ -126,7 +128,7 @@
<tr>
<td>${n:i18n("CMS_CREATEFILEINDIR")}:
</td>
- <td><%= sCurrPath %>
+ <td><%= EntityEncoder.FULL.encode(sCurrPath) %>
</td>
</tr>
<tr>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -1,7 +1,8 @@
<%@ page import="org.jboss.portal.core.cms.ui.admin.CMSAdminConstants" %>
+<%@ page import="org.jboss.portal.common.text.EntityEncoder" %>
<%@ page import="java.util.Locale" %>
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored="false" %>
@@ -81,7 +82,7 @@
<tr>
<td>${n:i18n("CMS_EDITING")}:
</td>
- <td><%= sCurrPath %>
+ <td><%= EntityEncoder.FULL.encode(sCurrPath) %>
</td>
</tr>
<tr>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/editbinary.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/editbinary.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/editbinary.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -1,6 +1,6 @@
<%@ page import="org.jboss.portal.core.cms.ui.admin.CMSAdminConstants" %>
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored="false" %>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/exportarchive.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/exportarchive.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/exportarchive.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -1,6 +1,6 @@
<%@ page import="java.util.Locale" %>
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored="false" %>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/exportarchive_pickup.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/exportarchive_pickup.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/exportarchive_pickup.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -1,6 +1,6 @@
<%@ page import="org.jboss.portal.core.cms.ui.admin.CMSAdminConstants" %>
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored="false" %>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/exportarchive_pickup_error.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/exportarchive_pickup_error.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/exportarchive_pickup_error.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -1,6 +1,6 @@
<%@ page import="org.jboss.portal.core.cms.ui.admin.CMSAdminConstants" %>
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored="false" %>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/folderlist.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/folderlist.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/folderlist.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -4,7 +4,7 @@
<%@ page import="java.util.List" %>
<%@ page import="java.util.StringTokenizer" %>
<%@ page isELIgnored="false" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/help.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/help.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/help.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -1 +1 @@
-Help page - nothing to see hear. Move along.
\ No newline at end of file
+Help page - nothing to see here. Move along.
\ No newline at end of file
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -1,12 +1,14 @@
<%@ page import="org.jboss.portal.cms.model.File" %>
<%@ page import="org.jboss.portal.cms.model.Folder" %>
<%@ page import="org.jboss.portal.core.cms.ui.admin.CMSAdminConstants" %>
+<%@ page import="org.jboss.portal.common.text.EntityEncoder" %>
<%@ page import="java.text.Format" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.StringTokenizer" %>
+
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ page isELIgnored="false" %>
<portlet:defineObjects/>
@@ -79,7 +81,7 @@
<portlet:param name="op" value="<%= CMSAdminConstants.OP_MAIN %>"/>
<portlet:param name="path" value="<%= sPathBuilder %>"/>
</portlet:renderURL>
-"><%= sPathChunk %>
+"><%= EntityEncoder.FULL.encode(sPathChunk) %>
</a>
</li>
<%
@@ -88,7 +90,7 @@
{
%>
<li class="pathSeperator"><img src="/portal-admin/img/pathSeparator.png" alt=">"></li>
- <li class="selected"><%= sPathChunk %>
+ <li class="selected"><%= EntityEncoder.FULL.encode(sPathChunk) %>
</li>
<%
}
@@ -218,7 +220,7 @@
<portlet:param name="op" value="<%= CMSAdminConstants.OP_MAIN %>"/>
<portlet:param name="path" value="<%= folder.getBasePath() %>"/>
</portlet:renderURL>"><%=
- folder.getBasePath().substring(folder.getBasePath().lastIndexOf("/") + 1, folder.getBasePath().length()) %>
+ EntityEncoder.FULL.encode(folder.getBasePath().substring(folder.getBasePath().lastIndexOf("/") + 1, folder.getBasePath().length())) %>
</a>
</td>
<td>
@@ -274,7 +276,7 @@
<portlet:param name="path"
value="<%= file.getBasePath() %>"/>
</portlet:renderURL>"><%=
- file.getBasePath().substring(file.getBasePath().lastIndexOf("/") + 1, file.getBasePath().length()) %>
+ EntityEncoder.FULL.encode(file.getBasePath().substring(file.getBasePath().lastIndexOf("/") + 1, file.getBasePath().length())) %>
</a>
</td>
<td>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -1,5 +1,5 @@
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored="false" %>
@@ -94,15 +94,20 @@
<!-- Preview of Content being approved -->
<%
String pendingPreviewContent = (String)request.getAttribute("pendingPreviewContent");
- String contentBeingPreviewed = "-1";
+ String contentBeingPreviewed = "-1";
+ if(pendingPreviewContent == null)
+ {
+ pendingPreviewContent = "";
+ }
+ String sDocBase = (String)request.getAttribute("document_base_url");
%>
-<%if(pendingPreviewContent != null && pendingPreviewContent.trim().length() >0){%>
+
+<%if(sDocBase != null){%>
<%
String pid = request.getParameter("pid");
String path = request.getParameter("path");
- String sDocBase = (String)request.getAttribute("document_base_url");
String sCSSURL = (String)request.getAttribute("css_url");
- contentBeingPreviewed = pid;
+ contentBeingPreviewed = pid;
%>
<!-- tinyMCE -->
<script language="javascript" type="text/javascript"
@@ -122,7 +127,7 @@
plugin_insertdate_timeFormat : "%H:%M:%S",
relative_urls : "true",
convert_urls: "false",
- document_base_url : "<%= sDocBase %>",
+ document_base_url : "<%= sDocBase %>",
extended_valid_elements :
"style[type],a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],font[face|size|color],hr[class|width|size|noshade]"
});
@@ -176,10 +181,12 @@
</table>
</form>
</div>
-<br/></br>
<%}%>
+<br/></br>
+
+
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="portlet-table-text"><b>${n:i18n("CMS_PATH")}</b></td>
@@ -227,36 +234,36 @@
<!-- User who requested approval -->
<td><%= cour.getUserName() %>
</td>
- <td>
- <%
- if (cour.getMimeType().equals("text/html") || cour.getMimeType().equals("text/plain"))
- {
- %>
- <a href="<portlet:renderURL>
- <portlet:param name="op" value="<%= CMSAdminConstants.OP_VIEWPENDINGPREVIEW %>"/>
- <portlet:param name="pid" value="<%=cour.getProcessId()%>"/>
- <portlet:param name="path" value="<%=linkPath%>"/>
- <portlet:param name="contentPath" value="<%=cour.getPath()%>"/>
- </portlet:renderURL>"
- <%if(contentBeingPreviewed.equals(cour.getProcessId())){%>style="color: red;"<%}%>
- >${n:i18n("CMS_PREVIEW")}</a>
-
- <% }
- else
- {
- //save the principal for the preview servlet
- String remoteUser = request.getRemoteUser();
- request.getSession().setAttribute("remoteUser", remoteUser);
- %>
- <a target="_blank"
- href="<%= request.getContextPath() %>/cmspreview?pid=<%= cour.getProcessId() %>&p=<%= cour.getPath() %>"<%if(contentBeingPreviewed.equals(cour.getProcessId())){%>style="color: red;"<%}%>
- >${n:i18n("CMS_PREVIEW")}</a>
- <%
- }
- %>
-
-
+ <td>
+ <%
+ if (cour.getMimeType().equals("text/html") || cour.getMimeType().equals("text/plain"))
+ {
+ %>
+ <a href="<portlet:renderURL>
+ <portlet:param name="op" value="<%= CMSAdminConstants.OP_VIEWPENDINGPREVIEW %>"/>
+ <portlet:param name="pid" value="<%=cour.getProcessId()%>"/>
+ <portlet:param name="path" value="<%=linkPath%>"/>
+ <portlet:param name="contentPath" value="<%=cour.getPath()%>"/>
+ </portlet:renderURL>"
+ <%if(contentBeingPreviewed.equals(cour.getProcessId())){%>style="color: red;"<%}%>
+ >${n:i18n("CMS_PREVIEW")}</a>
+
+ <% }
+ else
+ {
+ //save the principal for the preview servlet
+ String remoteUser = request.getRemoteUser();
+ request.getSession().setAttribute("remoteUser", remoteUser);
+ %>
+ <a target="_blank"
+ href="<%= request.getContextPath() %>/cmspreview?pid=<%= cour.getProcessId() %>&p=<%= cour.getPath() %>"<%if(contentBeingPreviewed.equals(cour.getProcessId())){%>style="color: red;"<%}%>
+ >${n:i18n("CMS_PREVIEW")}</a>
+ <%
+ }
+ %>
+
+
<a href="<portlet:actionURL>
<portlet:param name="op" value="<%= CMSAdminConstants.OP_APPROVE %>"/>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/searchResults.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/searchResults.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/searchResults.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -3,7 +3,7 @@
<%@ page import="java.text.Format" %>
<%@ page import="java.util.List" %>
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored="false" %>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/securenode.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/securenode.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/securenode.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -1,11 +1,12 @@
<%@ page import="org.jboss.portal.core.cms.ui.admin.CMSAdminConstants" %>
+<%@ page import="org.jboss.portal.common.text.EntityEncoder" %>
<%@ page import="org.jboss.portal.identity.Role" %>
<%@ page import="org.jboss.portal.identity.User" %>
<%@ page import="org.jboss.portal.cms.security.AuthorizationManager" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.Set" %>
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored="false" %>
@@ -50,7 +51,7 @@
%>
<tr>
<td colspan="2">
- <font class="portlet-font">${n:i18n("CMS_CONFIGURE_RESTRICTION")}: <%= sCurrPath %>
+ <font class="portlet-font">${n:i18n("CMS_CONFIGURE_RESTRICTION")}: <%= EntityEncoder.FULL.encode(sCurrPath) %>
</font>
</td>
</tr>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/upload.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/upload.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/upload.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -1,6 +1,6 @@
<%@ page import="java.util.Locale" %>
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored="false" %>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/uploadarchive.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/uploadarchive.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/uploadarchive.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -1,6 +1,6 @@
<%@ page import="java.util.Locale" %>
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored="false" %>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -1,11 +1,12 @@
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored="false" %>
<%@ page import="org.jboss.portal.cms.model.Content" %>
<%@ page import="org.jboss.portal.cms.util.NodeUtil" %>
<%@ page import="org.jboss.portal.core.cms.ui.admin.CMSAdminConstants" %>
+<%@ page import="org.jboss.portal.common.text.EntityEncoder" %>
<%@ page import="java.text.Format" %>
<%@ page import="java.util.Collection" %>
<%@ page import="java.util.Iterator" %>
@@ -77,7 +78,7 @@
<portlet:param name="op" value="<%= CMSAdminConstants.OP_MAIN %>"/>
<portlet:param name="path" value="<%= sPathBuilder %>"/>
</portlet:renderURL>
-"><%= sPathChunk %>
+"><%= EntityEncoder.FULL.encode(sPathChunk) %>
</a>
</li>
<%
@@ -86,7 +87,7 @@
{
%>
<li class="pathSeperator"><img src="/portal-admin/img/pathSeparator.png" alt=">"></li>
- <li class="selected"><%= sPathChunk %>
+ <li class="selected"><%= EntityEncoder.FULL.encode(sPathChunk) %>
</li>
<%
}
@@ -175,7 +176,19 @@
if (contentList.size() > 0)
{
Content content = (Content)contentList.get(0);
+
+ boolean hasPublishedContent = false;
+ for (int i = 0; i < contentList.size(); i++) // cycle thru list of version nodes
+ {
+ Content version = (Content)contentList.get(i);
+ if (!version.isWaitingForPublishApproval())
+ {
+ hasPublishedContent = true;
+ break;
+ }
+ }
%>
+<%if(hasPublishedContent){%>
<tr>
<td height="15"></td>
</tr>
@@ -322,9 +335,10 @@
%>
<%= modifiedDate %>
</td>
- <td><%= version.getTitle() %>
+ <td><%= EntityEncoder.FULL.encode(version.getTitle()) %>
</td>
</tr>
+<%}%>
<%
}
}
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/edit.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/edit.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/edit.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -1,5 +1,5 @@
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored="false" %>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -8,7 +8,7 @@
<%@ page import="javax.portlet.PortletURL" %>
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ page isELIgnored="false" %>
<portlet:defineObjects/>
Modified: branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/help.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/help.jsp 2009-03-06 23:22:21 UTC (rev 12983)
+++ branches/JBoss_Portal_AS5_Deployer/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/help.jsp 2009-03-06 23:22:30 UTC (rev 12984)
@@ -1,5 +1,5 @@
<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
<%@ page isELIgnored="false" %>
17 years, 1 month
JBoss Portal SVN: r12983 - branches/JBoss_Portal_AS5_Deployer/migration.
by portal-commits@lists.jboss.org
Author: mwringe
Date: 2009-03-06 18:22:21 -0500 (Fri, 06 Mar 2009)
New Revision: 12983
Modified:
branches/JBoss_Portal_AS5_Deployer/migration/.classpath
Log:
Merge JBoss_Portal_Branch_2_7 changes (rev range 12254:12964) into JBoss_Portal_AS5_Deployer branch
Modified: branches/JBoss_Portal_AS5_Deployer/migration/.classpath
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/migration/.classpath 2009-03-06 23:22:19 UTC (rev 12982)
+++ branches/JBoss_Portal_AS5_Deployer/migration/.classpath 2009-03-06 23:22:21 UTC (rev 12983)
@@ -8,7 +8,7 @@
<classpathentry kind="lib" path="/thirdparty/hibernate/lib/hibernate3.jar"/>
<classpathentry kind="lib" path="/thirdparty/junit/lib/junit.jar"/>
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-common.jar"/>
- <classpathentry kind="lib" path="/thirdparty/sun-jsf/lib/jsf-api.jar"/>
<classpathentry kind="lib" path="/thirdparty/sun-servlet/lib/servlet-api.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/glassfish/jsf/lib/jsf-api.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
17 years, 1 month
JBoss Portal SVN: r12982 - in branches/JBoss_Portal_AS5_Deployer/widget/src: resources/portal-widget-netvibes-war/WEB-INF and 3 other directories.
by portal-commits@lists.jboss.org
Author: mwringe
Date: 2009-03-06 18:22:19 -0500 (Fri, 06 Mar 2009)
New Revision: 12982
Modified:
branches/JBoss_Portal_AS5_Deployer/widget/src/main/org/jboss/portal/widget/exceptions/WidgetFailure.java
branches/JBoss_Portal_AS5_Deployer/widget/src/resources/portal-widget-netvibes-war/WEB-INF/jsp/edit_content.jsp
branches/JBoss_Portal_AS5_Deployer/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml
branches/JBoss_Portal_AS5_Deployer/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit_content.jsp
branches/JBoss_Portal_AS5_Deployer/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml
Log:
Merge JBoss_Portal_Branch_2_7 changes (rev range 12254:12964) into JBoss_Portal_AS5_Deployer branch
Modified: branches/JBoss_Portal_AS5_Deployer/widget/src/main/org/jboss/portal/widget/exceptions/WidgetFailure.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/widget/src/main/org/jboss/portal/widget/exceptions/WidgetFailure.java 2009-03-06 23:22:14 UTC (rev 12981)
+++ branches/JBoss_Portal_AS5_Deployer/widget/src/main/org/jboss/portal/widget/exceptions/WidgetFailure.java 2009-03-06 23:22:19 UTC (rev 12982)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.widget.exceptions;
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.widget.Widget;
+
import java.net.URL;
import java.util.Locale;
import java.util.Map;
-import org.jboss.portal.common.i18n.LocalizedString;
-import org.jboss.portal.widget.Widget;
-
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
@@ -90,7 +90,7 @@
}
else
{
- return "Error while retreiving Widget: "+ urlString;
+ return "Error while retrieving Widget: "+ urlString;
}
}
else
Modified: branches/JBoss_Portal_AS5_Deployer/widget/src/resources/portal-widget-netvibes-war/WEB-INF/jsp/edit_content.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/widget/src/resources/portal-widget-netvibes-war/WEB-INF/jsp/edit_content.jsp 2009-03-06 23:22:14 UTC (rev 12981)
+++ branches/JBoss_Portal_AS5_Deployer/widget/src/resources/portal-widget-netvibes-war/WEB-INF/jsp/edit_content.jsp 2009-03-06 23:22:19 UTC (rev 12982)
@@ -12,7 +12,7 @@
<%@page import="java.util.List"%>
<%@page import="java.util.Iterator"%>
<%@ page language="java" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="p" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="p" %>
<%@ page isELIgnored="false" %>
<%@page import="org.jboss.portal.widget.Widget"%>
<%@page import="org.jboss.portal.widget.exceptions.WidgetFailure"%>
Modified: branches/JBoss_Portal_AS5_Deployer/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml 2009-03-06 23:22:14 UTC (rev 12981)
+++ branches/JBoss_Portal_AS5_Deployer/widget/src/resources/portal-widget-netvibes-war/WEB-INF/portlet.xml 2009-03-06 23:22:19 UTC (rev 12982)
@@ -33,7 +33,7 @@
<display-name>Netvibes Widget Portlet</display-name>
<portlet-class>org.jboss.portal.widget.netvibes.NetvibesWidgetPortlet</portlet-class>
<init-param>
- <description>Connection timeout when retreiving gadgets from google directory (in milliseconds)</description>
+ <description>Connection timeout when retrieving gadgets from google directory (in milliseconds)</description>
<name>connectionTimeout</name>
<value>5000</value>
</init-param>
Modified: branches/JBoss_Portal_AS5_Deployer/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit_content.jsp
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit_content.jsp 2009-03-06 23:22:14 UTC (rev 12981)
+++ branches/JBoss_Portal_AS5_Deployer/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit_content.jsp 2009-03-06 23:22:19 UTC (rev 12982)
@@ -14,7 +14,7 @@
<%@ page import="java.util.Collection" %>
<%@ page import="java.util.Iterator" %>
<%@ page language="java" %>
-<%@ taglib uri="http://java.sun.com/portlet" prefix="p" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="p" %>
<%@ page isELIgnored="false" %>
<%@page import="org.jboss.portal.widget.Widget"%>
Modified: branches/JBoss_Portal_AS5_Deployer/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml 2009-03-06 23:22:14 UTC (rev 12981)
+++ branches/JBoss_Portal_AS5_Deployer/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml 2009-03-06 23:22:19 UTC (rev 12982)
@@ -33,7 +33,7 @@
<display-name>Google Widget Portlet</display-name>
<portlet-class>org.jboss.portal.widget.google.GGWidgetPortlet</portlet-class>
<init-param>
- <description>Connection timeout when retreiving gadgets from google directory (in milliseconds)</description>
+ <description>Connection timeout when retrieving gadgets from google directory (in milliseconds)</description>
<name>connectionTimeout</name>
<value>5000</value>
</init-param>
17 years, 1 month
JBoss Portal SVN: r12981 - in branches/JBoss_Portal_AS5_Deployer/faces: src/main and 4 other directories.
by portal-commits@lists.jboss.org
Author: mwringe
Date: 2009-03-06 18:22:14 -0500 (Fri, 06 Mar 2009)
New Revision: 12981
Added:
branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/faces/util/JSFFunctor.java
branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/test/faces/ManagedBeanTestCase.java
branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/test/faces/MessageFormatTestCase.java
branches/JBoss_Portal_AS5_Deployer/faces/src/main/util/
branches/JBoss_Portal_AS5_Deployer/faces/src/main/util/JSFFunctorTestCase.java
Removed:
branches/JBoss_Portal_AS5_Deployer/faces/src/main/util/JSFFunctorTestCase.java
Modified:
branches/JBoss_Portal_AS5_Deployer/faces/.classpath
branches/JBoss_Portal_AS5_Deployer/faces/build.xml
branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/faces/gui/BeanContext.java
branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/faces/gui/JSFBeanContext.java
branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/faces/gui/ManagedBean.java
Log:
Merge JBoss_Portal_Branch_2_7 changes (rev range 12254:12964) into JBoss_Portal_AS5_Deployer branch
Modified: branches/JBoss_Portal_AS5_Deployer/faces/.classpath
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/faces/.classpath 2009-03-06 23:22:10 UTC (rev 12980)
+++ branches/JBoss_Portal_AS5_Deployer/faces/.classpath 2009-03-06 23:22:14 UTC (rev 12981)
@@ -15,8 +15,7 @@
<classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/portlet/lib/portal-portlet-bridge-lib.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/portlet/lib/portal-portlet-lib.jar" sourcepath="/module-portlet-trunk"/>
<classpathentry kind="lib" path="/thirdparty/portlet/lib/portlet-api.jar"/>
- <classpathentry kind="lib" path="/thirdparty/sun-jsf/lib/jsf-api.jar"/>
- <classpathentry kind="lib" path="/thirdparty/sun-jsf/lib/jsf-impl.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/web/lib/jsp-api.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/glassfish/jsf/lib/jsf-api.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: branches/JBoss_Portal_AS5_Deployer/faces/build.xml
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/faces/build.xml 2009-03-06 23:22:10 UTC (rev 12980)
+++ branches/JBoss_Portal_AS5_Deployer/faces/build.xml 2009-03-06 23:22:14 UTC (rev 12981)
@@ -92,8 +92,8 @@
<path refid="jboss.portal/modules/common.classpath"/>
<path refid="jboss.portal/modules/portlet.classpath"/>
<path refid="sun.servlet.classpath"/>
- <path refid="sun.jsf.classpath"/>
- <path refid="sun.jstl.classpath"/>
+ <path refid="glassfish.jsf.classpath"/>
+ <path refid="glassfish.jstl.classpath"/>
<path refid="facelets.facelets.classpath"/>
<path refid="el.el.classpath"/>
<path refid="apache.log4j.classpath"/>
Modified: branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/faces/gui/BeanContext.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/faces/gui/BeanContext.java 2009-03-06 23:22:10 UTC (rev 12980)
+++ branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/faces/gui/BeanContext.java 2009-03-06 23:22:14 UTC (rev 12981)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -52,6 +52,11 @@
*/
public abstract String getParameter(String key);
+ /**
+ * @param target
+ * @param message
+ * @param severity
+ */
protected abstract void createMessage(String target, String message, Object severity);
protected abstract Object getErrorSeverity();
@@ -60,24 +65,33 @@
protected abstract Locale getLocale();
- public void createErrorMessage(String message, Object... params)
+ public void createErrorMessage(String localizedMessageId, Object... params)
{
- createLocalizedMessage(STATUS, message, getErrorSeverity(), params);
+ createLocalizedMessage(STATUS, localizedMessageId, getErrorSeverity(), params);
}
- protected void createErrorMessage(String target, String message, Object... params)
+ public void createTargetedErrorMessage(String target, String localizedMessageId, Object... params)
{
- createLocalizedMessage(target, message, getErrorSeverity(), params);
+ createLocalizedMessage(target, localizedMessageId, getErrorSeverity(), params);
}
- protected void createLocalizedMessage(String target, String message, Object severity, Object... params)
+ /**
+ * Adds a localized message using the appropriate severity to the identified target in the context. This method
+ * accepts an arbitrary number of arguments to be passed as parameters of localized strings.
+ *
+ * @param target the target in this context that will receive the new message
+ * @param localizedMessageId a resource bundle identifier identifying which the localized string to use as a message
+ * @param severity an object representing the severity of the message (typically FacesMessage.Severity)
+ * @param params additional parameters to be passed to replace tokens in localized strings
+ */
+ protected void createLocalizedMessage(String target, String localizedMessageId, Object severity, Object... params)
{
- createMessage(target, getMessageFromBundle(message, params), severity);
+ createMessage(target, getMessageFromBundle(localizedMessageId, params), severity);
}
- public String getMessageFromBundle(String message, Object... params)
+ public String getMessageFromBundle(String localizedMessageId, Object... params)
{
- return getLocalizedMessage(message, getLocale(), params);
+ return getLocalizedMessage(localizedMessageId, getLocale(), params);
}
public static String getLocalizedMessage(String localizationKey, Locale locale, Object... params)
@@ -91,6 +105,17 @@
createErrorMessageFrom(STATUS, e);
}
+ /**
+ * Creates a localized error message targeting the specified object in the context and using the specified error
+ * information. This method looks for two specific resource bundle entries to localize the message, {@link
+ * #UNEXPECTED_ERROR} and {@link #CAUSE}, using the following format for the message: <code>result of {@link
+ * #getLocalizedMessageOrExceptionName(Throwable)} for the exception\n[localized value associated with {@link
+ * #CAUSE}result of {@link #getLocalizedMessageOrExceptionName(Throwable)} for the exception's cause if the cause
+ * exists]
+ *
+ * @param target the contextual object target by the message to be created
+ * @param e the exception that we want to display as an error message
+ */
public void createErrorMessageFrom(String target, Exception e)
{
Throwable cause = e.getCause();
@@ -99,6 +124,14 @@
createMessage(target, message, getErrorSeverity());
}
+ /**
+ * Retrieves a localized message associated with the specified Throwable.
+ *
+ * @param e the Throwable for which a localized message is to be retrieved
+ * @return the localized message associated with the specified Throwable if it exists or the localized value
+ * associated with the {@link #UNEXPECTED_ERROR} resource bundle entry to which is appended the Throwable
+ * class name.
+ */
private String getLocalizedMessageOrExceptionName(Throwable e)
{
String localizedMessage = e.getLocalizedMessage();
@@ -109,14 +142,14 @@
return localizedMessage;
}
- protected void createInfoMessage(String target, String message)
+ protected void createInfoMessage(String target, String localizedMessageId)
{
- createLocalizedMessage(target, message, getInfoSeverity());
+ createLocalizedMessage(target, localizedMessageId, getInfoSeverity());
}
- public void createInfoMessage(String message)
+ public void createInfoMessage(String localizedMessageId)
{
- createInfoMessage(STATUS, message);
+ createInfoMessage(STATUS, localizedMessageId);
}
/**
@@ -174,7 +207,7 @@
}
getFromSession(name, newValue.getClass(), sessionMap, "Provided object: " + newValue
- + " is not compatible with previously assigned '" + name + "' object: " + CURRENT_PLACEHOLDER);
+ + " is not compatible with previously assigned '" + name + "' object: " + CURRENT_PLACEHOLDER);
sessionMap.put(name, newValue);
return newValue;
}
@@ -192,7 +225,7 @@
public <T> T getFromSession(String name, Class<T> expectedClass)
{
return getFromSession(name, expectedClass, getSessionMap(), "Current object:" + CURRENT_PLACEHOLDER
- + " is not compatible with expected class " + expectedClass + " for '" + name + "'");
+ + " is not compatible with expected class " + expectedClass + " for '" + name + "'");
}
/**
Modified: branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/faces/gui/JSFBeanContext.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/faces/gui/JSFBeanContext.java 2009-03-06 23:22:10 UTC (rev 12980)
+++ branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/faces/gui/JSFBeanContext.java 2009-03-06 23:22:14 UTC (rev 12981)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -23,7 +23,11 @@
package org.jboss.portal.faces.gui;
+import org.jboss.portal.common.util.ParameterValidation;
+
import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import java.util.Locale;
import java.util.Map;
@@ -37,17 +41,32 @@
{
public String getParameter(String key)
{
- Map pmap = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ return getParameter(key, FacesContext.getCurrentInstance());
+ }
+
+ public static String getParameter(String key, FacesContext facesContext)
+ {
+ Map pmap = facesContext.getExternalContext().getRequestParameterMap();
return (String)pmap.get(key);
}
public Map<String, Object> getSessionMap()
{
- return FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
+ return JSFBeanContext.getSessionMap(FacesContext.getCurrentInstance());
}
+ public static Map<String, Object> getSessionMap(FacesContext facesContext)
+ {
+ return facesContext.getExternalContext().getSessionMap();
+ }
+
protected void createMessage(String target, String message, Object severity)
{
+ if (ParameterValidation.isNullOrEmpty(target))
+ {
+ target = STATUS;
+ }
+
FacesMessage.Severity jsfSeverity;
if (severity instanceof FacesMessage.Severity)
{
@@ -58,8 +77,22 @@
jsfSeverity = FacesMessage.SEVERITY_ERROR;
}
+ // Get the component id from the target
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ UIViewRoot viewRoot = facesContext.getViewRoot();
+ UIComponent component = viewRoot.findComponent(target);
+ if (component != null)
+ {
+ target = component.getClientId(facesContext);
+ }
+ else
+ {
+ // todo: do something better here
+ System.out.println("Couldn't resolve component target: " + target);
+ }
+
FacesMessage msg = new FacesMessage(jsfSeverity, message, message);
- FacesContext.getCurrentInstance().addMessage(target, msg);
+ facesContext.addMessage(target, msg);
}
protected Object getErrorSeverity()
Modified: branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/faces/gui/ManagedBean.java
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/faces/gui/ManagedBean.java 2009-03-06 23:22:10 UTC (rev 12980)
+++ branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/faces/gui/ManagedBean.java 2009-03-06 23:22:14 UTC (rev 12981)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -24,6 +24,7 @@
package org.jboss.portal.faces.gui;
import org.apache.log4j.Logger;
+import org.jboss.portal.common.util.ParameterValidation;
/**
@@ -31,14 +32,118 @@
* @version $Revision$
* @since 2.6
*/
-public class ManagedBean
+public abstract class ManagedBean
{
protected Logger log = Logger.getLogger(getClass());
protected BeanContext beanContext;
+ public static final String INVALID_NAME = "INVALID_NAME_ERROR";
+ public static final String DUPLICATE = "DUPLICATE_ERROR";
public void setBeanContext(BeanContext beanContext)
{
this.beanContext = beanContext;
}
+
+ public String checkNameValidity(String name, String targetForErrorMessage)
+ {
+ if (ParameterValidation.isNullOrEmpty(name))
+ {
+ beanContext.createTargetedErrorMessage(targetForErrorMessage, INVALID_NAME, name, getLocalizedType());
+ return null;
+ }
+ else
+ {
+ // Trim name
+ name = name.trim();
+
+ // "sanitize" name: if it's invalid, return null and output message
+ name = ParameterValidation.sanitizeFromPatternWithHandler(name, ParameterValidation.XSS_CHECK,
+ new MessageValidationHandler(null, targetForErrorMessage, name));
+
+ // we got an invalid name, fail!
+ if (name == null)
+ {
+ return null;
+ }
+
+ // Check for duplicate
+ if (isAlreadyExisting(name))
+ {
+ beanContext.createTargetedErrorMessage(targetForErrorMessage, DUPLICATE, name, getLocalizedType());
+ return null;
+ }
+
+ return name;
+ }
+ }
+
+ private String getLocalizedType()
+ {
+ return beanContext.getMessageFromBundle(getObjectTypeName());
+ }
+
+ protected abstract String getObjectTypeName();
+
+ public abstract boolean isAlreadyExisting(String objectName);
+
+ /**
+ * @param oldValue
+ * @param newValue
+ * @return
+ * @todo public for test cases
+ */
+ public boolean isOldAndNewDifferent(Object oldValue, Object newValue)
+ {
+ oldValue = normalizeStringIfNeeded(oldValue);
+ newValue = normalizeStringIfNeeded(newValue);
+
+ return (oldValue != null && !oldValue.equals(newValue)) || (oldValue == null && newValue != null);
+ }
+
+ /**
+ * Normalizes String by considering empty String as null as JSF would give either and trim non-null Strings.
+ *
+ * @param value
+ * @return
+ * @todo public for test cases
+ */
+ public Object normalizeStringIfNeeded(Object value)
+ {
+ if (value == null)
+ {
+ return null;
+ }
+ else
+ {
+ if (value instanceof String)
+ {
+ String stringValue = (String)value;
+ return stringValue.length() == 0 ? null : stringValue.trim();
+ }
+ else
+ {
+ return value;
+ }
+ }
+ }
+
+ private class MessageValidationHandler extends ParameterValidation.ValidationErrorHandler
+ {
+ private String targetForErrorMessage;
+ private String validatedName;
+
+ private MessageValidationHandler(String defaultValue, String targetForErrorMessage, String validatedName)
+ {
+ super(defaultValue);
+ this.targetForErrorMessage = targetForErrorMessage;
+ this.validatedName = validatedName;
+ }
+
+ protected String internalValidationErrorHandling(String s)
+ {
+ beanContext.createTargetedErrorMessage(targetForErrorMessage, INVALID_NAME, validatedName, getLocalizedType());
+ return null;
+ }
+ }
}
Copied: branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/faces/util/JSFFunctor.java (from rev 12964, branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/util/JSFFunctor.java)
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/faces/util/JSFFunctor.java (rev 0)
+++ branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/faces/util/JSFFunctor.java 2009-03-06 23:22:14 UTC (rev 12981)
@@ -0,0 +1,126 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.portal.faces.util;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Allows to call a parameterized function in JSF EL expressions. See <a href="http://wiki.apache.org/myfaces/Parameters_In_EL_Functions">http://wiki.apache.org/myfaces/Parameters_In_EL_Functions</a>
+ * for more details. A better alternative would be to use JBoss-EL if it was available from the standard JBoss
+ * repository...
+ *
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public abstract class JSFFunctor implements Map<String, Object>
+{
+
+ /** Removes white spaces and periods from identifiers so that we can assign them to HTML id attributes. */
+ public static final JSFFunctor ID_SANITIZER = new JSFFunctor()
+ {
+ private String recent;
+ private String recentSanitized;
+
+ @Override
+ public Object get(Object parameter)
+ {
+ if (parameter instanceof String)
+ {
+ if (parameter.equals(recent))
+ {
+ return recentSanitized;
+ }
+
+ String id = (String)parameter;
+ recent = id;
+ recentSanitized = id.replace(' ', '_').replace('.', '_');
+ return recentSanitized;
+ }
+ return null;
+ }
+ };
+
+ public int size()
+ {
+ return 0;
+ }
+
+ public boolean isEmpty()
+ {
+ return false;
+ }
+
+ public boolean containsKey(Object key)
+ {
+ return false;
+ }
+
+ public boolean containsValue(Object value)
+ {
+ return false;
+ }
+
+ /**
+ * This is where the functor works. Subclasses need to implement the function logic here, the parameter being the
+ * specified parameter.
+ *
+ * @param parameter the value that will be used to compute the result of the function we want to implement
+ * @return the result of the funtion for the specified value
+ */
+ public abstract Object get(Object parameter);
+
+ public Object put(String key, Object value)
+ {
+ return null;
+ }
+
+ public Object remove(Object key)
+ {
+ return null;
+ }
+
+ public void putAll(Map<? extends String, ? extends Object> m)
+ {
+ }
+
+ public void clear()
+ {
+ }
+
+ public Set<String> keySet()
+ {
+ return null;
+ }
+
+ public Collection<Object> values()
+ {
+ return null;
+ }
+
+ public Set<Entry<String, Object>> entrySet()
+ {
+ return null;
+ }
+}
Copied: branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/test/faces/ManagedBeanTestCase.java (from rev 12964, branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/test/faces/ManagedBeanTestCase.java)
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/test/faces/ManagedBeanTestCase.java (rev 0)
+++ branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/test/faces/ManagedBeanTestCase.java 2009-03-06 23:22:14 UTC (rev 12981)
@@ -0,0 +1,71 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+
+package org.jboss.portal.test.faces;
+
+import junit.framework.TestCase;
+import org.jboss.portal.faces.gui.ManagedBean;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class ManagedBeanTestCase extends TestCase
+{
+ private ManagedBean bean;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ bean = new ManagedBean()
+ {
+ @Override
+ protected String getObjectTypeName()
+ {
+ return "test";
+ }
+
+ @Override
+ public boolean isAlreadyExisting(String objectName)
+ {
+ return false;
+ }
+ };
+ }
+
+ public void testNormalizeStringIfNeeded()
+ {
+ assertEquals("foo", bean.normalizeStringIfNeeded("foo"));
+ assertEquals("foo", bean.normalizeStringIfNeeded(" foo "));
+ assertEquals("foo", bean.normalizeStringIfNeeded("\t\nfoo\t"));
+ assertNull(bean.normalizeStringIfNeeded(null));
+ assertEquals(bean, bean.normalizeStringIfNeeded(bean));
+ }
+
+ public void testIsOldAndNewDifferent()
+ {
+ assertTrue(bean.isOldAndNewDifferent("foo", null));
+ assertTrue(bean.isOldAndNewDifferent(null, "foo"));
+ assertFalse(bean.isOldAndNewDifferent(null, null));
+ }
+}
Copied: branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/test/faces/MessageFormatTestCase.java (from rev 12964, branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/test/faces/MessageFormatTestCase.java)
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/test/faces/MessageFormatTestCase.java (rev 0)
+++ branches/JBoss_Portal_AS5_Deployer/faces/src/main/org/jboss/portal/test/faces/MessageFormatTestCase.java 2009-03-06 23:22:14 UTC (rev 12981)
@@ -0,0 +1,51 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.portal.test.faces;
+
+import junit.framework.TestCase;
+
+import java.text.MessageFormat;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class MessageFormatTestCase extends TestCase
+{
+ public void testFormat()
+ {
+ String input = "''{0}'' is not a valid URL: {1}";
+ String output = "'foo' is not a valid URL: bar";
+ assertEquals(output, MessageFormat.format(input, new String[] {"foo", "bar"}));
+
+
+ // Don't forget to escape single quotes in localization files if there are parameters to be interpreted
+ input = "Couldn't reload producer configuration. Cause: {0}";
+ output = "Couldnt reload producer configuration. Cause: {0}";
+ assertEquals(output, MessageFormat.format(input, new String[]{"foo"}));
+
+ input = "Couldn''t reload producer configuration. Cause: {0}";
+ output = "Couldn't reload producer configuration. Cause: foo";
+ assertEquals(output, MessageFormat.format(input, new String[]{"foo"}));
+ }
+}
Copied: branches/JBoss_Portal_AS5_Deployer/faces/src/main/util (from rev 12964, branches/JBoss_Portal_Branch_2_7/faces/src/main/util)
Deleted: branches/JBoss_Portal_AS5_Deployer/faces/src/main/util/JSFFunctorTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/faces/src/main/util/JSFFunctorTestCase.java 2009-03-06 20:30:12 UTC (rev 12964)
+++ branches/JBoss_Portal_AS5_Deployer/faces/src/main/util/JSFFunctorTestCase.java 2009-03-06 23:22:14 UTC (rev 12981)
@@ -1,63 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package util;
-
-import junit.framework.TestCase;
-import org.jboss.portal.faces.util.JSFFunctor;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public class JSFFunctorTestCase extends TestCase
-{
- private JSFFunctor functor = JSFFunctor.ID_SANITIZER;
-
- public void testGet()
- {
- assertNull(functor.get(null));
- assertEquals("foo_bar", functor.get("foo bar"));
- assertEquals("foo_bar", functor.get("foo.bar"));
- assertEquals("foo______bar", functor.get("foo .bar"));
- assertEquals("foo_bar_baz_boo", functor.get("foo.bar baz.boo"));
- }
-
- public void testSimplePerformance()
- {
- for (int i = 0; i < 500000; i++)
- {
- assertEquals("foo" + i + "_bar", functor.get("foo" + i + " bar"));
- }
- }
-
- public void testRepeatedPerformance()
- {
- for (int i = 0; i < 100000; i++)
- {
- assertEquals("foo" + i + "_bar", functor.get("foo" + i + " bar"));
- assertEquals("foo" + i + "_bar", functor.get("foo" + i + " bar"));
- assertEquals("foo" + i + "_bar", functor.get("foo" + i + " bar"));
- assertEquals("foo" + i + "_bar", functor.get("foo" + i + " bar"));
- }
- }
-}
Copied: branches/JBoss_Portal_AS5_Deployer/faces/src/main/util/JSFFunctorTestCase.java (from rev 12964, branches/JBoss_Portal_Branch_2_7/faces/src/main/util/JSFFunctorTestCase.java)
===================================================================
--- branches/JBoss_Portal_AS5_Deployer/faces/src/main/util/JSFFunctorTestCase.java (rev 0)
+++ branches/JBoss_Portal_AS5_Deployer/faces/src/main/util/JSFFunctorTestCase.java 2009-03-06 23:22:14 UTC (rev 12981)
@@ -0,0 +1,63 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package util;
+
+import junit.framework.TestCase;
+import org.jboss.portal.faces.util.JSFFunctor;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class JSFFunctorTestCase extends TestCase
+{
+ private JSFFunctor functor = JSFFunctor.ID_SANITIZER;
+
+ public void testGet()
+ {
+ assertNull(functor.get(null));
+ assertEquals("foo_bar", functor.get("foo bar"));
+ assertEquals("foo_bar", functor.get("foo.bar"));
+ assertEquals("foo______bar", functor.get("foo .bar"));
+ assertEquals("foo_bar_baz_boo", functor.get("foo.bar baz.boo"));
+ }
+
+ public void testSimplePerformance()
+ {
+ for (int i = 0; i < 500000; i++)
+ {
+ assertEquals("foo" + i + "_bar", functor.get("foo" + i + " bar"));
+ }
+ }
+
+ public void testRepeatedPerformance()
+ {
+ for (int i = 0; i < 100000; i++)
+ {
+ assertEquals("foo" + i + "_bar", functor.get("foo" + i + " bar"));
+ assertEquals("foo" + i + "_bar", functor.get("foo" + i + " bar"));
+ assertEquals("foo" + i + "_bar", functor.get("foo" + i + " bar"));
+ assertEquals("foo" + i + "_bar", functor.get("foo" + i + " bar"));
+ }
+ }
+}
17 years, 1 month