Internal QA info: http://intranet.corp.redhat.com/ic/intranet/TestingEmbeddedConsoleWithAS.html

JIRA issue: https://jira.jboss.org/jira/browse/JBQA-1938

Changelog: http://fisheye.jboss.org/changelog/EMBJOPR/

Hudson job: http://hudson.qa.jboss.com/hudson/job/embjopr-jsfunit/

Embedded Jopr project JIRA: https://jira.jboss.org/jira/browse/EMBJOPR

Hudson job: http://hudson.qa.jboss.com/hudson/job/embjopr/

Current versions

We're testing with (versions [and reasons for that version to be chosen]):

EmbJopr: 1.1.1-SNAPSHOT (? Shelly will correct.)

JBoss AS 4: jboss-eap-4.3.0_CP03

JBoss AS 5: jboss-5.1.0-Beta1 (Unreleased)

JDK: SUN 1.5.0 - latest update (currently 17)

JSFUnit: 1.1.0.GA-SNAPSHOT

Running Embedded Jopr tests

  1. Download and unzip JBoss AS / EAP distribution.
  2. Set the JBOSS_HOME property in maven's setting.xml to that JBoss directory.
  3. Checkout embjopr project from SVN.
  4. Set the root project and jbas4 + jbas5 modules to skip tests in the IDE of choice, or use -Dmaven.skip.test=true in later steps 3 and 4. This is because Seam tests fail.
  5. Build the root project recursively (this makes Maven downloads dependencies)
  6. Build again the jbas4 / jbas5 module
  7. Build the jsfunit module with the jboss4.2 or jboss5x profile

The last step includes launching JBoss AS in the JBOSS_HOME directory using the Maven Cargo plugin. Do not deploy the resulting war manually on that server, otherwise Cargo will behave quite weirdly (error parsing ServletRedirector.jsfunit, 404 Not found etc). If getting exceptions like this, make sure there's not the war deployed accidentally (in my case, it happened when I invoked non-standard maven goal; thanks to Farah Juma for pointing this out).

See also: JSFUnitWithMaven<br />

Running tests on Hudson: (TBD)

Example settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<settings>
<profiles>
<profile>
<id>jboss4.2</id>
<properties>
<JBOSS_HOME>/home/ondra/work/JOPRembedded/jboss-eap-4.3/jboss-as</JBOSS_HOME>
<JAVA_HOME>/home/ondra/sw/java/jdk/jdk1.5.0_17</JAVA_HOME>
</properties>
</profile>
<profile>
<id>jboss5x</id>
<properties>
<JBOSS_HOME>/home/ondra/work/JOPRembedded/jboss-5.0.0.GA</JBOSS_HOME>
<JAVA_HOME>/home/ondra/sw/java/jdk/jdk1.5.0_17</JAVA_HOME>
</properties>
</profile>
</profiles>
</settings>

Running a single / selected test class

mvn -Pjboss5x -Dtest=org.jboss.jopr.jsfunit.as5.DatasourceTest

In fact, test property takes a mask as it's value, so you can use asterisk to filter a group of tests:

mvn -Pjboss5x -Dtest=Datasource*Test

See http://maven.apache.org/plugins/maven-surefire-plugin/examples/single-test.html.

If you need to run single method, there's no (known) way to do it.

AS 5 issues when running JSFUnit tests with Maven Cargo plugin

Tests architecture

The tests are designed to cover both AS 4 (written using EAP 4.3.0) and AS 5 using the same code base, and covering the differences by overriding base classes.

Package hierarchy

The org.jboss.jopr.jsfunit package contains the base class EmbjoprTestCase with supporting methods which deal with common tasks of EmbJopr manipulation.

Other classes in this package, like DatasourceTestBase, inherit from the EmbjoprTestCase class. Generally, they follow the naming pattern <EmbJoprCompomentName>TestBase. These sub-classes contain test methods "stubs". They should provide at least general test abstraction, but usually they will also perform most of the test, as far as this code would be the same for AS 4 and AS 5.

The differences between tests for AS 4 and AS 5 are coded in subclasses of the *TestBase classes in the as4 and as5 packages. In case there's no difference between behavior of AS 4 and AS 5, the sub-class is not needed to override corresponding method; but, for clarity, it's better to override and explicitly call super.testSomething() method.

AS 4 and AS 5 test co-design procedure

Test coverage & plan

See JBoss Jira JBQA-1938.

Datasource

test subject
test methodAS 4 notes
AS 5 notes
testCreateDatasource
Negative tests
testCreateDatasourceMissingRequiredValues
testCreateDatasourcePropertyOutOfRange
testCreateDatasourceInvalidPropertyType
testCreateDatasourcePropertyNotAllowed
testCreateDatasourceDuplicateJNDIName
Delete tests
testDeleteLocalTXDatasource
testDeleteNoTXDatasource
testDeleteXADatasource
Metrics tests
testMetricsAfterDatasourceCreation
testMetricsAfterInitialDBConnection
testMetricsAfterMultipleDBConnections

JVM Metrics

