Ignore:
Timestamp:
Feb 3, 2011, 10:51:16 AM (9 years ago)
Author:
robert@…
Message:
  • Fixed StudySearch? unit tests (#303)
  • Changed css error message to class="errormessage" in order to avoid breaking the study wizard (see r1485)
File:
1 edited

Legend:

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

    r1483 r1487  
    4949        public void setResultFields( Map r ) { resultFields = r; }
    5050
     51        public Search() {
     52                def ctx = ApplicationHolder.getApplication().getMainContext();
     53                def authenticationService = ctx.getBean("authenticationService");
     54                def sessionUser = authenticationService?.getLoggedInUser();
     55
     56                if( sessionUser )
     57                        this.user = sessionUser;
     58                else
     59                        this.user = null
     60        }
     61       
    5162        /**
    5263         * Returns the number of results found by this search
     
    215226                        return [];
    216227                       
    217                 // Determine the moduleCommunicationService
    218                 def ctx = (ApplicationContext)ApplicationHolder.getApplication().getMainContext();
     228                // Determine the moduleCommunicationService. Because this object
     229                // is mocked in the tests, it can't be converted to a ApplicationContext object
     230                def ctx = ApplicationHolder.getApplication().getMainContext();
    219231                def moduleCommunicationService = ctx.getBean("moduleCommunicationService");
    220232                       
Note: See TracChangeset for help on using the changeset viewer.