UtkarshShrivastava / mp4parser

Automatically exported from code.google.com/p/mp4parser
0 stars 0 forks source link

com.coremedia.iso.boxes.mdat.SampleListTest.testGotAll() fails #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
C:\bt\libraries\mp4\isoparser>mvn -version
Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
Maven home: C:\java\apache-maven-3.0.4
Java version: 1.6.0_14, vendor: BEA Systems, Inc.
Java home: C:\java\jrmc-3.1.2-1.6.0\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

java.lang.AssertionError
    at org.junit.Assert.fail(Assert.java:92)
    at org.junit.Assert.assertTrue(Assert.java:43)
    at org.junit.Assert.assertTrue(Assert.java:54)
    at com.coremedia.iso.boxes.mdat.SampleListTest.testGotAll(SampleListTest.java:73)

Looks like the sample file fails to delete for some reason.

I think the test case should put the sample file in the target/ directory so 
the files are cleaned up on 'mvn clean'. If they are in the temp directory, 
they will build up over time when tests fail.

Original issue reported on code.google.com by osborn.j...@gmail.com on 25 Jun 2012 at 2:24

GoogleCodeExporter commented 9 years ago
somehow you are right but in the JUnit context I don't know anything about my 
maven environment. If I run the test in my IDE I don't have any Maven 
environment. 

I added a FileChannel#close to make sure Windows users can delete files. 

Could you please update and try again? 

Original comment by Sebastian.Annies on 25 Jun 2012 at 3:01

GoogleCodeExporter commented 9 years ago
yes, fixed the problem. 

You can use this to calculate the directory from which the class was loaded:
URL classesRootDir = 
getClass().getProtectionDomain().getCodeSource().getLocation();

for JUnit in either IDE (intelliJ?) or maven it should work just fine.

Original comment by osborn.j...@gmail.com on 25 Jun 2012 at 4:14

GoogleCodeExporter commented 9 years ago
That is in deed a workaround I could try. Thank you for pointing me there.

Original comment by Sebastian.Annies on 26 Jun 2012 at 6:43