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:
@@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
23
src/test/resources/namespace/couchbase-multi-bucket-bean.xml
Normal file
23
src/test/resources/namespace/couchbase-multi-bucket-bean.xml
Normal 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>
|
||||
Reference in New Issue
Block a user