Author: ozizka(a)redhat.com
Date: 2009-01-21 12:26:27 -0500 (Wed, 21 Jan 2009)
New Revision: 120
Modified:
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/as4/DatasourceTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/DatasourceTest.java
Log:
Fixed: removed toLowerCase getDatasourceConfigFile()
Fixed: NO_TX_DATASOURCE's htmlTemplateValue
Changed: added jndiName param to getDatasourceConfigFile( String jndiName )
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/DatasourceTestBase.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/DatasourceTestBase.java 2009-01-21
17:18:00 UTC (rev 119)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/DatasourceTestBase.java 2009-01-21
17:26:27 UTC (rev 120)
@@ -62,7 +62,7 @@
// Some of these values are specific for AS 5. TODO: Think up some way to split
nicely.
LOCAL_TX_DATASOURCE("Local TX Datasources", "LocalTxCM",
"local-tx-datasource", "default__Local TX Datasource"),
- NO_TX_DATASOURCE( "No TX Datasources", "NoTxCM",
"no-tx-datasource", null), // TODO: Fill the value.
+ NO_TX_DATASOURCE( "No TX Datasources", "NoTxCM",
"no-tx-datasource", "default__No TX Datasource"), // TODO: Fill
the value.
XA_DATASOURCE( "XA Datasources", "XATxCM",
"xa-datasource", "default__XA Datasource");
protected String label;
@@ -224,7 +224,7 @@
try {
// Parse the *-ds.xml file; create appropriate file name for AS 4 or 5.
- File file = new File( this.getDatasourceConfigFile());
+ File file = new File( this.getDatasourceConfigFile( jndiName ));
SAXBuilder builder = new SAXBuilder();
Document doc = builder.build(file);
@@ -787,7 +787,7 @@
*
* @returns a name of the Datasource's config file to check the properties in.
*/
- protected abstract String getDatasourceConfigFile();
+ protected abstract String getDatasourceConfigFile( String jndiName );
protected abstract String getMBeanName( String jndiName, String serviceName );
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java 2009-01-21
17:18:00 UTC (rev 119)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java 2009-01-21
17:26:27 UTC (rev 120)
@@ -282,20 +282,24 @@
public void checkClientAndServerMessages(String expectedClientMsg,
String expectedServerMsg,
boolean isErrorMsg) {
- assertTrue(client.getPageAsText().contains(expectedClientMsg));
+ assertTrue("Expected message not found on page.",
+ client.getPageAsText().contains(expectedClientMsg));
- assertTrue(server.getFacesMessages().hasNext());
+ assertTrue("Expected message not found in faces messages.",
+ server.getFacesMessages().hasNext());
+
FacesMessage message = server.getFacesMessages().next();
-
if(isErrorMsg) {
assertTrue(FacesMessage.SEVERITY_ERROR.equals(message.getSeverity()));
} else {
assertTrue(FacesMessage.SEVERITY_INFO.equals(message.getSeverity()));
}
-
- assertTrue(message.getDetail().contains(expectedServerMsg));
+ assertTrue("Expected message: "+expectedServerMsg+" Actual:
"+message.getDetail(),
+ message.getDetail().contains(expectedServerMsg));
+
}
+
/**
* Refresh the content under the given nav tree node.
*/
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as4/DatasourceTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as4/DatasourceTest.java 2009-01-21
17:18:00 UTC (rev 119)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as4/DatasourceTest.java 2009-01-21
17:26:27 UTC (rev 120)
@@ -135,8 +135,8 @@
* @return
*/
@Override
- protected String getDatasourceConfigFile() {
- String jndiName = this.getDatasourceProperties().get("jndi-name");
+ protected String getDatasourceConfigFile( String jndiName ) {
+ //String jndiName = this.getDatasourceProperties().get("jndi-name");
return System.getProperty("jsfunit.deploy.dir") + "/" +
jndiName.toLowerCase() + "-ds.xml";
}
@@ -176,7 +176,8 @@
<option value="default__Datasource">default
(Datasource)</option>
/**/
createDatasource(DatasourceType.LOCAL_TX_DATASOURCE, // unsued for AS 4
- "default__Datasource", // TODO: Differs! Split
DatasourceType accordingly...
+ // TODO: Differs! Split DatasourceType accordingly...
+ DatasourceTemplate.DEFAULT.getTemplateHtmlSelectValue(),
propertiesMap);
client.click("resourceConfigurationForm:saveButton");
@@ -189,7 +190,7 @@
assertTrue(checkProperties(propertiesMap.get("jndi-name"),
DatasourceType.LOCAL_TX_DATASOURCE,
propertiesMap));
-
+
// TODO: need to verify that appropriate default values were
// set for properties that were not specified above
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-01-21
17:18:00 UTC (rev 119)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/DatasourceTest.java 2009-01-21
17:26:27 UTC (rev 120)
@@ -174,8 +174,8 @@
@Override
- protected String getDatasourceConfigFile() {
- String jndiName = this.getDatasourceProperties().get("jndi-name");
+ protected String getDatasourceConfigFile( String jndiName ) {
+ //String jndiName = this.getDatasourceProperties().get("jndi-name");
return System.getProperty("jsfunit.deploy.dir") + "/" + jndiName +
"-ds.xml";
}
Show replies by date