package dk.statsbiblioteket.doms.transformers.shardmigrator;

import dk.statsbiblioteket.doms.transformers.shardmigrator.tvmeter.autogenerated.ObjectFactory;
import dk.statsbiblioteket.doms.transformers.shardmigrator.tvmeter.autogenerated.TvmeterProgram;
import org.junit.Test;


import javax.xml.bind.JAXBContext;
import java.io.File;
import java.io.InputStream;

public class TvmeterProgamTest {

    @Test
    public void testTvmeterProgramReader() throws Exception {
        File testfile = new File(Thread.currentThread().getContextClassLoader().getResource("objects/6a7f270c-a62e-4950-bec1-1ea230bf52ea_gallup.xml").toURI());
        TvmeterProgram testprogram = new TVMeterReader().readTVMeterFile(testfile.getAbsolutePath());
        JAXBContext.newInstance(TvmeterProgram.class.getPackage().getName()).createMarshaller().marshal(new ObjectFactory().createTvmeterProgram(testprogram),System.out);
    }

}

@@ -248,16 +248,54 @@
 rogram;%0A
+import org.apache.commons.io.IOUtils;%0A
 import o
@@ -309,16 +309,16 @@
 t.Test;%0A
-
 %0A%0Aimport
@@ -367,16 +367,48 @@
 o.File;%0A
+import java.io.FileInputStream;%0A
 import j
@@ -534,24 +534,25 @@
 ption %7B%0A
+%0A
         
 File tes
@@ -547,32 +547,89 @@
     
-File testfile = new File
+TvmeterProgram testprogram = new TVMeterReader().readTVMeterFile(IOUtils.toString
 (Thr
@@ -683,16 +683,24 @@
 Resource
+AsStream
 (%22object
@@ -754,117 +754,8 @@
 ml%22)
-.toURI());%0A        TvmeterProgram testprogram = new TVMeterReader().readTVMeterFile(testfile.getAbsolutePath(
 ));%0A

Test works