Skip to content

Commit

Permalink
Make sure all tests are run with TomEE 7 (#182)
Browse files Browse the repository at this point in the history
* Make sure all tests are run with TomEE 7

Rename tests and update dependencies to make all tests execute.

Use a recent Arquillian version and TomEE 7.
  • Loading branch information
hesara authored and pleku committed Nov 17, 2016
1 parent 19a40ac commit 11e8a2c
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 74 deletions.
64 changes: 28 additions & 36 deletions vaadin-cdi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@

<!-- In addition to POMs, these version numbers are in ArchiveProvider for tests -->
<vaadin.version>7.5.1</vaadin.version>
<deltaspike.version>1.4.1</deltaspike.version>
<deltaspike.version>1.7.2</deltaspike.version>

<!-- Testing dependencies -->
<selenium.version>2.43.1</selenium.version>
<shiro.version>1.2.3</shiro.version>
<arquillian.version>1.1.7.Final</arquillian.version>
<selenium.version>2.47.1</selenium.version>
<!-- This needs to be in sync with the class ShiroTest -->
<shiro.version>1.3.2</shiro.version>
<arquillian.version>1.1.10.Final</arquillian.version>

<!-- ZIP Manifest fields -->
<Implementation-Version>${project.version}</Implementation-Version>
Expand Down Expand Up @@ -178,25 +179,11 @@
<dependencies>
<!-- Embedded TomEE -->
<dependency>
<groupId>org.apache.openejb</groupId>
<artifactId>apache-tomee</artifactId>
<version>1.6.0.2</version>
<classifier>plus</classifier>
<type>zip</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.openejb</groupId>
<groupId>org.apache.tomee</groupId>
<artifactId>arquillian-tomee-embedded</artifactId>
<version>1.6.0.2</version>
<version>7.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<!-- Java EE 6 API. Must be last to be overridden by tomee for
the test phase -->
<dependency>
Expand Down Expand Up @@ -254,6 +241,13 @@
<version>${deltaspike.version}</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>

<!-- Test dependencies -->
<!-- Arquillian -->
Expand All @@ -272,20 +266,20 @@
<groupId>org.jboss.arquillian.graphene</groupId>
<artifactId>arquillian-graphene</artifactId>
<type>pom</type>
<version>2.0.3.Final</version>
<version>2.1.0.Alpha3</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.mortbay.jetty</groupId>
<artifactId>servlet-api-2.5</artifactId>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Unit testing -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -365,23 +359,21 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.13</version>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<!-- Assertions must be disabled when @UIScoped is a @NormalScope
<!-- Assertions must be disabled when @UIScoped is a @NormalScope
otherwise the core framework will fail assertions that compare
a direct reference to a proxy, such as in VaadinSession#removeUI
and ConnectorTracker#cleanConnectorMap (#14508) -->
<enableAssertions>false</enableAssertions>
<enableAssertions>false</enableAssertions>
<!-- Fork every test because it will launch a separate AS instance -->
<forkMode>always</forkMode>
<systemPropertyVariables>
<javax.el.ExpressionFactory>org.apache.el.ExpressionFactoryImpl</javax.el.ExpressionFactory>
</systemPropertyVariables>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import com.vaadin.cdi.uis.PlainColidingAlternativeUI;
import com.vaadin.cdi.uis.PlainUI;

public class CDIIntegrationWithConflictingDeployment extends
public class CDIIntegrationWithConflictingDeploymentTest extends
AbstractManagedCDIIntegrationTest {

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import com.vaadin.cdi.uis.PathCollisionUI;
import com.vaadin.cdi.uis.RootUI;

public class CDIIntegrationWithConflictingUIPath extends
public class CDIIntegrationWithConflictingUIPathTest extends
AbstractCDIIntegrationTest {

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

import com.vaadin.cdi.uis.CustomMappingUI;

public class CDIIntegrationWithCustomDeployment extends
public class CDIIntegrationWithCustomDeploymentTest extends
AbstractManagedCDIIntegrationTest {

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
import com.vaadin.cdi.views.MainView;
import com.vaadin.cdi.views.SubView;

public class CDIIntegrationWithDefaultDeployment extends
public class CDIIntegrationWithDefaultDeploymentTest extends
AbstractManagedCDIIntegrationTest {

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.vaadin.cdi.uis.ParameterizedNavigationUI;
import com.vaadin.cdi.views.CrossInjectingView;

public class CrossInjection extends AbstractManagedCDIIntegrationTest {
public class CrossInjectionTest extends AbstractManagedCDIIntegrationTest {

@Deployment(name = "crossInjection")
public static WebArchive crossInjectionArchive() {
Expand Down
20 changes: 10 additions & 10 deletions vaadin-cdi/src/test/java/com/vaadin/cdi/DeploymentTestSuiteIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
import com.vaadin.cdi.shiro.ShiroTest;

@RunWith(Suite.class)
@Suite.SuiteClasses({ CDIIntegrationWithCustomDeployment.class,
CDIUIProviderTest.class, ConventionsTest.class, MultipleRootUIs.class,
CDIIntegrationWithConflictingDeployment.class,
CDIIntegrationWithConflictingUIPath.class,
CDIIntegrationWithDefaultDeployment.class, RootViewAtContextRoot.class,
MultipleAccessIsolation.class, ScopedInstances.class,
@Suite.SuiteClasses({ CDIIntegrationWithCustomDeploymentTest.class,
CDIUIProviderTest.class, ConventionsTest.class, MultipleRootUIsTest.class,
CDIIntegrationWithConflictingDeploymentTest.class,
CDIIntegrationWithConflictingUIPathTest.class,
CDIIntegrationWithDefaultDeploymentTest.class, RootViewAtContextRootTest.class,
MultipleAccessIsolationTest.class, ScopedInstancesTest.class,
InjectionTest.class, ConsistentInjectionTest.class,
QualifiedInjection.class, MultipleSessionTest.class,
ScopedProducer.class, CrossInjection.class, ShiroTest.class,
InappropriateNestedServletInDeployment.class,
InappropriateCDIViewInDeployment.class, NonPassivatingBeanTest.class })
QualifiedInjectionTest.class, MultipleSessionTest.class,
ScopedProducerTest.class, CrossInjectionTest.class, ShiroTest.class,
InappropriateNestedServletInDeploymentTest.class,
InappropriateCDIViewInDeploymentTest.class, NonPassivatingBeanTest.class })
public class DeploymentTestSuiteIT {

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import com.vaadin.cdi.views.CDIViewNotImplementingView;

public class InappropriateCDIViewInDeployment extends
public class InappropriateCDIViewInDeploymentTest extends
AbstractCDIIntegrationTest {

@Deployment(name = "cdiViewWithoutView", managed = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

import com.vaadin.cdi.uis.UIWithNestedServlet;

public class InappropriateNestedServletInDeployment extends
public class InappropriateNestedServletInDeploymentTest extends
AbstractCDIIntegrationTest {

@Deployment(name = "nestedServlet", managed = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import com.vaadin.cdi.uis.ConcurrentUI;

public class MultipleAccessIsolation extends
public class MultipleAccessIsolationTest extends
AbstractManagedCDIIntegrationTest {

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

@RunAsClient
@RunWith(Arquillian.class)
public class MultipleRootUIs extends AbstractCDIIntegrationTest {
public class MultipleRootUIsTest extends AbstractCDIIntegrationTest {

@Before
public void resetCounter() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,14 @@
import static org.junit.Assert.assertThat;

import java.net.MalformedURLException;
import java.util.HashSet;
import java.util.Set;

import javax.enterprise.context.spi.Context;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;

import org.apache.myfaces.shared.util.Assert;
import org.hamcrest.core.Is;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.OperateOnDeployment;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;

import com.vaadin.cdi.internal.CDIUtil;
import com.vaadin.cdi.internal.Conventions;
import com.vaadin.cdi.internal.NonPassivatingBean;
import com.vaadin.cdi.internal.ViewScopedContext;
import com.vaadin.cdi.uis.NonPassivatingUI;
import com.vaadin.cdi.views.NonPassivatingContentView;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import com.vaadin.cdi.internal.MyBean;
import com.vaadin.cdi.uis.QualifierInjectionUI;

public class QualifiedInjection extends AbstractManagedCDIIntegrationTest {
public class QualifiedInjectionTest extends AbstractManagedCDIIntegrationTest {

@Deployment(name = "qualifiedInjection")
public static WebArchive qualifiedInjectionArchive() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import com.vaadin.cdi.uis.ParameterizedNavigationUI;
import com.vaadin.cdi.views.RootView;

public class RootViewAtContextRoot extends AbstractManagedCDIIntegrationTest {
public class RootViewAtContextRootTest extends AbstractManagedCDIIntegrationTest {

@Before
public void resetCounter() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.vaadin.cdi.views.UIScopedView;
import com.vaadin.cdi.views.ViewScopedView;

public class ScopedInstances extends AbstractManagedCDIIntegrationTest {
public class ScopedInstancesTest extends AbstractManagedCDIIntegrationTest {

@Deployment(name = "scopedNavigation")
public static WebArchive alternativeAndActiveWithSamePath() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import com.vaadin.cdi.internal.ProducedBean;
import com.vaadin.cdi.uis.ProducerUI;

public class ScopedProducer extends AbstractManagedCDIIntegrationTest {
public class ScopedProducerTest extends AbstractManagedCDIIntegrationTest {

@Deployment(name = "scopedProducer")
public static WebArchive scopedProducerArchive() {
Expand Down
4 changes: 2 additions & 2 deletions vaadin-cdi/src/test/java/com/vaadin/cdi/shiro/ShiroTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ public static WebArchive initAndPostConstructAreConsistent() {
AbstractShiroTestView.class, LoginPane.class,
GuestView.class, ViewerView.class, AdminView.class)
.addAsLibraries(
pom.resolve("org.apache.shiro:shiro-core:1.2.3")
pom.resolve("org.apache.shiro:shiro-core:1.3.2")
.withTransitivity().asFile())
.addAsLibraries(
pom.resolve("org.apache.shiro:shiro-web:1.2.3")
pom.resolve("org.apache.shiro:shiro-web:1.3.2")
.withTransitivity().asFile())
.addAsWebInfResource(new ClassLoaderAsset("shiro.ini"),
ArchivePaths.create("shiro.ini"))
Expand Down

0 comments on commit 11e8a2c

Please sign in to comment.