FileDocCategorySizeDatePackage
PathTest.javaAPI Docmp4parser 1.0-RC-171460Wed Dec 19 20:10:22 GMT 2012com.googlecode.mp4parser.util

PathTest

public class PathTest extends Object

Fields Summary
com.coremedia.iso.IsoFile
isoFile
Constructors Summary
Methods Summary
public voidsetup()

        isoFile = new IsoFile(Channels.newChannel(PathTest.class.getResourceAsStream("/multiTrack.3gp")));
    
public voidtestComponentMatcher()

        Assert.assertTrue(Path.component.matcher("abcd").matches());
        Assert.assertTrue(Path.component.matcher("xml ").matches());
        Assert.assertTrue(Path.component.matcher("xml [1]").matches());
        Assert.assertTrue(Path.component.matcher("..").matches());
    
public voidtestGetParent()

        Box b1 = isoFile.getMovieBox().getBoxes(TrackBox.class).get(1).getSampleTableBox().getTimeToSampleBox();
        Assert.assertEquals(isoFile.getMovieBox().getBoxes(TrackBox.class).get(1).getSampleTableBox(), Path.getPath(b1, ".."));

    
public voidtestRoundTrip()

        Box b1 = isoFile.getMovieBox().getBoxes(TrackBox.class).get(1).getSampleTableBox().getTimeToSampleBox();
        String p = Path.createPath(b1);
        Box b2 = Path.getPath(isoFile, p);
        Assert.assertSame(b1, b2);