Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/RepositoryProxy.java =================================================================== diff -u -rd69fd0c0b6e3af330bb1ddbf3099022feca3f092 -rbf4e2ba397c7ea1c20fe502a0039c411309bcf2f --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/RepositoryProxy.java (.../RepositoryProxy.java) (revision d69fd0c0b6e3af330bb1ddbf3099022feca3f092) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/RepositoryProxy.java (.../RepositoryProxy.java) (revision bf4e2ba397c7ea1c20fe502a0039c411309bcf2f) @@ -47,4 +47,20 @@ return repository; } + /** Get a version of the repository service suitable for using in JUNIT tests. + * It has been placed here (as well as similar logic existing in the BaseTestCase) + * so that other projects can access the appropriate Spring configuration. + * This configuration uses a local datasource and does not use the cache. + * @return Repository service built using a local datasource + */ + public static IRepository getLocalRepositoryService() { + + ApplicationContext context = new ClassPathXmlApplicationContext(IRepository.LOCAL_CONTEXT_PATH); + if ( context == null ) + throw new RepositoryRuntimeException("Unable to access application context. Cannot create repository object."); + + IRepository repository =(IRepository)context.getBean(IRepository.REPOSITORY_SERVICE_ID); + return repository; + } + } Index: lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/contentRepositoryLocalApplicationContext.xml =================================================================== diff -u --- lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/contentRepositoryLocalApplicationContext.xml (revision 0) +++ lams_contentrepository/src/java/org/lamsfoundation/lams/contentrepository/contentRepositoryLocalApplicationContext.xml (revision bf4e2ba397c7ea1c20fe502a0039c411309bcf2f) @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + /org/lamsfoundation/lams/contentrepository/dbConnection.properties + + + + + messages + + + + + + + + com.mysql.jdbc.Driver + jdbc:mysql://localhost/lams?characterEncoding=utf8 + lams + lamsdemo + + + + + + + + org/lamsfoundation/lams/contentrepository/CrCredential.hbm.xml + org/lamsfoundation/lams/contentrepository/CrNode.hbm.xml + org/lamsfoundation/lams/contentrepository/CrNodeVersion.hbm.xml + org/lamsfoundation/lams/contentrepository/CrNodeVersionProperty.hbm.xml + org/lamsfoundation/lams/contentrepository/CrWorkspace.hbm.xml + org/lamsfoundation/lams/contentrepository/CrWorkspaceCredential.hbm.xml + + + + + ${hibernate.dialect} + ${hibernate.show_sql} + ${hibernate.c3p0.minPoolSize} + ${hibernate.c3p0.maxPoolSize} + ${hibernate.c3p0.timeout} + ${hibernate.c3p0.max_statement} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PROPAGATION_SUPPORTS,readOnly,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_SUPPORTS,-RepositoryCheckedException,-RepositoryRuntimeException + + PROPAGATION_REQUIRED,readOnly,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,readOnly,-RepositoryCheckedException,-RepositoryRuntimeException + PROPAGATION_REQUIRED,readOnly,-RepositoryCheckedException,-RepositoryRuntimeException + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + D:\repository + + + Fisheye: Tag bf4e2ba397c7ea1c20fe502a0039c411309bcf2f refers to a dead (removed) revision in file `lams_contentrepository/test/java/org/lamsfoundation/lams/contentrepository/testContentRepositoryApplicationContext.xml'. Fisheye: No comparison available. Pass `N' to diff?