mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-13 07:32:11 +00:00
DATAES-395 - Downgrade to CDI 1.0.
This commit is contained in:
parent
e0d85f0c2a
commit
a30a13dced
44
pom.xml
44
pom.xml
@ -21,7 +21,7 @@
|
||||
<commonslang>2.6</commonslang>
|
||||
<elasticsearch>5.5.0</elasticsearch>
|
||||
<springdata.commons>2.0.0.BUILD-SNAPSHOT</springdata.commons>
|
||||
<java-module-name>spring.data.elasticsearch</java-module-name>
|
||||
<java-module-name>spring.data.elasticsearch</java-module-name>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@ -129,19 +129,37 @@
|
||||
</exclusions>
|
||||
</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.test</groupId>
|
||||
<artifactId>cditest-owb</artifactId>
|
||||
<version>1.2.8</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>
|
||||
|
||||
<!-- Upgrade xbean to 4.5 to prevent incompatibilities due to ASM versions -->
|
||||
<dependency>
|
||||
<groupId>org.apache.xbean</groupId>
|
||||
<artifactId>xbean-asm5-shaded</artifactId>
|
||||
<version>4.5</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.openwebbeans</groupId>
|
||||
<artifactId>openwebbeans-se</artifactId>
|
||||
<version>${webbeans}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>3.0-alpha-1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<!-- required by elasticsearch -->
|
||||
|
@ -20,9 +20,8 @@ import static org.junit.Assert.*;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.enterprise.inject.se.SeContainer;
|
||||
import javax.enterprise.inject.se.SeContainerInitializer;
|
||||
|
||||
import org.apache.webbeans.cditest.CdiTestContainer;
|
||||
import org.apache.webbeans.cditest.CdiTestContainerLoader;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
@ -36,29 +35,30 @@ import org.springframework.data.elasticsearch.entities.Product;
|
||||
*/
|
||||
public class CdiRepositoryTests {
|
||||
|
||||
private static SeContainer cdiContainer;
|
||||
private static CdiTestContainer cdiContainer;
|
||||
private CdiProductRepository repository;
|
||||
private SamplePersonRepository personRepository;
|
||||
private QualifiedProductRepository qualifiedProductRepository;
|
||||
|
||||
@BeforeClass
|
||||
public static void init() {
|
||||
public static void init() throws Exception {
|
||||
|
||||
cdiContainer = SeContainerInitializer.newInstance() //
|
||||
.disableDiscovery() //
|
||||
.addPackages(CdiRepositoryClient.class) //
|
||||
.initialize();
|
||||
cdiContainer = CdiTestContainerLoader.getCdiContainer();
|
||||
cdiContainer.startApplicationScope();
|
||||
cdiContainer.bootContainer();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void shutdown() {
|
||||
cdiContainer.close();
|
||||
public static void shutdown() throws Exception {
|
||||
|
||||
cdiContainer.stopContexts();
|
||||
cdiContainer.shutdownContainer();
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
|
||||
CdiRepositoryClient client = cdiContainer.select(CdiRepositoryClient.class).get();
|
||||
CdiRepositoryClient client = cdiContainer.getInstance(CdiRepositoryClient.class);
|
||||
repository = client.getRepository();
|
||||
personRepository = client.getSamplePersonRepository();
|
||||
repository.deleteAll();
|
||||
|
5
src/test/resources/META-INF/beans.xml
Normal file
5
src/test/resources/META-INF/beans.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?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