Commits

Raza Ali committed 09bd777

Protecting lucene indexes during testing

UpdatedRepListener sets the index location based on the
environment variable. Also, multi-process tests disabled
until a more thought out design decision can be made.

Comments (0)

Files changed (2)

src/groovy/net/biomodels/jummp/search/UpdatedRepositoryListener.groovy

 import org.apache.lucene.search.SearcherFactory
 import org.apache.lucene.search.IndexSearcher
 import org.codehaus.groovy.grails.commons.ApplicationHolder
+import grails.util.Environment
 /**
  * @short Listener for new revisions and models for indexing
  * 
 	def grailsApplication = ApplicationHolder.application
 	
 	public UpdatedRepositoryListener() {
-		File location=new File(grailsApplication.config.jummp.search.index)
+		String path=grailsApplication.config.jummp.search.index
+		if (Environment.current == Environment.TEST) {
+			path = "target/search/index"
+		}
+		File location=new File(path)
 		location.mkdirs()
 		System.out.println("USING ${location} for directory!")
 		//Create instance of Directory where index files will be stored

test/integration/net/biomodels/jummp/core/MultiProcessRepositoryTests.groovy

        FileUtils.deleteDirectory(new File("target/vcs/modelfolder"))
     }
 
-    @Test
+    @Ignore @Test
     void testConcurrent() {
     	//start up sync server
         InterJummpSync sync=new InterJummpSync()