EMBJOPR SVN: r195 - trunk/core/src/main/webapp.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-03-09 18:31:36 -0400 (Mon, 09 Mar 2009)
New Revision: 195
Modified:
trunk/core/src/main/webapp/layout.xhtml
Log:
Removed doubled <div id="pageheader">:
<div id="pageheader">
<ui:include src="include/header.xhtml"/>
</div>
Modified: trunk/core/src/main/webapp/layout.xhtml
===================================================================
--- trunk/core/src/main/webapp/layout.xhtml 2009-03-09 18:55:37 UTC (rev 194)
+++ trunk/core/src/main/webapp/layout.xhtml 2009-03-09 22:31:36 UTC (rev 195)
@@ -114,9 +114,7 @@
<ui:insert name="body">body goes here</ui:insert>
</div>
<ui:include src="include/resourceNavigation.xhtml"/>
- <div id="pageheader">
- <ui:include src="include/header.xhtml"/>
- </div>
+ <ui:include src="include/header.xhtml"/>
<ui:include src="include/footer.xhtml"/>
</body>
</f:view>
15 years, 10 months
EMBJOPR SVN: r194 - in trunk/jsfunit: src/test/java/org/jboss/jopr/jsfunit and 1 other directories.
by embjopr-commits@lists.jboss.org
Author: fjuma
Date: 2009-03-09 14:55:37 -0400 (Mon, 09 Mar 2009)
New Revision: 194
Modified:
trunk/jsfunit/pom.xml
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/DatasourceTestBase.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/DatasourceTest.java
Log:
Made minor changes to EmbjoprTestCase.java in order to update to jboss-integration-5.1.0.CR1.
Made minor changes to the datasource configuration tests.
Modified: trunk/jsfunit/pom.xml
===================================================================
--- trunk/jsfunit/pom.xml 2009-03-09 13:23:20 UTC (rev 193)
+++ trunk/jsfunit/pom.xml 2009-03-09 18:55:37 UTC (rev 194)
@@ -111,7 +111,7 @@
<dependency>
<groupId>org.jboss.integration</groupId>
<artifactId>jboss-profileservice-spi</artifactId>
- <version>5.0.3.GA</version>
+ <version>5.1.0.CR1</version>
<scope>provided</scope>
</dependency>
<dependency>
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/DatasourceTestBase.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/DatasourceTestBase.java 2009-03-09 13:23:20 UTC (rev 193)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/DatasourceTestBase.java 2009-03-09 18:55:37 UTC (rev 194)
@@ -309,7 +309,7 @@
public Connection connectDB(String jndiName, String username,
String password) throws Exception{
Context ctx = new InitialContext();
- DataSource ds = (DataSource)ctx.lookup(jndiName);
+ DataSource ds = (DataSource)ctx.lookup("java:" + jndiName);
return ds.getConnection(username, password);
}
@@ -972,8 +972,7 @@
String expected = metricsMap.get(metricName);
String actual = getMetricValueFromTable(metricName, "dataTable");
actual = normalizeIfDoubleExpected(expected, actual); // Some LOCALEs encode doubles with coma.
- assertEquals("Incorrect metric value for '"+metricName+"'='"+actual+"'," +
- " expected '"+expected+"'", expected, actual);
+ assertEquals("Incorrect metric value for '" + metricName + "'", expected, actual);
}
// Check values under the "Summary" tab
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java 2009-03-09 13:23:20 UTC (rev 193)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java 2009-03-09 18:55:37 UTC (rev 194)
@@ -155,7 +155,7 @@
String id = link.getIdAttribute();
String[] idElements = id.split(":");
String row = idElements[idElements.length - 2];
- return (HtmlButtonInput)client.getElement(row + ":removeButton");
+ return (HtmlButtonInput)client.getElement("dataTable:" + row + ":removeButton");
}
/**
@@ -750,8 +750,7 @@
ManagedDeployment managedDeployment = null;
try {
- managedDeployment = currentProfileView.getDeployment(deployment,
- ManagedDeployment.DeploymentPhase.APPLICATION);
+ managedDeployment = currentProfileView.getDeployment(deployment);
} catch (NoSuchDeploymentException e) {
return false;
}
@@ -792,12 +791,9 @@
{
ProfileService profileService = getProfileService();
ManagementView currentProfileView = profileService.getViewManager();
- String[] domains = profileService.getDomains();
-
- ProfileKey defaultKey = new ProfileKey(domains[0]);
-
+
try {
- currentProfileView.loadProfile(defaultKey);
+ currentProfileView.load();
} catch (Exception e) {
log.error("Could not find default Profile in Current Profile View", e);
}
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/DatasourceTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/DatasourceTest.java 2009-03-09 13:23:20 UTC (rev 193)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/DatasourceTest.java 2009-03-09 18:55:37 UTC (rev 194)
@@ -244,9 +244,7 @@
*/
public void testConfigureDatasourceChangeSetProperties() throws IOException, EmbJoprTestException {
Map<String, String> propertiesMap = createXADatasource("ChangeSetPropertiesDS");
- assertTrue("Error creating datasource",
- client.getPageAsText().contains("Successfully added"));
-
+
// Change some property values that are already set
Map<String, String> propertiesMapChanges = new HashMap<String, String>();
propertiesMapChanges.put("xa-resource-timeout", "60000");
@@ -287,8 +285,6 @@
*/
public void testConfigureDatasourceChangeUnsetProperties() throws IOException, EmbJoprTestException {
Map<String, String> propertiesMap = createLocalTXDatasource("ChangeUnsetPropertiesDS");
- assertTrue("Error creating datasource",
- client.getPageAsText().contains("Successfully added"));
// Set some property values that were previously unset
Map<String, String> propertiesMapChanges = new HashMap<String, String>();
@@ -332,8 +328,6 @@
*/
public void testConfigureDatasourceUnsetProperties() throws IOException, EmbJoprTestException {
Map<String, String> propertiesMap = createNoTXDatasource("UnsetPropertiesDS");
- assertTrue("Error creating datasource",
- client.getPageAsText().contains("Successfully added"));
// Unset some property values
navigateToPage(propertiesMap.get("jndi-name"),
15 years, 10 months
EMBJOPR SVN: r193 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-03-09 09:23:20 -0400 (Mon, 09 Mar 2009)
New Revision: 193
Added:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/WebClientTools.java
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/LoginTest.java
Log:
WebClientTools.java was missing
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/LoginTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/LoginTest.java 2009-03-07 00:03:33 UTC (rev 192)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/LoginTest.java 2009-03-09 13:23:20 UTC (rev 193)
@@ -46,7 +46,6 @@
public void testLoggedIn() throws IOException
{
- // TODO: Move user name to a constant.
assertTrue( client.getPageAsText().contains(LOGIN_USERNAME) );
assertTrue( client.getPageAsText().contains("Logout") );
Added: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/WebClientTools.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/WebClientTools.java (rev 0)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/WebClientTools.java 2009-03-09 13:23:20 UTC (rev 193)
@@ -0,0 +1,183 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jopr.jsfunit;
+
+import com.gargoylesoftware.htmlunit.JavaScriptPage;
+import com.gargoylesoftware.htmlunit.Page;
+import com.gargoylesoftware.htmlunit.TextPage;
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.*;
+import com.gargoylesoftware.htmlunit.xml.XmlPage;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+import org.jboss.jsfunit.jsfsession.ComponentIDNotFoundException;
+import org.jboss.jsfunit.jsfsession.DuplicateClientIDException;
+import org.w3c.dom.Element;
+
+/**
+ * Copied from JSFClientSession, only there's no JSFServersession reference.
+ * Contains some useful utils like getElement() etc.
+ *
+ * @author ozizka
+ * @since 1.0
+ */
+public class WebClientTools
+{
+ private WebClient webClient;
+
+ public WebClientTools(WebClient webClient)
+ {
+ this.webClient = webClient;
+ }
+
+ /**
+ * Get the latest content page returned from the server. This page may
+ * have been changed by javascript or direct manipulation of the DOM.
+ *
+ * @return The Page.
+ */
+ public Page getContentPage()
+ {
+ return webClient.getCurrentWindow().getEnclosedPage();
+ }
+
+ /**
+ * Get the content page as a text String.
+ *
+ * @return the text
+ */
+ public String getPageAsText()
+ {
+ if (getContentPage() instanceof HtmlPage) return ((HtmlPage)getContentPage()).asXml();
+ if (getContentPage() instanceof TextPage) return ((TextPage)getContentPage()).getContent();
+ if (getContentPage() instanceof XmlPage) return ((XmlPage)getContentPage()).asXml();
+ if (getContentPage() instanceof JavaScriptPage) return ((JavaScriptPage)getContentPage()).getContent();
+
+ throw new IllegalStateException("This page can not be converted to text. Page type is " + getContentPage().getClass().getName());
+ }
+
+ /**
+ * Get a DOM Element on the current page that has the given JSF componentID.
+ *
+ * @param componentID The JSF component id (or a suffix of the client ID)
+ *
+ * @return The Element, or <code>null</code> if not found.
+ *
+ * @throws DuplicateClientIDException if more than one client ID matches the suffix
+ * @throws ClassCastException if the current page is not an HtmlPage.
+ */
+ public Element getElement(String componentID)
+ {
+ DomNode domPage = (DomNode)getContentPage();
+ String xpathQuery = buildXPathQuery(componentID);
+ List elements = domPage.getByXPath(xpathQuery);
+ if (elements.size() == 0) return null;
+ if (elements.size() == 1) return (Element)elements.get(0);
+ Element exactMatch = findExactMatch(elements, componentID);
+ if (exactMatch != null) return exactMatch;
+ throw new DuplicateClientIDException(elements, componentID);
+ }
+
+ // JSFUNIT-178
+ private Element findExactMatch(List elements, String componentID)
+ {
+ for (Iterator i = elements.iterator(); i.hasNext();)
+ {
+ Element element = (Element)i.next();
+ String id = element.getAttribute("id");
+ if (id.equals(componentID)) return element;
+ }
+
+ return null;
+ }
+
+ private String buildXPathQuery(String componentID)
+ {
+ return "//*[" + endsWith("ID", componentID) + " or " + endsWith("id", componentID) + "]";
+ }
+
+ // XPath 1.0 doesn't have the ends-with function, so I have to make it myself
+ private String endsWith(String attribute, String string)
+ {
+ return "('" + string + "' = substring(@" + attribute + ",string-length(@" + attribute + ") - string-length('" + string + "') + 1))";
+ }
+
+ /**
+ * Set the value attribute of a JSF component.
+ *
+ * @param componentID The JSF component id (or a suffix of the client ID) of
+ * a component rendered as an HtmlInput component.
+ *
+ * @throws ComponentIDNotFoundException if no client ID matches the suffix
+ * @throws DuplicateClientIDException if more than one client ID matches the suffix
+ * @throws ClassCastException if the current page is not an HtmlPage or the
+ * specified component is not an HtmlInput.
+ */
+ public void setValue(String componentID, String value)
+ {
+ Element input = getElement(componentID);
+ if (input == null) throw new ComponentIDNotFoundException(componentID);
+
+ if (input instanceof HtmlInput)
+ {
+ ((HtmlInput)input).setValueAttribute(value);
+ return;
+ }
+
+ if (input instanceof HtmlTextArea)
+ {
+ ((HtmlTextArea)input).setText(value);
+ return;
+ }
+
+ if (input instanceof HtmlIsIndex)
+ {
+ ((HtmlIsIndex)input).setValue(value);
+ return;
+ }
+
+ throw new IllegalArgumentException("This method can not be used on components of type " + input.getClass().getName());
+ }
+
+ /**
+ * Simulates typing a character while this JSF component has focus.
+ *
+ * @param componentID The JSF component id (or a suffix of the client ID) of
+ * a component rendered as an HtmlElement.
+ *
+ * @throws ComponentIDNotFoundException if no client ID matches the suffix
+ * @throws DuplicateClientIDException if more than one client ID matches the suffix
+ * @throws ClassCastException if the current page is not an HtmlPage or the
+ * specified component is not an HtmlElement.
+ */
+ public void type(String componentID, char c) throws IOException
+ {
+ HtmlElement element = (HtmlElement)getElement(componentID);
+ if (element == null) throw new ComponentIDNotFoundException(componentID);
+ element.type(c);
+ }
+
+
+
+}
15 years, 10 months
EMBJOPR SVN: r192 - trunk/core/src/main/webapp/include.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-03-06 19:03:33 -0500 (Fri, 06 Mar 2009)
New Revision: 192
Modified:
trunk/core/src/main/webapp/include/header.xhtml
Log:
Logout link id
Modified: trunk/core/src/main/webapp/include/header.xhtml
===================================================================
--- trunk/core/src/main/webapp/include/header.xhtml 2009-03-06 23:50:15 UTC (rev 191)
+++ trunk/core/src/main/webapp/include/header.xhtml 2009-03-07 00:03:33 UTC (rev 192)
@@ -41,11 +41,11 @@
<div class="login">
<h:outputText rendered="#{not empty identity.username}">
#{messages['security.loggedIn']} #{identity.username}
- [<s:link action="#{identity.logout}">#{messages['security.logout']}</s:link>]
+ [<s:link id="logoutLink" action="#{identity.logout}">#{messages['security.logout']}</s:link>]
</h:outputText>
<h:outputText rendered="#{empty identity.username}">
#{messages['security.NotLoggedIn']}
- [<s:link id="logoutLink" action="/login.xhtml">#{messages['security.login']}</s:link>]
+ [<s:link action="/login.xhtml">#{messages['security.login']}</s:link>]
</h:outputText>
<ui:remove>
<!-- Disable the Help link until we actually have some online help to link to. -->
15 years, 10 months
EMBJOPR SVN: r191 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-03-06 18:50:15 -0500 (Fri, 06 Mar 2009)
New Revision: 191
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/MultipleUserLoginTest.java
Log:
* Multi-user login updated.
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/MultipleUserLoginTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/MultipleUserLoginTest.java 2009-03-06 23:03:55 UTC (rev 190)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/MultipleUserLoginTest.java 2009-03-06 23:50:15 UTC (rev 191)
@@ -23,13 +23,15 @@
package org.jboss.jopr.jsfunit;
import com.gargoylesoftware.htmlunit.BrowserVersion;
-import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
-import com.gargoylesoftware.htmlunit.html.HtmlDivision;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.Page;
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.*;
import java.io.IOException;
+import java.util.List;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.jboss.jsfunit.framework.WebClientSpec;
+import org.jboss.jsfunit.framework.WebConversationFactory;
import org.jboss.jsfunit.jsfsession.JSFClientSession;
import org.jboss.jsfunit.jsfsession.JSFServerSession;
import org.jboss.jsfunit.jsfsession.JSFSession;
@@ -117,11 +119,12 @@
/**
- * Logs in using several
- * @throws java.io.IOException
+ * Logs in using several
+ * @throws java.io.IOException
*
- * Fails. TODO: Add user/pass for 2nd user.
- */
+ * Fails because the page header is missing for some reason.
+ * TODO: Find out why.
+ */
public void testMultipleUsersLogin() throws IOException
{
@@ -141,52 +144,89 @@
assertEquals("JSF's '#{identity.username}' should be the user name.",
USER_A, sessA.getServer().getManagedBeanValue("#{identity.username}") );
- HtmlAnchor logoutLink_ = (HtmlAnchor) sessA.getClient().getElement("logoutLink");
+ DebugUtils.writeFile("target/multiuser1.html", sessA.getClient().getPageAsText());///
// USER B.
+ final WebClient wc = new WebClient(BrowserVersion.FIREFOX_3);
+ wc.setThrowExceptionOnFailingStatusCode(false);
+ wc.setConfirmHandler(new SimpleConfirmHandler(true));
+ final WebClientTools sessBclient = new WebClientTools(wc);
- log.info("Logging in with second user, '"+USER_B+"'");
- SessionInstance sessB = new SessionInstance(USER_B, PASS_B);
+ final String userNameComponent = "login_form:name";
+ final String passwordComponent = "login_form:password";
+ final String submitComponent = "login_form:submit";
+ String url = WebConversationFactory.getWARURL() + "/";
+ final HtmlPage loginPage = wc.getPage(url);
+ setValue(loginPage, userNameComponent, USER_B);
+ setValue(loginPage, passwordComponent, PASS_B);
+ clickSubmitComponent(loginPage, submitComponent);
assertTrue("Page doesn't contain user's name.",
- sessB.getClient().getPageAsText().contains(USER_B) );
+ sessBclient.getPageAsText().contains(USER_B) );
assertTrue("Page doesn't contain '"+LABEL_LOGOUT+"'.",
- sessB.getClient().getPageAsText().contains(LABEL_LOGOUT) );
+ sessBclient.getPageAsText().contains(LABEL_LOGOUT) );
- assertEquals("JSF's '#{identity.username}' should be the user name.",
- USER_B, sessB.getServer().getManagedBeanValue("#{identity.username}") );
+
+ // Refresh and log USER_A out.
+ ((HtmlPage) sessA.getClient().getContentPage()).refresh();
+ DebugUtils.writeFile("target/multiuser2.html", sessA.getClient().getPageAsText());///
- // Log USER_A out.
-
- /*HtmlDivision headerDiv = (HtmlDivision)sessA.getClient().getElement("pageheader");
- HtmlAnchor logoutLink = (HtmlAnchor) headerDiv
- .getByXPath("a[normalize-string() = '"+LABEL_LOGOUT+"']"); /**/
-
HtmlAnchor logoutLink = (HtmlAnchor) sessA.getClient().getElement("logoutLink");
logoutLink.click();
// Refresh sessB page Check that USER_B is still logged in.
-
- HtmlPage page = (HtmlPage) sessB.getClient().getContentPage();
- page.refresh();
-
assertTrue("Page doesn't contain user's name.",
- sessB.getClient().getPageAsText().contains(USER_B) );
+ sessBclient.getPageAsText().contains(USER_B) );
assertTrue("Page doesn't contain '"+LABEL_LOGOUT+"'.",
- sessB.getClient().getPageAsText().contains(LABEL_LOGOUT) );
+ sessBclient.getPageAsText().contains(LABEL_LOGOUT) );
+ }
- assertEquals("JSF's '#{identity.username}' should be the user name.",
- USER_B, sessB.getServer().getManagedBeanValue("#{identity.username}") );
+
+ // These were taken from FomrAuthenticationStrategy.java; unfortunately not reusable from there.
+
+ protected Page clickSubmitComponent(HtmlPage page, String elementName) throws IOException
+ {
+ HtmlElement htmlElement = getElement(page, elementName);
+ if (!(htmlElement instanceof ClickableElement))
+ throw new IllegalStateException("Component with name=" + elementName + " is not a ClickableElement.");
+
+ ClickableElement clickable = (ClickableElement)htmlElement;
+ return clickable.click();
}
+ public static void setValue(HtmlPage page, String elementName, String value)
+ {
+ HtmlElement element = getElement(page, elementName);
+ if (!(element instanceof HtmlInput))
+ {
+ throw new IllegalStateException("Component with name=" + elementName + " is not an HtmlInput element.");
+ }
+ HtmlInput inputElement = (HtmlInput)element;
+ inputElement.setValueAttribute(value);
+ }
+ public static HtmlElement getElement(HtmlPage page, String elementName)
+ {
+ List<HtmlElement> elements = page.getHtmlElementsByName(elementName);
+ if (elements.size() == 0)
+ {
+ throw new IllegalStateException("Component with name=" + elementName + " was not found on the login page.");
+ }
+ if (elements.size() > 1)
+ {
+ throw new IllegalStateException("More than one component with name=" + elementName + " was found on the login page.");
+ }
+ return elements.get(0);
+ }
+
+
}// class
15 years, 10 months
EMBJOPR SVN: r190 - trunk/jsfunit.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-03-06 18:03:55 -0500 (Fri, 06 Mar 2009)
New Revision: 190
Modified:
trunk/jsfunit/pom.xml
Log:
* POM: Added JMX conole users config files for multiuser login test
Modified: trunk/jsfunit/pom.xml
===================================================================
--- trunk/jsfunit/pom.xml 2009-03-06 22:59:30 UTC (rev 189)
+++ trunk/jsfunit/pom.xml 2009-03-06 23:03:55 UTC (rev 190)
@@ -298,7 +298,17 @@
<file>${basedir}/testdata/jboss-configuration/deploy/jbossweb.sar/server.xml</file>
<tofile>deploy/jbossweb.sar/server.xml</tofile>
</configfile>
+ <!-- JMX Console Users -->
<configfile>
+ <file>${basedir}/testdata/jboss-configuration/conf/props/jmx-console-roles.properties</file>
+ <tofile>conf/props/jmx-console-roles.properties</tofile>
+ </configfile>
+ <configfile>
+ <file>${basedir}/testdata/jboss-configuration/conf/props/jmx-console-users.properties</file>
+ <tofile>conf/props/jmx-console-users.properties</tofile>
+ </configfile>
+ <!-- Datasources -->
+ <configfile>
<file>${basedir}/testdata/datasources/MultipleDatasources-ds.xml</file>
<toFile>deploy/MultipleDatasources-ds.xml</toFile>
</configfile>
15 years, 10 months
EMBJOPR SVN: r189 - trunk/jsfunit.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-03-06 17:59:30 -0500 (Fri, 06 Mar 2009)
New Revision: 189
Modified:
trunk/jsfunit/pom.xml
Log:
* POM: Removed ${jopr.version} from <parent>, Maven doesn't resolve it there.
Modified: trunk/jsfunit/pom.xml
===================================================================
--- trunk/jsfunit/pom.xml 2009-03-06 22:54:17 UTC (rev 188)
+++ trunk/jsfunit/pom.xml 2009-03-06 22:59:30 UTC (rev 189)
@@ -11,7 +11,7 @@
<parent>
<groupId>org.jboss.jopr</groupId>
<artifactId>jopr-embedded-parent</artifactId>
- <version>${jopr.version}</version>
+ <version>1.2.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.jopr</groupId>
15 years, 10 months
EMBJOPR SVN: r188 - trunk/jsfunit.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-03-06 17:54:17 -0500 (Fri, 06 Mar 2009)
New Revision: 188
Modified:
trunk/jsfunit/pom.xml
Log:
* POM: Versions changed to reflect current state.
* Now using ${jopr.version}
Modified: trunk/jsfunit/pom.xml
===================================================================
--- trunk/jsfunit/pom.xml 2009-03-05 23:24:39 UTC (rev 187)
+++ trunk/jsfunit/pom.xml 2009-03-06 22:54:17 UTC (rev 188)
@@ -4,16 +4,19 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<modelVersion>4.0.0</modelVersion>
+ <properties>
+ <jopr.version>1.2.0-SNAPSHOT</jopr.version>
+ </properties>
<parent>
<groupId>org.jboss.jopr</groupId>
<artifactId>jopr-embedded-parent</artifactId>
- <version>1.1.1-SNAPSHOT</version>
+ <version>${jopr.version}</version>
</parent>
<groupId>org.jboss.jopr</groupId>
<artifactId>jopr-embedded-jsfunit</artifactId>
- <version>1.1.1-SNAPSHOT</version>
+ <version>${jopr.version}</version>
<packaging>war</packaging>
<name>JSFUnit Tests for Embedded Admin Console</name>
@@ -46,7 +49,7 @@
<dependency>
<groupId>org.jboss.jsfunit</groupId>
<artifactId>jboss-jsfunit-core</artifactId>
- <version>1.0.0.GA-SNAPSHOT</version>
+ <version>1.0.0.GA</version>
<scope>compile</scope>
<exclusions>
<exclusion>
@@ -62,7 +65,7 @@
<dependency>
<groupId>org.jboss.jsfunit</groupId>
<artifactId>jboss-jsfunit-richfaces</artifactId>
- <version>1.0.0.GA-SNAPSHOT</version>
+ <version>1.0.0.GA</version>
<scope>compile</scope>
</dependency>
<dependency>
@@ -74,7 +77,7 @@
<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-j2se</artifactId>
- <version>5.0.0-SNAPSHOT</version>
+ <version>5.0.1.GA</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -114,7 +117,7 @@
<dependency>
<groupId>org.jboss.man</groupId>
<artifactId>jboss-metatype</artifactId>
- <version>2.0.0.GA</version>
+ <version>2.1.0.CR3</version>
<scope>provided</scope>
</dependency>
</dependencies>
@@ -234,7 +237,7 @@
<dependency>
<groupId>org.jboss.jopr</groupId>
<artifactId>jopr-embedded-jbas5</artifactId>
- <version>${project.version}</version>
+ <version>${jopr.version}</version><!-- ${project.version} -->
<type>war</type>
</dependency>
<dependency>
15 years, 10 months
EMBJOPR SVN: r187 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-03-05 18:24:39 -0500 (Thu, 05 Mar 2009)
New Revision: 187
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/MultipleUserLoginTest.java
Log:
* Multiuser login test update
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/MultipleUserLoginTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/MultipleUserLoginTest.java 2009-03-05 23:09:10 UTC (rev 186)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/MultipleUserLoginTest.java 2009-03-05 23:24:39 UTC (rev 187)
@@ -23,6 +23,9 @@
package org.jboss.jopr.jsfunit;
import com.gargoylesoftware.htmlunit.BrowserVersion;
+import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
+import com.gargoylesoftware.htmlunit.html.HtmlDivision;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
import java.io.IOException;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -52,6 +55,7 @@
public static Test suite() {
return new TestSuite( MultipleUserLoginTest.class );
}
+ private static final String LABEL_LOGOUT = "Logout";
public void setUp() throws IOException
{
@@ -73,7 +77,7 @@
log.info("Detected AS version: " + version);
isJBoss4 = version.startsWith("4");
- // Contrary to super class, skip the session creation in setUp().
+ // Contrary to super class, this test skips the session creation in setUp().
}
@@ -82,8 +86,9 @@
*/
class SessionInstance {
- protected JSFClientSession client;
- protected JSFServerSession server;
+ protected JSFSession jsfSession;
+ protected JSFClientSession client_;
+ protected JSFServerSession server_;
protected String user;
protected String pass;
@@ -96,13 +101,15 @@
wcSpec.getWebClient().setThrowExceptionOnFailingStatusCode(false);
wcSpec.getWebClient().setConfirmHandler(new SimpleConfirmHandler(true));
wcSpec.setInitialRequestStrategy(new JoprLoginStrategy(user, pass)); // logs in
- JSFSession jsfSession = new JSFSession(wcSpec);
- this.client = jsfSession.getJSFClientSession();
- this.server = jsfSession.getJSFServerSession();
+ this.jsfSession = new JSFSession(wcSpec);
+ this.client_ = jsfSession.getJSFClientSession();
+ this.server_ = jsfSession.getJSFServerSession();
}
- public JSFClientSession getClient() { return client; }
- public JSFServerSession getServer() { return server; }
+ //public JSFClientSession getClient() { return this.client_; }
+ //public JSFServerSession getServer() { return this.server_; }
+ public JSFClientSession getClient() { return this.jsfSession.getJSFClientSession(); }
+ public JSFServerSession getServer() { return this.jsfSession.getJSFServerSession(); }
public String getUser() { return user; }
public String getPass() { return pass; }
@@ -112,6 +119,8 @@
/**
* Logs in using several
* @throws java.io.IOException
+ *
+ * Fails. TODO: Add user/pass for 2nd user.
*/
public void testMultipleUsersLogin() throws IOException
{
@@ -119,31 +128,66 @@
// USER A.
log.info("Logging in with first user, '"+USER_A+"'");
-
SessionInstance sessA = new SessionInstance(USER_A, PASS_A);
- assertTrue( sessA.client.getPageAsText().contains(USER_A) );
- assertTrue( sessA.client.getPageAsText().contains("Logout") );
+ //DebugUtils.writeFile("target/asd.html", sessA.client.getPageAsText());///
+
+ assertTrue("Page doesn't contain user's name.",
+ sessA.getClient().getPageAsText().contains(USER_A) );
+ assertTrue("Page doesn't contain '"+LABEL_LOGOUT+"'.",
+ sessA.getClient().getPageAsText().contains(LABEL_LOGOUT) );
+
assertEquals("JSF's '#{identity.username}' should be the user name.",
- USER_A, sessA.server.getManagedBeanValue("#{identity.username}") );
+ USER_A, sessA.getServer().getManagedBeanValue("#{identity.username}") );
+ HtmlAnchor logoutLink_ = (HtmlAnchor) sessA.getClient().getElement("logoutLink");
+
// USER B.
log.info("Logging in with second user, '"+USER_B+"'");
-
SessionInstance sessB = new SessionInstance(USER_B, PASS_B);
- assertTrue("Page doesn't contain user's name.", sessB.client.getPageAsText().contains(USER_B) );
- assertTrue("Page doesn't contain 'Logout'.", sessB.client.getPageAsText().contains("Logout") );
+ assertTrue("Page doesn't contain user's name.",
+ sessB.getClient().getPageAsText().contains(USER_B) );
+ assertTrue("Page doesn't contain '"+LABEL_LOGOUT+"'.",
+ sessB.getClient().getPageAsText().contains(LABEL_LOGOUT) );
+
assertEquals("JSF's '#{identity.username}' should be the user name.",
- USER_B, sessB.server.getManagedBeanValue("#{identity.username}") );
+ USER_B, sessB.getServer().getManagedBeanValue("#{identity.username}") );
+
+ // Log USER_A out.
+
+ /*HtmlDivision headerDiv = (HtmlDivision)sessA.getClient().getElement("pageheader");
+ HtmlAnchor logoutLink = (HtmlAnchor) headerDiv
+ .getByXPath("a[normalize-string() = '"+LABEL_LOGOUT+"']"); /**/
+
+ HtmlAnchor logoutLink = (HtmlAnchor) sessA.getClient().getElement("logoutLink");
+ logoutLink.click();
+
+
+ // Refresh sessB page Check that USER_B is still logged in.
+
+ HtmlPage page = (HtmlPage) sessB.getClient().getContentPage();
+ page.refresh();
+
+ assertTrue("Page doesn't contain user's name.",
+ sessB.getClient().getPageAsText().contains(USER_B) );
+ assertTrue("Page doesn't contain '"+LABEL_LOGOUT+"'.",
+ sessB.getClient().getPageAsText().contains(LABEL_LOGOUT) );
+
+ assertEquals("JSF's '#{identity.username}' should be the user name.",
+ USER_B, sessB.getServer().getManagedBeanValue("#{identity.username}") );
+
}
-}
\ No newline at end of file
+}// class
+
+
+
15 years, 10 months
EMBJOPR SVN: r186 - trunk.
by embjopr-commits@lists.jboss.org
Author: charles.crouch(a)jboss.com
Date: 2009-03-05 18:09:10 -0500 (Thu, 05 Mar 2009)
New Revision: 186
Modified:
trunk/pom.xml
Log:
EMBJOPR-68 update to RF 3.3.0 and use correct pom version
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-03-05 23:07:24 UTC (rev 185)
+++ trunk/pom.xml 2009-03-05 23:09:10 UTC (rev 186)
@@ -30,7 +30,7 @@
<groupId>org.jboss.jopr</groupId>
<artifactId>jopr-embedded-parent</artifactId>
- <version>1.1.1-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Embedded Jopr</name>
<description>a web application that provides administration and monitoring of the app server instance to which it is deployed</description>
@@ -65,7 +65,7 @@
<jaxb-api.version>2.1</jaxb-api.version>
<jaxb-impl.version>2.1.6</jaxb-impl.version>
<jon.version>2.2.0-SNAPSHOT</jon.version>
- <richfaces.version>3.2.2.SR1</richfaces.version>
+ <richfaces.version>3.3.0.GA</richfaces.version>
<rhq.version>1.2.0-SNAPSHOT</rhq.version>
<seam.version>2.1.0.SP1</seam.version>
<seam.embedded.version>beta3.SP3</seam.embedded.version>
15 years, 10 months