Skip to content

Commit

Permalink
AS7-6570 fixes for buiding on JDK7
Browse files Browse the repository at this point in the history
 * upgrade javassist to support jdk7
 * upgrade & mockito & powermock to support jdk7
 * upgrade junit to 4.11 to gain test ordering support
 * fix test ordering
  • Loading branch information
ctomc authored and bstansberry committed Feb 22, 2013
1 parent 17f2a65 commit a355e54
Show file tree
Hide file tree
Showing 15 changed files with 195 additions and 139 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ And of course Java EE!

Building
-------------------

If you already have Maven 3.0.3 or newer installed

> mvn install
Expand Down Expand Up @@ -46,18 +47,18 @@ More information on the wiki: http://community.jboss.org/wiki/JBossAS7UserGuide

Contributing
------------------
http://community.jboss.org/wiki/HackingonAS7
https://community.jboss.org/wiki/HackingOnAS8

Running the Testsuite
--------------------
The testsuite module contains several submodules including the following:

* "smoke" -- core tests that should be run as part of every build of the AS. Failures here will fail the build.
* "api" -- tests of features that involve end user use of the public JBoss AS 7 API. Should be run with no failures before any major commits.
* "api" -- tests of features that involve end user use of the public JBoss AS 8 API. Should be run with no failures before any major commits.
* "cluster" -- tests of the AS 7 HA clustering features. Should be run with no failures before any major commits.
* "domain" -- tests of the domain management features. Should be run with no failures before any major commits.
* "integration" -- tests of an AS 7 standalone server's internals. Should be run with no failures before any major commits.
* "spec" -- tests of features that only involve end user use of the Java EE 6 spec APIs. Should be run with no failures before any major commits.
* "spec" -- tests of features that only involve end user use of the Java EE 7 spec APIs. Should be run with no failures before any major commits.
* "benchmark" -- tests used to compare performance against other releases or previous builds
* "stress" -- tests of the server's ability to perform properly while under stress

