From 4243eb57ff3b39489c1dd3ff47607d17533679b2 Mon Sep 17 00:00:00 2001 From: Chris Ribble Date: Thu, 30 Dec 2021 10:22:42 -0600 Subject: [PATCH] Load test resources from classpath --- .../drm/packager/isoparser/RoundTripTest.java | 82 ++++++++----------- .../java/org/mp4parser/SkippingBoxTest.java | 9 +- .../java/org/mp4parser/tools/PathTest.java | 4 +- .../muxer/CencFileRoundtripTest.java | 56 +++++++------ .../muxer/FragmentedMp4BuilderTest.java | 4 +- .../mp4parser/muxer/InTestMovieCreator.java | 9 +- .../muxer/builder/DefaultFragmenterTest.java | 6 +- .../SyncSampleIntersectFinderImplTest.java | 23 +++--- .../samples/DefaultMp4SampleListTest.java | 6 +- .../muxer/tracks/AACTrackImplTest.java | 9 +- .../muxer/tracks/AC3TrackImplTest.java | 7 +- .../muxer/tracks/CencTracksImplTest.java | 9 +- .../muxer/tracks/DTSTrackImplTest.java | 4 +- .../muxer/tracks/H264TrackImplTest.java | 7 +- .../muxer/tracks/ttml/TtmlHelpersTest.java | 2 +- 15 files changed, 119 insertions(+), 118 deletions(-) diff --git a/isoparser/src/test/java/com/coremedia/drm/packager/isoparser/RoundTripTest.java b/isoparser/src/test/java/com/coremedia/drm/packager/isoparser/RoundTripTest.java index c7feba217..ae35061c7 100644 --- a/isoparser/src/test/java/com/coremedia/drm/packager/isoparser/RoundTripTest.java +++ b/isoparser/src/test/java/com/coremedia/drm/packager/isoparser/RoundTripTest.java @@ -16,93 +16,80 @@ package com.coremedia.drm.packager.isoparser; -import junit.framework.TestCase; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.nio.channels.Channels; +import java.nio.channels.ReadableByteChannel; + import org.mp4parser.IsoFile; import org.mp4parser.support.BoxComparator; import org.mp4parser.tools.ByteBufferByteChannel; -import java.io.ByteArrayOutputStream; -import java.io.FileInputStream; -import java.nio.channels.Channels; +import junit.framework.TestCase; /** * Tests ISO Roundtrip. */ public class RoundTripTest extends TestCase { - String defaultTestFileDir; - - @Override - protected void setUp() throws Exception { - super.setUp(); - defaultTestFileDir = this.getClass().getProtectionDomain().getCodeSource().getLocation().getFile(); -/* Logger.getLogger("").setLevel(Level.ALL); - Handler[] handlers = Logger.getLogger("").getHandlers(); - for (Handler handler : handlers) { - handler.setLevel(Level.ALL); - }*/ - } - /* public void testRoundDeleteMe() throws Exception { testRoundTrip_1("/suckerpunch-distantplanet_h1080p.mov"); }*/ public void testRoundTrip_TinyExamples_Old() throws Exception { - testRoundTrip_1(defaultTestFileDir + "/Tiny Sample - OLD.mp4"); + testRoundTrip_1("Tiny Sample - OLD.mp4"); } public void testRoundTrip_TinyExamples_Metaxed() throws Exception { - testRoundTrip_1(defaultTestFileDir + "/Tiny Sample - NEW - Metaxed.mp4"); + testRoundTrip_1("Tiny Sample - NEW - Metaxed.mp4"); } public void testRoundTrip_TinyExamples_Untouched() throws Exception { - testRoundTrip_1(defaultTestFileDir + "/Tiny Sample - NEW - Untouched.mp4"); + testRoundTrip_1("Tiny Sample - NEW - Untouched.mp4"); } - public void testRoundTrip_1a() throws Exception { - testRoundTrip_1(defaultTestFileDir + "/multiTrack.3gp"); + testRoundTrip_1("multiTrack.3gp"); } public void testRoundTrip_1b() throws Exception { - testRoundTrip_1(defaultTestFileDir + "/MOV00006.3gp"); + testRoundTrip_1("MOV00006.3gp"); } public void testRoundTrip_1c() throws Exception { - testRoundTrip_1(defaultTestFileDir + "/Beethoven - Bagatelle op.119 no.11 i.m4a"); + testRoundTrip_1("Beethoven - Bagatelle op.119 no.11 i.m4a"); } public void testRoundTrip_1d() throws Exception { - testRoundTrip_1(defaultTestFileDir + "/test.m4p"); + testRoundTrip_1("test.m4p"); } public void testRoundTrip_1e() throws Exception { - testRoundTrip_1(defaultTestFileDir + "/test-pod.m4a"); + testRoundTrip_1("test-pod.m4a"); } public void testRoundTrip_QuickTimeFormat() throws Exception { - testRoundTrip_1(defaultTestFileDir + "/QuickTimeFormat.mp4"); + testRoundTrip_1("QuickTimeFormat.mp4"); } - public void testRoundTrip_1(String originalFile) throws Exception { long start1 = System.currentTimeMillis(); long start2 = System.currentTimeMillis(); + + try (InputStream is = getClass().getClassLoader().getResourceAsStream(originalFile); + ReadableByteChannel channel = Channels.newChannel(is)) { + IsoFile isoFile = new IsoFile(channel); - IsoFile isoFile = new IsoFile(new FileInputStream(originalFile).getChannel()); - - long start3 = System.currentTimeMillis(); - - - long start4 = System.currentTimeMillis(); - Walk.through(isoFile); - long start5 = System.currentTimeMillis(); + long start3 = System.currentTimeMillis(); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - isoFile.getBox(Channels.newChannel(baos)); + long start4 = System.currentTimeMillis(); + Walk.through(isoFile); + long start5 = System.currentTimeMillis(); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + isoFile.getBox(Channels.newChannel(baos)); - long start6 = System.currentTimeMillis(); + long start6 = System.currentTimeMillis(); /* System.err.println("Preparing tmp copy took: " + (start2 - start1) + "ms"); System.err.println("Parsing took : " + (start3 - start2) + "ms"); @@ -110,15 +97,12 @@ public void testRoundTrip_1(String originalFile) throws Exception { System.err.println("Walking took : " + (start5 - start4) + "ms");*/ - IsoFile copyViaIsoFileReparsed = new IsoFile(new ByteBufferByteChannel(baos.toByteArray())); - BoxComparator.check(isoFile, copyViaIsoFileReparsed, "moov[0]/mvhd[0]", "moov[0]/trak[0]/tkhd[0]", "moov[0]/trak[0]/mdia[0]/mdhd[0]"); - isoFile.close(); - copyViaIsoFileReparsed.close(); - // as windows cannot delete file when something is memory mapped and the garbage collector - // doesn't necessarily free the Buffers quickly enough we cannot delete the file here (we could but only for linux) - - + IsoFile copyViaIsoFileReparsed = new IsoFile(new ByteBufferByteChannel(baos.toByteArray())); + BoxComparator.check(isoFile, copyViaIsoFileReparsed, "moov[0]/mvhd[0]", "moov[0]/trak[0]/tkhd[0]", "moov[0]/trak[0]/mdia[0]/mdhd[0]"); + isoFile.close(); + copyViaIsoFileReparsed.close(); + // as windows cannot delete file when something is memory mapped and the garbage collector + // doesn't necessarily free the Buffers quickly enough we cannot delete the file here (we could but only for linux) + } } - - } diff --git a/isoparser/src/test/java/org/mp4parser/SkippingBoxTest.java b/isoparser/src/test/java/org/mp4parser/SkippingBoxTest.java index abbcdebc1..a2a050296 100644 --- a/isoparser/src/test/java/org/mp4parser/SkippingBoxTest.java +++ b/isoparser/src/test/java/org/mp4parser/SkippingBoxTest.java @@ -6,6 +6,9 @@ import java.io.FileInputStream; import java.io.IOException; +import java.io.InputStream; +import java.nio.channels.Channels; +import java.nio.channels.ReadableByteChannel; import org.junit.Before; import org.junit.Test; @@ -20,9 +23,9 @@ public class SkippingBoxTest { @Before public void setup() throws IOException { - FileInputStream fis = new FileInputStream(PathTest.class.getProtectionDomain().getCodeSource().getLocation().getFile() + "/test.m4p"); - isoFile = new IsoFile(fis.getChannel(), new PropertyBoxParserImpl().skippingBoxes("mdat", "mvhd")); - fis.close(); + try (FileInputStream fis = new FileInputStream(getClass().getClassLoader().getResource("test.m4p").getPath())) { + isoFile = new IsoFile(fis.getChannel(), new PropertyBoxParserImpl().skippingBoxes("mdat", "mvhd")); + } } diff --git a/isoparser/src/test/java/org/mp4parser/tools/PathTest.java b/isoparser/src/test/java/org/mp4parser/tools/PathTest.java index 38896f1ef..d8c8c736b 100644 --- a/isoparser/src/test/java/org/mp4parser/tools/PathTest.java +++ b/isoparser/src/test/java/org/mp4parser/tools/PathTest.java @@ -14,7 +14,9 @@ public class PathTest { @Before public void setup() throws IOException { - isoFile = new IsoFile(new FileInputStream(PathTest.class.getProtectionDomain().getCodeSource().getLocation().getFile() + "/multiTrack.3gp").getChannel()); + try (FileInputStream fis = new FileInputStream(getClass().getClassLoader().getResource("multiTrack.3gp").getPath())) { + isoFile = new IsoFile(fis.getChannel()); + } } diff --git a/muxer/src/test/java/org/mp4parser/muxer/CencFileRoundtripTest.java b/muxer/src/test/java/org/mp4parser/muxer/CencFileRoundtripTest.java index dd18aead4..96ee1eba3 100644 --- a/muxer/src/test/java/org/mp4parser/muxer/CencFileRoundtripTest.java +++ b/muxer/src/test/java/org/mp4parser/muxer/CencFileRoundtripTest.java @@ -1,5 +1,19 @@ package org.mp4parser.muxer; +import java.io.ByteArrayOutputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.channels.Channels; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; + import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -14,16 +28,7 @@ import org.mp4parser.tools.ByteBufferByteChannel; import org.mp4parser.tools.RangeStartMap; -import javax.crypto.SecretKey; -import javax.crypto.spec.SecretKeySpec; -import java.io.ByteArrayOutputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.nio.channels.Channels; -import java.util.*; - public class CencFileRoundtripTest { - private String baseDir = CencFileRoundtripTest.class.getProtectionDomain().getCodeSource().getLocation().getFile(); private Map keys; private RangeStartMap keyRotation1; private RangeStartMap keyRotation2; @@ -59,67 +64,67 @@ public void setUp() throws Exception { @Test public void testSingleKeysStdMp4_cbc1() throws IOException { - testMultipleKeys(new DefaultMp4Builder(), baseDir + "/BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation1, "cbc1", false); + testMultipleKeys(new DefaultMp4Builder(), "BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation1, "cbc1", false); } @Test public void testSingleKeysFragMp4_cbc1() throws IOException { - testMultipleKeys(new FragmentedMp4Builder(), baseDir + "/BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation1, "cbc1", false); + testMultipleKeys(new FragmentedMp4Builder(), "BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation1, "cbc1", false); } @Test public void testSingleKeysStdMp4_cenc() throws IOException { - testMultipleKeys(new DefaultMp4Builder(), baseDir + "/BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation1, "cenc", false); + testMultipleKeys(new DefaultMp4Builder(), "BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation1, "cenc", false); } @Test public void testSingleKeysFragMp4_cenc() throws IOException { - testMultipleKeys(new FragmentedMp4Builder(), baseDir + "/BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation1, "cenc", false); + testMultipleKeys(new FragmentedMp4Builder(), "BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation1, "cenc", false); } @Test public void testClearLeadStdMp4_2_cbc1() throws IOException { - testMultipleKeys(new DefaultMp4Builder(), baseDir + "/BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation2, "cbc1", false); + testMultipleKeys(new DefaultMp4Builder(), "BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation2, "cbc1", false); } @Test public void testClearLeadFragMp4_2_cbc1() throws IOException { - testMultipleKeys(new FragmentedMp4Builder(), baseDir + "/BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation2, "cbc1", false); + testMultipleKeys(new FragmentedMp4Builder(), "BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation2, "cbc1", false); } @Test public void testClearLeadStdMp4_2_cenc() throws IOException { - testMultipleKeys(new DefaultMp4Builder(), baseDir + "/BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation2, "cenc", false); + testMultipleKeys(new DefaultMp4Builder(), "BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation2, "cenc", false); } @Test public void testClearLeadFragMp4_2_cenc() throws IOException { - testMultipleKeys(new FragmentedMp4Builder(), baseDir + "/BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation2, "cenc", false); + testMultipleKeys(new FragmentedMp4Builder(), "BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation2, "cenc", false); } @Test public void testMultipleKeysStdMp4_2_cbc1() throws IOException { - testMultipleKeys(new DefaultMp4Builder(), baseDir + "/BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation3, "cbc1", false); + testMultipleKeys(new DefaultMp4Builder(), "BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation3, "cbc1", false); } @Test public void testMultipleKeysFragMp4_2_cbc1() throws IOException { - testMultipleKeys(new FragmentedMp4Builder(), baseDir + "/BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation3, "cbc1", false); + testMultipleKeys(new FragmentedMp4Builder(), "BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation3, "cbc1", false); } @Test public void testMultipleKeysStdMp4_2_cenc() throws IOException { - testMultipleKeys(new DefaultMp4Builder(), baseDir + "/BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation3, "cenc", false); + testMultipleKeys(new DefaultMp4Builder(), "BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation3, "cenc", false); } @Test public void testMultipleKeysFragMp4_2_cenc() throws IOException { - testMultipleKeys(new FragmentedMp4Builder(), baseDir + "/BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation3, "cenc", false); + testMultipleKeys(new FragmentedMp4Builder(), "BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation3, "cenc", false); } @@ -128,13 +133,14 @@ public void testMultipleKeysFragMp4_2_cenc() throws IOException { @Test public void testMultipleKeysFragMp4_2_cenc_pseudo_encrypted() throws IOException { - testMultipleKeys(new FragmentedMp4Builder(), baseDir + "/BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation2, "cenc", true); + testMultipleKeys(new FragmentedMp4Builder(), "BBB_qpfile_10sec/BBB_fixedres_B_180x320_80.mp4", keys, keyRotation2, "cenc", true); } private void testMultipleKeys(Mp4Builder builder, String testFile, Map keys, RangeStartMap keyRotation, String encAlgo, boolean encryptButClear) throws IOException { - Movie m1 = MovieCreator.build(testFile); + String filePath = getClass().getClassLoader().getResource(testFile).getPath(); + Movie m1 = MovieCreator.build(filePath); Movie m2 = new Movie(); for (Track track : m1.getTracks()) { CencEncryptingTrackImpl cencEncryptingTrack = @@ -145,7 +151,9 @@ private void testMultipleKeys(Mp4Builder builder, String testFile, Map encTracks = new LinkedList(); for (Track track : m.getTracks()) { @@ -66,8 +65,7 @@ public void testEncryptDecryptDefaultMp4() throws Exception { public void testEncryptDecryptFragmentedMp4() throws Exception { SecretKey sk = new SecretKeySpec(new byte[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, "AES"); Movie m = MovieCreator.build( - CencTracksImplTest.class.getProtectionDomain().getCodeSource().getLocation().getFile() + - "/org/mp4parser/muxer/samples/1365070268951.mp4"); + CencTracksImplTest.class.getClassLoader().getResource("org/mp4parser/muxer/samples/1365070268951.mp4").toURI().getPath()); List encTracks = new LinkedList(); for (Track track : m.getTracks()) { @@ -99,8 +97,7 @@ public void testEncryptDecryptCbc1FragmentedMp4() throws Exception { UUID keyId = UUID.randomUUID(); SecretKey key = new SecretKeySpec(new byte[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, "AES"); Movie m = MovieCreator.build( - CencTracksImplTest.class.getProtectionDomain().getCodeSource().getLocation().getFile() + - "/org/mp4parser/muxer/samples/1365070268951.mp4"); + CencTracksImplTest.class.getClassLoader().getResource("org/mp4parser/muxer/samples/1365070268951.mp4").toURI().getPath()); List encTracks = new LinkedList(); for (Track track : m.getTracks()) { diff --git a/muxer/src/test/java/org/mp4parser/muxer/tracks/DTSTrackImplTest.java b/muxer/src/test/java/org/mp4parser/muxer/tracks/DTSTrackImplTest.java index c49ad33ab..de9ab732c 100644 --- a/muxer/src/test/java/org/mp4parser/muxer/tracks/DTSTrackImplTest.java +++ b/muxer/src/test/java/org/mp4parser/muxer/tracks/DTSTrackImplTest.java @@ -20,7 +20,7 @@ public class DTSTrackImplTest { @Test public void checkOutputIsStable() throws Exception { Movie m = new Movie(); - DTSTrackImpl dts = new DTSTrackImpl(new FileDataSourceImpl(DTSTrackImplTest.class.getProtectionDomain().getCodeSource().getLocation().getFile() + "/org/mp4parser/muxer/tracks/dts-sample.dtshd")); + DTSTrackImpl dts = new DTSTrackImpl(new FileDataSourceImpl(DTSTrackImplTest.class.getClassLoader().getResource("org/mp4parser/muxer/tracks/dts-sample.dtshd").toURI().getPath())); m.addTrack(dts); Fragmenter fif = new StaticFragmentIntersectionFinderImpl(Collections.singletonMap((Track) dts, new long[]{1})); DefaultMp4Builder mp4Builder = new DefaultMp4Builder(); @@ -31,7 +31,7 @@ public void checkOutputIsStable() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); c.writeContainer(Channels.newChannel(baos)); IsoFile ref = new IsoFile( - new FileInputStream(DTSTrackImplTest.class.getProtectionDomain().getCodeSource().getLocation().getFile() + "/org/mp4parser/muxer/tracks/dts-sample.mp4").getChannel()); + new FileInputStream(DTSTrackImplTest.class.getClassLoader().getResource("org/mp4parser/muxer/tracks/dts-sample.mp4").toURI().getPath()).getChannel()); BoxComparator.check(ref, c, "moov[0]/mvhd[0]", "moov[0]/trak[0]/tkhd[0]", "moov[0]/trak[0]/mdia[0]/mdhd[0]"); diff --git a/muxer/src/test/java/org/mp4parser/muxer/tracks/H264TrackImplTest.java b/muxer/src/test/java/org/mp4parser/muxer/tracks/H264TrackImplTest.java index d7ff29b91..dc2fc2ec4 100644 --- a/muxer/src/test/java/org/mp4parser/muxer/tracks/H264TrackImplTest.java +++ b/muxer/src/test/java/org/mp4parser/muxer/tracks/H264TrackImplTest.java @@ -28,6 +28,7 @@ import java.io.FileOutputStream; import java.io.IOException; +import java.net.URISyntaxException; /** * Simple test to make sure nothing breaks. @@ -35,8 +36,8 @@ public class H264TrackImplTest { @Test - public void freeze() throws IOException { - DataSource fc = new FileDataSourceImpl(getClass().getProtectionDomain().getCodeSource().getLocation().getFile() + "/org/mp4parser/muxer/tracks/h264-sample.h264"); + public void freeze() throws IOException, URISyntaxException { + DataSource fc = new FileDataSourceImpl(getClass().getClassLoader().getResource("org/mp4parser/muxer/tracks/h264-sample.h264").toURI().getPath()); H264TrackImpl.BUFFER = 65535; // make sure we are not just in one buffer Track t = new H264TrackImpl(fc); Movie m = new Movie(); @@ -48,7 +49,7 @@ public void freeze() throws IOException { // c.writeContainer(new FileOutputStream("/Users/sannies/dev/mp4parser/muxer/src/test/resources/org/mp4parser/muxer/tracks/h264-sample.mp4").getChannel()); - IsoFile isoFileReference = new IsoFile(getClass().getProtectionDomain().getCodeSource().getLocation().getFile() + "org/mp4parser/muxer/tracks/h264-sample.mp4"); + IsoFile isoFileReference = new IsoFile(getClass().getClassLoader().getResource("org/mp4parser/muxer/tracks/h264-sample.mp4").toURI().getPath()); BoxComparator.check(c, isoFileReference, "moov[0]/mvhd[0]", "moov[0]/trak[0]/tkhd[0]", "moov[0]/trak[0]/mdia[0]/mdhd[0]", "moov[0]/trak[0]/mdia[0]/minf[0]/stbl[0]/stco[0]"); } } diff --git a/muxer/src/test/java/org/mp4parser/muxer/tracks/ttml/TtmlHelpersTest.java b/muxer/src/test/java/org/mp4parser/muxer/tracks/ttml/TtmlHelpersTest.java index bf70ef51e..cc598701f 100644 --- a/muxer/src/test/java/org/mp4parser/muxer/tracks/ttml/TtmlHelpersTest.java +++ b/muxer/src/test/java/org/mp4parser/muxer/tracks/ttml/TtmlHelpersTest.java @@ -40,7 +40,7 @@ public void testToTimeExpression() throws Exception { public void testDeepCopyDocument() throws IOException, ParserConfigurationException, SAXException, XPathExpressionException, URISyntaxException { DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder db = documentBuilderFactory.newDocumentBuilder(); - Document ttml = db.parse(new InputSource(TtmlHelpersTest.class.getProtectionDomain().getCodeSource().getLocation().getFile() + "/org/mp4parser/muxer/tracks/ttml/tos-chapters-en.xml")); + Document ttml = db.parse(new InputSource(TtmlHelpersTest.class.getClassLoader().getResource("org/mp4parser/muxer/tracks/ttml/tos-chapters-en.xml").toURI().getPath())); //Document ttml = db.parse(new InputSource("http://localhost/mp4parser/isoparser/src/test/resources/com/googlecode/mp4parser/authoring/tracks/ttml/tos-chapters-en.xml")); File master = File.createTempFile("TtmlHelpersTest", "testDeepCopyDocument"); master.delete();