mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-24 21:12:12 +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>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.openwebbeans.test</groupId>
|
<dependency>
|
||||||
<artifactId>cditest-owb</artifactId>
|
<groupId>javax.annotation</groupId>
|
||||||
<version>${webbeans}</version>
|
<artifactId>javax.annotation-api</artifactId>
|
||||||
<scope>test</scope>
|
<version>${javax-annotation-api}</version>
|
||||||
<exclusions>
|
<scope>test</scope>
|
||||||
<exclusion>
|
</dependency>
|
||||||
<groupId>org.apache.geronimo.specs</groupId>
|
|
||||||
<artifactId>geronimo-jcdi_1.0_spec</artifactId>
|
<dependency>
|
||||||
</exclusion>
|
<groupId>org.apache.openwebbeans</groupId>
|
||||||
<exclusion>
|
<artifactId>openwebbeans-se</artifactId>
|
||||||
<groupId>org.apache.geronimo.specs</groupId>
|
<version>${webbeans}</version>
|
||||||
<artifactId>geronimo-atinject_1.0_spec</artifactId>
|
<scope>test</scope>
|
||||||
</exclusion>
|
</dependency>
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.servlet</groupId>
|
|
||||||
<artifactId>servlet-api</artifactId>
|
|
||||||
<version>3.0-alpha-1</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<!-- required by elasticsearch -->
|
<!-- required by elasticsearch -->
|
||||||
|
@ -20,8 +20,9 @@ import static org.junit.Assert.*;
|
|||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import org.apache.webbeans.cditest.CdiTestContainer;
|
import javax.enterprise.inject.se.SeContainer;
|
||||||
import org.apache.webbeans.cditest.CdiTestContainerLoader;
|
import javax.enterprise.inject.se.SeContainerInitializer;
|
||||||
|
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
@ -35,27 +36,29 @@ import org.springframework.data.elasticsearch.entities.Product;
|
|||||||
*/
|
*/
|
||||||
public class CdiRepositoryTests {
|
public class CdiRepositoryTests {
|
||||||
|
|
||||||
private static CdiTestContainer cdiContainer;
|
private static SeContainer cdiContainer;
|
||||||
private CdiProductRepository repository;
|
private CdiProductRepository repository;
|
||||||
private SamplePersonRepository personRepository;
|
private SamplePersonRepository personRepository;
|
||||||
private QualifiedProductRepository qualifiedProductRepository;
|
private QualifiedProductRepository qualifiedProductRepository;
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void init() throws Exception {
|
public static void init() {
|
||||||
cdiContainer = CdiTestContainerLoader.getCdiContainer();
|
|
||||||
cdiContainer.startApplicationScope();
|
cdiContainer = SeContainerInitializer.newInstance() //
|
||||||
cdiContainer.bootContainer();
|
.disableDiscovery() //
|
||||||
|
.addPackages(CdiRepositoryClient.class) //
|
||||||
|
.initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
public static void shutdown() throws Exception {
|
public static void shutdown() {
|
||||||
cdiContainer.stopContexts();
|
cdiContainer.close();
|
||||||
cdiContainer.shutdownContainer();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
CdiRepositoryClient client = cdiContainer.getInstance(CdiRepositoryClient.class);
|
|
||||||
|
CdiRepositoryClient client = cdiContainer.select(CdiRepositoryClient.class).get();
|
||||||
repository = client.getRepository();
|
repository = client.getRepository();
|
||||||
personRepository = client.getSamplePersonRepository();
|
personRepository = client.getSamplePersonRepository();
|
||||||
repository.deleteAll();
|
repository.deleteAll();
|
||||||
@ -64,6 +67,7 @@ public class CdiRepositoryTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCdiRepository() {
|
public void testCdiRepository() {
|
||||||
|
|
||||||
assertNotNull(repository);
|
assertNotNull(repository);
|
||||||
|
|
||||||
Product bean = new Product();
|
Product bean = new Product();
|
||||||
@ -132,7 +136,6 @@ public class CdiRepositoryTests {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void returnOneFromCustomImpl() {
|
public void returnOneFromCustomImpl() {
|
||||||
|
|
||||||
assertThat(personRepository.returnOne(), is(1));
|
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