Expand All @@ -76,7 +77,7 @@ To run all the tests
Using Eclipse
-------------
1. Install the latest version of eclipse
2. Make sure Xmx in eclipse.ini is at least 512M, and it's using java 6
2. Make sure Xmx in eclipse.ini is at least 512M, and it's using java 7
3. Launch eclispe and install the m2eclipse plugin, make sure it uses your repo configs
(get it from: http://m2eclipse.sonatype.org/sites/m2e)
4. In eclipse preferences Java->Compiler->Errors/Warnings->Deprecated and restricted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,17 @@
import org.jboss.as.clustering.web.SessionOwnershipSupport;
import org.junit.After;
import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;

/**
* @author Paul Ferraro
*
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class DistributedCacheManagerTest {
private LocalDistributableSessionManager sessionManager = mock(LocalDistributableSessionManager.class);
@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -167,6 +170,7 @@ public void sessionCreated() {

@SuppressWarnings("unchecked")
@Test

public void storeSessionData() throws IOException {
OutgoingDistributableSessionData data = mock(OutgoingDistributableSessionData.class);
Map<Object, Object> map = mock(Map.class);
Expand Down Expand Up @@ -612,7 +616,7 @@ public void isLocal() {
}

@Test
public void locate() {
public void testLocate() { //test keeps it in order
EmbeddedCacheManager container = mock(EmbeddedCacheManager.class);
DistributionManager distManager = mock(DistributionManager.class);
Address localAddress = mock(Address.class);
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<version.aesh>0.33</version.aesh>
<version.jansi>1.9</version.jansi>
<version.joda-time>1.6.2</version.joda-time>
<version.junit>4.10</version.junit>
<version.junit>4.11</version.junit>
<version.jsoup>1.6.1</version.jsoup>
<version.log4j>1.2.16</version.log4j>
<version.net.jcip>1.0</version.net.jcip>
Expand Down Expand Up @@ -147,7 +147,7 @@
<version.org.hornetq>2.3.0.CR1</version.org.hornetq>
<version.org.infinispan>5.2.1.Final</version.org.infinispan>
<version.org.jacorb>2.3.2.jbossorg-4</version.org.jacorb>
<version.org.javassist>3.15.0-GA</version.org.javassist>
<version.org.javassist>3.17.1-GA</version.org.javassist>
<version.org.jdom>1.1.2</version.org.jdom>
<version.org.jboss.arquillian.core>1.0.0.Final</version.org.jboss.arquillian.core>
<version.org.jboss.arquillian.osgi>1.0.3.Final</version.org.jboss.arquillian.osgi>
Expand Down Expand Up @@ -243,14 +243,14 @@
<version.org.jboss.xnio.xnio-nio>${version.org.jboss.xnio}</version.org.jboss.xnio.xnio-nio>
<version.org.jgroups>3.2.7.Final</version.org.jgroups>
<version.org.kohsuke.rngom>201103.jboss-1</version.org.kohsuke.rngom>
<version.org.mockito>1.8.5</version.org.mockito>
<version.org.mockito>1.9.5</version.org.mockito>
<version.org.opensaml.opensaml>2.5.1-1</version.org.opensaml.opensaml>
<version.org.opensaml.openws>1.4.2-1</version.org.opensaml.openws>
<version.org.opensaml.xmltooling>1.3.2-1</version.org.opensaml.xmltooling>
<version.org.picketbox>4.0.15.Final</version.org.picketbox>
<version.org.picketbox.picketbox-commons>1.0.0.final</version.org.picketbox.picketbox-commons>
<version.org.picketlink>2.1.6.Final</version.org.picketlink>
<version.org.powermock>1.4.11</version.org.powermock>
<version.org.powermock>1.5</version.org.powermock>
<version.org.projectodd.stilts>0.1.26</version.org.projectodd.stilts>
<version.org.scannotation>1.0.2</version.org.scannotation>
<version.org.slf4j>1.7.2</version.org.slf4j>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,15 @@
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;

/**
*
* @author Dominik Pospisil <[email protected]>
*/
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class RolloutPlanTestCase extends AbstractCliTestBase {

private static WebArchive war;
Expand Down Expand Up @@ -107,7 +110,7 @@ public static void after() throws Exception {
}

@Test
public void testInSeriesRolloutPlan() throws Exception {
public void test1InSeriesRolloutPlan() throws Exception {

// create rollout plans

Expand Down Expand Up @@ -188,7 +191,7 @@ public void testInSeriesRolloutPlan() throws Exception {
* Tests rollout plan with non-zero maxFailedServers attribute.
*/
@Test
public void testMaxFailServersRolloutPlan() throws Exception {
public void test2MaxFailServersRolloutPlan() throws Exception {

// deploy helper servlets
cli.sendLine("deploy " + warFile.getAbsolutePath() + " --all-server-groups");
Expand Down Expand Up @@ -254,7 +257,7 @@ public void testMaxFailServersRolloutPlan() throws Exception {
* Tests rollout plan with non-zero maxFailurePercentage attribute.
*/
@Test
public void testMaxFailServersPercentageRolloutPlan() throws Exception {
public void test3MaxFailServersPercentageRolloutPlan() throws Exception {

// deploy helper servlets
cli.sendLine("deploy " + warFile.getAbsolutePath() + " --all-server-groups");
Expand Down Expand Up @@ -312,7 +315,7 @@ public void testMaxFailServersPercentageRolloutPlan() throws Exception {
* Tests rollout plan with RollbackAcrossGroups set to true.
*/
@Test
public void testRollbackAcrossGroupsRolloutPlan() throws Exception {
public void test4RollbackAcrossGroupsRolloutPlan() throws Exception {
// deploy helper servlets
cli.sendLine("deploy " + warFile.getAbsolutePath() + " --all-server-groups");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.junit.InSequence;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.WebArchive;
Expand All @@ -48,6 +49,7 @@ public static Archive<?> deploy() {
}

@Test
@InSequence(1)
public void testMethodLevelInterceptors() throws NamingException {
final InitialContext ctx = new InitialContext();
final ClassifiedBean bean = (ClassifiedBean) ctx.lookup("java:module/" + ClassifiedBean.class.getSimpleName());
Expand All @@ -67,6 +69,7 @@ public void testMethodLevelInterceptors() throws NamingException {
}

@Test
@InSequence(2)
public void testMethodOverloaded() throws NamingException {
final InitialContext ctx = new InitialContext();
final ClassifiedBean bean = (ClassifiedBean) ctx.lookup("java:module/" + ClassifiedBean.class.getSimpleName());
Expand All @@ -87,6 +90,7 @@ public void testMethodOverloaded() throws NamingException {
}

@Test
@InSequence(3)
public void testAroundInvokeOverridedByXmlDescriptor() throws NamingException {
InitialContext ctx = new InitialContext();
AroundInvokeBean bean = (AroundInvokeBean) ctx.lookup("java:module/" + AroundInvokeBean.class.getSimpleName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.junit.InSequence;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
Expand Down Expand Up @@ -63,6 +64,7 @@ public static Archive<?> deploy() {
}

@Test
@InSequence(1)
public void testEntityBeanTimerService() throws Exception {
DataStore.DATA.clear();
DataStore.DATA.put(20, "Existing");
Expand All @@ -89,6 +91,7 @@ public void testEntityBeanTimerService() throws Exception {
* Aimed to test EJB3.1 18.4.5.
*/
@Test
@InSequence(2)
public void testExistenceAfterDelete() throws Exception {
DataStore.DATA.clear();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.junit.InSequence;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.WebArchive;
Expand Down Expand Up @@ -58,6 +59,7 @@ public static Archive<?> deploy() {
}

@Test
@InSequence(1)
public void testAnnotationTimeoutMethod() throws NamingException {
InitialContext ctx = new InitialContext();
AnnotationTimerServiceBean bean = (AnnotationTimerServiceBean) ctx.lookup("java:module/" + AnnotationTimerServiceBean.class.getSimpleName());
Expand All @@ -76,6 +78,7 @@ public void testAnnotationTimeoutMethod() throws NamingException {
}

@Test
@InSequence(2)
public void testTimedObjectTimeoutMethod() throws NamingException {
InitialContext ctx = new InitialContext();
TimedObjectTimerServiceBean bean = (TimedObjectTimerServiceBean) ctx.lookup("java:module/" + TimedObjectTimerServiceBean.class.getSimpleName());
Expand All @@ -96,6 +99,7 @@ public void testTimedObjectTimeoutMethod() throws NamingException {
}

@Test
@InSequence(3)
public void testIntervalTimer() throws NamingException {
InitialContext ctx = new InitialContext();
TimerConfig timerConfig = new TimerConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.jboss.arquillian.container.test.api.OperateOnDeployment;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.junit.InSequence;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.as.test.integration.common.HttpRequest;
import org.jboss.as.test.integration.jaxrs.packaging.war.WebXml;
Expand Down Expand Up @@ -81,12 +82,14 @@ private static String performCall(String urlPattern) throws Exception {
}

@Test
@InSequence(1)
public void testJaxRsWithNoApplication() throws Exception {
String result = performCall("myjaxrs/jsapi");
Assert.assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><customer><first>John</first><last>Citizen</last></customer>", result);
}

@Test
@InSequence(2)
public void testJaxRsJSApis() throws Exception {
String result = performCall("/rest-JS");
Assert.assertTrue(result.contains("var CustomerResource"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.junit.InSequence;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
Expand Down Expand Up @@ -74,6 +75,7 @@ protected <T> T rawLookup(String name, Class<T> interfaceType) throws NamingExce
}

@Test
@InSequence(1)
public void testMultipleNonTXTransactionalEntityManagerInvocations() throws Exception {
SFSB1 sfsb1 = lookup("SFSB1", SFSB1.class);
sfsb1.getEmployeeNoTX(1); // For each call in, we will use a transactional entity manager
Expand All @@ -84,6 +86,7 @@ public void testMultipleNonTXTransactionalEntityManagerInvocations() throws Exce
}

@Test
@InSequence(2)
public void testQueryNonTXTransactionalEntityManagerInvocations() throws Exception {
SFSB1 sfsb1 = lookup("SFSB1", SFSB1.class);
String name = sfsb1.queryEmployeeNameNoTX(1);
Expand All @@ -94,6 +97,7 @@ public void testQueryNonTXTransactionalEntityManagerInvocations() throws Excepti
// For a transaction scoped persistence context non jta-tx invocation, entities returned from Query
// must be detached.
@Test
@InSequence(3)
public void testQueryNonTXTransactionalDetach() throws Exception {
SFSB1 sfsb1 = lookup("SFSB1", SFSB1.class);
sfsb1.createEmployee("Jill", "54 Country Lane", 2);
Expand All @@ -110,6 +114,7 @@ public void testQueryNonTXTransactionalDetach() throws Exception {
* @throws Exception
*/
@Test
@InSequence(4)
public void testTransactionRequiredException() throws Exception {
Throwable error = null;
try {
Expand Down Expand Up @@ -138,6 +143,7 @@ public void testTransactionRequiredException() throws Exception {
* 3) The transaction fails after the DAO calls and the JTA transaction is rolled back and no database changes should occur.
*/
@Test
@InSequence(5)
public void testFailInDAOCalls() throws Exception {
SLSB1 slsb1 = lookup("SLSB1", SLSB1.class);
slsb1.addEmployee();
Expand All @@ -153,6 +159,7 @@ public void testFailInDAOCalls() throws Exception {
}

@Test
@InSequence(6)
public void testUserTxRollbackDiscardsChanges() throws Exception {
SFSBXPC sfsbxpc = lookup("SFSBXPC", SFSBXPC.class);
sfsbxpc.createEmployeeNoTx("Amory Lorch", "Lannister House", 10); // create the employee but leave in xpc
Expand All @@ -168,6 +175,7 @@ public void testUserTxRollbackDiscardsChanges() throws Exception {
}

@Test
@InSequence(7)
public void testEnlistXPCInUserTx() throws Exception {
SFSBXPC sfsbxpc = lookup("SFSBXPC", SFSBXPC.class);
sfsbxpc.createEmployeeNoTx("Amory Lorch", "Lannister House", 20); // create the employee but leave in xpc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.junit.InSequence;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
Expand Down Expand Up @@ -63,12 +64,14 @@ protected <T> T lookup(String beanName, Class<T> interfaceType) throws NamingExc
}

@Test
@InSequence(1)
public void testRequiresNewXPCPropagation() throws Exception {
BikeManagerBean stateful = lookup(BikeManagerBean.class.getSimpleName(), BikeManagerBean.class);
stateful.runTest();
}

@Test
@InSequence(2)
public void testXPCIsAssociatedWithTX() throws Exception {
BikeManagerBean stateful = lookup(BikeManagerBean.class.getSimpleName(), BikeManagerBean.class);
stateful.runTest2();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.hibernate.envers.DefaultRevisionEntity;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.junit.InSequence;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.as.test.integration.jpa.hibernate.envers.Organization;
import org.jboss.as.test.integration.jpa.hibernate.envers.SLSBValidityStrategyOrg;
Expand Down Expand Up @@ -74,6 +75,7 @@ protected static <T> T lookup(String beanName, Class<T> interfaceType) throws Na
}

@Test
@InSequence(1)
public void testEnversforValidityStrategy() throws Exception {

SLSBValidityStrategyOrg slsbvalidityOrg = lookup("SLSBValidityStrategyOrg", SLSBValidityStrategyOrg.class);
Expand All @@ -95,6 +97,7 @@ public void testEnversforValidityStrategy() throws Exception {
}

@Test
@InSequence(2)
public void testValidityStrategyActivationforEnvers() throws Exception {
SLSBValidityStrategyOrg slsbvalidityOrg = lookup("SLSBValidityStrategyOrg", SLSBValidityStrategyOrg.class);

Expand Down
Loading

0 comments on commit a355e54

Please sign in to comment.