JBoss Portal SVN: r13176 - modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/ldap.
by portal-commits@lists.jboss.org
Author: sviluppatorefico
Date: 2009-04-07 15:55:43 -0400 (Tue, 07 Apr 2009)
New Revision: 13176
Modified:
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtRoleModuleImpl.java
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModuleImpl.java
Log:
see https://jira.jboss.org/jira/browse/JBPORTAL-2352
Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtRoleModuleImpl.java
===================================================================
--- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtRoleModuleImpl.java 2009-04-07 19:55:11 UTC (rev 13175)
+++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/ldap/LDAPExtRoleModuleImpl.java 2009-04-07 19:55:43 UTC (rev 13176)
@@ -22,18 +22,6 @@
******************************************************************************/
package org.jboss.portal.identity.ldap;
-import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.identity.IdentityConfiguration;
-import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.identity.Role;
-
-import javax.naming.NamingException;
-import javax.naming.NamingEnumeration;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
-import javax.naming.ldap.LdapContext;
-import java.util.Enumeration;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
@@ -41,6 +29,18 @@
import java.util.NoSuchElementException;
import java.util.Set;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+import javax.naming.ldap.LdapContext;
+
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.identity.IdentityConfiguration;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.Role;
+
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
* @version $Revision: 1.1 $
@@ -73,6 +73,10 @@
throw new IdentityException("Found more than one role with id: " + name + "" +
"Posible data inconsistency");
}
+ if (sr.size() == 0)
+ {
+ throw new IdentityException("No such role " + name);
+ }
SearchResult res = (SearchResult)sr.iterator().next();
DirContext ctx = (DirContext)res.getObject();
return createRoleInstance(res.getAttributes(),ctx.getNameInNamespace());
Modified: modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModuleImpl.java
===================================================================
--- modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModuleImpl.java 2009-04-07 19:55:11 UTC (rev 13175)
+++ modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/ldap/LDAPRoleModuleImpl.java 2009-04-07 19:55:43 UTC (rev 13176)
@@ -22,13 +22,12 @@
******************************************************************************/
package org.jboss.portal.identity.ldap;
-import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.identity.Role;
-import org.jboss.portal.identity.User;
-import org.jboss.portal.identity.IdentityContext;
-import org.jboss.portal.identity.MembershipModule;
-import org.jboss.portal.identity.IdentityConfiguration;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
@@ -36,19 +35,16 @@
import javax.naming.directory.Attributes;
import javax.naming.directory.BasicAttribute;
import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.DirContext;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
-import javax.naming.directory.DirContext;
import javax.naming.ldap.LdapContext;
-import javax.naming.ldap.InitialLdapContext;
-import java.util.List;
-import java.util.NoSuchElementException;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Iterator;
-import java.util.Enumeration;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.identity.IdentityConfiguration;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.Role;
+
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
* @version $Revision: 1.1 $
@@ -78,6 +74,10 @@
throw new IdentityException("Found more than one role with id: " + name + "" +
"Posible data inconsistency");
}
+ if (sr.size() == 0)
+ {
+ throw new IdentityException("No such role " + name);
+ }
SearchResult res = (SearchResult)sr.iterator().next();
DirContext ctx = (DirContext)res.getObject();
return createRoleInstance(res.getAttributes(),ctx.getNameInNamespace());
15 years, 2 months
JBoss Portal SVN: r13175 - modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/ldap.
by portal-commits@lists.jboss.org
Author: sviluppatorefico
Date: 2009-04-07 15:55:11 -0400 (Tue, 07 Apr 2009)
New Revision: 13175
Modified:
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/ldap/LDAPExtRoleModuleImpl.java
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/ldap/LDAPRoleModuleImpl.java
Log:
see https://jira.jboss.org/jira/browse/JBPORTAL-2352
Modified: modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/ldap/LDAPExtRoleModuleImpl.java
===================================================================
--- modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/ldap/LDAPExtRoleModuleImpl.java 2009-04-07 19:51:38 UTC (rev 13174)
+++ modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/ldap/LDAPExtRoleModuleImpl.java 2009-04-07 19:55:11 UTC (rev 13175)
@@ -22,18 +22,6 @@
******************************************************************************/
package org.jboss.portal.identity.ldap;
-import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.identity.IdentityConfiguration;
-import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.identity.Role;
-
-import javax.naming.NamingException;
-import javax.naming.NamingEnumeration;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
-import javax.naming.ldap.LdapContext;
-import java.util.Enumeration;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
@@ -41,6 +29,18 @@
import java.util.NoSuchElementException;
import java.util.Set;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+import javax.naming.ldap.LdapContext;
+
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.identity.IdentityConfiguration;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.Role;
+
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
* @version $Revision: 1.1 $
@@ -73,6 +73,10 @@
throw new IdentityException("Found more than one role with id: " + name + "" +
"Posible data inconsistency");
}
+ if (sr.size() == 0)
+ {
+ throw new IdentityException("No such role " + name);
+ }
SearchResult res = (SearchResult)sr.iterator().next();
DirContext ctx = (DirContext)res.getObject();
return createRoleInstance(res.getAttributes(),ctx.getNameInNamespace());
Modified: modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/ldap/LDAPRoleModuleImpl.java
===================================================================
--- modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/ldap/LDAPRoleModuleImpl.java 2009-04-07 19:51:38 UTC (rev 13174)
+++ modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity/ldap/LDAPRoleModuleImpl.java 2009-04-07 19:55:11 UTC (rev 13175)
@@ -22,13 +22,12 @@
******************************************************************************/
package org.jboss.portal.identity.ldap;
-import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.identity.Role;
-import org.jboss.portal.identity.User;
-import org.jboss.portal.identity.IdentityContext;
-import org.jboss.portal.identity.MembershipModule;
-import org.jboss.portal.identity.IdentityConfiguration;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
@@ -36,19 +35,16 @@
import javax.naming.directory.Attributes;
import javax.naming.directory.BasicAttribute;
import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.DirContext;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
-import javax.naming.directory.DirContext;
import javax.naming.ldap.LdapContext;
-import javax.naming.ldap.InitialLdapContext;
-import java.util.List;
-import java.util.NoSuchElementException;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Iterator;
-import java.util.Enumeration;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.identity.IdentityConfiguration;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.Role;
+
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
* @version $Revision: 1.1 $
@@ -78,6 +74,10 @@
throw new IdentityException("Found more than one role with id: " + name + "" +
"Posible data inconsistency");
}
+ if (sr.size() == 0)
+ {
+ throw new IdentityException("No such role " + name);
+ }
SearchResult res = (SearchResult)sr.iterator().next();
DirContext ctx = (DirContext)res.getObject();
return createRoleInstance(res.getAttributes(),ctx.getNameInNamespace());
15 years, 2 months
JBoss Portal SVN: r13174 - in branches/JBoss_Portal_Branch_2_7/core/src: resources/portal-core-sar/META-INF and 1 other directory.
by portal-commits@lists.jboss.org
Author: sviluppatorefico
Date: 2009-04-07 15:51:38 -0400 (Tue, 07 Apr 2009)
New Revision: 13174
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/mail/MailModuleImpl.java
branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
see https://jira.jboss.org/jira/browse/JBPORTAL-2353
Modified: branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/mail/MailModuleImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/mail/MailModuleImpl.java 2009-04-07 19:49:57 UTC (rev 13173)
+++ branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/impl/mail/MailModuleImpl.java 2009-04-07 19:51:38 UTC (rev 13174)
@@ -93,6 +93,9 @@
/** SMTP timeout. */
private int SMTPTimeout = 10000;
+
+ /** SMTP Start TLS enable. */
+ private boolean SMTPStarttlsEnable = false;
/** The PrintStream java mail debug output is sent to. */
private LoggerStream logs;
@@ -158,6 +161,16 @@
this.smtpPassword = smtpPassword;
}
+ public boolean getSMTPStarttlsEnable()
+ {
+ return SMTPStarttlsEnable;
+ }
+
+ public void setSMTPStarttlsEnable(boolean SMTPStarttlsEnable)
+ {
+ this.SMTPStarttlsEnable = SMTPStarttlsEnable;
+ }
+
public int getQueueSize()
{
if (queue == null)
@@ -290,6 +303,7 @@
// Set timeouts, default is infinite, we want to avoid it
properties.setProperty("mail.smtp.connectiontimeout", "" + SMTPConnectionTimeout);
properties.setProperty("mail.smtp.timeout", "" + SMTPTimeout);
+ properties.setProperty("mail.smtp.starttls.enable", "" + SMTPStarttlsEnable);
//
super.startService();
Modified: branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2009-04-07 19:49:57 UTC (rev 13173)
+++ branches/JBoss_Portal_Branch_2_7/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2009-04-07 19:51:38 UTC (rev 13174)
@@ -603,6 +603,7 @@
<attribute name="JavaMailDebugEnabled">false</attribute>
<attribute name="SMTPConnectionTimeout">100000</attribute>
<attribute name="SMTPTimeout">10000</attribute>
+ <attribute name="SMTPStarttlsEnable">false</attribute>
<attribute name="JNDIName">java:portal/MailModule</attribute>
</mbean>
15 years, 2 months
JBoss Portal SVN: r13173 - in branches/JBoss_Portal_Branch_2_7_AS5/core/src: resources/portal-core-sar/META-INF and 1 other directory.
by portal-commits@lists.jboss.org
Author: sviluppatorefico
Date: 2009-04-07 15:49:57 -0400 (Tue, 07 Apr 2009)
New Revision: 13173
Modified:
branches/JBoss_Portal_Branch_2_7_AS5/core/src/main/org/jboss/portal/core/impl/mail/MailModuleImpl.java
branches/JBoss_Portal_Branch_2_7_AS5/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
see https://jira.jboss.org/jira/browse/JBPORTAL-2353
Modified: branches/JBoss_Portal_Branch_2_7_AS5/core/src/main/org/jboss/portal/core/impl/mail/MailModuleImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/core/src/main/org/jboss/portal/core/impl/mail/MailModuleImpl.java 2009-04-07 14:27:15 UTC (rev 13172)
+++ branches/JBoss_Portal_Branch_2_7_AS5/core/src/main/org/jboss/portal/core/impl/mail/MailModuleImpl.java 2009-04-07 19:49:57 UTC (rev 13173)
@@ -93,6 +93,9 @@
/** SMTP timeout. */
private int SMTPTimeout = 10000;
+
+ /** SMTP Start TLS enable. */
+ private boolean SMTPStarttlsEnable = false;
/** The PrintStream java mail debug output is sent to. */
private LoggerStream logs;
@@ -158,6 +161,16 @@
this.smtpPassword = smtpPassword;
}
+ public boolean getSMTPStarttlsEnable()
+ {
+ return SMTPStarttlsEnable;
+ }
+
+ public void setSMTPStarttlsEnable(boolean SMTPStarttlsEnable)
+ {
+ this.SMTPStarttlsEnable = SMTPStarttlsEnable;
+ }
+
public int getQueueSize()
{
if (queue == null)
@@ -290,6 +303,7 @@
// Set timeouts, default is infinite, we want to avoid it
properties.setProperty("mail.smtp.connectiontimeout", "" + SMTPConnectionTimeout);
properties.setProperty("mail.smtp.timeout", "" + SMTPTimeout);
+ properties.setProperty("mail.smtp.starttls.enable", "" + SMTPStarttlsEnable);
//
super.startService();
Modified: branches/JBoss_Portal_Branch_2_7_AS5/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7_AS5/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2009-04-07 14:27:15 UTC (rev 13172)
+++ branches/JBoss_Portal_Branch_2_7_AS5/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2009-04-07 19:49:57 UTC (rev 13173)
@@ -582,6 +582,7 @@
<attribute name="JavaMailDebugEnabled">false</attribute>
<attribute name="SMTPConnectionTimeout">100000</attribute>
<attribute name="SMTPTimeout">10000</attribute>
+ <attribute name="SMTPStarttlsEnable">false</attribute>
<attribute name="JNDIName">java:portal/MailModule</attribute>
</mbean>
15 years, 2 months
JBoss Portal SVN: r13172 - in branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests: src/org/jboss/portal/test/selenium and 1 other directory.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-04-07 10:27:15 -0400 (Tue, 07 Apr 2009)
New Revision: 13172
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/build.xml
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
Log:
[selenium] - javadoc dir not deleted when running tests
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/build.xml 2009-04-07 13:55:24 UTC (rev 13171)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/build.xml 2009-04-07 14:27:15 UTC (rev 13172)
@@ -68,7 +68,7 @@
<echo message="Deleting testng report directory" />
<delete dir="${testng.output.dir}" />
<delete dir="${testng.debug.dir}" />
- <delete dir="${dir.javadoc}" />
+ <!--delete dir="${dir.javadoc}" /-->
</target>
@@ -80,6 +80,7 @@
</target>
<target name="javadoc" depends="">
+ <delete dir="${dir.javadoc}" />
<mkdir dir="${dir.javadoc}" />
<javadoc packagenames="org.jboss.portal.test.selenium.*" classpathref="libraries.cp" access="public" destdir="${dir.javadoc}" author="true" version="true" use="true">
<fileset dir="${test.src.dir}" defaultexcludes="yes">
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2009-04-07 13:55:24 UTC (rev 13171)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2009-04-07 14:27:15 UTC (rev 13172)
@@ -12,6 +12,12 @@
import com.thoughtworks.selenium.Selenium;
/**
+ * JBossPortalSeleniumTestCase is the main class used in JBoss Portal selenium
+ * testing. Each testcase class has to extend this class. The
+ * JBossPortalSeleniumTestCase contains many basic methods for simple
+ * orientation in JBoss Portal like login/logout or finding elements in table.
+ * It also encapsulates selenium javascript extensions used in the tests.
+ *
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
public class JBossPortalSeleniumTestCase {
@@ -27,26 +33,30 @@
}
}
- 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 final String LINK_LOGOUT = getProp(casePfx + "link.logout", "link=Logout");
+ protected final String SUBMIT_LOGIN = getProp(casePfx + "submit.login", "login");
+ protected final String ADDR_PORTAL = getProp(casePfx + "addr.portal", "/portal/");
+ protected final String FRAME_LOGIN_CONTENT = getProp(casePfx + "frame.login.content", "login-content");
+ protected final String LINK_LOGIN = getProp(casePfx + "link.login", "link=Login");
+ protected final String INPUT_PASSWORD = getProp(casePfx + "input.password", "j_password");
+ protected 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 = "2400000";
- protected static final long AJAX_LOAD = 3000;
+ /**
+ * Generic timeout in miliseconds used in every selenium function
+ * waitForPageToLoad()}
+ */
+ public static final String PAGE_LOAD = "2400000";
+ /** Generic timeout in miliseconds used for AJAX timeouts } */
+ public static final long AJAX_LOAD = 3000;
// protected static final String PAGE_LOAD = "60000";
// protected static final long AJAX_LOAD = 2000;
- // Element timeout in seconds
- protected static final int ELEM_TIMEOUT = 220;
+ /** Element timeout in seconds used in waitForElement functions */
+ public static final int ELEM_TIMEOUT = 220;
@BeforeClass
protected void setupChromeForLogin() throws Exception {
@@ -82,6 +92,18 @@
return props;
}
+ /**
+ * Gets the property. Property file is named locator.properties and it's
+ * located in the org.jboss.portal.test.selenium package. It contains
+ * locator properties for all locators used in selenium tests.
+ *
+ * @param prop
+ * the name of the property
+ * @param subst
+ * the value which is returned in the case the property isn't set
+ *
+ * @return the prop
+ */
public String getProp(String prop, String subst) {
if (subst == null || "".equals(subst)) {
@@ -97,6 +119,12 @@
}
}
+ /**
+ * Click on an element only in case element is present on the screen.
+ *
+ * @param id
+ * the id
+ */
public void clickIfVisible(String id) {
if (selenium.isElementPresent(id)) {
@@ -106,15 +134,47 @@
}
}
+ /**
+ * Finding the correct row in a table due to input string and columns. The
+ * function uses selenium javascript extension findTableRow. It tries to
+ * look up the input string in the chosen column in selected table. After
+ * the first occurrence of input string, it returns the number of row where
+ * it was found.
+ *
+ * @param tableLocation
+ * the table locator
+ * @param searchName
+ * the string which the function searches for
+ * @param searchCol
+ * the column in which the function searches for
+ *
+ * @return the number of row with the first occurrence of searchName string.
+ */
public int findTableRow(String tableLocation, String searchName, int searchCol) {
return Integer.valueOf(selenium.getEval("selenium.findTableRow(\"" + tableLocation + "\",'" + searchName + "'," + searchCol + ")"));
}
+ /**
+ * Counts table rows for selected table.
+ *
+ * @param tableLocation
+ * the table locator
+ *
+ * @return the number of rows of the table
+ */
public int countTableRows(String tableLocation) {
return Integer.valueOf(selenium.getEval("selenium.countTableRows(\"" + tableLocation + "\")"));
}
// TODO refactor
+ /**
+ * Safe select.
+ *
+ * @param locator
+ * the locator
+ * @param value
+ * the value
+ */
public void safeSelect(String locator, String value) {
waitForElement(locator);
@@ -143,17 +203,33 @@
selenium.select(locator, "label=" + value);
}
+ /**
+ * Click and wait.
+ *
+ * @param locator the locator
+ */
public void clickAndWait(String locator) {
waitForElement(locator);
selenium.click(locator);
selenium.waitForPageToLoad(PAGE_LOAD);
}
+ /**
+ * Open and wait.
+ *
+ * @param locator the locator
+ */
public void openAndWait(String locator) {
selenium.open(locator);
selenium.waitForPageToLoad(PAGE_LOAD);
}
-
+
+ /**
+ * Select if not selected.
+ *
+ * @param selector the selector
+ * @param label the label
+ */
public void selectIfNotSelected(String selector, String label) {
waitForElement(selector);
if (!selenium.getSelectedLabel(selector).equals(label)) {
@@ -162,6 +238,13 @@
}
}
+ /**
+ * Assert text order.
+ *
+ * @param text the text
+ *
+ * @return true, if successful
+ */
public boolean assertTextOrder(String text) {
return Boolean.valueOf(selenium.getEval("selenium.assertTextOrder(\"" + text + "\")"));
}
@@ -169,7 +252,8 @@
/**
* Waits for specified time in ms. Used mostly in AJAX based tests.
*
- * @param time the time (in ms) to be waited for.
+ * @param time
+ * the time (in ms) to be waited for.
*/
public void waitFor(long time) {
try {
@@ -181,9 +265,11 @@
}
/**
- * Waits for element to appear on the screen. Used mostly in AJAX based tests.
+ * Waits for element to appear on the screen. Used mostly in AJAX based
+ * tests.
*
- * @param locator the locator of the element to be waited for
+ * @param locator
+ * the locator of the element to be waited for
*/
public void waitForElement(String locator) {
for (int second = 0;; second++) {
@@ -201,14 +287,19 @@
}
/**
- * Waits for element to appear on the screen. Used mostly in AJAX based tests.
+ * Waits for element to appear on the screen. Used mostly in AJAX based
+ * tests.
*
- * @param locatorElem the element locator
- * @param locatorLink the link locator - not used
- * @param timeToWait the time (in ms) to wait until timeout is reached
- * @param n the n
+ * @param locatorElem
+ * the element locator
+ * @param locatorLink
+ * the link locator - not used
+ * @param timeToWait
+ * the time (in ms) to wait until timeout is reached
+ * @param n
+ * the n
*/
- //TODO refactor - locatorLink is not used
+ // TODO refactor - locatorLink is not used
public void waitForElement(String locatorElem, String locatorLink, long timeToWait, long n) {
for (int i = 0;; i++) {
if (i >= n) {
@@ -227,7 +318,8 @@
/**
* Waits for text to appear on the screen. Used mostly in AJAX based tests.
*
- * @param text the text to be waited for
+ * @param text
+ * the text to be waited for
*/
public void waitForText(String text) {
for (int second = 0;; second++) {
@@ -247,8 +339,10 @@
/**
* Login into JBoss portal.
*
- * @param username the username
- * @param password the password
+ * @param username
+ * the username
+ * @param password
+ * the password
*/
public void login(String username, String password) {
selenium.open(ADDR_PORTAL);
@@ -285,7 +379,7 @@
/**
* Logs out from portal application if a user is logged in.
*/
- //TODO refactoring needed - use function logout()
+ // TODO refactoring needed - use function logout()
public void logoutIfPossible() {
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -298,9 +392,12 @@
}
/**
- * Prints a message into the system output for debugging purposes. The message is printed only in the case, if the value true of parameter <i>debug</i> was passed to jvm with -Ddebug="true" switch.
+ * Prints a message into the system output for debugging purposes. The
+ * message is printed only in the case, if the value true of parameter
+ * <i>debug</i> was passed to jvm with -Ddebug="true" switch.
*
- * @param debugText the debug text
+ * @param debugText
+ * the debug text
*/
public void debugPrint(String debugText) {
if (JBossSeleniumTestListener.debug)
@@ -308,9 +405,12 @@
}
/**
- * Captures screenshot for debugging purposes. Saves a screenshot into debug directory. The screenshot is saved only in the case, if the value true of parameter <i>debug</i> was passed to jvm with -Ddebug="true" switch.
+ * Captures screenshot for debugging purposes. Saves a screenshot into debug
+ * directory. The screenshot is saved only in the case, if the value true of
+ * parameter <i>debug</i> was passed to jvm with -Ddebug="true" switch.
*
- * @param filename the filename of the debug screenshot
+ * @param filename
+ * the filename of the debug screenshot
*/
public void debugScreenshot(String filename) {
if (JBossSeleniumTestListener.debug)
15 years, 2 months
JBoss Portal SVN: r13171 - in branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui: dashboard and 1 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-04-07 09:55:24 -0400 (Tue, 07 Apr 2009)
New Revision: 13171
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/DashboardBean.java
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/wizard/NewWindowWizard.java
Log:
- JBPORTAL-2365: Make several beans serializable and mark as much state as possible as transient.
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java 2009-04-07 13:21:00 UTC (rev 13170)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java 2009-04-07 13:55:24 UTC (rev 13171)
@@ -59,8 +59,9 @@
* @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
* @version $Revision$
*/
-public class InstanceManagerBean
+public class InstanceManagerBean implements Serializable
{
+ private static final long serialVersionUID = 4661096923593747947L;
/** . */
private final Mode INTERNAL_EDIT_CONTENT = Mode.create("edit_content");
@@ -68,13 +69,13 @@
// Wired services
/** . */
- private InstanceContainer instanceContainer;
+ private transient InstanceContainer instanceContainer;
/** . */
- private RoleModule roleModule;
+ private transient RoleModule roleModule;
/** . */
- private DomainConfigurator domainConfigurator;
+ private transient DomainConfigurator domainConfigurator;
// Navigational state of the user
@@ -96,13 +97,13 @@
// Runtime fields depending on the navigational state
/** . */
- private PreferencesBean selectedPrefs;
+ private transient PreferencesBean selectedPrefs;
/** . */
- private Instance selectedInstance;
+ private transient Instance selectedInstance;
/** . */
- private List<InstanceDefinition> instances;
+ private transient List<InstanceDefinition> instances;
/** . */
private AuthorizationBean auth = new InstanceAuthorizationBean();
@@ -435,7 +436,7 @@
}
};
- public class InstanceAuthorizationBean extends AuthorizationBean implements Serializable
+ public class InstanceAuthorizationBean extends AuthorizationBean
{
private static final long serialVersionUID = -6284936544525435559L;
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2009-04-07 13:21:00 UTC (rev 13170)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2009-04-07 13:55:24 UTC (rev 13171)
@@ -128,7 +128,7 @@
private String selectedContentURI;
/** . */
- private Map selectedContentParameters = new HashMap();
+// private Map selectedContentParameters = new HashMap();
/** . */
private Map<String, String[]> renderParameters;
@@ -139,34 +139,34 @@
private final AuthorizationBean auth = new PortalObjectAuthorizationBean();
/** . */
- private List selectedObjectPath;
+ private transient List selectedObjectPath;
/** . */
- private PortalObject selectedObject;
+ private transient PortalObject selectedObject;
/** . */
- private PortalObject selectedDeletingObject;
+ private transient PortalObject selectedDeletingObject;
/** . */
- private PropertiesBean selectedProperties;
+ private transient PropertiesBean selectedProperties;
/** . */
- PropertyAction propertyAction;
+ transient PropertyAction propertyAction;
/** . */
- private ControlPropertiesBean controlProperties;
+ private transient ControlPropertiesBean controlProperties;
/** . */
- private PortletInvoker portletDefinitionInvoker;
+ private transient PortletInvoker portletDefinitionInvoker;
/** . */
- private ThemeBean theme;
+ private transient ThemeBean theme;
/** . */
- public PageManagerBean pageManager;
+ public transient PageManagerBean pageManager;
/** . */
- private Boolean maximizedStateExists;
+ private transient Boolean maximizedStateExists;
// Wired services
@@ -328,7 +328,7 @@
this.renderParameters = renderParameters;
}
- public Map getSelectedContentParameters()
+ /*public Map getSelectedContentParameters()
{
return selectedContentParameters;
}
@@ -336,7 +336,7 @@
public void setSelectedContentParameters(Map selectedContentParameters)
{
this.selectedContentParameters = selectedContentParameters;
- }
+ }*/
public DomainConfigurator getDomainConfigurator()
{
@@ -740,7 +740,7 @@
getDomainConfigurator().setSecurityBindings(page.getId().toString(PortalObjectPath.CANONICAL_FORMAT), constraints);
}
- public class PortalObjectAuthorizationBean extends AuthorizationBean implements Serializable
+ public class PortalObjectAuthorizationBean extends AuthorizationBean
{
private static final long serialVersionUID = 7281763204029034269L;
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java 2009-04-07 13:21:00 UTC (rev 13170)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java 2009-04-07 13:55:24 UTC (rev 13171)
@@ -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. *
@@ -44,6 +44,7 @@
import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -58,8 +59,9 @@
* @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
* @version $Revision$
*/
-public class PortletManagerBean
+public class PortletManagerBean implements Serializable
{
+ private static final long serialVersionUID = -567346587947451954L;
/** . */
private static final Logger log = Logger.getLogger(PortletManagerBean.class);
@@ -77,16 +79,16 @@
// Wired services
/** . */
- private InstanceContainer instanceContainer;
+ private transient InstanceContainer instanceContainer;
/** . */
- private AuthorizationDomainRegistry authorizationDomainRegistry;
+ private transient AuthorizationDomainRegistry authorizationDomainRegistry;
/** . */
- private RoleModule roleModule;
+ private transient RoleModule roleModule;
/** . */
- private FederatingPortletInvoker federatingPortletInvoker;
+ private transient FederatingPortletInvoker federatingPortletInvoker;
// Navigational state
@@ -108,19 +110,19 @@
// Runtime state
/** . */
- private PreferencesBean selectedPreferences;
+ private transient PreferencesBean selectedPreferences;
/** . */
- private Portlet selectedPortlet;
+ private transient Portlet selectedPortlet;
/** . */
- private Collection portletInvokerItems;
+ private transient Collection portletInvokerItems;
/** . */
- private List portlets;
+ private transient List portlets;
/** . */
- private FederatedPortletInvoker selectedPortletInvoker;
+ private transient FederatedPortletInvoker selectedPortletInvoker;
// Wired services
@@ -241,7 +243,7 @@
{
// Get portlet
Portlet portlet = getSelectedPortlet();
-
+
//
if (portlet != null)
{
@@ -279,9 +281,9 @@
if (portlets == null)
{
portlets = new ArrayList();
-
+
List tmpPortlets = null;
-
+
if (getSelectedPortletInvoker() != null)
{
tmpPortlets = new ArrayList(getSelectedPortletInvoker().getPortlets());
@@ -363,8 +365,8 @@
public String selectPortlet()
{
FacesContext ctx = FacesContext.getCurrentInstance();
- selectedPortletId = (String)ctx.getExternalContext().getRequestParameterMap().get("id");
- selectedPlugin = (String)ctx.getExternalContext().getRequestParameterMap().get("plugin");
+ selectedPortletId = ctx.getExternalContext().getRequestParameterMap().get("id");
+ selectedPlugin = ctx.getExternalContext().getRequestParameterMap().get("plugin");
selectedFrom = 0;
if (selectedPortletId != null && selectedPortletId.length() != 0)
@@ -431,7 +433,7 @@
* A comparator for portlets. Order portlets in the alphabetical order of their display name. If there is no display
* name, fall back to portlet id.
*/
- final Comparator comparator = new Comparator()
+ final transient Comparator comparator = new Comparator()
{
FacesContext ctx = FacesContext.getCurrentInstance();
Locale locale = ctx.getExternalContext().getRequestLocale();
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/DashboardBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/DashboardBean.java 2009-04-07 13:21:00 UTC (rev 13170)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/DashboardBean.java 2009-04-07 13:55:24 UTC (rev 13171)
@@ -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.admin.ui.dashboard;
import org.jboss.portal.common.util.IteratorStatus;
@@ -41,13 +42,14 @@
import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
+import java.io.Serializable;
import java.util.Collection;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public class DashboardBean implements AddPageAction.Listener
+public class DashboardBean implements Serializable, AddPageAction.Listener
{
/** . */
@@ -57,16 +59,16 @@
// Wired services
/** . */
- public PortalObjectContainer portalObjectContainer;
+ public transient PortalObjectContainer portalObjectContainer;
/** . */
- public LayoutService layoutService;
+ public transient LayoutService layoutService;
/** . */
- public ThemeService themeService;
+ public transient ThemeService themeService;
/** . */
- public InstanceContainer instanceContainer;
+ public transient InstanceContainer instanceContainer;
// Navigational state
@@ -76,22 +78,22 @@
// Runtime fields
/** . */
- public Portal userPortal;
+ public transient Portal userPortal;
/** . */
- public String selectedPageTheme;
+ public transient String selectedPageTheme;
/** . */
- public String selectedPageLayout;
+ public transient String selectedPageLayout;
/** . */
- public PageManagerBean pageManager;
+ public transient PageManagerBean pageManager;
/** . */
- public SelectItem[] pageItems;
+ public transient SelectItem[] pageItems;
/** . */
- public boolean selectePageIsDefault;
+ public transient boolean selectePageIsDefault;
//
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/wizard/NewWindowWizard.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/wizard/NewWindowWizard.java 2009-04-07 13:21:00 UTC (rev 13170)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/wizard/NewWindowWizard.java 2009-04-07 13:55:24 UTC (rev 13171)
@@ -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. *
@@ -46,6 +46,7 @@
import org.jboss.portal.theme.ThemeConstants;
import javax.faces.context.FacesContext;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -56,22 +57,25 @@
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @version $Revision$
*/
-public class NewWindowWizard
+public class NewWindowWizard implements Serializable
{
+ private static final long serialVersionUID = -223476489826544201L;
- private List steps;
+ private transient List steps;
private int currentStep;
- private FederatingPortletInvoker federatingPortletInvoker;
private String selectedPortletId;
private String selectedPortalId;
private String selectedPageId;
private String selectedRegionId;
private String selectedPortletInvokerId;
+
private String selectedParentPageId;
- private PortalObjectContainer portalObjectContainer;
- private InstanceContainer instanceContainer;
- private LayoutService layoutService;
- private AuthorizationDomainRegistry authorizationDomainRegistry;
+ // Injected services
+ private transient PortalObjectContainer portalObjectContainer;
+ private transient FederatingPortletInvoker federatingPortletInvoker;
+ private transient InstanceContainer instanceContainer;
+ private transient LayoutService layoutService;
+ private transient AuthorizationDomainRegistry authorizationDomainRegistry;
public NewWindowWizard()
{
15 years, 2 months
JBoss Portal SVN: r13170 - in branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium: cms and 1 other directories.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-04-07 09:21:00 -0400 (Tue, 07 Apr 2009)
New Revision: 13170
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/CoordinationSamplesTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/EndToEndBeaPortlet.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java
Log:
[selenium] - more javadoc for tests
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/CoordinationSamplesTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/CoordinationSamplesTestCase.java 2009-04-07 13:13:01 UTC (rev 13169)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/CoordinationSamplesTestCase.java 2009-04-07 13:21:00 UTC (rev 13170)
@@ -10,9 +10,13 @@
import com.sun.corba.se.impl.protocol.giopmsgheaders.Message;
/**
- * The Class Coordination Samples TestCase is responsible for testing of coordination features of JBoss Portal using it's coordination samples page.
- * In default state the page is available on address <a href="http://localhost:8080/portal/portal/default/Coordination+Samples">/portal/portal/default/Coordination+Samples</a>.
+ * The Class Coordination Samples TestCase is responsible for testing of
+ * coordination features of JBoss Portal using it's coordination samples page.
+ * In default state the page is available on address <a
+ * href="http://localhost:8080/portal/portal/default/Coordination+Samples"
+ * >/portal/portal/default/Coordination+Samples</a>.
*/
+//TODO - refactor to use property file
@Test(groups = { "coordination_samples" }, enabled = true)
public class CoordinationSamplesTestCase extends JBossPortalSeleniumTestCase {
@@ -90,30 +94,40 @@
}
/**
- * Default coordination test is responsible for testing default coordination on the coordination samples page.
- * It has to work with the default page <a href="http://localhost:8080/portal/portal/default/Coordination+Samples">/portal/portal/default/Coordination+Samples</a>.
- * <br/>
- * It starts with opening <a href="http://localhost:8080/portal/portal/default/Coordination+Samples?zip=78759">http://localhost:8080/portal/portal/default/Coordination+Samples?zip=78759</a>
- * and checking that both variables on page have values asserted like this: <br/>
+ * Default coordination test is responsible for testing default coordination
+ * on the coordination samples page. It has to work with the default page <a
+ * href="http://localhost:8080/portal/portal/default/Coordination+Samples">/
+ * portal/portal/default/Coordination+Samples</a>. <br/> It starts with
+ * opening <a href=
+ * "http://localhost:8080/portal/portal/default/Coordination+Samples?zip=78759"
+ * >http://localhost:8080/portal/portal/default/Coordination+Samples?zip=
+ * 78759</a> and checking that both variables on page have values asserted
+ * like this: <br/>
* <table>
* <tr>
- * <td>Weather for (my_zipcode)</td><td>78759</td>
+ * <td>Weather for (my_zipcode)</td>
+ * <td>78759</td>
* </tr>
* <tr>
- * <td>Map for (your_zipcode)</td><td>78759</td>
+ * <td>Map for (your_zipcode)</td>
+ * <td>78759</td>
* </tr>
* </table>
* Then it fills up the <em>Page Parameter Portlet</em> with values:
* <table>
* <tr>
- * <td>Page parameter name</td><td>xyz</td>
+ * <td>Page parameter name</td>
+ * <td>xyz</td>
* </tr>
* <tr>
- * <td>Page parameter value</td><td>123</td>
+ * <td>Page parameter value</td>
+ * <td>123</td>
* </tr>
* </table>
*
- * clicks on submit button and assert the url is in format <a href="http://localhost:8080//portal/portal/default/Coordination+Samples?xyz=123">/portal/portal/default/Coordination+Samples?xyz=123</a>
+ * clicks on submit button and assert the url is in format <a href=
+ * "http://localhost:8080//portal/portal/default/Coordination+Samples?xyz=123"
+ * >/portal/portal/default/Coordination+Samples?xyz=123</a>
*/
@Test(enabled = true)
public void defaultCoordinationTest() {
@@ -136,7 +150,33 @@
/**
* Events explicit test.
*
- * <h3>For the page: http://host:8080/portal/portal/default/Coordination+Samples/Events+-+Expl...</h3><p>This is demonstration of explicit event wiring.</p><ul><li>Click on "Add to Cart" on the Catalog Portlet on the left half for Snowboard.</li></ul><p> Assert that two Cart Portlets on the left half<strong> have Snowboard in them.</strong></p><p style="padding-left: 30px;"> Assert that two Cart Porlets on the right <strong>have "Cart is empty"</strong></p><ul><li>Click on "Add to Cart" on the Catalog Portlet on the right half for Tent.</li></ul><p> Assert that two Cart Portlets on the left half <strong>have no "Tent"</strong> in them</p><p style="padding-left: 30px;"> Assert that two Cart Porlets on the <strong>right have "Tent"</strong> in them.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p>
+ * <h3>For the page:
+ * http://host:8080/portal/portal/default/Coordination+Samples
+ * /Events+-+Explicit</h3>
+ * <p>
+ * This is demonstration of explicit event wiring.
+ * </p>
+ * <ul>
+ * <li>Click on "Add to Cart" on the Catalog Portlet on the left half for
+ * Snowboard.</li>
+ * </ul>
+ * <p>
+ * Assert that two Cart Portlets on the left half<strong> have Snowboard in
+ * them.</strong>
+ * </p>
+ * <p style="padding-left: 30px;"> Assert that two Cart Porlets on the right
+ * <strong>have "Cart is empty"</strong></p>
+ * <ul>
+ * <li>Click on "Add to Cart" on the Catalog Portlet on the right half for
+ * Tent.</li>
+ * </ul>
+ * <p>
+ * Assert that two Cart Portlets on the left half <strong>have no
+ * "Tent"</strong> in them
+ * </p>
+ * <p style="padding-left: 30px;"> Assert that two Cart Porlets on the
+ * <strong>right have "Tent"</strong> in them.</p><p
+ * style="min-height: 8pt; height: 8pt; padding: 0px;"> </p>
*/
@Test(enabled = true)
public void eventsExplicitTest() {
@@ -199,7 +239,35 @@
/**
* Events fallback test.
*
- * <h3>For the page: http://host:8080/portal/portal/default/Coordination+Samples/Events+-+Fall...</h3><p>This is demonstration of mix of both explicit and implicit. (Is there a better way to describe this?)</p><ul><li>Click on "Add to Cart" on the Catalog Portlet on the left half for Snowboard.</li></ul><p> Assert that two Cart Portlets on the left half<strong> have Snowboard in them.</strong></p><p style="padding-left: 30px;"> Assert that two Cart Porlets on the right <strong>have "Cart is empty"</strong></p><ul><li>Click on "Add to Cart" on the Catalog Portlet on the right half for Tent.</li></ul><p> Assert that two Cart Portlets on the left half <strong>have "Tent"</strong> in them</p><p style="padding-left: 30px;"> Assert that two Cart Porlets on the <strong>right have "Tent"</strong> in them.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p>
+ * <h3>For the page:
+ * http://host:8080/portal/portal/default/Coordination+Samples
+ * /Events+-+Fallback</h3>
+ * <p>
+ * This is demonstration of mix of both explicit and implicit. (Is there a
+ * better way to describe this?)
+ * </p>
+ * <ul>
+ * <li>Click on "Add to Cart" on the Catalog Portlet on the left half for
+ * Snowboard.</li>
+ * </ul>
+ * <p>
+ * Assert that two Cart Portlets on the left half<strong> have Snowboard in
+ * them.</strong>
+ * </p>
+ * <p style="padding-left: 30px;"> Assert that two Cart Porlets on the right
+ * <strong>have "Cart is empty"</strong></p>
+ * <ul>
+ * <li>Click on "Add to Cart" on the Catalog Portlet on the right half for
+ * Tent.</li>
+ * </ul>
+ * <p>
+ * Assert that two Cart Portlets on the left half <strong>have
+ * "Tent"</strong> in them
+ * </p>
+ * <p style="padding-left: 30px;"> Assert that two Cart Porlets on the
+ * <strong>right have "Tent"</strong> in them.</p><p
+ * style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p
+ * style="min-height: 8pt; height: 8pt; padding: 0px;"> </p>
*/
@Test(enabled = true)
public void eventsFallbackTest() {
@@ -262,7 +330,35 @@
/**
* Events implicit test.
*
- * <h3>For the page: http://host:8080/portal/portal/default/Coordination+Samples/Events+-+Impl...</h3><p>This is implicit wiring which is the default wiring. Events are propagated based on their Qname regarless of which portlet generated the event.</p><ul><li>Click on "Add to Cart" on the Catalog Portlet on the left half for Snowboard.</li></ul><p> Assert that two Cart Portlets on the left half<strong> have Snowboard in them.</strong></p><p style="padding-left: 30px;"> Assert that two Cart Porlets on the right <strong>have Snowboard in them.</strong></p><ul><li>Click on "Add to Cart" on the Catalog Portlet on the right half for Tent.</li></ul><p> Assert that two Cart Portlets on the left half <strong>have "Tent"</strong> in them</p><p style="padding-left: 30px;"> Assert that two Cart Porlets on the <strong>right have "Tent"</strong> in them.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><h2><span><span style="color!
: #800000;">Parameters Binding:</span></span></h2>
+ * <h3>For the page:
+ * http://host:8080/portal/portal/default/Coordination+Samples
+ * /Events+-+Implicit</h3>
+ * <p>
+ * This is implicit wiring which is the default wiring. Events are
+ * propagated based on their Qname regarless of which portlet generated the
+ * event.
+ * </p>
+ * <ul>
+ * <li>Click on "Add to Cart" on the Catalog Portlet on the left half for
+ * Snowboard.</li>
+ * </ul>
+ * <p>
+ * Assert that two Cart Portlets on the left half<strong> have Snowboard in
+ * them.</strong>
+ * </p>
+ * <p style="padding-left: 30px;"> Assert that two Cart Porlets on the right
+ * <strong>have Snowboard in them.</strong></p>
+ * <ul>
+ * <li>Click on "Add to Cart" on the Catalog Portlet on the right half for
+ * Tent.</li>
+ * </ul>
+ * <p>
+ * Assert that two Cart Portlets on the left half <strong>have
+ * "Tent"</strong> in them
+ * </p>
+ * <p style="padding-left: 30px;"> Assert that two Cart Porlets on the
+ * <strong>right have "Tent"</strong> in them.</p><p
+ * style="min-height: 8pt; height: 8pt; padding: 0px;"> </p>
*/
@Test(enabled = true)
public void eventsImplicitTest() {
@@ -349,7 +445,31 @@
/**
* Parameter alias test.
*
- * <h3>For the page: http://host:8080/portal/portal/default/Coordination+Samples/Parameters+-+...</h3><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><ul><li><span>Hit the URL </span><a class="jive-link-external-small" href="http://host:8080/portal/portal/default/Coordination+Samples/Parameters+-+...">http://host:8080/portal/portal/default/Coordination+Samples/Parameters+-+...</a><span>. Assert that </span><strong>"Viliam" is present</strong> in all PublicParametersPortletWindow for foo* parameters</li><li><span>Hit the URL </span><a class="jive-link-external-small" href="http://host:8080/portal/portal/default/Coordination+Samples/Parameters+-+...">http://host:8080/portal/portal/default/Coordination+Samples/Parameters+-+...</a><span>. Assert that </span><strong>"Prabhat" is present </strong>in all PublicParametersPortletWindow for juu* parameters and <strong>Viliam is not present</!
strong> in all PublicParametersPortletWindow for foo* parameters</li><li>Add "footest" for foo1 in PublicParametersPortletWindow1 and hit update. Assert that "footest" is present in all PublicParametersPortletWindow</li><li>Click on Remove link from PublicParametersPortletWindow4 for foo2. Assert that "footest" is removed from all PublicParametersPortletWindow.</li><li>In Page Parameters Portlet, add any parameter and value (xyz, 123) and verify that URL is changed (appended with ?xyz=123) once you hit update.</li></ul>
+ * <h3>For the page:
+ * http://host:8080/portal/portal/default/Coordination+Samples
+ * /Parameters+-+Alias</h3><p
+ * style="min-height: 8pt; height: 8pt; padding: 0px;"> </p>
+ * <ul>
+ * <li><span>Hit the URL </span><a class="jive-link-external-small" href="http://host:8080/portal/portal/default/Coordination+Samples/Parameters+-+..."
+ * >http://host:8080/portal/portal/default/Coordination+Samples/Parameters+-
+ * +Alias?binding1=Viliam</a><span>. Assert that </span><strong>"Viliam" is
+ * present</strong> in all PublicParametersPortletWindow for foo* parameters
+ * </li>
+ * <li><span>Hit the URL </span><a class="jive-link-external-small" href="http://host:8080/portal/portal/default/Coordination+Samples/Parameters+-+..."
+ * >http://host:8080/portal/portal/default/Coordination+Samples/Parameters+-
+ * +Alias?binding2=Prabhat</a><span>. Assert that </span><strong>"Prabhat"
+ * is present </strong>in all PublicParametersPortletWindow for juu*
+ * parameters and <strong>Viliam is not present</strong> in all
+ * PublicParametersPortletWindow for foo* parameters</li>
+ * <li>Add "footest" for foo1 in PublicParametersPortletWindow1 and hit
+ * update. Assert that "footest" is present in all
+ * PublicParametersPortletWindow</li>
+ * <li>Click on Remove link from PublicParametersPortletWindow4 for foo2.
+ * Assert that "footest" is removed from all PublicParametersPortletWindow.</li>
+ * <li>In Page Parameters Portlet, add any parameter and value (xyz, 123)
+ * and verify that URL is changed (appended with ?xyz=123) once you hit
+ * update.</li>
+ * </ul>
*/
@Test(enabled = true)
public void parameterAliasTest() {
@@ -476,7 +596,26 @@
/**
* Parameter explicit test.
*
- * <h3>For the page: http://host:8080/portal/portal/default/Coordination+Samples/Parameters+-+...</h3><ul><li><span>Hit the URL </span><a class="jive-link-external-small" href="http://host:8080/portal/portal/default/Coordination+Samples/Parameters+-+...">http://host:8080/portal/portal/default/Coordination+Samples/Parameters+-+...</a><span>. Assert that </span><strong>"Viliam" is present in Windows 1,2 and 3 but not in 4.</strong></li><li>Click on Remove link from Window 3 and assert that "Viliam" is not present in any of windows.</li><li><span>Hit the URL </span><a class="jive-link-external-small" href="http://host:8080/portal/portal/default/Coordination+Samples/Parameters+-+...">http://host:8080/portal/portal/default/Coordination+Samples/Parameters+-+...</a><span>. Assert that "Nepal" is present in Window1 for bar1, daa1 for Window2, bar2 for Window3, daa2 for Window4.</span><br/></li><!
li>In Page Parameters Portlet, add any parameter and value (xyz, 123) and verify that URL is changed (appended with ?xyz=123) once you hit update.</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p>
+ * <h3>For the page:
+ * http://host:8080/portal/portal/default/Coordination+Samples
+ * /Parameters+-+Explicit</h3>
+ * <ul>
+ * <li><span>Hit the URL </span><a class="jive-link-external-small" href="http://host:8080/portal/portal/default/Coordination+Samples/Parameters+-+..."
+ * >http://host:8080/portal/portal/default/Coordination+Samples/Parameters+-
+ * +Explicit?binding1=Viliam</a><span>. Assert that </span><strong>"Viliam"
+ * is present in Windows 1,2 and 3 but not in 4.</strong></li>
+ * <li>Click on Remove link from Window 3 and assert that "Viliam" is not
+ * present in any of windows.</li>
+ * <li><span>Hit the URL </span><a class="jive-link-external-small" href="http://host:8080/portal/portal/default/Coordination+Samples/Parameters+-+..."
+ * >http://host:8080/portal/portal/default/Coordination+Samples/Parameters+-
+ * +Explicit?binding2=Nepal</a><span>. Assert that "Nepal" is present in
+ * Window1 for bar1, daa1 for Window2, bar2 for Window3, daa2 for
+ * Window4.</span><br/></li>
+ * <li>In Page Parameters Portlet, add any parameter and value (xyz, 123)
+ * and verify that URL is changed (appended with ?xyz=123) once you hit
+ * update.</li>
+ * </ul>
+ * <p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p>
*/
@Test(enabled = true)
public void parameterExplicitTest() {
@@ -524,9 +663,9 @@
Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
-
+
clickAndWait(PAR_R1_FOO1_R);
-
+
Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
@@ -579,7 +718,29 @@
/**
* Parameter explicit alias test.
*
- * <h3>For the page: http://host:8080/portal/portal/default/Coordination+Samples/Parameters+-+...</h3><ul><li><span>Hit the URL </span><a class="jive-link-external-small" href="http://host:8080/portal/portal/portal/default/Coordination+Samples/Parame...">http://host:8080/portal/portal/portal/default/Coordination+Samples/Parame...</a><span>. Assert that </span><strong>"Prabhat" is present in Windows 1 for foo1 and in Windows2 for bar1.<br/></strong></li><li>Click on Remove link from Window 2 and assert that "Prabhat" is not present in any of windows.</li><li><span>Hit the URL </span><a class="jive-link-external-small" href="http://host:8080/portal/portal/portal/default/Coordination+Samples/Parame...">http://host:8080/portal/portal/portal/default/Coordination+Samples/Parame...</a><span>. Assert that "Thomas" is present!
in Window2, Window3 and Window4 but not in Window1. Since foo parameter in Window is part of binding1 and it's explicit binding, using binding2 does not have impact on foo parameter for window1.</span><br/> </li><li>In Page Parameters Portlet, add any parameter and value (xyz, 123) and verify that URL is changed (appended with ?xyz=123) once you hit update.</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p>
+ * <h3>For the page:
+ * http://host:8080/portal/portal/default/Coordination+Samples
+ * /Parameters+-+Explicit%2BAlias</h3>
+ * <ul>
+ * <li><span>Hit the URL </span><a class="jive-link-external-small" href="http://host:8080/portal/portal/portal/default/Coordination+Samples/Parame..."
+ * >http://host:8080/portal/portal/portal/default/Coordination+Samples/
+ * Parameters+-+Explicit%2BAlias?binding1=prabhat</a><span>. Assert that
+ * </span><strong>"Prabhat" is present in Windows 1 for foo1 and in Windows2
+ * for bar1.<br/></strong></li>
+ * <li>Click on Remove link from Window 2 and assert that "Prabhat" is not
+ * present in any of windows.</li>
+ * <li><span>Hit the URL </span><a class="jive-link-external-small" href="http://host:8080/portal/portal/portal/default/Coordination+Samples/Parame..."
+ * >http://host:8080/portal/portal/portal/default/Coordination+Samples/
+ * Parameters+-+Explicit%2BAlias?binding2=Thomas</a><span>. Assert that
+ * "Thomas" is present in Window2, Window3 and Window4 but not in Window1.
+ * Since foo parameter in Window is part of binding1 and it's explicit
+ * binding, using binding2 does not have impact on foo parameter for
+ * window1.</span><br/></li>
+ * <li>In Page Parameters Portlet, add any parameter and value (xyz, 123)
+ * and verify that URL is changed (appended with ?xyz=123) once you hit
+ * update.</li>
+ * </ul>
+ * <p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p>
*/
@Test(enabled = true)
public void parameterExplicitAliasTest() {
@@ -627,9 +788,9 @@
Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "");
Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
-
+
clickAndWait(PAR_R1_BAR1_R);
-
+
Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
@@ -682,7 +843,17 @@
/**
* Parameter implicit test.
*
- * <h3>For the page: http://host:8080/portal/portal/default/Coordination+Samples/Parameters+-+...</h3><ul><li>Add "footest" for foo1 in PublicParametersPortletWindow1 and hit update. Assert that "footest" is present in all PublicParametersPortletWindow</li><li>Click on Remove link from PublicParametersPortletWindow4 for foo2. Assert that "footest" is removed from all PublicParametersPortletWindow</li><li>Need clarification for the rest.</li></ul>
+ * <h3>For the page:
+ * http://host:8080/portal/portal/default/Coordination+Samples
+ * /Parameters+-+Implicit</h3>
+ * <ul>
+ * <li>Add "footest" for foo1 in PublicParametersPortletWindow1 and hit
+ * update. Assert that "footest" is present in all
+ * PublicParametersPortletWindow</li>
+ * <li>Click on Remove link from PublicParametersPortletWindow4 for foo2.
+ * Assert that "footest" is removed from all PublicParametersPortletWindow</li>
+ * <li>Need clarification for the rest.</li>
+ * </ul>
*/
@Test(enabled = true)
public void parameterImplicitTest() {
@@ -712,9 +883,9 @@
Assert.assertEquals(selenium.getValue(PAR_R2_FOO2), "footest");
Assert.assertEquals(selenium.getValue(PAR_R2_DAA2), "");
Assert.assertEquals(selenium.getValue(PAR_R2_BAR2), "");
-
+
clickAndWait(PAR_L1_FOO1_R);
-
+
Assert.assertEquals(selenium.getValue(PAR_L1_DAA1), "");
Assert.assertEquals(selenium.getValue(PAR_L1_BAR1), "");
Assert.assertEquals(selenium.getValue(PAR_L1_JUU1), "");
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2009-04-07 13:13:01 UTC (rev 13169)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2009-04-07 13:21:00 UTC (rev 13170)
@@ -6,17 +6,21 @@
import org.testng.annotations.Test;
/**
+ * DashboardTestCase is responsible for testing configure dashboard functions.
+ * Each test is running with user "admin" logged in.
+ *
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
@Test(groups = { "cms_dashboard" }, enabled = true, description = "Dashboard issues test case.")
public class DashboardTestCase extends JBossPortalSeleniumTestCase {
-
private static final String MSG_POWER = "Powered by JBoss Enterprise Portal Platform";
+ /** prefix for locator properties = dash. */
public String casePfx = "dash.";
- private final String LNK_POR_WEA_EDIT = getProp(casePfx + "lnk.por.wea.edit", "//body/div[2]/div/div/div[2]/div/div/div/div/div/div/table/tbody/tr/td[2]/div/div/div[2]/span/a");
+ private final String LNK_POR_WEA_EDIT = getProp(casePfx + "lnk.por.wea.edit",
+ "//body/div[2]/div/div/div[2]/div/div/div/div/div/div/table/tbody/tr/td[2]/div/div/div[2]/span/a");
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')]");
@@ -41,13 +45,13 @@
private final String SUB_THEMESEL = getProp(casePfx + "sub.themesel", "//form[contains(@id,'dashboardThemeForm')]/input[@type='submit']");
@BeforeMethod(groups = { "log" })
- public void loginBeforeTest() {
+ protected void loginBeforeTest() {
logoutIfPossible();
login("admin", "admin");
}
@AfterMethod(groups = { "log" })
- public void logoutAfterTest() {
+ protected void logoutAfterTest() {
}
@@ -60,6 +64,11 @@
}
}
+ /**
+ * Creates a page. In Dashboard configuration a new page named
+ * "DashTestPage" is created. The existence of the link (page) is then
+ * asserted on dashboard.s
+ */
@Test(enabled = true)
public void testCreatePage() {
selenium.click(LNK_DASHBOARD);
@@ -84,6 +93,12 @@
Assert.assertTrue(selenium.isTextPresent(MSG_POWER));
}
+ /**
+ * Renaming of a page on dashboard. firstly a page named "DashToRenamePage"
+ * is created the same way as in {@link DashboardTestCase#testCreatePage()}.
+ * The page is then renamed to "DashRenamedPage".
+ */
+ // TODO final assertion is missing
@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
public void testRenamePage() {
@@ -121,6 +136,12 @@
}
+ /**
+ * Updating a theme on a page. On a page created in
+ * {@link DashboardTestCase#testCreatePage()} a theme is changed to
+ * "renaissance". It is asserted that it was not selected before and at the
+ * end it is asserted, that the renaissance value is selected.
+ */
@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
public void testUpdateTheme() {
// selenium.setSpeed("10000");
@@ -132,6 +153,8 @@
selectIfNotSelected(SEL_PAGE, "DashTestPage");
+ Assert.assertFalse(selenium.getSelectedLabel(SEL_THEME).equals("renaissance"), "Previously selected theme other then expected.");
+
selenium.select(SEL_THEME, "label=renaissance");
selenium.click(SUB_THEMESEL);
@@ -147,6 +170,12 @@
Assert.assertEquals(selenium.getSelectedLabel(SEL_THEME), "renaissance", "Previously selected theme other then expected.");
}
+ /**
+ * Updating a layout on a page. On a page created in
+ * {@link DashboardTestCase#testCreatePage()} a theme is changed to
+ * "generic". It is asserted that it was not selected before and at the end
+ * it is asserted, that the renaissance value is selected.
+ */
@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
public void testUpdateLayout() {
// selenium.setSpeed("10000");
@@ -158,6 +187,8 @@
selenium.windowMaximize();
selectIfNotSelected(SEL_PAGE, "DashTestPage");
+ Assert.assertFalse(selenium.getSelectedLabel(SEL_LAYOUT).equals("generic"), "Previously selected layout other then expected.");
+
selenium.select(SEL_LAYOUT, "label=generic");
selenium.click(SUB_LAYOUT_UPDATE);
@@ -173,6 +204,11 @@
Assert.assertEquals(selenium.getSelectedLabel(SEL_LAYOUT), "generic", "Previously selected layout other then expected.");
}
+ /**
+ * Adding a portlet to dashboard. Adding a "Who's online portlet" to
+ * dashboard (center). At the end some strings specific for the portlet are
+ * asserted to appear on a dashboard.
+ */
@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
public void testAddPortlet() {
// selenium.setSpeed("10000");
@@ -200,6 +236,17 @@
// selenium.setSpeed("0");
}
+ /**
+ * Moving with portlets on a dashboard. Firstly a page called "DashMovePage"
+ * is created the same way as in {@link DashboardTestCase#testCreatePage()}.
+ * Then two portlets ("Welcome portlet", "Who's online portlet" in that
+ * order) are added to the page the same way as in
+ * {@link DashboardTestCase#testAddPortlet()}. Their positions are swapped
+ * at the end and the ordering of strings on a dashboard page is used for
+ * assertion.
+ *
+ */
+ // TODO assert the the ordering just after adding
@Test(enabled = true, dependsOnMethods = { "testCreatePage", "testAddPortlet" })
public void testMovePortlet() {
final String pageName = "DashMovePage";
@@ -241,6 +288,12 @@
}
+ /**
+ * Reordering of portlets. After the portlets are moved in
+ * {@link DashboardTestCase#testMovePortlet()}, they are swaped to the
+ * previous position (reordered again) with this test. The ordering of
+ * strings on a dashboard page is used for assertion.
+ */
@Test(enabled = true, dependsOnMethods = { "testCreatePage", "testMovePortlet" })
public void testReorder() {
final String pageName = "DashMovePage";
@@ -265,6 +318,12 @@
Assert.assertTrue(assertTextOrder("Current;Greetings"));
}
+ /**
+ * Deleting of a portlet. Portlet added in
+ * {@link DashboardTestCase#testAddPortlet()} is used in this test. The
+ * portlet is deleted and it is asserted that string specific for this
+ * portlet are not appearing on the dashboard anymore.
+ */
@Test(enabled = true, dependsOnMethods = { "testAddPortlet" })
public void testDeletePortlet() {
@@ -290,6 +349,12 @@
Assert.assertFalse(selenium.isTextPresent("[admin]"));
}
+ /**
+ * Adding of google portlet. Same as
+ * {@link DashboardTestCase#testAddPortlet()} but added portlet is of type
+ * "widget/google" (content type selector). "Band Culinaria" google portlet
+ * is used in this test.
+ */
@Test(enabled = false, dependsOnMethods = { "testCreatePage" })
public void testAddGooglePortlet() {
selenium.click(LNK_DASHBOARD);
@@ -315,6 +380,20 @@
// http://www.jboss.com/index.html?module=bb&op=viewtopic&t=143023
// https://jira.jboss.org/jira/browse/JBPORTAL-2177
+ /**
+ * Dashboard rename page loses portlet state settings bug testing.
+ * From forum reference <a href="http://www.jboss.com/index.html?module=bb&op=viewtopic&t=143023">http://www.jboss.com/index.html?module=bb&op=viewtopic&t=143023</a>.
+ * Jira for this issue already created in <a href="https://jira.jboss.org/jira/browse/JBPORTAL-2177">https://jira.jboss.org/jira/browse/JBPORTAL-2177</a>.
+ * <pre>
+ * - in Configure Dashboard, create a new dashboard page; I called mine test1
+ * - in the left region, add the Weather portlet
+ * - return to the Dashboard, select the new tab/page (test1), you see Miami weather (the default)
+ * - EDIT the weather portlet and enter a local zipcode, press OK, you see local weather, so far so good
+ * - return to Configure Dashboard, rename the page (test1a)
+ * - return to the Dashboard, select the newly renamed tab
+ * - now you no longer see the local weather because renaming the page has lost the portlet window-specific settings
+ * </pre>
+ */
@Test(enabled = true)
public void testBugResetPortletSetting() {
final String pageName = "page1";
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/EndToEndBeaPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/EndToEndBeaPortlet.java 2009-04-07 13:13:01 UTC (rev 13169)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/EndToEndBeaPortlet.java 2009-04-07 13:21:00 UTC (rev 13170)
@@ -2,141 +2,108 @@
import java.text.MessageFormat;
+import org.jboss.portal.test.selenium.portal.AdminPortalTestCase;
+import org.jboss.portal.test.selenium.portal.PortletDefinitionsTestCase;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
+ * EndToEndBeaPortlet is reposnsible for end-to-end testing of adding a BEA
+ * portlet into a portal page.
+ *
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
-@Test(groups = {"end2end"}, enabled = true, description = "Creating of new portal with content.")
+//TODO some refactoring of class fields needed
+@Test(groups = { "end2end" }, enabled = true, description = "Creating of new portal with content.")
public class EndToEndBeaPortlet extends JBossPortalSeleniumTestCase {
-
+ /** prefix for locator properties = e2e.wsrp. */
public static String casePfx = "e2e.wsrp.";
private final String SUB_VIEW_PORTLETS = "//input[contains(@id,'definition-form:view-portlets')]";
- public final String SEL_CONS_TYPE = "//select[contains(@id,'definition-form:menu')]";
-
- 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'')]");
+ private final String SEL_CONS_TYPE = "//select[contains(@id,'definition-form:menu')]";
-
- /// def
-
- private final String T_LINK_PREF = "//a[contains(@id,''def-list:portlet-pref-{0}'')]";
+ private final String ADR_HOME = getProp(casePfx + "adr.home", "portal/auth/portal/default");
+
+ 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_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_CONSCONF = getProp(casePfx + "id.link.consconf", "//a[contains(@id,'producer-temp-form:consumersTab')]");
+
+ private 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 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 TBL_PORTALPAGE_ADMIN = getProp(casePfx + "tbl.portalpage.admin", "//table[contains(@id,'obj-nav-form:pages-datatable')]");
+ 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 SUBMIT_CREATE_INST = "//input[contains(@name,'add_instance_form:j_id19')]";
private final String INPUT_INSTANCE_NAME = "//input[contains(@id,'add_instance_form:instanceId')]";
private final String T_LINK_CREATE = "//a[contains(@id,''def-list:create-instance-{0}'')]";
- private final String SUBMIT_PROVIDER_VIEW = "//input[contains(@id,'definition-form:view-portlets')]";
- private final String SELECT_PROVIDER = "//select[contains(@id,'definition-form:menu')]";
private final String TABLE_PORTLET = "//form[contains(@id,'def-list')]/table";
- private final String LINK_NAME_ADMIN_PORT = "//a[contains(@id,'common-show-portlet-detail-form:field1:select')]";
- private final String LINK_ADMIN_PORT = "//a[contains(@id,'def-list:portlet-def-0')]";
private final String LINK_ADMIN = "link=Admin";
private final String LINK_TAB_PD = "//a[contains(@id,'admin-subtab-form:portlet-def-link')]";
private 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() {
+ protected void loginBeforeTest() {
logoutIfPossible();
login("admin", "admin");
}
@AfterMethod(groups = { "log" })
- public void logoutAfterTest() {
- //logout();
+ protected void logoutAfterTest() {
+ // logout();
}
-
+
private String PORTLET = "";
-
+
+ /**
+ * Testing the end-to-end adding of bea portlet. Simple WSRP consumer with
+ * name "BeaE2E" is created similar way as in
+ * {@link WSRPTestCase#testCreateBeaConsumer()}. Then the portlet instance
+ * is created with definition name "BEA: Hellow World", instance name
+ * "1BeaPor" and of type "BeaE2E" similar way as in
+ * {@link PortletDefinitionsTestCase#testCreateInstance()}. The instance is
+ * then added to page "default" to portal "default" similar way as in
+ * {@link AdminPortalTestCase#testCreateWindow()}. The final assertion is
+ * made in the "default" page of "default" portal. The appearance of string
+ * specific for bea portlet is asserted.
+ */
+ // TODO - click on a link in BEA applet and assert
@Test(enabled = true, description = "Creating a standard BEA portlet.")
- public void testEnd2EndBeaPortlet(){
-
+ public void testEnd2EndBeaPortlet() {
+
String consName = "BeaE2E";
String portalName = "default";
String pageName = "default";
- String defName= "BEA: Hello World";
- String insName = "1BeaPor";
-
+ 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){
+
+ private void createConsumer(String consumerName) {
selenium.open(ADR_HOME);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
@@ -144,13 +111,13 @@
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);
@@ -165,77 +132,77 @@
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent(consumerName));
}
-
- private void createInstance(String defName, String type, String insName){
+
+ 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.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.click(MessageFormat.format(T_LINK_CREATE, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
- //selenium.setSpeed("5555");
+ // 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"));
+ 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.open(ADR_HOME);
+ selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Admin");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
- clickIfVisible(TAB_PORTALOBJ_ID);
- clickIfVisible(LNK_PORTALS_ID);
- clickIfVisible(LNK_PORTAL_HOME);
+ 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);
+ 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;
+ r = findTableRow(TBL_PORTALPAGE_ADMIN, pageName, 0) - 1;
- // click on the page layout
- selenium.click(MessageFormat.format(PAG_TL_LAYOUT, r));
+ // 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);
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
- selenium.click(SUB_LAYOUT_ADD_CENTER);
- selenium.waitForPageToLoad(PAGE_LOAD);
-
- }
+ // 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_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2009-04-07 13:13:01 UTC (rev 13169)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2009-04-07 13:21:00 UTC (rev 13170)
@@ -8,6 +8,7 @@
import org.testng.annotations.Test;
/**
+ * IdentityAdminTestCase is responsible for
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
@@ -38,50 +39,52 @@
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'')]");
+ private final String TBL_USERLIST = getProp(casePfx + "tbl.userlist", "//table[contains(@id,'search-user-form1:userlist')]");
+ private final String LNK_T_USRLIST_DEL = getProp(casePfx + "lnk.t.usrlist.del", "//a[contains(@id,''search-user-form1:userlist:{0}:delete-user-link'')]");
+ private final String LNK_T_USRLIST_ROLES = getProp(casePfx + "lnk.t.usrlist.roles", "//a[contains(@id,''search-user-form1:userlist:{0}:assign-role-link'')]");
+ private final String LNK_T_USRLIST_DIS = getProp(casePfx + "lnk.t.usrlist.dis", "//a[contains(@id,''search-user-form1:userlist:{0}:enable-user-link'')]");
+ private 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')]");
+ private 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'')]");
+ private final String LNK_T_ROLLIST_DEL = getProp(casePfx + "lnk.t.rollist.del", "//a[contains(@id,''roles-form:userlist:{0}:delete-role-link'')]");
+ private final String LNK_T_ROLLIST_MEMBERS = getProp(casePfx + "lnk.t.rollist.members", "//a[contains(@id,''roles-form:userlist:{0}:view-role-link'')]");
+ private 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')]");
+ private 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')]");
+ private final String SUB_CONF_CREATE_USER = getProp(casePfx + "sub.conf.create.user", "//input[contains(@id,'confirm-form:admin')]");
+ private final String SUB_DELETE_ROLE = getProp(casePfx + "sub.delete.role", "//input[contains(@id,'delete-role-form:confirm')]");
+ private final String SUB_ROLE_CREATE = getProp(casePfx + "sub.role.create", "//input[contains(@id,'create-role-form:submit')]");
+ private final String INP_ROLEDISNAME = getProp(casePfx + "inp.roledisname", "//input[contains(@id,'create-role-form:roledisplayname')]");
+ private 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')]");
+ private final String LNK_ROLE_CREATE = getProp(casePfx + "lnk.role.create", "//a[contains(@id, 'create-role-form:create-role-link')]");
+ private final String SUB_DEL_USER = getProp(casePfx + "sub.del.user", "//input[contains(@id,'delete-user-form:submit')]");
+ private final String SUB_ASSIGN_ROLE = getProp(casePfx + "sub.assign.role", "//input[contains(@id,'assign-roles-form:submit')]");
+ private final String SUB_USER_ROLE = getProp(casePfx + "sub.user.role", "//input[contains(@id,'register-role-form:submit')]");
+ private final String SUB_CREATE_USER = getProp(casePfx + "sub.create.user", "//input[contains(@id,'register-form:submit')]");
+ private final String INP_PASSWORD_CHK = getProp(casePfx + "inp.password.chk", "//input[contains(@id,'register-form:passwordCheck')]");
+ private final String INP_PASSWORD = getProp(casePfx + "inp.password", "//input[contains(@id,'register-form:password')]");
+ private final String INP_USEREMAIL = getProp(casePfx + "inp.useremail", "//input[contains(@id,'register-form:email')]");
+ private final String INP_USERNAME = getProp(casePfx + "inp.username", "//input[contains(@id,'register-form:username')]");
+ private final String SUB_SEARCH_USER = getProp(casePfx + "sub.search.user", "//input[contains(@id,'search-user-form:search') and @type='submit']");
+ private final String INP_SEARCH_USER = getProp(casePfx + "inp.search.user", "//input[contains(@id,'search-user-form:searchString')]");
+ private final String LNK_SEARCH_USER = getProp(casePfx + "lnk.search.user", "//a[contains(@id,'user-form:search-user-link')]");
+ private final String LNK_USERTAB = getProp(casePfx + "lnk.usertab", "//a[contains(@id,'role-temp-form:manage-users')]");
+ private 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')]");
+ private 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')]");
+ private final String LNK_ROLEMAIN = getProp(casePfx + "lnk.rolemain", "//a[contains(@id, 'role-temp-form1:role-admin-link')]");
+ private final String LNK_USERMANG_MAIN = getProp(casePfx + "lnk.usermang.main", "//a[contains(@id,'user-temp-form1:assign-role-link')]");
+ private final String LNK_USERMANG_MAIN2 = getProp(casePfx + "lnk.usermang.main2", "//a[contains(@id,'user-temp-form1:user-mgm-link')]");
+ private 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}'']");
+ private final String CHK_ROLE = getProp(casePfx + "chk.role", "//input[contains(@name,''assign-roles-form:roles'') and @value=''{0}'']");
+
+ /** The timeout used to wait after clicking submit button in user search. */
public final long SEARCH_TIMEOUT = 10000;
private String butDelUsr_id(String userName) {
@@ -97,13 +100,13 @@
}
@BeforeMethod(groups = { "log" })
- public void loginBeforeTest() {
+ private void loginBeforeTest() {
logoutIfPossible();
login("admin", "admin");
}
@AfterMethod(groups = { "log" })
- public void logoutAfterTest() {
+ private void logoutAfterTest() {
}
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2009-04-07 13:13:01 UTC (rev 13169)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2009-04-07 13:21:00 UTC (rev 13170)
@@ -49,7 +49,7 @@
protected static final int ELEM_TIMEOUT = 220;
@BeforeClass
- public void setupChromeForLogin() throws Exception {
+ protected void setupChromeForLogin() throws Exception {
String browser = System.getProperty("browser");
@@ -62,7 +62,7 @@
}
@AfterClass
- public void tearDownInstaller() throws Exception {
+ protected void tearDownInstaller() throws Exception {
selenium.stop();
}
@@ -82,7 +82,7 @@
return props;
}
- protected String getProp(String prop, String subst) {
+ public String getProp(String prop, String subst) {
if (subst == null || "".equals(subst)) {
subst = "Locator not set";
@@ -97,7 +97,7 @@
}
}
- protected void clickIfVisible(String id) {
+ public void clickIfVisible(String id) {
if (selenium.isElementPresent(id)) {
selenium.click(id);
@@ -106,16 +106,16 @@
}
}
- protected int findTableRow(String tableLocation, String searchName, int searchCol) {
+ public int findTableRow(String tableLocation, String searchName, int searchCol) {
return Integer.valueOf(selenium.getEval("selenium.findTableRow(\"" + tableLocation + "\",'" + searchName + "'," + searchCol + ")"));
}
- protected int countTableRows(String tableLocation) {
+ public int countTableRows(String tableLocation) {
return Integer.valueOf(selenium.getEval("selenium.countTableRows(\"" + tableLocation + "\")"));
}
// TODO refactor
- protected void safeSelect(String locator, String value) {
+ public void safeSelect(String locator, String value) {
waitForElement(locator);
for (int second = 0;; second++) {
@@ -143,18 +143,18 @@
selenium.select(locator, "label=" + value);
}
- protected void clickAndWait(String locator) {
+ public void clickAndWait(String locator) {
waitForElement(locator);
selenium.click(locator);
selenium.waitForPageToLoad(PAGE_LOAD);
}
- protected void openAndWait(String locator) {
+ public void openAndWait(String locator) {
selenium.open(locator);
selenium.waitForPageToLoad(PAGE_LOAD);
}
-
- protected void selectIfNotSelected(String selector, String label) {
+
+ public void selectIfNotSelected(String selector, String label) {
waitForElement(selector);
if (!selenium.getSelectedLabel(selector).equals(label)) {
selenium.select(selector, "label=" + label);
@@ -162,11 +162,16 @@
}
}
- protected boolean assertTextOrder(String text) {
+ public boolean assertTextOrder(String text) {
return Boolean.valueOf(selenium.getEval("selenium.assertTextOrder(\"" + text + "\")"));
}
- protected void waitFor(long time) {
+ /**
+ * Waits for specified time in ms. Used mostly in AJAX based tests.
+ *
+ * @param time the time (in ms) to be waited for.
+ */
+ public void waitFor(long time) {
try {
Thread.sleep(time);
} catch (InterruptedException e) {
@@ -175,7 +180,12 @@
}
}
- protected void waitForElement(String locator) {
+ /**
+ * Waits for element to appear on the screen. Used mostly in AJAX based tests.
+ *
+ * @param locator the locator of the element to be waited for
+ */
+ public void waitForElement(String locator) {
for (int second = 0;; second++) {
if (second >= ELEM_TIMEOUT) {
Assert.fail("Element " + locator + " not found.");
@@ -190,7 +200,16 @@
}
}
- protected void waitForElement(String locatorElem, String locatorLink, long timeToWait, long n) {
+ /**
+ * Waits for element to appear on the screen. Used mostly in AJAX based tests.
+ *
+ * @param locatorElem the element locator
+ * @param locatorLink the link locator - not used
+ * @param timeToWait the time (in ms) to wait until timeout is reached
+ * @param n the n
+ */
+ //TODO refactor - locatorLink is not used
+ public void waitForElement(String locatorElem, String locatorLink, long timeToWait, long n) {
for (int i = 0;; i++) {
if (i >= n) {
Assert.fail("Element " + locatorElem + " not found.");
@@ -205,6 +224,11 @@
}
}
+ /**
+ * Waits for text to appear on the screen. Used mostly in AJAX based tests.
+ *
+ * @param text the text to be waited for
+ */
public void waitForText(String text) {
for (int second = 0;; second++) {
if (second >= ELEM_TIMEOUT) {
@@ -220,7 +244,13 @@
}
}
- protected void login(String username, String password) {
+ /**
+ * Login into JBoss portal.
+ *
+ * @param username the username
+ * @param password the password
+ */
+ public void login(String username, String password) {
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -239,7 +269,10 @@
Assert.assertTrue(selenium.isTextPresent("Logged in as: " + username), "Not logged in, login message missing.");
}
- protected void logout() {
+ /**
+ * Logs out from JBoss portal application.
+ */
+ public void logout() {
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isElementPresent(LINK_LOGOUT));
@@ -249,7 +282,11 @@
Assert.assertTrue(selenium.isElementPresent("Link=Login"), "Login link not present.");
}
- protected void logoutIfPossible() {
+ /**
+ * Logs out from portal application if a user is logged in.
+ */
+ //TODO refactoring needed - use function logout()
+ public void logoutIfPossible() {
selenium.open(ADDR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
if (selenium.isElementPresent(LINK_LOGOUT)) {
@@ -260,12 +297,22 @@
}
}
- protected void debugPrint(String debugText) {
+ /**
+ * Prints a message into the system output for debugging purposes. The message is printed only in the case, if the value true of parameter <i>debug</i> was passed to jvm with -Ddebug="true" switch.
+ *
+ * @param debugText the debug text
+ */
+ public void debugPrint(String debugText) {
if (JBossSeleniumTestListener.debug)
System.out.println("[Selenium debug] : " + debugText);
}
- protected void debugScreenshot(String filename) {
+ /**
+ * Captures screenshot for debugging purposes. Saves a screenshot into debug directory. The screenshot is saved only in the case, if the value true of parameter <i>debug</i> was passed to jvm with -Ddebug="true" switch.
+ *
+ * @param filename the filename of the debug screenshot
+ */
+ public void debugScreenshot(String filename) {
if (JBossSeleniumTestListener.debug)
selenium.captureScreenshot(debugDir + "/" + filename);
}
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2009-04-07 13:13:01 UTC (rev 13169)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2009-04-07 13:21:00 UTC (rev 13170)
@@ -10,9 +10,12 @@
import org.testng.annotations.Test;
/**
+ * CMSSecureTestCase is reponsible for testing of security of CMS module in
+ * JBoss Portal.
+ *
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
-
+//TODO tests testing write and manage security are missing
@Test(groups = { "cms_secure" }, enabled = true, description = "Setting permissions on the default portlet.")
public class CMSSecureTestCase extends JBossPortalSeleniumTestCase {
private final String casePfx = "cms.sec.";
@@ -34,27 +37,29 @@
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");
+ /** prefix for locator properties = user.login. */
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",
+
+ private final String LNK_ROLETAB = getProp(caseIPfx + "lnk.roletab", "//a[contains(@id,'user-temp-form:role-mgm-link')]");
+ private final String LNK_ROLEMAIN = getProp(caseIPfx + "lnk.rolemain", "//a[contains(@id, 'role-temp-form1:role-admin-link')]");
+ private final String LNK_ROLE_CREATE = getProp(caseIPfx + "lnk.role.create", "//a[contains(@id, 'create-role-form:create-role-link')]");
+ private final String INP_ROLEDISNAME = getProp(caseIPfx + "inp.roledisname", "//input[contains(@id,'create-role-form:roledisplayname')]");
+ private final String INP_ROLENAME = getProp(caseIPfx + "inp.rolename", "//input[contains(@id,'create-role-form:rolename')]");
+ private final String SUB_ROLE_CREATE = getProp(caseIPfx + "sub.role.create", "//input[contains(@id,'create-role-form:submit')]");
+ private final String SUB_ASSIGN_ROLE = getProp(caseIPfx + "sub.assign.role", "//input[contains(@id,'assign-roles-form:submit')]");
+ private final String CHK_ROLE = getProp(caseIPfx + "chk.role", "//input[contains(@name,''assign-roles-form:roles'') and @value=''{0}'']");
+ private final String LNK_USERTAB = getProp(caseIPfx + "lnk.usertab", "//a[contains(@id,'role-temp-form:manage-users')]");
+ private final String LNK_USERMAIN = getProp(caseIPfx + "lnk.usermain", "//a[contains(@id,'user-temp-form1:user-adm-link')]");
+ private final String LNK_USERMANG_MAIN = getProp(caseIPfx + "lnk.usermang.main", "//a[contains(@id,'user-temp-form1:assign-role-link')]");
+ private final String SUB_SEARCH_USER = getProp(caseIPfx + "sub.search.user", "//input[contains(@id,'search-user-form:search') and @type='submit']");
+ private final String INP_SEARCH_USER = getProp(caseIPfx + "inp.search.user", "//input[contains(@id,'search-user-form:searchString')]");
+ private final String LNK_SEARCH_USER = getProp(caseIPfx + "lnk.search.user", "//a[contains(@id,'user-form:search-user-link')]");
+ private final String TBL_USERLIST = getProp(caseIPfx + "tbl.userlist", "//table[contains(@id,'search-user-form1:userlist')]");
+ private 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() {
+ private void logoutAfterTestIfPossible() {
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -90,7 +95,7 @@
}
@BeforeClass()
- public void createRoles() {
+ private void createRoles() {
String roleName = "secRole";
String roleDisplayName = "secRoleDisp";
@@ -114,6 +119,12 @@
logout();
}
+ /**
+ * Sets admin read permissions, login as user. Sets permissions of
+ * default/index.html to Administrators/admin;#/#;#/#. Assert is then based
+ * on a fact, that logged admin is able to see the content of index html (on
+ * homepage) and non visible to not logged in user or "user".
+ */
@Test(enabled = true, description = "Set admin read permissions, login as user.")
public void testSetAdminReadPer() {
login("admin", "admin");
@@ -148,12 +159,22 @@
Assert.assertTrue(selenium.isTextPresent("Access to this resource is denied"), "Secured resource is visible.#2");
logout();
+ login("admin", "admin");
+ Assert.assertFalse(selenium.isTextPresent("Access to this resource is denied"), "Secured resource is visible.#2");
}
+ /**
+ * Sets user read permissions, login as user. Sets permissions of
+ * default/index.html to Administrators/user;#/#;#/#. At first attempt the
+ * setting of permissions is canceled, at the second attempt, it is
+ * submitted. Assert is then based on a fact, that logged "user" is able to
+ * see the content of index html (on homepage) and non visible to not logged
+ * in user.
+ */
@Test(enabled = true, description = "Set user read permissions, login as user.")
public void testSetUserReadPer() {
- // cancelling at first stage
+ // canceling at first stage
login("admin", "admin");
@@ -209,6 +230,13 @@
}
+ /**
+ * Sets user read permissions, login as user. It assigns role "secRole" to
+ * user "user". Sets permissions for default/index.html to
+ * secRoleDisp/admin;#/#;#/#. Assert is then based on a fact, that logged
+ * "user" is able to see the content of index html (on homepage) and non
+ * visible to not logged in user.
+ */
@Test(enabled = true, description = "Set admin/secRole read permissions, login as user w secRole.")
public void testSetRoleReadPer1() {
login("admin", "admin");
@@ -244,6 +272,12 @@
}
+ /**
+ * Sets user read permissions, login as user. It deassigns role "secRole" from
+ * user "user". Sets permissions for default/index.html to
+ * secRoleDisp/admin;#/#;#/#. Assert is then based on a fact, that logged
+ * "user" is not able to see the content of index html (on homepage) and neither not logged in user is able to see the resources.
+ */
@Test(enabled = true, dependsOnMethods = { "testSetRoleReadPer1" }, description = "Set admin/secRole read permissions, login as user w/o secRole.")
public void testSetRoleReadPer2() {
login("admin", "admin");
@@ -279,6 +313,10 @@
}
+ /**
+ * Unknown
+ */
+ //TODO implementation missing!
@Test(enabled = false, description = "Recursive permission test")
public void testRecursiveSecurity() {
login("admin", "admin");
@@ -306,6 +344,12 @@
logout();
}
+ /**
+ * Sets user read permissions, login as user. It deassigns role "secRole" from
+ * user "user". Sets permissions for default/index.html to
+ * Administrators/admin;Administrators/admin;Administrators/admin. Assert is then based on a fact, that not logged
+ * user is not able to see the subpage of (explore page) of the CMS module.
+ */
@Test(enabled = true, dependsOnMethods = { "testSetRoleReadPer1" }, description = "Subpage permission test")
public void testSubpageSecurity() {
selenium.open("/portal/portal/default");
@@ -412,9 +456,9 @@
selenium.click(LNK_SEARCH_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
- //selenium.setSpeed("5000");
+ // selenium.setSpeed("5000");
selenium.type(INP_SEARCH_USER, username);
- //System.out.println(SUB_SEARCH_USER);
+ // System.out.println(SUB_SEARCH_USER);
selenium.click(SUB_SEARCH_USER);
try {
@@ -426,7 +470,7 @@
Assert.assertTrue(selenium.isTextPresent(username), "Username was not found.");
Assert.assertTrue(selenium.isTextPresent(email), "User email adress was not found.");
- //selenium.setSpeed("0");
+ // selenium.setSpeed("0");
}
private String butUsrRol_id(String userName) {
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java 2009-04-07 13:13:01 UTC (rev 13169)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalTestCase.java 2009-04-07 13:21:00 UTC (rev 13170)
@@ -13,6 +13,7 @@
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*
*/
+//TODO - adding of simple portlet - more portlet types
@Test(groups = { "admin_portal" }, enabled = true, description = "Partal administrating.")
public class AdminPortalTestCase extends JBossPortalSeleniumTestCase {
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java 2009-04-07 13:13:01 UTC (rev 13169)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/DashboardsTestCase.java 2009-04-07 13:21:00 UTC (rev 13170)
@@ -8,51 +8,64 @@
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
+/**
+ * DashboardsTestCase responsible for testing of dashboards settings in portal
+ * admin.
+ *
+ * @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
+ */
public class DashboardsTestCase extends JBossPortalSeleniumTestCase {
+ /** prefix for locator properties = portal.dash. */
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 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')]");
@BeforeMethod(groups = { "log" })
- public void loginBeforeTest() {
+ protected void loginBeforeTest() {
logoutIfPossible();
login("admin", "admin");
goToDash();
}
@AfterMethod(groups = { "log" })
- public void logoutAfterTest() {
-
+ protected void logoutAfterTest() {
+
}
+ /**
+ * Testing property addition. Simple adding of "SelenProp" property. Only
+ * the appearance of text "SelenProp" on the dashboards screen is used for
+ * final assertion.
+ */
@Test(enabled = true)
public void testPropAdd() {
final String propName = "SelenProp";
@@ -64,6 +77,11 @@
Assert.assertTrue(selenium.isTextPresent(propName));
}
+ /**
+ * Testing of property update. Simple adding of "SelenValueProp" property
+ * and setting it the value "updatedValue". The value is then assrted to be
+ * appearing in the property table.
+ */
@Test(enabled = true)
public void testPropUpdate() {
final String propName = "SelenValueProp";
@@ -74,16 +92,21 @@
selenium.click(SUBMIT_ADD_PROP);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent(propName));
-
+
int r = findTableRow(TABLE_PROPS, propName, 1);
-
- selenium.type(MessageFormat.format(T_PROPS_INPUT_VALUE, r-1),value);
+
+ selenium.type(MessageFormat.format(T_PROPS_INPUT_VALUE, r - 1), value);
selenium.click(SUBMIT_UPDATE_VALUE);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertEquals(selenium.getValue(MessageFormat.format(T_PROPS_INPUT_VALUE, r-1)),value,"Updated value not found.");
-
+ Assert.assertEquals(selenium.getValue(MessageFormat.format(T_PROPS_INPUT_VALUE, r - 1)), value, "Updated value not found.");
+
}
+ /**
+ * Testing property deletion. Property named "SelenDeleteProp" is added and
+ * deleted. Final assertion is about non-appearance of that property in
+ * property table.
+ */
@Test(enabled = true)
public void testPropDelete() {
final String propName = "SelenDeleteProp";
@@ -93,16 +116,24 @@
selenium.click(SUBMIT_ADD_PROP);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent(propName));
-
+
int r = findTableRow(TABLE_PROPS, propName, 0);
-
- selenium.click(MessageFormat.format(T_PROPS_LINK_DEL, r-1));
+
+ selenium.click(MessageFormat.format(T_PROPS_LINK_DEL, r - 1));
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertFalse(selenium.isTextPresent(propName));
-
+
}
+ /**
+ * Testing of portal error handling. in
+ * "Configure how the system handles errors on portal level." changing
+ * several (access, unavailable, page not found) items and changing of
+ * redirection is done. There is no final assertion.
+ */
+ // TODO - not all elements tested
+ // TODO - no assertions done
@Test(enabled = true)
public void testPortalError() {
selenium.select(T_PO_SEL_ACCESS, "label=Redirect to the specified resource");
@@ -116,6 +147,12 @@
selenium.waitForPageToLoad(PAGE_LOAD);
}
+ /**
+ * Testing of page error handling. in
+ * "Configure how the system handles errors on page level." changing all
+ * items and changing of redirection is done. There is no final assertion.
+ */
+ // TODO - no assertions done
@Test(enabled = true)
public void testPageError() {
selenium.select(T_PA_SEL_ACCESS, "label=Display the default error message");
@@ -133,18 +170,19 @@
selenium.waitForPageToLoad(PAGE_LOAD);
}
+ /**
+ * Testing of dashboard theme. The layout, theme and renderset are changed,
+ * but no assertion is done.
+ */
+ // TODO - no assertions done
@Test(enabled = true)
public void testDashboardTheme() {
-
+
safeSelect(T_DH_SEL_LAYOUT, "1column");
-
-
-
safeSelect(T_DH_SEL_RENDERSET, "default");
-
safeSelect(T_DH_SEL_THEME, "nphalanx");
clickAndWait(T_DH_SUB_UPDATE);
-
+
}
private void goToDash() {
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java 2009-04-07 13:13:01 UTC (rev 13169)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java 2009-04-07 13:21:00 UTC (rev 13170)
@@ -12,12 +12,14 @@
import org.testng.annotations.Test;
/**
+ * EndtoEndPortalAdminTestCase is responsible for end-to-end testing of portal admin. Creating of new portal, adding pages to it and setting it as a default portal
+ * is the main goal of this test case.
* @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 {
-
+ /** prefix for locator properties = portal.e2e.*/
public static String casePfx = "portal.e2e.";
private final String ADR_PORTAL = getProp(casePfx + "adr.home","/portal");
@@ -58,21 +60,14 @@
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() {
+ protected void loginBeforeTest() {
logoutIfPossible();
login("admin", "admin");
}
@AfterMethod(groups = { "log" })
- public void logoutAfterTest() {
+ protected void logoutAfterTest() {
}
final String portalName = "UseCasePortal";
@@ -92,6 +87,51 @@
final String PORTLET5 = "default/project.html";
final String por5str = "Our wiki knowledge base";
+ /**
+ * Usecase for creating small portal with content. Portal named "UseCasePortal" is created similar way as in {@link AdminPortalTestCase#testPortalCreate()}. Then few pages are added similar way
+ * as in {@link AdminPortalTestCase#testAddPage()}. A portlet is added to each page similar way as in {@link AdminPortalTestCase#testCreateWindow()}. The important information about pages and portlets are
+ * listed in the table below
+ *
+ * <table>
+ * <caption>Important information about portlets in EndtoEndPortalAdminTestCase</caption>
+ * <thead>
+ * <tr>
+ * <th>page name</th>
+ * <th>portlet name</th>
+ * <th>asserted string</th>
+ * <th>portlet type</th>
+ * </tr>
+ * </thead>
+ * <tr>
+ * <td>firstPage</td>
+ * <td>Cart Portlet</td><td>Cart Portlet</td>
+ * <td>portlet</td>
+ * </tr>
+ * <tr>
+ * <td>anotherPage</td>
+ * <td>Band Culinaria</td><td>Band Culinaria</td>
+ * <td>widget/google</td>
+ * </tr>
+ * <tr>
+ * <td>lastPage with whitespace</td>
+ * <td>Cahuete.com</td><td>Cahuete.com</td>
+ * <td>widget/netvibes</td>
+ * </tr>
+ * <tr>
+ * <td>dseer</td>
+ * <td>dir1/foo.txt</td><td>File Portlet</td>
+ * <td>filesystem</td>
+ * </tr>
+ * <tr>
+ * <td>cemese</td>
+ * <td>default/project.html</td><td>Our wiki knowledge base</td>
+ * <td>cms</td>
+ * </tr>
+ * </table>
+ *
+ * Final assertions are made by clicking on the pages listed above and asserting that each page contains the string specific for the portlet used (again listed in table).
+ *
+ */
@Test(enabled = true, description = "Usecase for creating small portal with content.")
public void testCreatePortalUsecase() {
createPortal(portalName);
@@ -128,10 +168,6 @@
assertPageContains(page5Name, por5str);
}
-
- public void testManagePortal(){
-
- }
private void assertPageContains(String pageName, String awaitStr) {
selenium.open(ADR_PORTAL);
15 years, 2 months
JBoss Portal SVN: r13169 - branches/Enterprise_Portal_Platform_4_3/build.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-04-07 09:13:01 -0400 (Tue, 07 Apr 2009)
New Revision: 13169
Modified:
branches/Enterprise_Portal_Platform_4_3/build/build-thirdparty.xml
Log:
Using portlet 2.0.7
Modified: branches/Enterprise_Portal_Platform_4_3/build/build-thirdparty.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/build/build-thirdparty.xml 2009-04-07 12:33:33 UTC (rev 13168)
+++ branches/Enterprise_Portal_Platform_4_3/build/build-thirdparty.xml 2009-04-07 13:13:01 UTC (rev 13169)
@@ -41,11 +41,11 @@
are pushed to the http://repository.jboss.com site.
-->
- <componentref name="jboss-portal/modules/common" version="1.2.3"/>
+ <componentref name="jboss-portal/modules/common" version="1.2.4"/>
<componentref name="jboss-portal/modules/web" version="1.2.3"/>
<componentref name="jboss-portal/modules/test" version="1.0.4"/>
- <componentref name="jboss-portal/modules/portlet" version="trunk-SNAPSHOT"/>
- <componentref name="jboss-portal/modules/identity" version="1.0.7"/>
+ <componentref name="jboss-portal/modules/portlet" version="2.0.7"/>
+ <componentref name="jboss-portal/modules/identity" version="1.0.8"/>
<componentref name="jboss-portal/modules/cms" version="1.2.4"/>
<componentref name="antlr" version="2.7.6-brew"/>
<componentref name="apache-ant" version="1.6.5"/>
15 years, 2 months
JBoss Portal SVN: r13168 - in modules/portlet/tags/JBP_PORTLET_2_0_7: bridge and 13 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-04-07 08:33:33 -0400 (Tue, 07 Apr 2009)
New Revision: 13168
Modified:
modules/portlet/tags/JBP_PORTLET_2_0_7/bridge/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_7/build/distrib/distrib.xml
modules/portlet/tags/JBP_PORTLET_2_0_7/build/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_7/controller/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_7/docs/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_7/docs/user-guide/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_7/federation/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_7/jsr168api/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_7/management/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_7/mc/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_7/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_7/portal/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_7/portlet/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_7/releaseLibs.sh
modules/portlet/tags/JBP_PORTLET_2_0_7/samples/pom.xml
modules/portlet/tags/JBP_PORTLET_2_0_7/test/pom.xml
Log:
tagging
Modified: modules/portlet/tags/JBP_PORTLET_2_0_7/bridge/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_7/bridge/pom.xml 2009-04-07 12:13:30 UTC (rev 13167)
+++ modules/portlet/tags/JBP_PORTLET_2_0_7/bridge/pom.xml 2009-04-07 12:33:33 UTC (rev 13168)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>trunk-SNAPSHOT</version>
+ <version>2.0.7</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -24,4 +24,4 @@
</dependencies>
-</project>
\ No newline at end of file
+</project>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_7/build/distrib/distrib.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_7/build/distrib/distrib.xml 2009-04-07 12:13:30 UTC (rev 13167)
+++ modules/portlet/tags/JBP_PORTLET_2_0_7/build/distrib/distrib.xml 2009-04-07 12:33:33 UTC (rev 13168)
@@ -2,9 +2,9 @@
<property name="source.dir" value="../.."/>
<property name="src.docs.dir" value="${source.dir}/docs"/>
- <property name="pc.release.version" value="trunk-SNAPSHOT"/>
- <property name="demo.release.version" value="trunk-SNAPSHOT"/>
- <property name="maven.version" value="trunk-SNAPSHOT"/>
+ <property name="pc.release.version" value="2.0.7"/>
+ <property name="demo.release.version" value="2.0.7"/>
+ <property name="maven.version" value="2.0.7"/>
<!-- -->
<property name="pc.release.name" value="jboss-portletcontainer-${pc.release.version}"/>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_7/build/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_7/build/pom.xml 2009-04-07 12:13:30 UTC (rev 13167)
+++ modules/portlet/tags/JBP_PORTLET_2_0_7/build/pom.xml 2009-04-07 12:33:33 UTC (rev 13168)
@@ -18,7 +18,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>trunk-SNAPSHOT</version>
+ <version>2.0.7</version>
<packaging>pom</packaging>
<name>JBoss Portal Portlet Module</name>
<description>JBoss Portal Portlet Module</description>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_7/controller/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_7/controller/pom.xml 2009-04-07 12:13:30 UTC (rev 13167)
+++ modules/portlet/tags/JBP_PORTLET_2_0_7/controller/pom.xml 2009-04-07 12:33:33 UTC (rev 13168)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>trunk-SNAPSHOT</version>
+ <version>2.0.7</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_7/docs/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_7/docs/pom.xml 2009-04-07 12:13:30 UTC (rev 13167)
+++ modules/portlet/tags/JBP_PORTLET_2_0_7/docs/pom.xml 2009-04-07 12:33:33 UTC (rev 13168)
@@ -4,13 +4,13 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>trunk-SNAPSHOT</version>
+ <version>2.0.7</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<artifactId>docs-aggregator</artifactId>
<packaging>pom</packaging>
<name>JBoss Portal Portlet Docs Aggregator</name>
- <version>2.0-Beta1</version>
+ <version>2.0.7</version>
<url>http://labs.jboss.com/jbossportal</url>
<modules>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_7/docs/user-guide/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_7/docs/user-guide/pom.xml 2009-04-07 12:13:30 UTC (rev 13167)
+++ modules/portlet/tags/JBP_PORTLET_2_0_7/docs/user-guide/pom.xml 2009-04-07 12:33:33 UTC (rev 13168)
@@ -11,7 +11,7 @@
</parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>user-guide-${translation}</artifactId>
- <version>trunk-SNAPSHOT</version>
+ <version>2.0.7</version>
<packaging>jdocbook</packaging>
<name>User_Guide_(${translation})</name>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_7/federation/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_7/federation/pom.xml 2009-04-07 12:13:30 UTC (rev 13167)
+++ modules/portlet/tags/JBP_PORTLET_2_0_7/federation/pom.xml 2009-04-07 12:33:33 UTC (rev 13168)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>trunk-SNAPSHOT</version>
+ <version>2.0.7</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -62,4 +62,4 @@
</build>
-</project>
\ No newline at end of file
+</project>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_7/jsr168api/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_7/jsr168api/pom.xml 2009-04-07 12:13:30 UTC (rev 13167)
+++ modules/portlet/tags/JBP_PORTLET_2_0_7/jsr168api/pom.xml 2009-04-07 12:33:33 UTC (rev 13168)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>trunk-SNAPSHOT</version>
+ <version>2.0.7</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_7/management/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_7/management/pom.xml 2009-04-07 12:13:30 UTC (rev 13167)
+++ modules/portlet/tags/JBP_PORTLET_2_0_7/management/pom.xml 2009-04-07 12:33:33 UTC (rev 13168)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>trunk-SNAPSHOT</version>
+ <version>2.0.7</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -20,4 +20,4 @@
</dependencies>
-</project>
\ No newline at end of file
+</project>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_7/mc/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_7/mc/pom.xml 2009-04-07 12:13:30 UTC (rev 13167)
+++ modules/portlet/tags/JBP_PORTLET_2_0_7/mc/pom.xml 2009-04-07 12:33:33 UTC (rev 13168)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>trunk-SNAPSHOT</version>
+ <version>2.0.7</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_7/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_7/pom.xml 2009-04-07 12:13:30 UTC (rev 13167)
+++ modules/portlet/tags/JBP_PORTLET_2_0_7/pom.xml 2009-04-07 12:33:33 UTC (rev 13168)
@@ -5,7 +5,7 @@
<artifactId>module-aggregator</artifactId>
<packaging>pom</packaging>
<name>JBoss Portal Portlet Module Aggregator</name>
- <version>trunk-SNAPSHOT</version>
+ <version>2.0.7</version>
<url>http://labs.jboss.com/jbossportal</url>
<dependencies/>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_7/portal/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_7/portal/pom.xml 2009-04-07 12:13:30 UTC (rev 13167)
+++ modules/portlet/tags/JBP_PORTLET_2_0_7/portal/pom.xml 2009-04-07 12:33:33 UTC (rev 13168)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>trunk-SNAPSHOT</version>
+ <version>2.0.7</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_7/portlet/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_7/portlet/pom.xml 2009-04-07 12:13:30 UTC (rev 13167)
+++ modules/portlet/tags/JBP_PORTLET_2_0_7/portlet/pom.xml 2009-04-07 12:33:33 UTC (rev 13168)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>trunk-SNAPSHOT</version>
+ <version>2.0.7</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -207,4 +207,4 @@
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_7/releaseLibs.sh
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_7/releaseLibs.sh 2009-04-07 12:13:30 UTC (rev 13167)
+++ modules/portlet/tags/JBP_PORTLET_2_0_7/releaseLibs.sh 2009-04-07 12:33:33 UTC (rev 13168)
@@ -25,9 +25,9 @@
echo "Releasing to Portal thirdparty"
fi
-cp bridge/target/portlet-bridge-2.1.0-SNAPSHOT.jar $loc/portal-portlet-bridge-lib.jar
-cp controller/target/portlet-controller-2.1.0-SNAPSHOT.jar $loc/portal-portlet-controller-lib.jar
-cp federation/target/portlet-federation-2.1.0-SNAPSHOT.jar $loc/portal-portlet-federation-lib.jar
-cp management/target/portlet-management-2.1.0-SNAPSHOT.jar $loc/portal-portlet-management-lib.jar
-cp portlet/target/portlet-portlet-2.1.0-SNAPSHOT.jar $loc/portal-portlet-lib.jar
-cp samples/target/portlet-samples-2.1.0-SNAPSHOT.jar $loc/portal-portlet-samples-lib.jar
+cp bridge/target/portlet-bridge-2.0.7.jar $loc/portal-portlet-bridge-lib.jar
+cp controller/target/portlet-controller-2.0.7.jar $loc/portal-portlet-controller-lib.jar
+cp federation/target/portlet-federation-2.0.7.jar $loc/portal-portlet-federation-lib.jar
+cp management/target/portlet-management-2.0.7.jar $loc/portal-portlet-management-lib.jar
+cp portlet/target/portlet-portlet-2.0.7.jar $loc/portal-portlet-lib.jar
+cp samples/target/portlet-samples-2.0.7.jar $loc/portal-portlet-samples-lib.jar
Modified: modules/portlet/tags/JBP_PORTLET_2_0_7/samples/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_7/samples/pom.xml 2009-04-07 12:13:30 UTC (rev 13167)
+++ modules/portlet/tags/JBP_PORTLET_2_0_7/samples/pom.xml 2009-04-07 12:33:33 UTC (rev 13168)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>trunk-SNAPSHOT</version>
+ <version>2.0.7</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/tags/JBP_PORTLET_2_0_7/test/pom.xml
===================================================================
--- modules/portlet/tags/JBP_PORTLET_2_0_7/test/pom.xml 2009-04-07 12:13:30 UTC (rev 13167)
+++ modules/portlet/tags/JBP_PORTLET_2_0_7/test/pom.xml 2009-04-07 12:33:33 UTC (rev 13168)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>module-parent</artifactId>
- <version>trunk-SNAPSHOT</version>
+ <version>2.0.7</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
15 years, 2 months
JBoss Portal SVN: r13167 - modules/portlet/tags.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-04-07 08:13:30 -0400 (Tue, 07 Apr 2009)
New Revision: 13167
Added:
modules/portlet/tags/JBP_PORTLET_2_0_7/
Log:
Tagging portlet modules
Copied: modules/portlet/tags/JBP_PORTLET_2_0_7 (from rev 13166, modules/portlet/trunk)
15 years, 2 months