test subject
test methodAS 4 notes
AS 5 notes

JMX Server

test subject
test methodAS 4 notes
AS 5 notes

ConnectionFactory Service

test subject
test methodAS 4 notes
AS 5 notes

Messaging Service

test subject
test methodAS 4 notes
AS 5 notes
Creation tests
Strategy: Create a destination. Make sure the destination is deployed. Verify that the properties of the corresponding ManagedComponent were set correctly. Make sure the appropriate success messages occur on the client side and on the server side.
testCreateQueue
testCreateTopic
Strategy: Attempt to create a destination using invalid property values. Make sure the appropriate error messages occur on the client side and on the server side.
testCreateQueueMissingRequiredValue
testCreateTopicMissingRequiredValue
testCreateQueuePropertyOutOfRange
testCreateTopicPropertyOutOfRange
testCreateQueueInvalidPropertyType
testCreateTopicInvalidPropertyType
testCreateQueueDuplicateJNDIName
testCreateTopicDuplicateJNDIName
Deletion tests
Strategy: Delete a destination. Make sure the ManagedComponent is removed. Make sure the appropriate success messages occur on the client side and on the server side.
testDeleteQueue
testDeleteQueueUsingExistingServiceFile
testDeleteTopic
testDeleteTopicUsingExistingServiceFile
Configuration tests
Strategy: Change some of the properties associated with a destination. Make sure the appropriate success messages occur on the client side and on the server side. Make sure the properties of the ManagedComponent are updated accordingly.
testConfigureQueueChangeProperties
testConfigureQueueChangePropertiesUsingExistingServiceFile
testConfigureTopicChangeProperties
testConfigureTopicChangePropertiesUsingExistingServiceFile
testConfigureQueueUnsetProperties
testConfigureQueueUnsetPropertiesUsingExistingServiceFile
testConfigureTopicUnsetProperties
testConfigureTopicUnsetPropertiesUsingExistingServiceFile
Metrics tests
Operations tests

APPLICATIONS

The application strategy:

test subject
test method
AS 4 Notes
AS 5 Notes
Navigation
assertion: Verify the navigation sequence to Applications.
test Strategy: From the root of the navigation tree:
Click JBossAS Servers ==> JBoss App Server:${config} ++> Applications
testNavigationToApplications
assertion: Verify the navigation sequence to Applications.
test Strategy: From the root of the navigation tree: Click Applications
testNavigationToApplicationsDirect

assertion: Verify the navigation sequence to Applications.

test Strategy: From the root of the navigation tree:
Click JBossAS Servers ==> JBoss App Server:${config}==> Applications
Verify the archives in the list when viewing all types.

testApplicationViewAllTypes Once the list of all available applications are viewed, there is no way to navigate back to the previous list. Shelly to file JIRA.

assertion: Verify the navigation sequence to Applications.

test Strategy: From the root of the navigation tree:
Click JBossAS Servers ==> JBoss App Server:${config}==> Applications
Verify the archives in the list when viewing SAR Types
testApplicationViewSARTypes

assertion: Verify the navigation sequence to Applications.

test Strategy: From the root of the navigation tree:
Click JBossAS Servers ==> JBoss App Server:${config}==> Applications
Verify the archives in the list when viewing WAR Types
testApplicationViewWARTypes

assertion: Verify the navigation sequence to Applications.

test Strategy: From the root of the navigation tree:

Click JBossAS Servers ==> JBoss App Server:${config}==> Applications
Verify the archives in the list when viewing EAR Types

testApplicationViewEARTypes

assertion: Verify the navigation sequence to Applications.

test Strategy: From the root of the navigation tree:
Click JBossAS Servers ==> JBoss App Server:${config}==> Applications
Verify the archives in the list when viewing EJB Types
testApplicationViewEJBTypes

WAR

test subject
test methodAS 4 notes
AS 5 notes
verify deployment of basic web archive. testBasicWarDeployment

EJB

test subject
test methodAS 4 notes
AS 5 notes
verify deployment of standalone EJB .jar testBasicEjbDeployment

Fails because of NPE - JSFUnit bug?

When done manually, EJB is deployed but not listed.

EMBJOPR-73/74

Enterprise Application (EAR)

test subject
test method
Header 3
AS 4 Notes
AS 5 Notes
Deploy Tests

assertion: verify deployment of basic Enterprise Archive package
test Strategy: Navigate to Enterprise Applications. Add a new resource.

Verify the resource was successfully deployed.

testBasicEarDeployment
assertion: Verify an .ear that contained a bad deployment descriptor
fails deployment, fixed using console, and can then be
successfully deployed.
test Strategy: Deploy an .ear that is known to have a bad deployment
descriptor. Verify the console shows deployment failed.
Edit the .ear resource to fix the achive. Redeploy and
verify the archive has been deployed successfully.
testBadEarRedeploy
assertion: Verify the navigation sequence to Enterprise Applications
test Strategy: From the root of the navigation tree:
Click JBossAS Servers ==> JBoss App Server:${config} ==> Applications
==> Enterprise Application
testNavigationToEar
assertion: Verify the content of the Enterprise Application Summary tab. testEarSummary

