Ignore:
Timestamp:
07/23/15 12:59:01 (9 years ago)
Author:
Twan Goosen
Message:

Data roots are include via XInclude, file to include determined via property. Default build has not changed (now a profile called 'test-local'). Filtered (post-build) config files are now included in the distribution package instead of from source.
Fixes #746

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vlo/trunk/vlo-commons/src/test/java/eu/clarin/cmdi/vlo/config/VloConfigMarshallerTest.java

    r6087 r6409  
    2121import java.io.StringWriter;
    2222import java.util.Arrays;
     23import java.util.Properties;
    2324import javax.xml.transform.stream.StreamResult;
    2425import javax.xml.transform.stream.StreamSource;
     
    3132
    3233/**
    33  * 
     34 *
    3435 * @author twagoo
    3536 */
    3637public class VloConfigMarshallerTest {
    3738   
     39    private final static String VLO_CONFIG_FILE = "/VloConfig.xml";
    3840    private final static Logger logger = LoggerFactory.getLogger(VloConfigMarshallerTest.class);
    3941    private VloConfigMarshaller instance;
     42    private Properties testProps;
    4043   
    4144    @Before
    4245    public void setUp() throws Exception {
    4346        instance = new VloConfigMarshaller();
     47        testProps = new Properties();
     48        testProps.load(getClass().getResourceAsStream("/vloconfig.properties"));
    4449    }
    4550
     
    4954    @Test
    5055    public void testUnmarshal() throws Exception {
    51         InputStream configFile = getClass().getResourceAsStream("/VloConfig.xml");
    52         VloConfig config = instance.unmarshal(new StreamSource(configFile));
     56        InputStream configFile = getClass().getResourceAsStream(VLO_CONFIG_FILE);
     57        VloConfig config = instance.unmarshal(new StreamSource(configFile, getClass().getResource(VLO_CONFIG_FILE).toString()));
    5358        configFile.close();
    5459       
    5560        assertNotNull(config);
    56         assertEquals("http://localhost:8080/vlo-solr/core0/", config.getSolrUrl());
    57         assertEquals(2, config.getDataRoots().size());
     61        assertEquals(testProps.getProperty("solrUrl"), config.getSolrUrl());
    5862        assertEquals(14, config.getFacetFields().size());
    5963    }
Note: See TracChangeset for help on using the changeset viewer.