Changeset 1478


Ignore:
Timestamp:
Feb 2, 2011, 1:52:01 PM (7 years ago)
Author:
s.h.sikkema@…
Message:

Made StudySearchTests? succeed while still being able to manually inject moduleCommunicationService

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/groovy/dbnp/query/Search.groovy

    r1473 r1478  
    4242        public void setResultFields( Map r ) { resultFields = r; }
    4343
    44     def moduleCommunicationService
    45 
    4644        /**
    4745         * Returns the number of results found by this search
     
    208206                        return [];
    209207                       
    210 //              // Determine the moduleCommunicationService
    211 //              ApplicationContext ctx = (ApplicationContext)ApplicationHolder.getApplication().getMainContext();
    212 //              def moduleCommunicationService = ctx.getBean("moduleCommunicationService");
     208                // Determine the moduleCommunicationService
     209                def ctx = ApplicationHolder.getApplication().getMainContext();
     210                def moduleCommunicationService = ctx.getBean("moduleCommunicationService");
    213211                       
    214212                // Loop through all modules and check whether criteria have been given
  • trunk/test/unit/dbnp/query/StudySearchTests.groovy

    r1473 r1478  
    44import grails.test.*
    55import org.dbnp.gdt.AssayModule
     6import org.codehaus.groovy.grails.commons.ApplicationHolder
    67
    78/**
     
    4849                samples.each { it.parent.addToSamples( it ); }
    4950                assays.each { it.parent.addToAssays( it ); }
     51
     52        // some mocks to make sure test doesn't break on finding 'moduleCommunicationService'
     53        ApplicationHolder.metaClass.static.getApplication = { [getMainContext: { [getBean: {a -> null}] }] }
    5054               
    5155    }
Note: See TracChangeset for help on using the changeset viewer.