mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-01 09:42:11 +00:00
parent
843fd4db85
commit
a3e87a8525
32
pom.xml
32
pom.xml
@ -173,6 +173,7 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Logging -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>log4j-over-slf4j</artifactId>
|
<artifactId>log4j-over-slf4j</artifactId>
|
||||||
@ -198,6 +199,21 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- CDI -->
|
<!-- CDI -->
|
||||||
|
<!-- Dependency order required to build against CDI 1.0 and test with CDI 2.0 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.geronimo.specs</groupId>
|
||||||
|
<artifactId>geronimo-jcdi_2.0_spec</artifactId>
|
||||||
|
<version>1.0.1</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.interceptor</groupId>
|
||||||
|
<artifactId>javax.interceptor-api</artifactId>
|
||||||
|
<version>1.2.1</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.enterprise</groupId>
|
<groupId>javax.enterprise</groupId>
|
||||||
<artifactId>cdi-api</artifactId>
|
<artifactId>cdi-api</artifactId>
|
||||||
@ -206,6 +222,20 @@
|
|||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</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>
|
||||||
|
|
||||||
<!-- Test -->
|
<!-- Test -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
@ -242,6 +272,7 @@
|
|||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!--
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.openwebbeans.test</groupId>
|
<groupId>org.apache.openwebbeans.test</groupId>
|
||||||
<artifactId>cditest-owb</artifactId>
|
<artifactId>cditest-owb</artifactId>
|
||||||
@ -258,6 +289,7 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
-->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.skyscreamer</groupId>
|
<groupId>org.skyscreamer</groupId>
|
||||||
|
@ -24,8 +24,9 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
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.jupiter.api.AfterAll;
|
import org.junit.jupiter.api.AfterAll;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
@ -48,7 +49,9 @@ import org.springframework.lang.Nullable;
|
|||||||
@IntegrationTest
|
@IntegrationTest
|
||||||
public class CdiRepositoryTests {
|
public class CdiRepositoryTests {
|
||||||
|
|
||||||
@Nullable private static CdiTestContainer cdiContainer;
|
@Nullable private static SeContainer container;
|
||||||
|
|
||||||
|
// @Nullable private static CdiTestContainer cdiContainer;
|
||||||
private CdiProductRepository repository;
|
private CdiProductRepository repository;
|
||||||
private SamplePersonRepository personRepository;
|
private SamplePersonRepository personRepository;
|
||||||
private QualifiedProductRepository qualifiedProductRepository;
|
private QualifiedProductRepository qualifiedProductRepository;
|
||||||
@ -56,22 +59,24 @@ public class CdiRepositoryTests {
|
|||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void init() throws Exception {
|
public static void init() throws Exception {
|
||||||
|
|
||||||
cdiContainer = CdiTestContainerLoader.getCdiContainer();
|
container = SeContainerInitializer.newInstance() //
|
||||||
cdiContainer.startApplicationScope();
|
.disableDiscovery()//
|
||||||
cdiContainer.bootContainer();
|
.addPackages(CdiRepositoryTests.class) //
|
||||||
|
.initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterAll
|
@AfterAll
|
||||||
public static void shutdown() throws Exception {
|
public static void shutdown() throws Exception {
|
||||||
|
|
||||||
cdiContainer.stopContexts();
|
if (container != null) {
|
||||||
cdiContainer.shutdownContainer();
|
container.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
|
|
||||||
CdiRepositoryClient client = cdiContainer.getInstance(CdiRepositoryClient.class);
|
CdiRepositoryClient client = container.select(CdiRepositoryClient.class).get();
|
||||||
repository = client.getRepository();
|
repository = client.getRepository();
|
||||||
personRepository = client.getSamplePersonRepository();
|
personRepository = client.getSamplePersonRepository();
|
||||||
repository.deleteAll();
|
repository.deleteAll();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user