Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d30b41cc59 | |||
| 3fa7851544 | |||
| e990e57b6e | |||
| a30a13dced | |||
| e0d85f0c2a | |||
| 960263837b | |||
| 6dd4d28067 | |||
| adf846d665 | |||
| 8193212d5b | |||
| e529c56ced | |||
| 7ba5195c6e | |||
| f899cf389f | |||
| 196ab5b5e2 | |||
| 771e01189e | |||
| 54d1b2f3dd | |||
| 527d594389 | |||
| 8d0e1df742 |
@@ -54,7 +54,7 @@ the appropriate dependency version.
|
||||
|
||||
| spring data elasticsearch | elasticsearch |
|
||||
|:-----------------------------------:|:-------------:|
|
||||
| 3.0.0.RC1 | 5.5.0 |
|
||||
| 3.0.0.RC2 | 5.5.0 |
|
||||
| 3.0.0.M4 | 5.4.0 |
|
||||
| 2.0.4.RELEASE | 2.4.0 |
|
||||
| 2.0.0.RELEASE | 2.2.0 |
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-elasticsearch</artifactId>
|
||||
<version>3.0.0.RC2</version>
|
||||
<version>3.0.0.RELEASE</version>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.data.build</groupId>
|
||||
<artifactId>spring-data-parent</artifactId>
|
||||
<version>2.0.0.RC2</version>
|
||||
<version>2.0.0.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<name>Spring Data Elasticsearch</name>
|
||||
@@ -20,7 +20,8 @@
|
||||
<commonscollections>3.2.1</commonscollections>
|
||||
<commonslang>2.6</commonslang>
|
||||
<elasticsearch>5.5.0</elasticsearch>
|
||||
<springdata.commons>2.0.0.RC2</springdata.commons>
|
||||
<springdata.commons>2.0.0.RELEASE</springdata.commons>
|
||||
<java-module-name>spring.data.elasticsearch</java-module-name>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -127,10 +128,11 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.openwebbeans.test</groupId>
|
||||
<artifactId>cditest-owb</artifactId>
|
||||
<version>${webbeans}</version>
|
||||
<version>1.2.8</version>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
@@ -143,6 +145,15 @@
|
||||
</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>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
@@ -211,8 +222,8 @@
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spring-libs-milestone</id>
|
||||
<url>https://repo.spring.io/libs-milestone</url>
|
||||
<id>spring-libs-release</id>
|
||||
<url>https://repo.spring.io/libs-release</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
|
||||
@@ -1,6 +1,28 @@
|
||||
Spring Data Elasticsearch Changelog
|
||||
===================================
|
||||
|
||||
Changes in version 3.0.0.RELEASE (2017-10-02)
|
||||
---------------------------------------------
|
||||
* DATAES-397 - Add explicit automatic module name for Java 9.
|
||||
* DATAES-395 - Upgrade to OpenWebBeans 2.0.1.
|
||||
* DATAES-392 - Release 3.0 GA (Kay).
|
||||
|
||||
|
||||
Changes in version 3.0.0.RC3 (2017-09-11)
|
||||
-----------------------------------------
|
||||
* DATAES-376 - Release 3.0 RC3 (Kay).
|
||||
|
||||
|
||||
Changes in version 2.1.7.RELEASE (2017-09-11)
|
||||
---------------------------------------------
|
||||
* DATAES-378 - Release 2.1.7 (Ingalls SR7).
|
||||
|
||||
|
||||
Changes in version 2.1.6.RELEASE (2017-07-26)
|
||||
---------------------------------------------
|
||||
* DATAES-374 - Release 2.1.6 (Ingalls SR6).
|
||||
|
||||
|
||||
Changes in version 3.0.0.RC2 (2017-07-25)
|
||||
-----------------------------------------
|
||||
* DATAES-375 - Release 3.0 RC2 (Kay).
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Spring Data Elasticsearch 3.0 RC2
|
||||
Spring Data Elasticsearch 3.0 GA
|
||||
Copyright (c) [2013-2016] Pivotal Software, Inc.
|
||||
|
||||
This product is licensed to you under the Apache License, Version 2.0 (the "License").
|
||||
|
||||
+141
-138
@@ -1,138 +1,141 @@
|
||||
/*
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.repositories.cdi;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.apache.webbeans.cditest.CdiTestContainer;
|
||||
import org.apache.webbeans.cditest.CdiTestContainerLoader;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.springframework.data.elasticsearch.entities.Product;
|
||||
|
||||
/**
|
||||
* @author Mohsin Husen
|
||||
* @author Mark Paluch
|
||||
* @author Christoph Strobl
|
||||
*/
|
||||
public class CdiRepositoryTests {
|
||||
|
||||
private static CdiTestContainer cdiContainer;
|
||||
private CdiProductRepository repository;
|
||||
private SamplePersonRepository personRepository;
|
||||
private QualifiedProductRepository qualifiedProductRepository;
|
||||
|
||||
@BeforeClass
|
||||
public static void init() throws Exception {
|
||||
cdiContainer = CdiTestContainerLoader.getCdiContainer();
|
||||
cdiContainer.startApplicationScope();
|
||||
cdiContainer.bootContainer();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void shutdown() throws Exception {
|
||||
cdiContainer.stopContexts();
|
||||
cdiContainer.shutdownContainer();
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
CdiRepositoryClient client = cdiContainer.getInstance(CdiRepositoryClient.class);
|
||||
repository = client.getRepository();
|
||||
personRepository = client.getSamplePersonRepository();
|
||||
repository.deleteAll();
|
||||
qualifiedProductRepository = client.getQualifiedProductRepository();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCdiRepository() {
|
||||
assertNotNull(repository);
|
||||
|
||||
Product bean = new Product();
|
||||
bean.setId("id-1");
|
||||
bean.setName("cidContainerTest-1");
|
||||
|
||||
repository.save(bean);
|
||||
|
||||
assertTrue(repository.existsById(bean.getId()));
|
||||
|
||||
Optional<Product> retrieved = repository.findById(bean.getId());
|
||||
|
||||
assertTrue(retrieved.isPresent());
|
||||
retrieved.ifPresent(product -> {
|
||||
assertEquals(bean.getId(), product.getId());
|
||||
assertEquals(bean.getName(), product.getName());
|
||||
});
|
||||
|
||||
assertEquals(1, repository.count());
|
||||
|
||||
assertTrue(repository.existsById(bean.getId()));
|
||||
|
||||
repository.delete(bean);
|
||||
|
||||
assertEquals(0, repository.count());
|
||||
retrieved = repository.findById(bean.getId());
|
||||
assertFalse(retrieved.isPresent());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAES-234
|
||||
*/
|
||||
@Test
|
||||
public void testQualifiedCdiRepository() {
|
||||
assertNotNull(qualifiedProductRepository);
|
||||
|
||||
Product bean = new Product();
|
||||
bean.setId("id-1");
|
||||
bean.setName("cidContainerTest-1");
|
||||
|
||||
qualifiedProductRepository.save(bean);
|
||||
|
||||
assertTrue(qualifiedProductRepository.existsById(bean.getId()));
|
||||
|
||||
Optional<Product> retrieved = qualifiedProductRepository.findById(bean.getId());
|
||||
|
||||
assertTrue(retrieved.isPresent());
|
||||
retrieved.ifPresent(product -> {
|
||||
assertEquals(bean.getId(), product.getId());
|
||||
assertEquals(bean.getName(), product.getName());
|
||||
});
|
||||
|
||||
assertEquals(1, qualifiedProductRepository.count());
|
||||
|
||||
assertTrue(qualifiedProductRepository.existsById(bean.getId()));
|
||||
|
||||
qualifiedProductRepository.delete(bean);
|
||||
|
||||
assertEquals(0, qualifiedProductRepository.count());
|
||||
retrieved = qualifiedProductRepository.findById(bean.getId());
|
||||
assertFalse(retrieved.isPresent());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAES-113
|
||||
*/
|
||||
@Test
|
||||
public void returnOneFromCustomImpl() {
|
||||
|
||||
assertThat(personRepository.returnOne(), is(1));
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Copyright 2014-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.repositories.cdi;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.apache.webbeans.cditest.CdiTestContainer;
|
||||
import org.apache.webbeans.cditest.CdiTestContainerLoader;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.springframework.data.elasticsearch.entities.Product;
|
||||
|
||||
/**
|
||||
* @author Mohsin Husen
|
||||
* @author Mark Paluch
|
||||
* @author Christoph Strobl
|
||||
*/
|
||||
public class CdiRepositoryTests {
|
||||
|
||||
private static CdiTestContainer cdiContainer;
|
||||
private CdiProductRepository repository;
|
||||
private SamplePersonRepository personRepository;
|
||||
private QualifiedProductRepository qualifiedProductRepository;
|
||||
|
||||
@BeforeClass
|
||||
public static void init() throws Exception {
|
||||
|
||||
cdiContainer = CdiTestContainerLoader.getCdiContainer();
|
||||
cdiContainer.startApplicationScope();
|
||||
cdiContainer.bootContainer();
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void shutdown() throws Exception {
|
||||
|
||||
cdiContainer.stopContexts();
|
||||
cdiContainer.shutdownContainer();
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
|
||||
CdiRepositoryClient client = cdiContainer.getInstance(CdiRepositoryClient.class);
|
||||
repository = client.getRepository();
|
||||
personRepository = client.getSamplePersonRepository();
|
||||
repository.deleteAll();
|
||||
qualifiedProductRepository = client.getQualifiedProductRepository();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCdiRepository() {
|
||||
|
||||
assertNotNull(repository);
|
||||
|
||||
Product bean = new Product();
|
||||
bean.setId("id-1");
|
||||
bean.setName("cidContainerTest-1");
|
||||
|
||||
repository.save(bean);
|
||||
|
||||
assertTrue(repository.existsById(bean.getId()));
|
||||
|
||||
Optional<Product> retrieved = repository.findById(bean.getId());
|
||||
|
||||
assertTrue(retrieved.isPresent());
|
||||
retrieved.ifPresent(product -> {
|
||||
assertEquals(bean.getId(), product.getId());
|
||||
assertEquals(bean.getName(), product.getName());
|
||||
});
|
||||
|
||||
assertEquals(1, repository.count());
|
||||
|
||||
assertTrue(repository.existsById(bean.getId()));
|
||||
|
||||
repository.delete(bean);
|
||||
|
||||
assertEquals(0, repository.count());
|
||||
retrieved = repository.findById(bean.getId());
|
||||
assertFalse(retrieved.isPresent());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAES-234
|
||||
*/
|
||||
@Test
|
||||
public void testQualifiedCdiRepository() {
|
||||
assertNotNull(qualifiedProductRepository);
|
||||
|
||||
Product bean = new Product();
|
||||
bean.setId("id-1");
|
||||
bean.setName("cidContainerTest-1");
|
||||
|
||||
qualifiedProductRepository.save(bean);
|
||||
|
||||
assertTrue(qualifiedProductRepository.existsById(bean.getId()));
|
||||
|
||||
Optional<Product> retrieved = qualifiedProductRepository.findById(bean.getId());
|
||||
|
||||
assertTrue(retrieved.isPresent());
|
||||
retrieved.ifPresent(product -> {
|
||||
assertEquals(bean.getId(), product.getId());
|
||||
assertEquals(bean.getName(), product.getName());
|
||||
});
|
||||
|
||||
assertEquals(1, qualifiedProductRepository.count());
|
||||
|
||||
assertTrue(qualifiedProductRepository.existsById(bean.getId()));
|
||||
|
||||
qualifiedProductRepository.delete(bean);
|
||||
|
||||
assertEquals(0, qualifiedProductRepository.count());
|
||||
retrieved = qualifiedProductRepository.findById(bean.getId());
|
||||
assertFalse(retrieved.isPresent());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAES-113
|
||||
*/
|
||||
@Test
|
||||
public void returnOneFromCustomImpl() {
|
||||
assertThat(personRepository.returnOne(), is(1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +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>
|
||||
<?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