JBoss Portal SVN: r11957 - in branches/JBoss_Portal_Branch_2_7: wsrp/src/main/org/jboss/portal/test/wsrp/consumer and 1 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2008-09-24 03:54:40 -0400 (Wed, 24 Sep 2008)
New Revision: 11957
Modified:
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/RegistrationInfoTestCase.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
Log:
- Renamed *Modified to *ModifiedSinceLastRefresh since it fits semantics better.
- Added isModifyRegistrationNeeded to handle most of the modifyRegistration checking logic to RegistrationInfo.
- Added tests.
Modified: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2008-09-23 21:28:50 UTC (rev 11956)
+++ branches/JBoss_Portal_Branch_2_7/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2008-09-24 07:54:40 UTC (rev 11957)
@@ -403,7 +403,7 @@
if (!isRegistrationLocallyModified())
{
IllegalStateException e =
- new IllegalStateException("Registration not locally modified: there should be expected registration from producer!");
+ new IllegalStateException("Registration not locally modified: there should be expected registration from producer!");
log.debug(e);
throw e;
}
@@ -412,11 +412,11 @@
try
{
// todo: this should be done better cf regPropListener
- newReg.setModified(true); // mark as modified to force refresh of RegistrationData
+ newReg.setModifiedSinceLastRefresh(true); // mark as modified to force refresh of RegistrationData
// attempt to modify the registration using new registration info
info.setRegistrationInfo(newReg);
info.modifyRegistration();
- newReg.setModified(false);
+ newReg.setModifiedSinceLastRefresh(false);
registrationLocallyModified = false;
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/RegistrationInfoTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/RegistrationInfoTestCase.java 2008-09-23 21:28:50 UTC (rev 11956)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/RegistrationInfoTestCase.java 2008-09-24 07:54:40 UTC (rev 11957)
@@ -70,7 +70,8 @@
// and we don't know if the registration is valid
assertNull(info.isRegistrationValid());
- assertFalse(info.isModified());
+ assertFalse(info.isModifiedSinceLastRefresh());
+ assertFalse(info.isModifyRegistrationNeeded());
try
{
@@ -98,7 +99,8 @@
// check status
assertNull(info.isConsistentWithProducerExpectations());
- assertTrue(info.isModified());
+ assertTrue(info.isModifiedSinceLastRefresh());
+ assertTrue(info.isModifyRegistrationNeeded());
Map properties = info.getRegistrationProperties();
assertFalse(properties.isEmpty());
@@ -120,7 +122,8 @@
RegistrationProperty prop = info.getRegistrationProperty("prop0");
assertNull(prop.isInvalid());
assertFalse(result.hasIssues());
- assertFalse(info.isModified());
+ assertFalse(info.isModifiedSinceLastRefresh());
+ assertFalse(info.isModifyRegistrationNeeded());
assertTrue(info.isConsistentWithProducerExpectations());
// specifiy that the prop is valid to simulate a successful registration (integration test, should have something
@@ -146,6 +149,7 @@
assertTrue(info.isRegistrationDeterminedNotRequired());
assertFalse(info.isRegistrationDeterminedRequired());
assertTrue(info.isRegistrationValid());
+ assertFalse(info.isModifyRegistrationNeeded());
result = info.refresh(sd, producerId, false, false, false);
assertNotNull(result);
@@ -155,6 +159,7 @@
assertTrue(info.isRegistrationDeterminedNotRequired());
assertFalse(info.isRegistrationDeterminedRequired());
assertTrue(info.isRegistrationValid());
+ assertFalse(info.isModifyRegistrationNeeded());
}
public void testRefreshRegistrationDefaultRegistrationNoLocalInfo()
@@ -178,13 +183,15 @@
// set a registration property
info.setRegistrationPropertyValue("foo", "bar");
+ // we were not registered so this is a failure and not a need to call modifyRegistration
RegistrationInfo.RegistrationRefreshResult result = info.refresh(
- createServiceDescription(true, 0), producerId, false, false, false);
+ createServiceDescription(true, 0), producerId, false, false, true);
assertNotNull(result);
assertTrue(result.hasIssues());
assertEquals(RefreshResult.Status.FAILURE, result.getStatus());
assertEquals(1, info.getRegistrationProperties().size());
assertEquals(1, result.getRegistrationProperties().size());
+ assertFalse(info.isModifyRegistrationNeeded());
Map regProps = result.getRegistrationProperties();
assertNotNull(regProps);
@@ -196,6 +203,34 @@
assertEquals(RegistrationProperty.Status.INEXISTENT, prop.getStatus());
}
+ public void testRefreshRegistrationDefaultRegistrationExtraLocalInfoWhileRegistered()
+ {
+ // set a registration property
+ info.setRegistrationPropertyValue("foo", "bar");
+
+ // simulate being registered
+ info.setRegistrationHandle("blah");
+
+ // we were registered so we need to call modifyRegistration, force check of extra props
+ RegistrationInfo.RegistrationRefreshResult result = info.refresh(
+ createServiceDescription(true, 0), producerId, false, false, true);
+ assertNotNull(result);
+ assertEquals(RefreshResult.Status.MODIFY_REGISTRATION_REQUIRED, result.getStatus());
+ assertTrue(result.hasIssues());
+ assertEquals(1, info.getRegistrationProperties().size());
+ assertEquals(1, result.getRegistrationProperties().size());
+ assertTrue(info.isModifyRegistrationNeeded());
+
+ Map regProps = result.getRegistrationProperties();
+ assertNotNull(regProps);
+
+ RegistrationProperty prop = (RegistrationProperty)regProps.get("foo");
+ assertNotNull(prop);
+ assertEquals("bar", prop.getValue());
+ assertTrue(prop.isInvalid());
+ assertEquals(RegistrationProperty.Status.INEXISTENT, prop.getStatus());
+ }
+
public void testRefreshRegistrationRegistrationNoLocalInfo()
{
// producer requests 2 registration properties
@@ -207,6 +242,7 @@
assertEquals(RefreshResult.Status.FAILURE, result.getStatus());
assertEquals(0, info.getRegistrationProperties().size());
assertEquals(2, result.getRegistrationProperties().size());
+ assertFalse(info.isModifyRegistrationNeeded()); // we weren't registered
Map regProps = result.getRegistrationProperties();
assertNotNull(regProps);
@@ -294,24 +330,29 @@
assertTrue(info.isRegistrationRequired());
assertTrue(info.isRegistrationDeterminedRequired());
assertFalse(info.isRegistrationDeterminedNotRequired());
+ assertFalse(info.isModifyRegistrationNeeded());
}
public void testGetRegistrationData()
{
assertNotNull(info.getRegistrationData());
- assertFalse(info.isModified());
+ assertFalse(info.isModifiedSinceLastRefresh());
+ assertFalse(info.isModifyRegistrationNeeded());
info.setRegistrationPropertyValue("prop0", "value0");
- assertTrue(info.isModified());
+ assertTrue(info.isModifiedSinceLastRefresh());
+ assertTrue(info.isModifyRegistrationNeeded());
RegistrationData registrationData = info.getRegistrationData();
checkRegistrationData(registrationData, "value0");
Property[] properties;
// check that setRegistrationValidInternalState properly updates RegistrationData if required
info.setRegistrationPropertyValue("prop0", "value1");
- assertTrue(info.isModified());
+ assertTrue(info.isModifiedSinceLastRefresh());
+ assertTrue(info.isModifyRegistrationNeeded());
info.setRegistrationValidInternalState();
- assertFalse(info.isModified());
+ assertFalse(info.isModifiedSinceLastRefresh());
+ assertFalse(info.isModifyRegistrationNeeded());
properties = info.getRegistrationData().getRegistrationProperties();
assertEquals("value1", properties[0].getStringValue());
}
@@ -365,7 +406,7 @@
assertTrue(info.isRegistrationDeterminedRequired());
assertFalse(info.isRegistrationValid());
assertFalse(info.isConsistentWithProducerExpectations());
- assertFalse(info.isModified());
+ assertFalse(info.isModifiedSinceLastRefresh());
}
private void checkRegistrationData(RegistrationData registrationData, String prop0Value)
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2008-09-23 21:28:50 UTC (rev 11956)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2008-09-24 07:54:40 UTC (rev 11957)
@@ -250,7 +250,7 @@
public boolean isModifyRegistrationRequired()
{
- return isModifyRegistrationRequired || (persistentRegistrationInfo != null && persistentRegistrationInfo.isModified());
+ return isModifyRegistrationRequired || (persistentRegistrationInfo != null && persistentRegistrationInfo.isModifiedSinceLastRefresh());
}
// FIX-ME: remove when a better dirty management is in place at property level
@@ -308,7 +308,7 @@
{
ServiceDescription serviceDescription;
- if(isModifyRegistrationRequired)
+ if (isModifyRegistrationRequired)
{
return new RefreshResult(RefreshResult.Status.MODIFY_REGISTRATION_REQUIRED);
}
Modified: branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2008-09-23 21:28:50 UTC (rev 11956)
+++ branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2008-09-24 07:54:40 UTC (rev 11957)
@@ -64,7 +64,8 @@
private transient Boolean requiresRegistration;
private transient Boolean consistentWithProducerExpectations;
private transient RegistrationData registrationData;
- private transient boolean modified;
+ private transient boolean modifiedSinceLastRefresh;
+ private transient boolean modifyRegistrationNeeded;
private transient ProducerInfo parent;
public RegistrationInfo(ProducerInfo producerInfo)
@@ -154,7 +155,7 @@
public boolean isRefreshNeeded()
{
- boolean result = requiresRegistration == null || isModified();
+ boolean result = requiresRegistration == null || isModifiedSinceLastRefresh();
if (result)
{
log.debug("Refresh needed");
@@ -307,7 +308,7 @@
{
throw new IllegalArgumentException("Cannot remove inexistent registration property '" + name + "'");
}
- setModified(true);
+ setModifiedSinceLastRefresh(true);
}
private Map<String, RegistrationProperty> getOrCreateRegistrationPropertiesMap(boolean forceCreate)
@@ -402,7 +403,8 @@
{
result.setRegistrationProperties(new HashMap<String, RegistrationProperty>(persistentRegistrationProperties));
}
- setModified(false);
+ setModifiedSinceLastRefresh(false);
+ modifyRegistrationNeeded = false;
if (serviceDescription.isRequiresRegistration())
{
@@ -450,7 +452,7 @@
}
log.debug("Missing value for property '" + name + "'");
- result.setStatus(RefreshResult.Status.FAILURE);
+ setResultAsFailedOrModifyNeeded(result);
}
}
}
@@ -562,6 +564,19 @@
}
}
log.debug(message);
+ setResultAsFailedOrModifyNeeded(result);
+ }
+ }
+
+ private void setResultAsFailedOrModifyNeeded(RegistrationRefreshResult result)
+ {
+ if (persistentRegistrationHandle != null)
+ {
+ result.setStatus(RefreshResult.Status.MODIFY_REGISTRATION_REQUIRED);
+ modifyRegistrationNeeded = true;
+ }
+ else
+ {
result.setStatus(RefreshResult.Status.FAILURE);
}
}
@@ -627,7 +642,8 @@
consistentWithProducerExpectations = Boolean.TRUE; // since we have a registration context, we're consistent with the Producer
requiresRegistration = Boolean.TRUE; // we know we require registration
- setModified(false); // our state is clean :)
+ setModifiedSinceLastRefresh(false); // our state is clean :)
+ modifyRegistrationNeeded = false;
}
public RegistrationContext getRegistrationContext()
@@ -644,20 +660,26 @@
}
}
- public boolean isModified()
+ public boolean isModifyRegistrationNeeded()
{
- return modified;
+ return modifyRegistrationNeeded;
}
- public void setModified(boolean modified)
+ public boolean isModifiedSinceLastRefresh()
{
- this.modified = modified;
+ return modifiedSinceLastRefresh;
}
+ public void setModifiedSinceLastRefresh(boolean modifiedSinceLastRefresh)
+ {
+ this.modifiedSinceLastRefresh = modifiedSinceLastRefresh;
+ }
+
/** todo: Should be package-only, public for tests... */
public void propertyValueChanged(RegistrationProperty property, Object oldValue, Object newValue)
{
- setModified(true);
+ setModifiedSinceLastRefresh(true);
+ modifyRegistrationNeeded = true;
}
public class RegistrationRefreshResult extends RefreshResult
17 years, 7 months
JBoss Portal SVN: r11956 - branches/JBoss_Portal_Branch_2_7/core-cms.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2008-09-23 17:28:50 -0400 (Tue, 23 Sep 2008)
New Revision: 11956
Modified:
branches/JBoss_Portal_Branch_2_7/core-cms/build.xml
Log:
fixing the packaging to include the cms module library
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/build.xml 2008-09-23 19:06:21 UTC (rev 11955)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/build.xml 2008-09-23 21:28:50 UTC (rev 11956)
@@ -251,7 +251,7 @@
<copy todir="${build.resources}/portal-cms/lib">
<!-- portal cms -->
<fileset dir="${build.lib}" includes="portal-core-cms-lib.jar"/>
- <fileset dir="${jboss.portal/modules/cms.lib}" includes="cms-jackrabbit-trunk-SNAPSHOT.jar"/>
+ <fileset dir="${jboss.portal/modules/cms.lib}" includes="cms-jackrabbit.jar"/>
<!-- jcr/jackrabbit integration -->
<fileset dir="${jcr.jcr.lib}" includes="jcr-1.0.jar"/>
17 years, 7 months
JBoss Portal SVN: r11955 - in branches/JBoss_Portal_Branch_2_7: core-wsrp/src/resources/portal-wsrp-admin-war/jsf/producer and 1 other directory.
by portal-commits@lists.jboss.org
Author: prabhat.jha(a)jboss.com
Date: 2008-09-23 15:06:21 -0400 (Tue, 23 Sep 2008)
New Revision: 11955
Modified:
branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/jsf/admin/assignRoles.xhtml
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/producer/producer.xhtml
Log:
[JBPORTAL-2101] adding ids to identity admin ui
[JBPORTAL-2103] adding ids to wsrp admin ui
Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/jsf/admin/assignRoles.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/jsf/admin/assignRoles.xhtml 2008-09-23 18:55:38 UTC (rev 11954)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/jsf/admin/assignRoles.xhtml 2008-09-23 19:06:21 UTC (rev 11955)
@@ -10,7 +10,7 @@
<ui:define name="title">
<li class="pathItem">
- <h:commandLink id="assign-role-link" action="userAdmin" value="#{bundle.IDENTITY_MANAGEMENT_USER_MANAGEMENT}" />
+ <h:commandLink id="user-adm-link" action="userAdmin" value="#{bundle.IDENTITY_MANAGEMENT_USER_MANAGEMENT}" />
</li>
<li class="pathSeparator"><h:graphicImage url="/img/pathSeparator.png" alt=">"/></li>
<li class="pathItem">
Modified: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/producer/producer.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/producer/producer.xhtml 2008-09-23 18:55:38 UTC (rev 11954)
+++ branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/producer/producer.xhtml 2008-09-23 19:06:21 UTC (rev 11955)
@@ -9,13 +9,12 @@
<ui:define name="content">
<h:form id="producer-form">
<h:panelGrid columns="2" width="100%">
- <h:selectBooleanCheckbox value="#{producer.registrationRequiredForFullDescription}"/>
+ <h:selectBooleanCheckbox id="cons-reg-req-check" value="#{producer.registrationRequiredForFullDescription}"/>
<h:outputText value="#{i18n.producer_config_sd_requires_reg}"/>
-
<h:selectBooleanCheckbox value="#{producer.strictMode}"/>
<h:outputText value="#{i18n.producer_config_strict}"/>
-
- <h:selectBooleanCheckbox value="#{producer.registrationRequired}" immediate="true"
+
+ <h:selectBooleanCheckbox id="req-reg-check" value="#{producer.registrationRequired}" immediate="true"
onchange="this.form.submit()"
valueChangeListener="#{producer.requireRegistrationListener}"/>
<h:outputText value="#{i18n.producer_config_requires_reg}"/>
@@ -46,7 +45,7 @@
headerClass="portlet-section-header">
<h:column>
<f:facet name="header">#{i18n.producer_config_reg_prop_name}</f:facet>
- <h:inputText value="#{property.nameAsString}" size="30"/>
+ <h:inputText id="name" value="#{property.nameAsString}" size="30"/>
</h:column>
<h:column>
<f:facet name="header">#{i18n.producer_config_reg_prop_type}</f:facet>
@@ -56,11 +55,11 @@
</h:column>
<h:column>
<f:facet name="header">#{i18n.producer_config_reg_prop_label}</f:facet>
- <h:inputText value="#{property.label}" size="50"/>
+ <h:inputText id="label" value="#{property.label}" size="50"/>
</h:column>
<h:column>
<f:facet name="header">#{i18n.producer_config_reg_prop_hint}</f:facet>
- <h:inputText value="#{property.hint}" size="50"/>
+ <h:inputText id="hint" value="#{property.hint}" size="50"/>
</h:column>
<h:column>
<f:facet name="header">#{i18n.producer_config_reg_prop_action}</f:facet>
17 years, 7 months
JBoss Portal SVN: r11954 - in branches/JBoss_Portal_Branch_2_6: core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer and 1 other directory.
by portal-commits@lists.jboss.org
Author: prabhat.jha(a)jboss.com
Date: 2008-09-23 14:55:38 -0400 (Tue, 23 Sep 2008)
New Revision: 11954
Modified:
branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/assignRoles.xhtml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producer.xhtml
Log:
[JBPORTAL-2101] adding ids to identity admin ui
[JBPORTAL-2103] adding ids to wsrp admin ui
Modified: branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/assignRoles.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/assignRoles.xhtml 2008-09-23 17:35:50 UTC (rev 11953)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/assignRoles.xhtml 2008-09-23 18:55:38 UTC (rev 11954)
@@ -10,7 +10,7 @@
<ui:define name="title">
<li class="pathItem">
- <h:commandLink id="assign-role-link" action="userAdmin" value="#{bundle.IDENTITY_MANAGEMENT_USER_MANAGEMENT}" />
+ <h:commandLink id="user-adm-link" action="userAdmin" value="#{bundle.IDENTITY_MANAGEMENT_USER_MANAGEMENT}" />
</li>
<li class="pathSeparator"><h:graphicImage url="/img/pathSeparator.png" alt=">"/></li>
<li class="pathItem">
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producer.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producer.xhtml 2008-09-23 17:35:50 UTC (rev 11953)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producer.xhtml 2008-09-23 18:55:38 UTC (rev 11954)
@@ -9,10 +9,10 @@
<ui:define name="content">
<h:form id="producer-form">
<h:panelGrid columns="2" width="100%">
- <h:selectBooleanCheckbox value="#{producer.registrationRequiredForFullDescription}"/>
+ <h:selectBooleanCheckbox id="cons-reg-req-check" value="#{producer.registrationRequiredForFullDescription}"/>
<h:outputText value="#{i18n.producer_config_sd_requires_reg}"/>
- <h:selectBooleanCheckbox value="#{producer.registrationRequired}" immediate="true"
+ <h:selectBooleanCheckbox id="req-reg-check" value="#{producer.registrationRequired}" immediate="true"
onchange="this.form.submit()"
valueChangeListener="#{producer.requireRegistrationListener}"/>
<h:outputText value="#{i18n.producer_config_requires_reg}"/>
@@ -43,7 +43,7 @@
headerClass="portlet-section-header">
<h:column>
<f:facet name="header">#{i18n.producer_config_reg_prop_name}</f:facet>
- <h:inputText value="#{property.nameAsString}" size="30"/>
+ <h:inputText id="name" value="#{property.nameAsString}" size="30"/>
</h:column>
<h:column>
<f:facet name="header">#{i18n.producer_config_reg_prop_type}</f:facet>
@@ -53,11 +53,11 @@
</h:column>
<h:column>
<f:facet name="header">#{i18n.producer_config_reg_prop_label}</f:facet>
- <h:inputText value="#{property.label}" size="50"/>
+ <h:inputText id="label" value="#{property.label}" size="50"/>
</h:column>
<h:column>
<f:facet name="header">#{i18n.producer_config_reg_prop_hint}</f:facet>
- <h:inputText value="#{property.hint}" size="50"/>
+ <h:inputText id="hint" value="#{property.hint}" size="50"/>
</h:column>
<h:column>
<f:facet name="header">#{i18n.producer_config_reg_prop_action}</f:facet>
17 years, 7 months
JBoss Portal SVN: r11953 - branches/JBoss_Portal_2_6_6_JBPORTAL-2109/cms/src/main/org/jboss/portal/cms/impl/jcr/ha.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2008-09-23 13:35:50 -0400 (Tue, 23 Sep 2008)
New Revision: 11953
Modified:
branches/JBoss_Portal_2_6_6_JBPORTAL-2109/cms/src/main/org/jboss/portal/cms/impl/jcr/ha/HAJCRCMS.java
Log:
JBPORTAL-2161 - Special character in filename generates NullPointerException
JBPORTAL-2162 - Special character in foldername throws RepositoryException
JBPORTAL-2163 - File- and foldernames with special characters and umlauts are not exported correctly
(Fixing an issue with slave nodes in the clustered setup)
Modified: branches/JBoss_Portal_2_6_6_JBPORTAL-2109/cms/src/main/org/jboss/portal/cms/impl/jcr/ha/HAJCRCMS.java
===================================================================
--- branches/JBoss_Portal_2_6_6_JBPORTAL-2109/cms/src/main/org/jboss/portal/cms/impl/jcr/ha/HAJCRCMS.java 2008-09-23 15:12:31 UTC (rev 11952)
+++ branches/JBoss_Portal_2_6_6_JBPORTAL-2109/cms/src/main/org/jboss/portal/cms/impl/jcr/ha/HAJCRCMS.java 2008-09-23 17:35:50 UTC (rev 11953)
@@ -107,10 +107,12 @@
returnValue = invoker.invoke("execute", new Class[]{Command.class}, new Object[]{cmd});
if(returnValue instanceof CMSException)
{
- if(returnValue.toString().indexOf("Access to this resource is denied") != -1)
+ CMSException cmsException = (CMSException)returnValue;
+ if(cmsException.toString().indexOf("Access to this resource is denied") != -1 ||
+ cmsException.hasPathFormatFailure())
{
- throw (CMSException)returnValue;
- }
+ throw cmsException;
+ }
else
{
returnValue = null;
@@ -170,7 +172,7 @@
}
catch(CMSException ce)
{
- if (ce.toString().indexOf("Access to this resource is denied") != -1)
+ if (ce.toString().indexOf("Access to this resource is denied") != -1 || ce.hasPathFormatFailure())
{
result = ce;
}
17 years, 7 months
JBoss Portal SVN: r11952 - in branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium: cms and 1 other directory.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2008-09-23 11:12:31 -0400 (Tue, 23 Sep 2008)
New Revision: 11952
Added:
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileManipulationTestCase.java
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileNoWorkflowTestCase.java
Modified:
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortletUserCreationTestCase.java
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSDirectoryTestCase.java
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
Log:
2.6 tests update
Modified: branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2008-09-23 14:53:05 UTC (rev 11951)
+++ branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/DashboardTestCase.java 2008-09-23 15:12:31 UTC (rev 11952)
@@ -10,6 +10,14 @@
@Test(groups = { "cms_dashboard" }, enabled = true, description = "Dashboard issues test case.")
public class DashboardTestCase extends JBossPortalSeleniumTestCase {
+ private static final String SELECT_PAGE = "page-selector-form:pageNameSelector";
+ private static final String INPUT_PAGENAME = "dashboard-form:pageName";
+ private static final String SUBMIT_CREATEPAGE = "dashboard-form:save-button";
+ private static final String SELECT_LAYOUT = "dashboardLayoutForm:layoutSelector";
+ private static final String SUBMIT_LAYOUTSEL = "dashboardLayoutForm:update-layout";
+ private static final String SELECT_THEME = "dashboardThemeForm:themeSelector";
+ private static final String SUBMIT_THEMESEL = "dashboardThemeForm:update-theme";
+
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
//selenium.setSpeed("3000");
@@ -27,8 +35,8 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Configure dashboard");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type("_id3jbpnsabcsnpbj:pageName", "DashTestPage");
- selenium.click("_id3jbpnsabcsnpbj:_id4jbpnsabcsnpbj");
+ selenium.type(INPUT_PAGENAME, "DashTestPage");
+ selenium.click(SUBMIT_CREATEPAGE);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Dashboard");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -38,59 +46,65 @@
Assert.assertTrue(selenium.isTextPresent("Powered by JBoss Portal"));
}
- @Test(enabled = false, dependsOnMethods = { "testCreatePage" })
+ @Test(enabled = true, dependsOnMethods = { "testCreatePage" })
public void testUpdateTheme() {
selenium.click("link=Dashboard");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Configure dashboard");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select("page_selector_form:pageNameSelector", "label=DashTestPage");
- selenium.waitForPageToLoad(PAGE_LOAD);
+
+
+ System.out.println(selenium.getSelectedLabel(SELECT_PAGE));
+ if (!selenium.getSelectedLabel(SELECT_PAGE).equals("DashTestPage"))
+ selenium.select(SELECT_PAGE, "label=DashTestPage");
+
+ //selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select("_id15jbpnsabcsnpbj:themeSelector", "label=renaissance");
- selenium.click("_id15jbpnsabcsnpbj:_id18jbpnsabcsnpbj");
+ selenium.select(SELECT_THEME, "label=renaissance");
+ selenium.click(SUBMIT_THEMESEL);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Dashboard");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Configure dashboard");
selenium.waitForPageToLoad(PAGE_LOAD);
- if (!selenium.getSelectedLabel("page_selector_form:pageNameSelector").equals("DashTestPage")) {
- selenium.select("page_selector_form:pageNameSelector", "label=DashTestPage");
+ if (!selenium.getSelectedLabel(SELECT_PAGE).equals("DashTestPage")) {
+ selenium.select(SELECT_PAGE, "label=DashTestPage");
selenium.waitForPageToLoad(PAGE_LOAD);
}
//System.out.println(selenium.isElementPresent("_id15jbpnsabcsnpbj:themeSelector"));
//System.out.println(selenium.getSelectedLabel("_id15jbpnsabcsnpbj:themeSelector"));
- Assert.assertEquals("renaissance", selenium.getSelectedLabel("_id15jbpnsabcsnpbj:themeSelector"));
+ Assert.assertEquals("renaissance", selenium.getSelectedLabel(SELECT_THEME));
}
- @Test(enabled = false, dependsOnMethods = { "testCreatePage" })
+ @Test(enabled = true, dependsOnMethods = { "testCreatePage" })
public void testUpdateLayout() {
selenium.click("link=Dashboard");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Configure dashboard");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select("page_selector_form:pageNameSelector", "label=DashTestPage");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ if (!selenium.getSelectedLabel(SELECT_PAGE).equals("DashTestPage"))
+ selenium.select(SELECT_PAGE, "label=DashTestPage");
+ //selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertEquals("default", selenium.getSelectedLabel("_id10jbpnsabcsnpbj:layoutSelector"));
+ Assert.assertEquals("default", selenium.getSelectedLabel(SELECT_LAYOUT));
- selenium.select("_id10jbpnsabcsnpbj:layoutSelector", "label=generic");
- selenium.click("_id15jbpnsabcsnpbj:_id18jbpnsabcsnpbj");
+ selenium.select(SELECT_LAYOUT, "label=generic");
+ selenium.click(SUBMIT_LAYOUTSEL);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Dashboard");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Configure dashboard");
selenium.waitForPageToLoad(PAGE_LOAD);
- if (!selenium.getSelectedLabel("page_selector_form:pageNameSelector").equals("DashTestPage")) {
- selenium.select("page_selector_form:pageNameSelector", "label=DashTestPage");
+ if (!selenium.getSelectedLabel(SELECT_PAGE).equals("DashTestPage")) {
+ selenium.select(SELECT_PAGE, "label=DashTestPage");
selenium.waitForPageToLoad(PAGE_LOAD);
}
- Assert.assertEquals("generic", selenium.getSelectedLabel("_id10jbpnsabcsnpbj:layoutSelector"));
+ Assert.assertEquals("generic", selenium.getSelectedLabel(SELECT_LAYOUT));
}
@Test(enabled = true, dependsOnMethods = { "testCreatePage" })
@@ -100,8 +114,9 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Configure dashboard");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select("page_selector_form:pageNameSelector", "label=DashTestPage");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ if (!selenium.getSelectedLabel(SELECT_PAGE).equals("DashTestPage"))
+ selenium.select(SELECT_PAGE, "label=DashTestPage");
+ //selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Who's online portlet");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("layoutForm:a_center");
@@ -115,14 +130,15 @@
Assert.assertTrue(selenium.isTextPresent("[admin]"));
}
- @Test(enabled = false, dependsOnMethods = { "testCreatePage" })
+ @Test(enabled = true, dependsOnMethods = { "testCreatePage" })
public void testAddGooglePortlet() {
selenium.click("link=Dashboard");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Configure dashboard");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select("page_selector_form:pageNameSelector", "label=DashTestPage");
- selenium.waitForPageToLoad(PAGE_LOAD);
+ if (!selenium.getSelectedLabel(SELECT_PAGE).equals("DashTestPage"))
+ selenium.select(SELECT_PAGE, "label=DashTestPage");
+ //selenium.waitForPageToLoad(PAGE_LOAD);
selenium.select("abc:instanceId", "label=widget/google");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Hindu God of the Week");
Modified: branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2008-09-23 14:53:05 UTC (rev 11951)
+++ branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2008-09-23 15:12:31 UTC (rev 11952)
@@ -18,7 +18,6 @@
selenium = new DefaultSelenium("127.0.0.1", 44444, browser, "http://localhost:8080/portal/");
selenium.start();
- selenium.setTimeout("300000");
}
@AfterClass
@@ -27,12 +26,10 @@
}
protected void clickIfVisible(String id) {
- if (findLink(id)) {
- selenium.click(id);
- selenium.waitForPageToLoad(PAGE_LOAD);
- }
+
if (selenium.isElementPresent(id)){
selenium.click(id);
+
selenium.waitForPageToLoad(PAGE_LOAD);
}
}
@@ -62,6 +59,7 @@
}
protected void login(String username, String password) {
+ selenium.setTimeout("0");
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
Modified: branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortletUserCreationTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortletUserCreationTestCase.java 2008-09-23 14:53:05 UTC (rev 11951)
+++ branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/PortletUserCreationTestCase.java 2008-09-23 15:12:31 UTC (rev 11952)
@@ -9,21 +9,21 @@
@Test(groups = { "portlet_user_creation" }, enabled = true)
public class PortletUserCreationTestCase extends JBossPortalSeleniumTestCase {
- private static final String SUBMIT_CREATE_CONF = "_id14jbpns_2fdefault_2fdefault_2fIdentityUserPortletWindowsnpbj:user";
+ private static final String SUBMIT_CREATE_CONF = "confirm-form:user";
- private static final String SUBMIT_CREATE_USER = "_id14jbpns_2fdefault_2fdefault_2fIdentityUserPortletWindowsnpbj:submit";
+ private static final String SUBMIT_CREATE_USER = "register-form:submit";
- private static final String INPUT_USERPASSWDCONF = "_id14jbpns_2fdefault_2fdefault_2fIdentityUserPortletWindowsnpbj:passwordCheck";
+ private static final String INPUT_USERPASSWDCONF = "register-form:passwordCheck";
- private static final String INPUT_USERPASSWD = "_id14jbpns_2fdefault_2fdefault_2fIdentityUserPortletWindowsnpbj:password";
+ private static final String INPUT_USERPASSWD = "register-form:password";
- private static final String INPUT_USERMAIL = "_id14jbpns_2fdefault_2fdefault_2fIdentityUserPortletWindowsnpbj:email";
+ private static final String INPUT_USERMAIL = "register-form:email";
- private static final String INPUT_USERNAME = "_id14jbpns_2fdefault_2fdefault_2fIdentityUserPortletWindowsnpbj:username";
+ private static final String INPUT_USERNAME = "register-form:username";
- private static final String LINK_CREATE_USER = "_id14jbpns_2fdefault_2fdefault_2fIdentityUserPortletWindowsnpbj:_id16jbpns_2fdefault_2fdefault_2fIdentityUserPortletWindowsnpbj";
+ private static final String LINK_CREATE_USER = "create-account-form:register";
- private static final String TAB_WELCOME = "_id1jbpns_2fdefault_2fdefault_2fIdentityUserPortletWindowsnpbj:_id3jbpns_2fdefault_2fdefault_2fIdentityUserPortletWindowsnpbj";
+ private static final String TAB_WELCOME = "register-temp-form:start-link";
@Test(enabled = true, description = "Simple user creation.")
public void userCreationTest() {
Modified: branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java 2008-09-23 14:53:05 UTC (rev 11951)
+++ branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/WSRPTestCase.java 2008-09-23 15:12:31 UTC (rev 11952)
@@ -1,5 +1,7 @@
package org.jboss.portal.test.selenium;
+import java.text.MessageFormat;
+
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -10,6 +12,9 @@
@Test(groups = { "cms_wsrp" }, enabled = true, description = "WSRP test case.")
public class WSRPTestCase extends JBossPortalSeleniumTestCase {
+ private static final String SUBMIT_REFRESH_CANCEL = "edit-cons-form:list-cons-link_1";
+ private static final String SUBMIT_PROD_SAVE = "producer-form:save-producer";
+ private static final String SUBMIT_CONSDEL_CONF = "confirm-delete-form:destroy-link";
// private static final String ID_LINK_PRODCONF =
// "_id1jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:_id3jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj"
// ;
@@ -17,11 +22,37 @@
// "_id1jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:_id3jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj"
// ;
- private static final String ID_LINK_PRODCONF = "link=*Producer Configuration*";
- private static final String ID_LINK_CONSCONF = "link=*Consumers Configuration*";
+
- public static String WSRP_CONSUMER_TABLE = "//div[@id='center']/div/div/div/table";
-
+ // TODO shouldn't be same as REFRESH?
+ private static final String SUBMIT_CONS_REGVAL = "edit-cons-form:refresh-cons-link";
+ private static final String SUBMIT_REFRESHFINAL = "edit-cons-form:refresh-cons-link";
+
+ private static final String INPUT_CONS_REGVALUE = "edit-cons-form:prop-value-input";
+ private static final String SUBMIT_REFRESHSAVE = "edit-cons-form:refresh-cons-link";
+ private static final String INPUT_CONSWSDL = "edit-cons-form:wsdl";
+ private static final String INPUT_CACHEEXP = "edit-cons-form:cache";
+ private static final String SUBMIT_ADDPROP_INIT = "producer-form:add-reg-prop";
+ private static final String SUBMIT_ADDPROP = "producer-form:add-reg-prop";
+ private static final String INPUT_PROPHINT = "producer-form:reg-properties:0:_id33jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj";
+ private static final String INPUT_PROPLABEL = "producer-form:reg-properties:0:_id30jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj";
+ private static final String INPUT_PROPNAME = "producer-form:reg-properties:0:_id24jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj";
+ private static final String SUBMIT_CREATECONS = "createConsumer:createConsumerButton";
+ private static final String INPUT_CREATECONS = "createConsumer:consumerName";
+ private static final String ID_LINK_PRODCONF = "cons-temp-form:producer-link";
+ private static final String ID_LINK_CONSCONF = "producer-temp-form:consumersTab";
+ private static final String LINK_CONSUMER_HOME ="cons-temp-form1:list-cons-link";
+ private static final String LINK_T_CONS_CON="consumer-list-form:consumersList:{0}:configure";
+ private static final String LINK_T_CONS_REF="consumer-list-form:consumersList:{0}:refresh";
+ private static final String LINK_T_CONS_ACT="consumer-list-form:consumersList:{0}:activate";
+ private static final String LINK_T_CONS_DEA="consumer-list-form:consumersList:{0}:activate";
+ private static final String LINK_T_CONS_REG="consumer-list-form:consumersList:{0}:register";
+ private static final String LINK_T_CONS_DER="consumer-list-form:consumersList:{0}:register";
+ private static final String LINK_T_CONS_DEL="consumer-list-form:consumersList:{0}:delete";
+
+
+// public static String WSRP_CONSUMER_TABLE = "//form[@id='_id18jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj']/table";
+ public static String WSRP_CONSUMER_TABLE = "consumer-list-form:consumersList";
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
@@ -36,32 +67,30 @@
@Test(enabled = true, description = "Creating a standard BEA consumer.")
public void testCreateBeaConsumer() {
selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=WSRP");
selenium.waitForPageToLoad(PAGE_LOAD);
clickIfVisible(ID_LINK_CONSCONF);
- selenium.type("_id16jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:consumerName", "BEA");
- selenium.click("_id16jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:_id18jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj");
+ selenium.type(INPUT_CREATECONS, "BEA");
+
+ selenium.click(SUBMIT_CREATECONS);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type("_id21jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:cache", "600");
- // selenium.click("link=14. Web Services for Remote Portlets (WSRP)");
- selenium.type("_id21jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:wsdl", "http://wsrp.bea.com:7001/producer/producer?WSDL");
- selenium.click("_id21jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:_id34jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj");
+ selenium.type(INPUT_CACHEEXP, "600");
+
+ selenium.type(INPUT_CONSWSDL, "http://wsrp.bea.com:7001/producer/producer?WSDL");
+ selenium.click(SUBMIT_REFRESHSAVE);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Refresh failed (probably because the registration information was not valid)."));
- Assert
- .assertEquals(
- "Missing value",
- selenium
- .getText("//form[@id='_id21jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj']/table/tbody/tr[4]/td/span/table/tbody/tr[2]/td[3]/span"));
- selenium.type("_id21jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:_id38jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj",
- "public");
- selenium.click("_id21jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:_id48jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj");
+ Assert.assertTrue(selenium.isTextPresent("Missing value"));
+
+ selenium.type(INPUT_CONS_REGVALUE, "public");
+ selenium.click(SUBMIT_CONS_REGVAL);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Refresh was successful."));
- selenium.click("_id6jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:_id8jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj");
+ selenium.click(SUBMIT_REFRESHFINAL);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("BEA"));
}
@@ -70,23 +99,24 @@
public void testBeaConsumerRegister() {
selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=WSRP");
selenium.waitForPageToLoad(PAGE_LOAD);
clickIfVisible(ID_LINK_CONSCONF);
-
- int r = findTableRow(WSRP_CONSUMER_TABLE, "BEAreg", 0);
- selenium.click(WSRP_CONSUMER_TABLE + "/tbody/tr[" + r + "]/td[2]/a[4]");
+ clickIfVisible(LINK_CONSUMER_HOME);
+ int r = findTableRow(WSRP_CONSUMER_TABLE, "BEAreg", 0)-1 ;
+ selenium.click(MessageFormat.format(LINK_T_CONS_REG,r));
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("_id21jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:_id52jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj");
+ selenium.click(SUBMIT_REFRESHSAVE);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("_id6jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:_id8jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj");
+ selenium.click(LINK_CONSUMER_HOME);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertEquals(selenium.getText(WSRP_CONSUMER_TABLE + "/tbody/tr[" + r + "]/td[2]/a[4]"), "Deregister");
+ Assert.assertEquals(selenium.getText(MessageFormat.format(LINK_T_CONS_DER,r)), "Deregister");
}
@Test(enabled = true, dependsOnMethods = { "testCreateBeaConsumer" }, description = "Standard BEA consumer deregistering.")
@@ -94,36 +124,40 @@
createConsumer("BEAreg", "100", "http://wsrp.bea.com:7001/producer/producer?WSDL");
selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=WSRP");
selenium.waitForPageToLoad(PAGE_LOAD);
clickIfVisible(ID_LINK_CONSCONF);
+ clickIfVisible(LINK_CONSUMER_HOME);
+
+ int r = findTableRow(WSRP_CONSUMER_TABLE, "BEAreg", 0) -1;
- int r = findTableRow(WSRP_CONSUMER_TABLE, "BEAreg", 0);
-
- selenium.click(WSRP_CONSUMER_TABLE + "/tbody/tr[" + r + "]/td[2]/a[4]");
+ selenium.click(MessageFormat.format(LINK_T_CONS_DER,r));
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("_id21jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:_id49jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj");
+ selenium.click(SUBMIT_REFRESH_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertEquals(selenium.getText(WSRP_CONSUMER_TABLE + "/tbody/tr[" + r + "]/td[2]/a[4]"), "Register");
+ Assert.assertEquals(selenium.getText(MessageFormat.format(LINK_T_CONS_DER,r)), "Register");
}
@Test(enabled = true, dependsOnMethods = { "testCreateBeaConsumer", "testBeaConsumerDeactivate" }, description = "Standard BEA consumer activating.")
public void testBeaConsumerActivate() {
selenium.open("/portal/");
+
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=WSRP");
selenium.waitForPageToLoad(PAGE_LOAD);
clickIfVisible(ID_LINK_CONSCONF);
+ clickIfVisible(LINK_CONSUMER_HOME);
+ int r = findTableRow(WSRP_CONSUMER_TABLE, "BEAact", 0)-1;
- int r = findTableRow(WSRP_CONSUMER_TABLE, "BEAact", 0);
-
Assert.assertTrue(selenium.isTextPresent("BEAact (inactive) (refresh needed)"));
- selenium.click(WSRP_CONSUMER_TABLE + "/tbody/tr[" + r + "]/td[2]/a[3]");
+ selenium.click(MessageFormat.format(LINK_T_CONS_ACT,r));
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertFalse(selenium.isTextPresent("BEAact (inactive) (refresh needed)"));
@@ -135,16 +169,19 @@
createConsumer("BEAact", "100", "http://wsrp.bea.com:7001/producer/producer?WSDL");
selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=WSRP");
selenium.waitForPageToLoad(PAGE_LOAD);
clickIfVisible(ID_LINK_CONSCONF);
- int r = findTableRow(WSRP_CONSUMER_TABLE, "BEAact", 0);
+ clickIfVisible(LINK_CONSUMER_HOME);
+
+ int r = findTableRow(WSRP_CONSUMER_TABLE, "BEAact", 0)-1;
Assert.assertFalse(selenium.isTextPresent("BEAact (inactive) (refresh needed)"));
- selenium.click(WSRP_CONSUMER_TABLE + "/tbody/tr[" + r + "]/td[2]/a[3]");
+ selenium.click(MessageFormat.format(LINK_T_CONS_DEA,r));
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("BEAact (inactive) (refresh needed)"));
@@ -159,22 +196,28 @@
public void testBeaConsumerDelete() {
createConsumer("BEAdel", "100", "http://wsrp.bea.com:7001/producer/producer?WSDL");
-
+ //selenium.setSpeed("2000");
selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=WSRP");
-
selenium.waitForPageToLoad(PAGE_LOAD);
clickIfVisible(ID_LINK_CONSCONF);
+ clickIfVisible(LINK_CONSUMER_HOME);
Assert.assertTrue(selenium.isTextPresent("BEAdel"));
- int r = findTableRow(WSRP_CONSUMER_TABLE, "BEAdel", 0);
+ selenium.captureScreenshot("tabletable");
+ Assert.assertTrue(selenium.isElementPresent(WSRP_CONSUMER_TABLE),"Consumer table not available.");
+ int r = findTableRow(WSRP_CONSUMER_TABLE, "BEAdel", 0)-1;
+ Assert.assertFalse(r < 0,"Consumer BEAdel not found");
- selenium.click(WSRP_CONSUMER_TABLE + "/tbody/tr[" + r + "]/td[2]/a[5]");
+ selenium.click(MessageFormat.format(LINK_T_CONS_DEL,r));
selenium.waitForPageToLoad(PAGE_LOAD);
-
- selenium.click("_id29jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:_id30jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj");
+ selenium.captureScreenshot("delete");
+ Assert.assertTrue(selenium.isTextPresent("Delete 'BEAdel' consumer?"));
+
+ selenium.click(SUBMIT_CONSDEL_CONF);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertFalse(selenium.isTextPresent("BEAdel"));
@@ -183,73 +226,53 @@
@Test(enabled = true, description = "Basic configuring of WSRP producer.")
public void testConfigureProducer() {
selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=WSRP");
selenium.waitForPageToLoad(PAGE_LOAD);
-
clickIfVisible(ID_LINK_PRODCONF);
-
-
- selenium.click("_id10jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:_id26jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj");
+
+ selenium.click(SUBMIT_ADDPROP_INIT);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium
- .type(
- "_id10jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:registrationProperties:0:_id27jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj",
- "testProp");
- selenium
- .type(
- "_id10jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:registrationProperties:0:_id34jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj",
- "testProp label");
- selenium
- .type(
- "_id10jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:registrationProperties:0:_id37jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj",
- "tetsPropHint");
- selenium.click("_id10jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:_id45jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj");
+ selenium.type(INPUT_PROPNAME, "testProp");
+ selenium.type(INPUT_PROPLABEL, "testProp label");
+ selenium.type(INPUT_PROPHINT, "tetsPropHint");
+
+ selenium.click(SUBMIT_PROD_SAVE);
selenium.waitForPageToLoad(PAGE_LOAD);
+
Assert.assertTrue(selenium.isTextPresent("Producer configuration successfully saved!"));
clickIfVisible(ID_LINK_CONSCONF);
clickIfVisible(ID_LINK_PRODCONF);
- Assert
- .assertEquals(
- "testProp",
- selenium
- .getValue("_id10jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:registrationProperties:0:_id27jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj"));
- Assert
- .assertEquals(
- "testProp label",
- selenium
- .getValue("_id10jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:registrationProperties:0:_id34jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj"));
- Assert
- .assertEquals(
- "tetsPropHint",
- selenium
- .getValue("_id10jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:registrationProperties:0:_id37jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj"));
+ Assert.assertEquals("testProp", selenium.getValue(INPUT_PROPNAME));
+ Assert.assertEquals("testProp label", selenium.getValue(INPUT_PROPLABEL));
+ Assert.assertEquals("tetsPropHint", selenium.getValue(INPUT_PROPHINT));
}
private void createConsumer(String name, String timeout, String address) {
selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=WSRP");
selenium.waitForPageToLoad(PAGE_LOAD);
clickIfVisible(ID_LINK_CONSCONF);
- selenium.type("_id16jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:consumerName", name);
- selenium.click("_id16jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:_id18jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj");
+ selenium.type(INPUT_CREATECONS, name);
+ selenium.click(SUBMIT_CREATECONS);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type("_id21jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:cache", timeout);
+ selenium.type(INPUT_CACHEEXP, timeout);
// selenium.click("link=14. Web Services for Remote Portlets (WSRP)");
- selenium.type("_id21jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:wsdl", address);
- selenium.click("_id21jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:_id34jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj");
+ selenium.type(INPUT_CONSWSDL, address);
+ selenium.click(SUBMIT_REFRESHSAVE);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type("_id21jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:_id38jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj",
- "public");
- selenium.click("_id21jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:_id48jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj");
+ selenium.type(INPUT_CONS_REGVALUE, "public");
+ selenium.click(SUBMIT_CONS_REGVAL);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("_id6jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj:_id8jbpns_2fadmin_2fWSRP_2fWSRPConfigurationPortletWindowsnpbj");
+ selenium.click(SUBMIT_REFRESHFINAL);
selenium.waitForPageToLoad(PAGE_LOAD);
}
}
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSDirectoryTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSDirectoryTestCase.java 2008-09-23 14:53:05 UTC (rev 11951)
+++ branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSDirectoryTestCase.java 2008-09-23 15:12:31 UTC (rev 11952)
@@ -38,6 +38,8 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.open("/portal/auth/portal/admin/CMS");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
Assert.assertFalse(selenium.isTextPresent("TestFolder["), "Test folder is already present.");
selenium.select("//div[@id='center']/div/div/div[1]/div/select", "label=Create Folder");
Added: branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileManipulationTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileManipulationTestCase.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileManipulationTestCase.java 2008-09-23 15:12:31 UTC (rev 11952)
@@ -0,0 +1,109 @@
+package org.jboss.portal.test.selenium.cms;
+
+import org.jboss.portal.test.selenium.JBossPortalSeleniumTestCase;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+@Test(groups = { "cms_file" }, enabled = true)
+public class CMSFileManipulationTestCase extends JBossPortalSeleniumTestCase {
+ private static final String SELECT_CMS_MAIN = "//div[@id='center']/div/div/div[1]/div/select";
+
+ private final String CMS_FILE_TABLE = "//div[@id='center']/div/div/div[3]/table";
+
+ // file workflow table in CMS
+ private final String CMS_WF_TABLE = "//div[@id='center']/div/div/table[2]";
+
+ // file version table in CMS
+ private final String CMS_FV_TABLE = "//div[@id='center']/div/div/table";
+
+ @BeforeMethod(groups = { "log" })
+ public void loginBeforeTest() {
+ login("admin", "admin");
+ }
+
+ @AfterMethod( groups = { "log" })
+ public void logoutAfterTest() {
+ logout();
+ }
+
+ @Test(enabled = true, description = "File creation and moving to default directory.")
+ public void testMoveFile() {
+ createFile("fileToMove");
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=CMS");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ int row = findTableRow(CMS_FILE_TABLE, "fileToMove", 0) + 1;
+
+ selenium.select("//div[@id='center']/div/div/div[3]/table/tbody/tr[" + row + "]/td[2]/form/select", "label=Move");
+ selenium.click("//div[@id='center']/div/div/div[3]/table/tbody/tr[" + row + "]/td[2]/form/select/option[3]");
+ selenium.click("//div[@id='center']/div/div/div[3]/table/tbody/tr[" + row + "]/td[2]/form/input");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=default");
+ selenium.click("submit");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=default");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isElementPresent("link=fileToMove"));
+
+ selenium.click("link=Home");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertFalse(selenium.isElementPresent("link=fileToMove"));
+ }
+
+ @Test(enabled = true, description = "File creation and copying to default directory.")
+ public void testCopyFile() {
+ createFile("file2copy");
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=CMS");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ int row = findTableRow(CMS_FILE_TABLE, "file2copy", 0) + 1;
+
+ selenium.select("//div[@id='center']/div/div/div[3]/table/tbody/tr[" + row + "]/td[2]/form/select", "label=Copy");
+ selenium.click("//div[@id='center']/div/div/div[3]/table/tbody/tr[" + row + "]/td[2]/form/select/option[3]");
+ selenium.click("//div[@id='center']/div/div/div[3]/table/tbody/tr[" + row + "]/td[2]/form/input");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=default");
+ selenium.click("submit");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=default");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isElementPresent("link=file2copy"));
+
+ selenium.click("link=Home");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isElementPresent("link=file2copy"));
+ }
+
+
+
+ private void createFile(String name) {
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=CMS");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select("//div[@id='center']/div/div/div[1]/div/select", "label=Create File");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.waitForPopUp("_top", PAGE_LOAD);
+ selenium.type("filename", name);
+ selenium.type("description", name + " description");
+ selenium.type("title", "existingFile title");
+ selenium.select("language", "label=Czech");
+ selenium.click("save");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=Approve");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=Home");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(name, selenium.getText("link=" + name));
+ logout();login("admin","admin");
+ }
+}
Property changes on: branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileManipulationTestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileNoWorkflowTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileNoWorkflowTestCase.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileNoWorkflowTestCase.java 2008-09-23 15:12:31 UTC (rev 11952)
@@ -0,0 +1,378 @@
+package org.jboss.portal.test.selenium.cms;
+
+import org.jboss.portal.test.selenium.JBossPortalSeleniumTestCase;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
+ */
+
+@Test(groups = { "cms_file" }, enabled = false)
+public class CMSFileNoWorkflowTestCase extends JBossPortalSeleniumTestCase {
+
+ private final String CMS_FILE_TABLE = "//div[@id='center']/div/div/div[3]/table";
+
+ @BeforeMethod(groups = { "log" })
+ public void loginBeforeTest() {
+ login("admin", "admin");
+ }
+
+ @AfterMethod( groups = { "log" })
+ public void logoutAfterTest() {
+ logout();
+ }
+
+ @Test(enabled = false, description = "Common file structure browsing test.")
+ public void testDefaultBrowsing() {
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=CMS");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isElementPresent("link=default"));
+ selenium.click("link=default");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isElementPresent("link=images"));
+ Assert.assertTrue(selenium.isElementPresent("link=private"));
+ Assert.assertTrue(selenium.isElementPresent("link=index.html"));
+ Assert.assertTrue(selenium.isElementPresent("link=project.html"));
+ Assert.assertTrue(selenium.isElementPresent("link=support.html"));
+ selenium.click("link=index.html");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isElementPresent("link=text/html"));
+ Assert.assertTrue(selenium.isElementPresent("//div[@id='center']/div/div/table/tbody/tr[4]/td[6]"));
+ Assert.assertEquals("JBoss Portal", selenium.getText("//div[@id='center']/div/div/table/tbody/tr[4]/td[6]"));
+ selenium.click("link=Home");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=default");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=images");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isElementPresent("link=logo.gif"));
+ }
+
+ @Test(enabled = false, description = "File properties checking.")
+ public void testFileProperties() {
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=CMS");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.open("/portal/auth/portal/admin/CMS/CMSAdminPortletWindow?op=main&action=2&path=%2F");
+ selenium.click("link=default");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=index.html");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+
+
+ Assert.assertEquals("text/html", selenium.getText("link=text/html"));
+ Assert.assertEquals("English", selenium.getText("link=English"));
+ Assert.assertEquals("Type", selenium.getText("//div[@id='center']/div/div/table/tbody/tr[3]/td[1]/b"));
+ Assert.assertEquals("Size", selenium.getText("//div[@id='center']/div/div/table/tbody/tr[3]/td[2]/b"));
+ Assert.assertEquals("Version", selenium.getText("//div[@id='center']/div/div/table/tbody/tr[3]/td[3]/b"));
+ Assert.assertEquals("Created", selenium.getText("//div[@id='center']/div/div/table/tbody/tr[3]/td[4]/b"));
+ Assert.assertEquals("Modified", selenium.getText("//div[@id='center']/div/div/table/tbody/tr[3]/td[5]/b"));
+ Assert.assertEquals("Title", selenium.getText("//div[@id='center']/div/div/table/tbody/tr[3]/td[6]/b"));
+
+ Assert.assertEquals("2kb", selenium.getText("//div[@id='center']/div/div/table/tbody/tr[4]/td[2]"));
+ Assert.assertEquals("1.0", selenium.getText("//div[@id='center']/div/div/table/tbody/tr[4]/td[3]"));
+ Assert.assertEquals("JBoss Portal", selenium.getText("//div[@id='center']/div/div/table/tbody/tr[4]/td[6]"));
+
+ Assert.assertEquals("index.html", selenium.getText("//div[@id='center']/div/div/ul/li[5]"));
+ Assert.assertEquals("Manage Content", selenium.getText("//div[@id='center']/div/h3"));
+
+ Assert.assertTrue(selenium.isElementPresent("//div[@id='center']/div/div/div/div/select/option[.='Create']"));
+ Assert.assertTrue(selenium.isElementPresent("//div[@id='center']/div/div/div/div/select/option[.='Copy']"));
+ Assert.assertTrue(selenium.isElementPresent("//div[@id='center']/div/div/div/div/select/option[.='Move']"));
+ Assert.assertTrue(selenium.isElementPresent("//div[@id='center']/div/div/div/div/select/option[.='Delete']"));
+ Assert.assertTrue(selenium.isElementPresent("//div[@id='center']/div/div/div/div/select/option[.='Secure']"));
+
+ }
+
+ @Test(enabled = true, description = "Simple file creation.")
+ public void testCreateFile() {
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=CMS");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select("//div[@id='center']/div/div/div[1]/div/select", "label=Create File");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.waitForPopUp("_top", PAGE_LOAD);
+ selenium.type("filename", "newFile");
+ selenium.type("description", "newFile description");
+ selenium.type("title", "newFile title");
+ selenium.select("language", "label=Czech");
+ selenium.click("save");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertEquals("Czech", selenium.getText("link=Czech"));
+ Assert.assertEquals("text/plain", selenium.getText("link=text/plain"));
+ Assert.assertEquals("1.0", selenium.getText("//div[@id='center']/div/div/table/tbody/tr[4]/td[3]"));
+ Assert.assertEquals("0kb", selenium.getText("//div[@id='center']/div/div/table/tbody/tr[4]/td[2]"));
+ Assert.assertEquals("newFile title", selenium.getText("//div[@id='center']/div/div/table/tbody/tr[4]/td[6]"));
+ selenium.click("link=Home");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertEquals("newFile", selenium.getText("link=newFile"));
+
+ }
+
+ @Test(enabled = false, description = "Editing of file.")
+ public void testEditFile() {
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=CMS");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select("//div[@id='center']/div/div/div[1]/div/select", "label=Create File");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.waitForPopUp("_top", PAGE_LOAD);
+ selenium.type("filename", "file2edit");
+ selenium.type("description", "file2edit description");
+ selenium.type("title", "file2edit title");
+ selenium.select("language", "label=Czech");
+ selenium.selectFrame("mce_editor_0");
+
+ String s = selenium.getEval("document.getElementById('mce_editor_0')contentDocument.body.innerHTML=\"jaja\"");
+ //System.out.println(s);
+
+ ////*[@id="mce_editor_0"]
+ selenium.type("elm1","it's nice to work for RH");
+ selenium.selectFrame("_top");
+ selenium.click("save");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int row = findTableRow("//div[@id='center']/div/div/table", "1.0", 2)+1;
+
+ Assert.assertEquals("Czech", selenium.getText("link=Czech"));
+ Assert.assertEquals("text/plain", selenium.getText("link=text/plain"));
+ Assert.assertEquals("1.0", selenium.getText("//div[@id='center']/div/div/table/tbody/tr["+ row +"]/td[3]"));
+ Assert.assertEquals("0kb", selenium.getText("//div[@id='center']/div/div/table/tbody/tr["+ row +"]/td[2]"));
+ Assert.assertEquals("file2edit title", selenium.getText("//div[@id='center']/div/div/table/tbody/tr["+ row +"]/td[6]"));
+
+ selenium.click("link=text/plain");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("save");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("1.1"));
+ Assert.assertTrue(selenium.isElementPresent("//div[@id='center']/div/div/table/tbody/tr[5]/td[3]/img"));
+
+
+ selenium.click("link=Home");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertEquals("file2edit", selenium.getText("link=file2edit"));
+
+ }
+
+ @Test(enabled = false, dependsOnMethods = "testDeleteFile", description = "Creation of existing file.")
+ public void testCreateExistingFile() {
+ String filename = "existingFile";
+
+ createFile(filename);
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=CMS");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select("//div[@id='center']/div/div/div[1]/div/select", "label=Create File");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.waitForPopUp("_top", PAGE_LOAD);
+ selenium.type("filename", "existingFile");
+ selenium.type("description", "existingFile description");
+ selenium.type("title", "existingFile title");
+ selenium.select("language", "label=Czech");
+ selenium.click("save");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertEquals("Czech", selenium.getText("link=Czech"));
+ Assert.assertEquals("text/plain", selenium.getText("link=text/plain"));
+ Assert.assertTrue(selenium.isTextPresent("1.0"));
+ Assert.assertTrue(selenium.isTextPresent("1.1"));
+ Assert.assertFalse(selenium.isTextPresent("1.2"));
+ selenium.click("link=Home");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertEquals("existingFile", selenium.getText("link=" + filename));
+
+ deleteFile(filename);
+ }
+
+ @Test(enabled = false, description = "File creation and moving to default directory.")
+ public void testMoveFile() {
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=CMS");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select("//div[@id='center']/div/div/div[1]/div/select", "label=Create File");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.waitForPopUp("_top", PAGE_LOAD);
+ selenium.type("filename", "fileToMove");
+ selenium.type("description", "fileToMove description");
+ selenium.type("title", "fileToMove title");
+ selenium.select("language", "label=Czech");
+ selenium.click("save");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertEquals("Czech", selenium.getText("link=Czech"));
+ Assert.assertEquals("text/plain", selenium.getText("link=text/plain"));
+ Assert.assertEquals("1.0", selenium.getText("//div[@id='center']/div/div/table/tbody/tr[4]/td[3]"));
+ Assert.assertEquals("0kb", selenium.getText("//div[@id='center']/div/div/table/tbody/tr[4]/td[2]"));
+ Assert.assertEquals("fileToMove title", selenium.getText("//div[@id='center']/div/div/table/tbody/tr[4]/td[6]"));
+ selenium.click("link=Home");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertEquals("fileToMove", selenium.getText("link=fileToMove"));
+
+ int row = findTableRow(CMS_FILE_TABLE, "fileToMove", 0)+1;
+
+ selenium.select("//div[@id='center']/div/div/div[3]/table/tbody/tr["+row+"]/td[2]/form/select", "label=Move");
+ selenium.click("//div[@id='center']/div/div/div[3]/table/tbody/tr["+row+"]/td[2]/form/select/option[3]");
+ selenium.click("//div[@id='center']/div/div/div[3]/table/tbody/tr["+row+"]/td[2]/form/input");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=default");
+ selenium.click("submit");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=default");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isElementPresent("link=fileToMove"));
+
+ selenium.click("link=Home");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertFalse(selenium.isElementPresent("link=fileToMove"));
+ }
+
+ @Test(enabled = false, description = "File creation and copying to default directory.")
+ public void testCopyFile() {
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=CMS");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select("//div[@id='center']/div/div/div[1]/div/select", "label=Create File");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.waitForPopUp("_top", PAGE_LOAD);
+ selenium.type("filename", "file2copy");
+ selenium.type("description", "file2copy description");
+ selenium.type("title", "file2copy title");
+ selenium.select("language", "label=Czech");
+ selenium.click("save");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int row = findTableRow("//div[@id='center']/div/div/table", "1.0", 2)+1;
+
+ Assert.assertEquals("Czech", selenium.getText("link=Czech"));
+ Assert.assertEquals("text/plain", selenium.getText("link=text/plain"));
+ Assert.assertEquals("1.0", selenium.getText("//div[@id='center']/div/div/table/tbody/tr["+row+"]/td[3]"));
+ Assert.assertEquals("0kb", selenium.getText("//div[@id='center']/div/div/table/tbody/tr["+row+"]/td[2]"));
+ Assert.assertEquals("file2copy title", selenium.getText("//div[@id='center']/div/div/table/tbody/tr["+row+"]/td[6]"));
+ selenium.click("link=Home");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertEquals("file2copy", selenium.getText("link=file2copy"));
+
+ row = findTableRow(CMS_FILE_TABLE, "file2copy", 0)+1;
+
+ selenium.select("//div[@id='center']/div/div/div[3]/table/tbody/tr["+row+"]/td[2]/form/select", "label=Copy");
+ selenium.click("//div[@id='center']/div/div/div[3]/table/tbody/tr["+row+"]/td[2]/form/select/option[3]");
+ selenium.click("//div[@id='center']/div/div/div[3]/table/tbody/tr["+row+"]/td[2]/form/input");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=default");
+ selenium.click("submit");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=default");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isElementPresent("link=file2copy"));
+
+ selenium.click("link=Home");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isElementPresent("link=file2copy"));
+ }
+
+ @Test(enabled = false, description = "Not implemented!")
+ public void testMoveOverwriteFile() {
+
+ }
+
+ @Test(enabled = false, description = "Not implemented!")
+ public void testMoveNotOverwriteFile() {
+
+ }
+
+ @Test(enabled = false, dependsOnMethods = "testCreateFile", description = "Simple file delete.")
+ public void testDeleteFile() {
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=CMS");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.select("//div[@id='center']/div/div/div[3]/table/tbody/tr[3]/td[2]/form/select", "label=Delete");
+ selenium.click("//div[@id='center']/div/div/div[3]/table/tbody/tr[3]/td[2]/form/select/option[4]");
+ selenium.click("//div[@id='center']/div/div/div[3]/table/tbody/tr[3]/td[2]/form/input");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("Confirm Deletion of /newFile"));
+ Assert.assertTrue(selenium.isTextPresent("WARNING! You will not be able to undo these change!"));
+ Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this resource?"));
+ selenium.click("cancel");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select("//div[@id='center']/div/div/div[3]/table/tbody/tr[3]/td[2]/form/select", "label=Delete");
+ selenium.click("//div[@id='center']/div/div/div[3]/table/tbody/tr[3]/td[2]/form/select/option[4]");
+ selenium.click("//div[@id='center']/div/div/div[3]/table/tbody/tr[3]/td[2]/form/input");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("Confirm Deletion of /newFile"));
+ Assert.assertTrue(selenium.isTextPresent("WARNING! You will not be able to undo these change!"));
+ Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this resource?"));
+ selenium.click("submit");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
+
+ @Test(enabled = false)
+ public void testDeleteCancelFile() {
+
+ }
+
+ private void createFile(String name) {
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=CMS");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select("//div[@id='center']/div/div/div[1]/div/select", "label=Create File");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.waitForPopUp("_top", PAGE_LOAD);
+ selenium.type("filename", name);
+ selenium.type("description", name + " description");
+ selenium.type("title", "existingFile title");
+ selenium.select("language", "label=Czech");
+ selenium.click("save");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertEquals("Czech", selenium.getText("link=Czech"));
+ Assert.assertEquals("text/plain", selenium.getText("link=text/plain"));
+ Assert.assertEquals("1.0", selenium.getText("//div[@id='center']/div/div/table/tbody/tr[4]/td[3]"));
+ Assert.assertEquals("0kb", selenium.getText("//div[@id='center']/div/div/table/tbody/tr[4]/td[2]"));
+ Assert.assertEquals(name + " title", selenium.getText("//div[@id='center']/div/div/table/tbody/tr[4]/td[6]"));
+ selenium.click("link=Home");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertEquals(name, selenium.getText("link=" + name));
+ logout();login("admin","admin");
+ }
+
+ private void deleteFile(String name) {
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=CMS");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.select("//div[@id='center']/div/div/div[3]/table/tbody/tr[3]/td[2]/form/select", "label=Delete");
+ selenium.click("//div[@id='center']/div/div/div[3]/table/tbody/tr[3]/td[2]/form/select/option[4]");
+ selenium.click("//div[@id='center']/div/div/div[3]/table/tbody/tr[3]/td[2]/form/input");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent("Confirm Deletion of /" + name));
+ Assert.assertTrue(selenium.isTextPresent("WARNING! You will not be able to undo these change!"));
+ Assert.assertTrue(selenium.isTextPresent("Are you sure you want to delete this resource?"));
+ selenium.click("submit");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ logout();login("admin","admin");
+ }
+}
Property changes on: branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileNoWorkflowTestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Modified: branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2008-09-23 14:53:05 UTC (rev 11951)
+++ branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSSecureTestCase.java 2008-09-23 15:12:31 UTC (rev 11952)
@@ -1,7 +1,10 @@
package org.jboss.portal.test.selenium.cms;
+import java.text.MessageFormat;
+
import org.jboss.portal.test.selenium.IdentityAdminTestCase;
import org.jboss.portal.test.selenium.JBossPortalSeleniumTestCase;
+import org.jboss.portal.test.selenium.portal.AdminPortalTestCase;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
@@ -14,7 +17,22 @@
@Test(groups = { "cms_secure" }, enabled = true, description = "Setting permissions on the default portlet.")
public class CMSSecureTestCase extends JBossPortalSeleniumTestCase {
- //@AfterMethod()
+ private static final String SELECT_CMS_ACTION = "//div[@id='center']/div/div/div[1]/div/select";
+
+ @AfterMethod(groups = { "log" })
+ public void logoutAfterTestIfPossible() {
+
+ selenium.open("/portal/");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ if (selenium.isElementPresent("link=Logout")) {
+ selenium.click("link=Logout");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
+
+ resetSecurity();
+ }
+
+ // @AfterMethod()
private void resetSecurity() {
login("admin", "admin");
selenium.click("link=Admin");
@@ -25,7 +43,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=index.html");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select("//div[@id='center']/div/div/div/div/select", "label=Secure");
+ selenium.select(SELECT_CMS_ACTION, "label=Secure");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.select("secureroles:read", "label=Anonymous");
selenium.select("secureusers:read", "label=admin");
@@ -78,29 +96,28 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=index.html");
selenium.waitForPageToLoad(PAGE_LOAD);
-
-
- selenium.select("//div[@id='center']/div/div/div/div/select", "label=Secure");
+
+ selenium.select(SELECT_CMS_ACTION, "label=Secure");
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.select("secureroles:read", "label=Administrators");
selenium.select("secureusers:read", "label=admin");
-
+
selenium.click("submit");
selenium.waitForPageToLoad(PAGE_LOAD);
logout();
Assert.assertTrue(selenium.isTextPresent("Access Denied"));
- Assert.assertTrue(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
+ //Assert.assertTrue(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
login("user", "user");
Assert.assertTrue(selenium.isTextPresent("Access Denied"));
- Assert.assertTrue(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
+ //Assert.assertTrue(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
logout();
-
+
resetSecurity();
}
@@ -119,7 +136,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=index.html");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select("//div[@id='center']/div/div/div/div/select", "label=Secure");
+ selenium.select(SELECT_CMS_ACTION, "label=Secure");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.select("secureroles:read", "label=Administrators");
selenium.select("secureusers:read", "label=user");
@@ -129,15 +146,15 @@
logout();
Assert.assertTrue(selenium.isTextPresent("Access Denied"));
- Assert.assertTrue(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
+ //Assert.assertTrue(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
login("user", "user");
Assert.assertFalse(selenium.isTextPresent("Access Denied"));
- Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
+ //Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
logout();
-
+
resetSecurity();
}
@@ -158,7 +175,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=index.html");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select("//div[@id='center']/div/div/div/div/select", "label=Secure");
+ selenium.select(SELECT_CMS_ACTION, "label=Secure");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.select("secureroles:read", "label=secRoleDisp");
selenium.select("secureusers:read", "label=admin");
@@ -168,15 +185,15 @@
logout();
Assert.assertTrue(selenium.isTextPresent("Access Denied"));
- Assert.assertTrue(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
+ //Assert.assertTrue(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
login("user", "user");
Assert.assertFalse(selenium.isTextPresent("Access Denied"));
- Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
+ //Assert.assertFalse(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
logout();
-
+
resetSecurity();
}
@@ -197,7 +214,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=index.html");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select("//div[@id='center']/div/div/div/div/select", "label=Secure");
+ selenium.select(SELECT_CMS_ACTION, "label=Secure");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.select("secureroles:read", "label=secRoleDisp");
selenium.select("secureusers:read", "label=admin");
@@ -207,20 +224,20 @@
logout();
Assert.assertTrue(selenium.isTextPresent("Access Denied"));
- Assert.assertTrue(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
+ //Assert.assertTrue(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
login("user", "user");
Assert.assertTrue(selenium.isTextPresent("Access Denied"));
- Assert.assertTrue(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
+ //Assert.assertTrue(selenium.isTextPresent("You are not allowed to access the following resource - /default/index.html"));
logout();
-
+
resetSecurity();
}
-
+
@Test(enabled = false, description = "Recursive permission test")
- public void testRecursiveSecurity(){
+ public void testRecursiveSecurity() {
login("admin", "admin");
deassignRole("user", "user(a)portal.com", "secRole", "secRoleDisp");
@@ -236,7 +253,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=index.html");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select("//div[@id='center']/div/div/div/div/select", "label=Secure");
+ selenium.select(SELECT_CMS_ACTION, "label=Secure");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.select("secureroles:read", "label=secRoleDisp");
selenium.select("secureusers:read", "label=admin");
@@ -246,15 +263,19 @@
logout();
resetSecurity();
}
-
+
@Test(enabled = true, description = "Subpage permission test")
- public void testSubpageSecurity(){
+ public void testSubpageSecurity() {
selenium.open("/portal/portal/default");
- Assert.assertTrue(selenium.isTextPresent("Thank you for downloading and deploying JBoss Portal. We hope your enjoy working with it as much as we enjoy developing it!"));
+
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium
+ .isTextPresent("Thank you for downloading and deploying JBoss Portal. We hope your enjoy working with it as much as we enjoy developing it!"));
selenium.click("link=Explore");
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertFalse(selenium.isTextPresent("Thank you for downloading and deploying JBoss Portal. We hope your enjoy working with it as much as we enjoy developing it!"));
-
+ Assert.assertFalse(selenium
+ .isTextPresent("Thank you for downloading and deploying JBoss Portal. We hope your enjoy working with it as much as we enjoy developing it!"));
+
login("admin", "admin");
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -264,7 +285,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=support.html");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select("//div[@id='center']/div/div/div/div/select", "label=Secure");
+ selenium.select(SELECT_CMS_ACTION, "label=Secure");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.select("secureroles:read", "label=Administrators");
selenium.select("secureusers:read", "label=admin");
@@ -276,23 +297,25 @@
selenium.waitForPageToLoad(PAGE_LOAD);
logout();
- Assert.assertTrue(selenium.isTextPresent("Thank you for downloading and deploying JBoss Portal. We hope your enjoy working with it as much as we enjoy developing it!"));
+ Assert.assertTrue(selenium
+ .isTextPresent("Thank you for downloading and deploying JBoss Portal. We hope your enjoy working with it as much as we enjoy developing it!"));
selenium.open("/portal/portal/default");
selenium.click("link=Explore");
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent("Thank you for downloading and deploying JBoss Portal. We hope your enjoy working with it as much as we enjoy developing it!"));
-
+ Assert.assertTrue(selenium
+ .isTextPresent("Thank you for downloading and deploying JBoss Portal. We hope your enjoy working with it as much as we enjoy developing it!"));
+
resetSecurity();
}
- private void assignRole(String user, String email, String role, String roleDisplay) {
+ void assignRole(String user, String email, String role, String roleDisplay) {
searchUser(user, email);
- selenium.click(butSeaUsrRol_id(user));
+ selenium.click(butUsrRol_id(user));
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent(roleDisplay), "Role display name: " + roleDisplay + " not found on the page.");
- final String ID_CHECK_ROLE = "//input[@name='_id28jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:roles' and @value='" + role + "']";
+ final String ID_CHECK_ROLE = "//input[@name='assign-roles-form:roles' and @value='" + role + "']";
selenium.click(ID_CHECK_ROLE);
@@ -301,37 +324,36 @@
searchUser(user, email);
- selenium.click(butSeaUsrRol_id(user));
+ selenium.click(butUsrRol_id(user));
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isChecked(ID_CHECK_ROLE), "The role wasn't correctly assigned.");
}
- private void deassignRole(String user, String email, String role, String roleDisplay) {
+ void deassignRole(String user, String email, String role, String roleDisplay) {
searchUser(user, email);
- selenium.click(butSeaUsrRol_id(user));
+ selenium.click(butUsrRol_id(user));
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent(roleDisplay), "Role display name: " + roleDisplay + " not found on the page.");
- // uncheck the tempRole check box
- final String ID_CHECK_ROLE = "//input[@name='_id28jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:roles' and @value='" + role + "']";
- Assert.assertTrue(selenium.isChecked(ID_CHECK_ROLE), "Role to unassign wasn't really assigned (checked).");
+ // check the tempRole check box
+ final String ID_CHECK_ROLE = "//input[@name='assign-roles-form:roles' and @value='" + role + "']";
selenium.click(ID_CHECK_ROLE);
selenium.click(IdentityAdminTestCase.ID_SUBMIT_ASSIGN_ROLE);
selenium.waitForPageToLoad(PAGE_LOAD);
searchUser(user, email);
- selenium.click(butSeaUsrRol_id(user));
+ selenium.click(butUsrRol_id(user));
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertFalse(selenium.isChecked(ID_CHECK_ROLE), "Unassigned role is assigned (checked).");
}
- private void searchUser(String username, String email) {
+ void searchUser(String username, String email) {
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
@@ -342,7 +364,7 @@
clickIfVisible(IdentityAdminTestCase.ID_LINK_USERTAB);
clickIfVisible(IdentityAdminTestCase.ID_LINK_USERMAIN);
- selenium.click(IdentityAdminTestCase.ID_BUT_SEARCH_USER);
+ selenium.click(IdentityAdminTestCase.LINK_SEARCH_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.type(IdentityAdminTestCase.ID_INPUT_SEARCH_USER, username);
@@ -353,10 +375,9 @@
Assert.assertTrue(selenium.isTextPresent(email), "User email adress was not found.");
}
- private String butSeaUsrRol_id(String userName) {
- String table = "_id28jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:userlist";
+ private String butUsrRol_id(String userName) {
+ String table = IdentityAdminTestCase.TABLE_USERLIST;
int r = findTableRow(table, userName, 0);
- return "_id28jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:userlist:" + (r - 1)
- + ":_id51jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj";
+ return MessageFormat.format(IdentityAdminTestCase.LINK_T_USRLIST_ROLES, r - 1);
}
}
17 years, 7 months
JBoss Portal SVN: r11951 - branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2008-09-23 10:53:05 -0400 (Tue, 23 Sep 2008)
New Revision: 11951
Modified:
branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
Log:
indentityadmin test
Modified: branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2008-09-22 16:50:21 UTC (rev 11950)
+++ branches/JBoss_Portal_Branch_2_6/testsuite/ui-tests/src/org/jboss/portal/test/selenium/IdentityAdminTestCase.java 2008-09-23 14:53:05 UTC (rev 11951)
@@ -1,5 +1,7 @@
package org.jboss.portal.test.selenium;
+import java.text.MessageFormat;
+
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
@@ -14,60 +16,61 @@
@Test(groups = { "admin_ui" }, enabled = true)
public class IdentityAdminTestCase extends JBossPortalSeleniumTestCase {
- public static final String ID_SUBMIT_CONF_CREATE_USER = "_id25jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:admin";
- public static final String ID_SUBMIT_DELETE_ROLE = "_id31jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:_id33jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj";
- //private static final String ID_BUT_DELETE_ROLE = "_id21jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:userlist:2:_id38jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj";
- public static final String ID_SUBMIT_ROLE_CREATE = "_id24jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:_id29jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj";
- public static final String ID_INPUT_ROLEDISNAME = "_id24jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:roledisplayname";
- public static final String ID_INPUT_ROLENAME = "_id24jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:rolename";
- public static final String ID_BUT_ROLE_CREATE = "_id43jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:_id45jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj";
- public static final String ID_BUT_SUBMIT_DEL_USER = "_id32jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:_id34jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj";
- //private static final String ID_BUT_USER_DELETE = "_id28jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:userlist:0:_id60jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj";
- public static final String ID_SUBMIT_ASSIGN_ROLE = "_id28jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:_id31jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj";
- //private static final String ID_BUT_SEARCHED_USER_ROLES = "_id28jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:userlist:0:_id51jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj";
- public static final String ID_SUBMIT_CREATE_USER = "_id25jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:submit";
- public static final String ID_INPUT_PASSWORD_CHK = "_id25jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:passwordCheck";
- public static final String ID_INPUT_PASSWORD = "_id25jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:password";
- public static final String ID_INPUT_USEREMAIL = "_id25jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:email";
- public static final String ID_INPUT_USERNAME = "_id25jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:username";
- public static final String ID_SUBMIT_SEARCH_USER = "_id24jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:search";
- public static final String ID_INPUT_SEARCH_USER = "_id24jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:searchString";
- public static final String ID_BUT_SEARCH_USER = "_id20jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:_id22jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj";
- public static final String ID_LINK_USERTAB = "_id1jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:_id3jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj";
- public static final String ID_LINK_USERMAIN = "_id9jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:_id12jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj";
- public static final String ID_LINK_ROLETAB = "_id1jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:_id5jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj";
- public static final String ID_LINK_ROLEMAIN = "_id9jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:_id12jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj";
- public static final String ID_LINK_CREATE_USER = "_id20jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:_id23jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj";
-
- private String butSeaUsrRol_id(String userName){
- String table ="_id28jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:userlist";
+ public static final String LINK_T_USRLIST_DEL = "search-user-form1:userlist:{0}:delete-user-link";
+ public static final String LINK_T_USRLIST_ROLES = "search-user-form1:userlist:{0}:assign-role-link";
+ public static final String LINK_T_ROLLIST_DEL = "roles-form:userlist:{0}:delete-role-link";
+ public static final String TABLE_ROLELIST = "roles-form:userlist";
+ public static final String TABLE_USERLIST = "search-user-form1:userlist";
+ public static final String ID_SUBMIT_CONF_CREATE_USER = "confirm-form:admin";
+ public static final String ID_SUBMIT_DELETE_ROLE = "delete-role-form:confirm";
+ public static final String ID_SUBMIT_ROLE_CREATE = "create-role-form:submit";
+ public static final String ID_INPUT_ROLEDISNAME = "create-role-form:roledisplayname";
+ public static final String ID_INPUT_ROLENAME = "create-role-form:rolename";
+ public static final String ID_BUT_ROLE_CREATE = "create-role-form:create-role-link";
+ public static final String ID_BUT_SUBMIT_DEL_USER = "delete-user-form:submit";
+ public static final String ID_SUBMIT_ASSIGN_ROLE = "assign-roles-form:submit";
+ public static final String ID_SUBMIT_USER_ROLE = "register-role-form:submit";
+ public static final String ID_SUBMIT_CREATE_USER = "register-form:submit";
+ public static final String ID_INPUT_PASSWORD_CHK = "register-form:passwordCheck";
+ public static final String ID_INPUT_PASSWORD = "register-form:password";
+ public static final String ID_INPUT_USEREMAIL = "register-form:email";
+ public static final String ID_INPUT_USERNAME = "register-form:username";
+ public static final String ID_SUBMIT_SEARCH_USER = "search-user-form:search";
+ public static final String ID_INPUT_SEARCH_USER = "search-user-form:searchString";
+ public static final String LINK_SEARCH_USER = "user-form:search-user-link";
+ public static final String ID_LINK_USERTAB = "role-temp-form:manage-users";
+ public static final String ID_LINK_USERMAIN = "user-temp-form1:user-adm-link";
+ public static final String ID_LINK_ROLETAB = "user-temp-form:role-mgm-link";
+ public static final String ID_LINK_ROLEMAIN = "role-temp-form1:role-mgm-link";
+ public static final String LINK_USERMANG_MAIN = "user-temp-form1:assign-role-link";
+ public static final String LINK_USERMANG_MAIN2 = "user-temp-form1:user-mgm-link";
+ public static final String ID_LINK_CREATE_USER = "user-form:create-user-link";
+
+ public static final String ID_CHECK_ROLE = "//input[@name=''assign-roles-form:roles'' and @value=''{0}'']";
+
+ private String butDelUsr_id(String userName) {
+ String table = TABLE_USERLIST;
int r = findTableRow(table, userName, 0);
- return "_id28jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:userlist:"+(r-1)+":_id51jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj";
+ return MessageFormat.format(LINK_T_USRLIST_DEL, r - 1);
}
-
- private String butDelUsr_id(String userName){
- String table = "_id28jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:userlist";
- int r = findTableRow(table, userName, 0);
- return "_id28jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:userlist:"+(r-1)+":_id60jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj";
- }
-
- private String butDelRol_id(String roleName){
- String table = "_id21jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:userlist";
+
+ private String butDelRol_id(String roleName) {
+ String table = TABLE_ROLELIST;
int r = findTableRow(table, roleName, 0);
- return "_id21jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:userlist:"+(r-1)+":_id38jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj";
+ return MessageFormat.format(LINK_T_ROLLIST_DEL, r - 1);
}
-
- private String butUsrRol_id(String userName){
- String table ="_id28jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:userlist";
+
+ private String butUsrRol_id(String userName) {
+ String table = TABLE_USERLIST;
int r = findTableRow(table, userName, 0);
- return "_id28jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:userlist:"+(r-1)+":_id51jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj";
+ return MessageFormat.format(LINK_T_USRLIST_ROLES, r - 1);
}
-
+
@BeforeMethod(groups = { "log" })
public void loginBeforeTest() {
login("admin", "admin");
- }
-
+ }
+
@AfterMethod(groups = { "log" })
public void logoutAfterTest() {
logout();
@@ -115,60 +118,61 @@
createUser(user, "tempPassword", userMail);
createRole(role, "tempRoleDisplay");
assignRole(user, userMail, role, roleDisplay);
-
+
deassignRole(user, userMail, role, roleDisplay);
deleteRole(role);
deleteUser(user, userMail);
}
- private void assignRole(String user, String email, String role, String roleDisplay) {
+ void assignRole(String user, String email, String role, String roleDisplay) {
searchUser(user, email);
- selenium.click(butSeaUsrRol_id(user));
+ selenium.click(butUsrRol_id(user));
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent(roleDisplay), "Role display name: " + roleDisplay + " not found on the page.");
- final String ID_CHECK_ROLE = "//input[@name='_id28jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:roles' and @value='" + role + "']";
+ final String CHECK_ROLE = MessageFormat.format(this.ID_CHECK_ROLE, role);
+ selenium.click(CHECK_ROLE);
- selenium.click(ID_CHECK_ROLE);
-
selenium.click(ID_SUBMIT_ASSIGN_ROLE);
selenium.waitForPageToLoad(PAGE_LOAD);
searchUser(user, email);
- selenium.click(butSeaUsrRol_id(user));
+ selenium.click(butUsrRol_id(user));
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isChecked(ID_CHECK_ROLE), "The role wasn't correctly assigned.");
+ Assert.assertTrue(selenium.isChecked(CHECK_ROLE), "The role wasn't correctly assigned.");
}
- private void deassignRole(String user, String email, String role, String roleDisplay) {
+ void deassignRole(String user, String email, String role, String roleDisplay) {
searchUser(user, email);
- selenium.click(butSeaUsrRol_id(user));
+ selenium.click(butUsrRol_id(user));
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent(roleDisplay), "Role display name: " + roleDisplay + " not found on the page.");
// check the tempRole check box
- final String ID_CHECK_ROLE = "//input[@name='_id28jbpns_2fadmin_2fMembers_2fIdentityAdminPortletWindowsnpbj:roles' and @value='" + role + "']";
- selenium.click(ID_CHECK_ROLE);
+ final String CHECK_ROLE = MessageFormat.format(this.ID_CHECK_ROLE, role);
+ selenium.click(CHECK_ROLE);
selenium.click(ID_SUBMIT_ASSIGN_ROLE);
selenium.waitForPageToLoad(PAGE_LOAD);
searchUser(user, email);
- selenium.click(butSeaUsrRol_id(user));
+ selenium.click(butUsrRol_id(user));
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertFalse(selenium.isChecked(ID_CHECK_ROLE), "Unassigned role is assigned (checked).");
+ Assert.assertFalse(selenium.isChecked(CHECK_ROLE), "Unassigned role is assigned (checked).");
}
- private void createUser(String username, String password, String email) {
+ void createUser(String username, String password, String email) {
selenium.open("/portal/auth/portal/default");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -194,7 +198,7 @@
Assert.assertFalse(selenium.isTextPresent("This username is already taken. tempUser"), "User already exists.");
- selenium.click(ID_SUBMIT_ASSIGN_ROLE);
+ selenium.click(ID_SUBMIT_USER_ROLE);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Confirmation"), "Confirmation screen is missing or corrupted.");
@@ -206,6 +210,8 @@
private void createExistingUser(String username, String password, String email) {
selenium.open("/portal/auth/portal/default");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Members");
@@ -228,7 +234,7 @@
}
- private void searchUser(String username, String email) {
+ void searchUser(String username, String email) {
selenium.open("/portal/");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=Admin");
@@ -238,8 +244,9 @@
clickIfVisible(ID_LINK_USERTAB);
clickIfVisible(ID_LINK_USERMAIN);
+ clickIfVisible(LINK_USERMANG_MAIN);
- selenium.click(ID_BUT_SEARCH_USER);
+ selenium.click(LINK_SEARCH_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.type(ID_INPUT_SEARCH_USER, username);
@@ -261,15 +268,19 @@
clickIfVisible(ID_LINK_USERTAB);
// user home page
clickIfVisible(ID_LINK_USERMAIN);
+ clickIfVisible(LINK_USERMANG_MAIN);
+ clickIfVisible(LINK_USERMANG_MAIN2);
- selenium.click(ID_BUT_SEARCH_USER);
+ selenium.click(LINK_SEARCH_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.type(ID_INPUT_SEARCH_USER, username);
selenium.click(ID_SUBMIT_SEARCH_USER);
selenium.waitForPageToLoad(PAGE_LOAD);
+
Assert.assertTrue(selenium.isTextPresent(username), "Username was not found.");
Assert.assertTrue(selenium.isTextPresent(email), "User e-mail adress was not found.");
+
selenium.click(butDelUsr_id(username));
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(ID_BUT_SUBMIT_DEL_USER);
@@ -316,9 +327,9 @@
clickIfVisible(ID_LINK_ROLEMAIN);
Assert.assertTrue(selenium.isTextPresent(roleName), "Role name is missing");
-
+
selenium.click(butDelRol_id(roleName));
-
+
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isTextPresent("Warning! You are about to delete the role " + roleName),
"Confirmation text for role deletion missing missing.");
17 years, 7 months
JBoss Portal SVN: r11950 - in branches/JBoss_Portal_Branch_2_7: core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers and 1 other directories.
by portal-commits@lists.jboss.org
Author: prabhat.jha(a)jboss.com
Date: 2008-09-22 12:50:21 -0400 (Mon, 22 Sep 2008)
New Revision: 11950
Modified:
branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/jsf/admin/assignRoles.xhtml
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/editConsumer.xhtml
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/producer/producer.xhtml
Log:
[JBPORTAL-2101] adding ids to identity admin ui
[JBPORTAL-2103] adding ids to wsrp admin ui
Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/jsf/admin/assignRoles.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/jsf/admin/assignRoles.xhtml 2008-09-22 16:18:30 UTC (rev 11949)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/jsf/admin/assignRoles.xhtml 2008-09-22 16:50:21 UTC (rev 11950)
@@ -10,7 +10,7 @@
<ui:define name="title">
<li class="pathItem">
- <h:commandLink action="userAdmin" value="#{bundle.IDENTITY_MANAGEMENT_USER_MANAGEMENT}" />
+ <h:commandLink id="assign-role-link" action="userAdmin" value="#{bundle.IDENTITY_MANAGEMENT_USER_MANAGEMENT}" />
</li>
<li class="pathSeparator"><h:graphicImage url="/img/pathSeparator.png" alt=">"/></li>
<li class="pathItem">
Modified: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/editConsumer.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/editConsumer.xhtml 2008-09-22 16:18:30 UTC (rev 11949)
+++ branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/consumers/editConsumer.xhtml 2008-09-22 16:50:21 UTC (rev 11950)
@@ -95,7 +95,7 @@
<td>#{prop.value.name}</td>
<td>#{prop.value.description.label.value}</td>
<td>
- <h:inputText value="#{prop.value.value}" size="50"
+ <h:inputText id="prop-value-input" value="#{prop.value.value}" size="50"
valueChangeListener="#{consumer.regPropListener}"
disabled="#{consumer.registrationModified}"/>
<h:outputText styleClass="portlet-msg-error" value="#{prop.value.status}"
@@ -141,7 +141,7 @@
<td>#{prop.value.name}</td>
<td>#{prop.value.description.label.value}</td>
<td>
- <h:inputText value="#{prop.value.value}" size="50"/>
+ <h:inputText id="prop-value-input" value="#{prop.value.value}" size="50"/>
<h:outputText styleClass="portlet-msg-error" value="#{prop.value.status}"
rendered="#{prop.value.determinedInvalid}"
converter="faces.convert.RegistrationProperty.Status"/>
Modified: branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/producer/producer.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/producer/producer.xhtml 2008-09-22 16:18:30 UTC (rev 11949)
+++ branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/jsf/producer/producer.xhtml 2008-09-22 16:50:21 UTC (rev 11950)
@@ -40,7 +40,7 @@
<h:panelGroup styleClass="portlet-area-body">
<c:choose>
<c:when test="#{!empty producer.registrationProperties}">
- <h:dataTable id="producer-data-table" var="property" id="registrationProperties" width="100%"
+ <h:dataTable id="reg-properties" var="property" width="100%"
value="#{producer.registrationProperties}"
rendered="#{producer.registrationRequired}"
headerClass="portlet-section-header">
17 years, 7 months
JBoss Portal SVN: r11949 - in branches/JBoss_Portal_Branch_2_6: core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers and 1 other directories.
by portal-commits@lists.jboss.org
Author: prabhat.jha(a)jboss.com
Date: 2008-09-22 12:18:30 -0400 (Mon, 22 Sep 2008)
New Revision: 11949
Modified:
branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/assignRoles.xhtml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producer.xhtml
Log:
[JBPORTAL-2101] adding ids to identity admin ui
[JBPORTAL-2103] adding ids to wsrp admin ui
Modified: branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/assignRoles.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/assignRoles.xhtml 2008-09-22 15:57:31 UTC (rev 11948)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/assignRoles.xhtml 2008-09-22 16:18:30 UTC (rev 11949)
@@ -10,7 +10,7 @@
<ui:define name="title">
<li class="pathItem">
- <h:commandLink action="userAdmin" value="#{bundle.IDENTITY_MANAGEMENT_USER_MANAGEMENT}" />
+ <h:commandLink id="assign-role-link" action="userAdmin" value="#{bundle.IDENTITY_MANAGEMENT_USER_MANAGEMENT}" />
</li>
<li class="pathSeparator"><h:graphicImage url="/img/pathSeparator.png" alt=">"/></li>
<li class="pathItem">
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2008-09-22 15:57:31 UTC (rev 11948)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2008-09-22 16:18:30 UTC (rev 11949)
@@ -95,7 +95,7 @@
<td>#{prop.name}</td>
<td>#{prop.description.label.value}</td>
<td>
- <h:inputText value="#{prop.value}" size="50"
+ <h:inputText id="prop-value-input" value="#{prop.value}" size="50"
valueChangeListener="#{consumer.regPropListener}"
disabled="#{consumer.registrationModified}"/>
<h:outputText styleClass="portlet-msg-error" value="#{prop.status}"
@@ -139,7 +139,8 @@
<td>#{prop.name}</td>
<td>#{prop.description.label.value}</td>
<td>
- <h:inputText value="#{prop.value}" size="50"/>
+ <h:inputText id="prop-value-input" value="#{prop.value}" size="50"/>
+
<h:outputText styleClass="portlet-msg-error" value="#{prop.status}"
rendered="#{prop.determinedInvalid}"/>
</td>
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producer.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producer.xhtml 2008-09-22 15:57:31 UTC (rev 11948)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producer.xhtml 2008-09-22 16:18:30 UTC (rev 11949)
@@ -37,7 +37,7 @@
<h:panelGroup styleClass="portlet-area-body">
<c:choose>
<c:when test="#{!empty producer.registrationProperties}">
- <h:dataTable id="producer-data-table" var="property" id="registrationProperties" width="100%"
+ <h:dataTable id="reg-properties" var="property" width="100%"
value="#{producer.registrationProperties}"
rendered="#{producer.registrationRequired}"
headerClass="portlet-section-header">
17 years, 7 months
JBoss Portal SVN: r11947 - branches/JBoss_Portal_Branch_2_7/build.
by portal-commits@lists.jboss.org
Author: wesleyhales
Date: 2008-09-22 09:42:51 -0400 (Mon, 22 Sep 2008)
New Revision: 11947
Modified:
branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml
Log:
downgrade to 1.2_08-brew for per Thomas last email
Modified: branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml 2008-09-22 10:55:17 UTC (rev 11946)
+++ branches/JBoss_Portal_Branch_2_7/build/build-thirdparty.xml 2008-09-22 13:42:51 UTC (rev 11947)
@@ -107,7 +107,7 @@
<componentref name="sun-jaf" version="1.1"/>
<componentref name="sun-javacc" version="3.2-portal"/>
<componentref name="sun-javamail" version="1.3.1"/>
- <componentref name="sun-jsf" version="1.2_09"/>
+ <componentref name="sun-jsf" version="1.2_08-brew"/>
<componentref name="sun-opends" version="snapshot"/>
<componentref name="sun-servlet" version="2.4"/>
<componentref name="sun-jaxb" version="2.1.4"/>
17 years, 7 months