SGF-140 - Update to Spring Data Commons 1.5.0.

Expose GemfireMappingContext to the parent class to enable PersistentEntity lookup.
This commit is contained in:
Oliver Gierke
2012-11-28 19:01:25 +01:00
parent 0a2fcb7324
commit b9f4a55c79
5 changed files with 43 additions and 5 deletions

View File

@@ -15,11 +15,19 @@
*/
package org.springframework.data.gemfire.repository.support;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import java.util.Collections;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.data.gemfire.mapping.Regions;
import org.springframework.data.gemfire.repository.sample.Person;
import org.springframework.data.gemfire.repository.sample.PersonRepository;
import org.springframework.data.mapping.PersistentEntity;
import org.springframework.data.repository.support.Repositories;
import org.springframework.test.context.ContextConfiguration;
/**
@@ -30,6 +38,9 @@ import org.springframework.test.context.ContextConfiguration;
@ContextConfiguration("../config/repo-context.xml")
public class GemfireRepositoryFactoryIntegrationTests extends AbstractGemfireRepositoryFactoryIntegrationTests {
@Autowired
ApplicationContext context;
@Override
protected PersonRepository getRepository(Regions regions) {
@@ -44,4 +55,15 @@ public class GemfireRepositoryFactoryIntegrationTests extends AbstractGemfireRep
GemfireRepositoryFactory factory = new GemfireRepositoryFactory((Iterable) Collections.emptySet(), null);
factory.getRepository(PersonRepository.class);
}
/**
* @see SGF-140
*/
@Test
public void exposesPersistentProperty() {
Repositories repositories = new Repositories(context);
PersistentEntity<?, ?> entity = repositories.getPersistentEntity(Person.class);
assertThat(entity, is(notNullValue()));
}
}