DATACOUCH-47 - ensure multiple buckets are working over xml config.

This test verifies the functionality as reported in the ticket.
This commit is contained in:
Michael Nitschinger
2014-01-24 12:40:39 +01:00
parent 11ed095c58
commit 9c3cc52d2e
2 changed files with 34 additions and 0 deletions

View File

@@ -60,4 +60,15 @@ public class CouchbaseTemplateParserIntegrationTests {
factory.getBean("couchbaseTemplate");
}
/**
* Test case for DATACOUCH-47.
*/
@Test
public void allowsMultipleBuckets() {
reader.loadBeanDefinitions(new ClassPathResource("namespace/couchbase-multi-bucket-bean.xml"));
factory.getBean("cb-template-first");
factory.getBean("cb-template-second");
}
}

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:couchbase="http://www.springframework.org/schema/data/couchbase"
xmlns:data-repository="http://www.springframework.org/schema/data/repository"
xsi:schemaLocation="http://www.springframework.org/schema/data/couchbase http://www.springframework.org/schema/data/couchbase/spring-couchbase.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/data/repository http://www.springframework.org/schema/data/repository/spring-repository.xsd">
<couchbase:couchbase id="cb-first" bucket="default" password="" host="localhost" />
<couchbase:couchbase id="cb-second" bucket="default" password="" host="localhost" />
<couchbase:template id="cb-template-first" client-ref="cb-first" />
<couchbase:template id="cb-template-second" client-ref="cb-second" />
<couchbase:repositories base-package="com.example" couchbase-template-ref="cb-template-first">
<data-repository:include-filter type="regex" expression=".*ARepository" />
</couchbase:repositories>
<couchbase:repositories base-package="com.example" couchbase-template-ref="cb-template-second">
<data-repository:include-filter type="regex" expression=".*BRepository" />
</couchbase:repositories>
</beans>