assertion: Verify the General Properties of a successfully deployed .ear

test Strategy: After verifying an Enterprise Archive was successfully
deployed, select the .ear from the list of available applications on the Summary Tab
of Enterprise Application (EAR). This brings you to Summary Tab of the deployed
enterprise achive. Verify the General Properties:
* Name:
* Version:
* Description:

testEarProperties
assertion: Verify the Resource Traits of a successfully deployed .ear.
test Strategy: After verifying an Enterprise Archive was successfully
deployed, select the .ear from the list of available applications on the Summary Tab
of Enterprise Application (EAR). This brings you to Summary Tab of the deployed
enterprise achive. Verify the Resource Traits:
* Path:
* Exploded?:
testEarResourceTraits
assertion: Verify the Metrics Summary of a successfully deployed .ear.
test Strategy: After verifying an Enterprise Archive was successfully
deployed, select the .ear from the list of available applications on the Summary Tab
of Enterprise Application (EAR). This brings you to Summary Tab of the deployed
enterprise achive. Verify the selection of the Metrics Summary option:
* NAME
testEarMetricsSummaryName
assertion: Verify the Metrics Summary of a successfully deployed .ear.
test Strategy: After verifying an Enterprise Archive was successfully
deployed, select the .ear from the list of available applications on the Summary Tab
of Enterprise Application (EAR). This brings you to Summary Tab of the deployed enterprise achive. Verify the selection of the Metrics Summary option:
* VALUE
testEarMetricsSummaryValue
assertion: Verify the Metrics Summary of a successfully deployed .ear.
test Strategy: After verifying an Enterprise Archive was successfully deployed, select the .ear from the list of available applications on the Summary Tab
of Enterprise Application (EAR). This brings you to Summary Tab of the deployed
enterprise achive. Verify the selection of the Metrics Summary option:
* DESCRIPTION
testEarMetricsSummaryDescription

assertion: Verify the Configuration Page of a successfully deployed .ear.
test Strategy: After verifying an Enterprise Archive was successfully
deployed, select the .ear from the list of available applications on the Summary Tab
of Enterprise Application (EAR). This brings you to Summary Tab of the deployed

enterprise achive. Choose the Configuration Tab and verify the Configuration.

testEarConfigurationPage
assertion: From the Configuration Tab, Edit a deployed resource and SAVE the changes.
test Strategy: Deploy an .ear. Verify it is UP. Navigate to the Configuration tab and Edit the Resource. Save the changes and verify the changes were saved.
testModifyEarAndSave Currently only see EDIT RESOURCE SAVE/CANCEL. Cannot edit the resource. Same as EMBJOPR-69?
assertion: From the Configuration Tab, Edit a deployed resource but CANCEL the changes.
test Strategy: Deploy an .ear. Verify it is UP. Navigate to the Configuration tab and Edit the Resource. Cancel the changes and verify the resource did not get updated .
testModifyEarAndCancel
assertion: Verify the Metrics Page of a successfully deployed .ear.
test Strategy: After verifying an Enterprise Archive was successfully
deployed, select the .ear from the list of available applications on the Summary Tab
of Enterprise Application (EAR). This brings you to Summary Tab of the deployed
enterprise achive. Choose the Metrics Tab and verify the Trait Values as shown.
* Path:
* Exploded?:
testEarMetricTraits Does the user have control over whether the archive is exploded?
assertion: Verify the Metrics Page of a successfully deployed .ear.
test Strategy: After verifying an Enterprise Archive was successfully deployed, select the .ear from the list of available applications on the Summary Tab of Enterprise Application (EAR). This brings you to Summary Tab of the deployed enterprise achive. Choose the Metrics Tab and verify the Numeric Values as shown.
testEarNumericValues What numeric values are expected to be exposed for a applications?
assertion: Verify the Metrics Page of a successfully deployed .ear.
test Strategy: After verifying an Enterprise Archive was successfully
deployed, select the .ear from the list of available applications on the Summary Tab
of Enterprise Application (EAR). This brings you to Summary Tab of the deployed
enterprise achive. Choose the Metrics Tab. Verify the use of the REFRESH button.
testEarMetricsRefresh
assertion: Verify an .ear can be updated reloading from disk.
test Strategy: After verifying an Enterprise Archive was successfully
deployed, select the .ear from the list of available applications on the Summary Tab
of Enterprise Application (EAR). This brings you to Summary Tab of the deployed
enterprise achive. Choose the Content Tab. Browse to pick up the .ear that is currently deployed. Hit Update. Verify the change to the archive.
testEarContent

What is the use case for this? Is it the intent that a newer version of the managed archive will be uploaded? When this action is invoked, NPE encountered. Shelly to file JIRA after further analysis

root cause

java.lang.NullPointerException

org.jboss.seam.exception.Exceptions.parse(Exceptions.java:195)
org.jboss.seam.exception.Exceptions.initialize(Exceptions.java:119)

See also: