Changeset 2590


Ignore:
Timestamp:
02/14/13 15:46:12 (11 years ago)
Author:
keeloo
Message:

some work on the vlo tests

Location:
vlo/branches/vlo-2.13-param/vlo_webapp/src
Files:
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • vlo/branches/vlo-2.13-param/vlo_webapp/src/main/java/eu/clarin/cmdi/vlo/VloApplication.java

    r2577 r2590  
    1414    private final SearchResultsDao searchResults;
    1515
     16    static WebAppConfig config;
     17   
    1618    public VloApplication() {
    17         // BeanFactory factory = new ClassPathXmlApplicationContext(new String[] { Configuration.CONFIG_FILE });
    18         // factory.getBean("configuration"); //Use Configuration.getInstance to get the Configuration just loading the instance here.
    19         WebAppConfig.setServletContext(this.getServletContext());
    20         String test = WebAppConfig.open().getSolrUrl();
    21        
     19        /**
     20         * The new way of doing things. In case of the web application tests:
     21         * just extend this class, and override the constructor by invoking the
     22         * open method of the extended test web application configuration class.
     23         * Also, change the way in which the get methods are being invoked. From
     24         * now on, you only have to invoke config.get ...
     25         */
     26        config = WebAppConfig.open();
     27        // String test;
     28        // test = config.getVloHomeLink();
     29
    2230        searchResults = new SearchResultsDao();
    2331    }
  • vlo/branches/vlo-2.13-param/vlo_webapp/src/main/java/eu/clarin/cmdi/vlo/config/ConfigFromFile.java

    r2577 r2590  
    2626 * @author keeloo
    2727 */
    28 public abstract class ConfigFileParam {
     28public abstract class ConfigFromFile {
    2929
    3030    /**
    3131     * Empty constructor
    3232     */
    33     public ConfigFileParam() {
     33    public ConfigFromFile() {
    3434    }
    3535
     
    5252     * @return the object with values assigned to annotated members
    5353     */
    54     public static synchronized ConfigFileParam read(ConfigFileParam config) {
     54    public static synchronized ConfigFromFile read(ConfigFromFile config) {
    5555
    5656        ConfigFilePersister persister;
     
    5959
    6060        // assign the members their values
    61         config = (ConfigFileParam) persister.ConfigFromFile();
     61        config = (ConfigFromFile) persister.ConfigFromFile();
    6262        return config;
    6363    }
     
    6969     * written to a file in the form of an XML definition.
    7070     */
    71      public static void write(ConfigFileParam config) {
     71     public static void write(ConfigFromFile config) {
    7272       
    7373        ConfigFilePersister persister;
  • vlo/branches/vlo-2.13-param/vlo_webapp/src/main/java/eu/clarin/cmdi/vlo/config/ImporterConfig.java

    r2570 r2590  
    1818 */
    1919@Root // directive for Simple
    20 public class ImporterConfig extends ConfigFileParam {
     20public class ImporterConfig extends ConfigFromFile {
    2121   
    2222    /**
  • vlo/branches/vlo-2.13-param/vlo_webapp/src/main/java/eu/clarin/cmdi/vlo/config/WebAppConfig.java

    r2577 r2590  
    6666 */
    6767@Root
    68 public class WebAppConfig extends ConfigFileParam {
     68public class WebAppConfig extends ConfigFromFile {
    6969
    7070    // create a reference to the application logging
     
    9494        ConfigFilePersister.setLogger(WebAppConfig.logger);
    9595    }
    96 
     96   
    9797    /**
    9898     * XML File in which the application configuration is stored
     
    161161        /* Contrary to Simple, the servlet context parameters are not retrieved
    162162         * by annotation. Get them by invoking a local method.
     163         *
     164         * Here also invoke a superclass method
    163165         */
    164166        config = addServletContext(config);
     
    567569       
    568570        servletContext = context;
    569     }
    570 
     571       
     572        // servletContest can be null
     573    }
     574   
    571575    /**
    572576     * Add properties of the {@literal servlet's} context<br><br>
     
    582586
    583587        // retrieve parameter valies from the servlet context
    584 
    585         config.solrUrl = servletContext.getInitParameter("solrUrl");
     588       
     589        if (servletContext == null) {
     590            // no servlet context yet
     591           
     592        } else {
     593            config.solrUrl = servletContext.getInitParameter("solrUrl");
     594        }
    586595
    587596        return config;
     
    595604     */
    596605   
    597     @Element
    598606    private String solrUrl = "";
    599607
  • vlo/branches/vlo-2.13-param/vlo_webapp/src/main/webapp/META-INF/context.xml

    r2577 r2590  
    1616
    1717<Context antiJARLocking="true" path="/vlo">
    18     <Parameter name=solrURL value="http://localhost:8084/vlo_solr/"/>
     18    <Parameter name=solrUrl value="http://localhost:8084/vlo_solr/"/>
    1919</Context>
  • vlo/branches/vlo-2.13-param/vlo_webapp/src/test/java/eu/clarin/cmdi/vlo/pages/FacetBoxPanelTest.java

    r1093 r2590  
    1717    @Before
    1818    public void setUp() {
    19         new WicketTester(new VloApplication());
     19        WicketTester wicketTester;
     20        wicketTester = new WicketTester(new VloApplication());
    2021    }
    2122
Note: See TracChangeset for help on using the changeset viewer.