Changeset 6517


Ignore:
Timestamp:
09/21/15 14:46:02 (9 years ago)
Author:
davor.ostojic@oeaw.ac.at
Message:
 
Location:
vlo/branches/vlo-3.3-oeaw/vlo-importer/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • vlo/branches/vlo-3.3-oeaw/vlo-importer/src/main/java/eu/clarin/cmdi/vlo/importer/VLOMarshaller.java

    r6366 r6517  
    5353        FacetConceptMapping result;
    5454       
    55                 try {
    56                         result = (FacetConceptMapping) unmarshal(inputStream, FacetConceptMapping.class);
     55                try {                   
     56                        JAXBContext jc = JAXBContext.newInstance(FacetConceptMapping.class);
     57                Unmarshaller u = jc.createUnmarshaller();
     58                result = (FacetConceptMapping) u.unmarshal(inputStream);       
    5759                } catch (JAXBException e) {
    5860                        throw new RuntimeException();
     
    6365    }
    6466   
    65     /**
    66      * Get object of specified type from input stream
    67      *
    68      * @param inputStream
    69      * @param clazz
    70      * @return
    71      */
    72     static Object unmarshal(InputStream inputStream, Class<?> clazz)throws JAXBException{
    73         JAXBContext jc = JAXBContext.newInstance(clazz);
    74         Unmarshaller u = jc.createUnmarshaller();
    75         return u.unmarshal(inputStream);       
    76     }
    7767
    7868    /**
  • vlo/branches/vlo-3.3-oeaw/vlo-importer/src/test/java/eu/clarin/cmdi/vlo/importer/ImporterTestcase.java

    r6515 r6517  
    11package eu.clarin.cmdi.vlo.importer;
     2
     3import java.io.File;
     4import java.io.IOException;
     5import java.net.URISyntaxException;
     6import java.net.URL;
     7import java.net.URLClassLoader;
     8
     9import org.apache.commons.io.FileUtils;
     10import org.junit.After;
     11import org.junit.Before;
     12import org.junit.Rule;
     13import org.junit.rules.TemporaryFolder;
    214
    315import eu.clarin.cmdi.vlo.LanguageCodeUtils;
     
    517import eu.clarin.cmdi.vlo.config.VloConfig;
    618import eu.clarin.cmdi.vlo.config.VloConfigFactory;
    7 import java.io.File;
    8 import java.io.IOException;
    9 import java.net.URISyntaxException;
    10 import org.apache.commons.io.FileUtils;
    11 import org.junit.After;
    12 import org.junit.Before;
    13 import org.junit.Rule;
    14 import org.junit.rules.TemporaryFolder;
    1519
    1620public abstract class ImporterTestcase {
     
    5458
    5559        MetadataImporter.languageCodeUtils = new LanguageCodeUtils(config);
     60       
     61       
     62        //print classpath
     63       
     64        ClassLoader cl = ClassLoader.getSystemClassLoader();
     65
     66        URL[] urls = ((URLClassLoader)cl).getURLs();
     67
     68        for(URL url: urls){
     69                System.out.println(url.getFile());
     70        }
    5671     
    5772    }
Note: See TracChangeset for help on using the changeset viewer.