mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-24 13:02:10 +00:00
DATAES-395 - Upgrade to OpenWebBeans 2.0.1.
This commit is contained in:
parent
adf846d665
commit
6dd4d28067
36
pom.xml
36
pom.xml
@ -127,28 +127,20 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.openwebbeans.test</groupId>
|
||||
<artifactId>cditest-owb</artifactId>
|
||||
<version>${webbeans}</version>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-jcdi_1.0_spec</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.apache.geronimo.specs</groupId>
|
||||
<artifactId>geronimo-atinject_1.0_spec</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>3.0-alpha-1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
<version>${javax-annotation-api}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.openwebbeans</groupId>
|
||||
<artifactId>openwebbeans-se</artifactId>
|
||||
<version>${webbeans}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<!-- required by elasticsearch -->
|
||||
|
@ -20,8 +20,9 @@ import static org.junit.Assert.*;
|
||||
|
||||
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;
|
||||
@ -35,27 +36,29 @@ import org.springframework.data.elasticsearch.entities.Product;
|
||||
*/
|
||||
public class CdiRepositoryTests {
|
||||
|
||||
private static CdiTestContainer cdiContainer;
|
||||
private static SeContainer cdiContainer;
|
||||
private CdiProductRepository repository;
|
||||
private SamplePersonRepository personRepository;
|
||||
private QualifiedProductRepository qualifiedProductRepository;
|
||||
|
||||
@BeforeClass
|
||||
public static void init() throws Exception {
|
||||
cdiContainer = CdiTestContainerLoader.getCdiContainer();
|
||||
cdiContainer.startApplicationScope();
|
||||
cdiContainer.bootContainer();
|
||||
public static void init() {
|
||||
|
||||
cdiContainer = SeContainerInitializer.newInstance() //
|
||||
.disableDiscovery() //
|
||||
.addPackages(CdiRepositoryClient.class) //
|
||||
.initialize();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void shutdown() throws Exception {
|
||||
cdiContainer.stopContexts();
|
||||
cdiContainer.shutdownContainer();
|
||||
public static void shutdown() {
|
||||
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();
|
||||
repository.deleteAll();
|
||||
@ -64,6 +67,7 @@ public class CdiRepositoryTests {
|
||||
|
||||
@Test
|
||||
public void testCdiRepository() {
|
||||
|
||||
assertNotNull(repository);
|
||||
|
||||
Product bean = new Product();
|
||||
@ -132,7 +136,6 @@ public class CdiRepositoryTests {
|
||||
*/
|
||||
@Test
|
||||
public void returnOneFromCustomImpl() {
|
||||
|
||||
assertThat(personRepository.returnOne(), is(1));
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +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>
|
Loading…
x
Reference in New Issue
Block a user