DATACASS-495 - Upgrade to OpenWebBeans 2.0.1.
This commit is contained in:
@@ -119,21 +119,22 @@
|
||||
<dependency>
|
||||
<groupId>javax.enterprise</groupId>
|
||||
<artifactId>cdi-api</artifactId>
|
||||
<version>${cdi}</version>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.openwebbeans.test</groupId>
|
||||
<artifactId>cditest-owb</artifactId>
|
||||
<version>${webbeans}</version>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
<version>${javax-annotation-api}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>3.0-alpha-1</version>
|
||||
<groupId>org.apache.openwebbeans</groupId>
|
||||
<artifactId>openwebbeans-se</artifactId>
|
||||
<version>${webbeans}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -19,8 +19,9 @@ import static org.assertj.core.api.Assertions.*;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.apache.webbeans.cditest.CdiTestContainer;
|
||||
import org.apache.webbeans.cditest.CdiTestContainerLoader;
|
||||
import javax.enterprise.inject.se.SeContainer;
|
||||
import javax.enterprise.inject.se.SeContainerInitializer;
|
||||
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
@@ -34,40 +35,40 @@ import org.springframework.data.cassandra.test.util.AbstractEmbeddedCassandraInt
|
||||
*/
|
||||
public class CdiRepositoryTests extends AbstractEmbeddedCassandraIntegrationTest {
|
||||
|
||||
private static CdiTestContainer cdiContainer;
|
||||
private static SeContainer cdiContainer;
|
||||
|
||||
private CdiUserRepository repository;
|
||||
private SamplePersonRepository personRepository;
|
||||
private QualifiedUserRepository qualifiedUserRepository;
|
||||
|
||||
@BeforeClass
|
||||
public static void init() throws Exception {
|
||||
|
||||
// CDI container is booted before the @Rule can be triggered.
|
||||
// Ensure that we have a usable Cassandra instance otherwise the container won't boot
|
||||
// because it needs a CassandraOperations with a working Session/Cluster
|
||||
|
||||
cdiContainer = CdiTestContainerLoader.getCdiContainer();
|
||||
cdiContainer.startApplicationScope();
|
||||
cdiContainer.startContexts();
|
||||
cdiContainer.bootContainer();
|
||||
cdiContainer = SeContainerInitializer.newInstance() //
|
||||
.disableDiscovery() //
|
||||
.addPackages(CdiRepositoryClient.class) //
|
||||
.initialize();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void shutdown() throws Exception {
|
||||
|
||||
cdiContainer.stopContexts();
|
||||
cdiContainer.shutdownContainer();
|
||||
cdiContainer.close();
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
|
||||
CdiRepositoryClient client = cdiContainer.getInstance(CdiRepositoryClient.class);
|
||||
CdiRepositoryClient client = cdiContainer.select(CdiRepositoryClient.class).get();
|
||||
repository = client.getRepository();
|
||||
personRepository = client.getSamplePersonRepository();
|
||||
qualifiedUserRepository = client.getQualifiedUserRepository();
|
||||
}
|
||||
|
||||
@Test // DATACASS-149
|
||||
@Test // DATACASS-149, DATACASS-495
|
||||
public void testCdiRepository() {
|
||||
|
||||
assertThat(repository).isNotNull();
|
||||
@@ -100,7 +101,7 @@ public class CdiRepositoryTests extends AbstractEmbeddedCassandraIntegrationTest
|
||||
assertThat(repository.findById(bean.getId())).isNotPresent();
|
||||
}
|
||||
|
||||
@Test // DATACASS-249
|
||||
@Test // DATACASS-249, DATACASS-495
|
||||
public void testQualifiedCdiRepository() {
|
||||
|
||||
assertThat(qualifiedUserRepository).isNotNull();
|
||||
@@ -116,9 +117,8 @@ public class CdiRepositoryTests extends AbstractEmbeddedCassandraIntegrationTest
|
||||
assertThat(qualifiedUserRepository.existsById(bean.getId())).isTrue();
|
||||
}
|
||||
|
||||
@Test // DATACASS-149
|
||||
@Test // DATACASS-149, DATACASS-495
|
||||
public void returnOneFromCustomImpl() {
|
||||
|
||||
assertThat(personRepository.returnOne()).isEqualTo(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
|
||||
</beans>
|
||||
|
||||
Reference in New Issue
Block a user