Current version of trunk doesn't pass unit tests

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Current version of trunk doesn't pass unit tests

chrismattmann
Hi Guys,

Hate to be the bearer of bad news, but the current trunk version does not
pass unit tests:

[XXX:~/src/tika/trunk] mattmann% mvn clean assembly:assembly
[..snip...]
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.apache.tika.exception.CauseIOExceptionTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.086 sec
Running org.apache.tika.TestRereadableInputStream
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.046 sec
Running org.apache.tika.mime.MimeTypeTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec
Running org.apache.tika.sax.xpath.XPathParserTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 sec
Running org.apache.tika.metadata.TestSpellCheckedMetadata
10000 spellchecked metadata I/O time:3136ms.
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.155 sec
Running org.apache.tika.parser.html.HtmlParserTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.127 sec
Running org.apache.tika.TestParsers
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.322 sec
Running org.apache.tika.metadata.TestMetadata
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec
Running org.apache.tika.parser.xml.DcXMLParserTest
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.033 sec
<<< FAILURE!
Running org.apache.tika.sax.AppendableAdaptorTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec
Running org.apache.tika.parser.txt.TXTParserTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec
Running org.apache.tika.parser.microsoft.PowerPointParserTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec
Running org.apache.tika.parser.microsoft.ExcelParserTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.032 sec
Running org.apache.tika.mime.TestMimeTypes
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.08 sec
Running org.apache.tika.parser.AutoDetectParserTest
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.858 sec
Running org.apache.tika.parser.opendocument.OpenOfficeParserTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.01 sec
Running org.apache.tika.mime.MimeTypesTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec
Running org.apache.tika.mime.PatternsTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec
Running org.apache.tika.utils.RegexUtilsTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec
Running org.apache.tika.parser.microsoft.WordParserTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec

Results :

Failed tests:
  testXMLParser(org.apache.tika.parser.xml.DcXMLParserTest)

Tests run: 85, Failures: 1, Errors: 0, Skipped: 0

[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
[..snip..]

Seems to be an error with the DcXMLParser. I will take a look and see if I
can figure it out.

Thanks!

Cheers,
  Chris

______________________________________________
Chris Mattmann, Ph.D.
[hidden email]
Cognizant Development Engineer
Early Detection Research Network Project
_________________________________________________
Jet Propulsion Laboratory            Pasadena, CA
Office: 171-266B                     Mailstop:  171-246
_______________________________________________________

Disclaimer:  The opinions presented within are my own and do not reflect
those of either NASA, JPL, or the California Institute of Technology.


Reply | Threaded
Open this post in threaded view
|

Re: Current version of trunk doesn't pass unit tests

Jukka Zitting
Hi,

On Jan 22, 2008 8:47 PM, Chris Mattmann <[hidden email]> wrote:
> Hate to be the bearer of bad news, but the current trunk version does not
> pass unit tests:
> [...]
> Running org.apache.tika.parser.xml.DcXMLParserTest
> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.033 sec
> <<< FAILURE!
> [...]
> Seems to be an error with the DcXMLParser. I will take a look and see if I
> can figure it out.

That's  related to TIKA-1116. I added the DcXMLParserTest test case to
verify that I wouldn't break existing XML parsing functionality while
modifying the parser classes...

The tests work just fine for me with Sun Java 1.5.0_14 and 1.6.0_03 on
Windows Vista.

What does the org.apache.tika.parser.xml.DcXMLParserTest.txt file in
target/surefire-reports contain?

BR,

Jukka Zitting
Reply | Threaded
Open this post in threaded view
|

Re: Current version of trunk doesn't pass unit tests

Sami Siren-2
Jukka Zitting wrote:
> Hi,
>
> On Jan 22, 2008 8:47 PM, Chris Mattmann <[hidden email]> wrote:
>> Hate to be the bearer of bad news, but the current trunk version does not
>> pass unit tests:
 >
> What does the org.apache.tika.parser.xml.DcXMLParserTest.txt file in
> target/surefire-reports contain?
>

To me it says on FC6 with both

Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_08-b03)
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)

the following:

Test set: org.apache.tika.parser.xml.DcXMLParserTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.099
sec <<< FAILURE!
testXMLParser(org.apache.tika.parser.xml.DcXMLParserTest)  Time elapsed:
0.036 sec  <<< FAILURE!
junit.framework.ComparisonFailure: expected:<...?...> but was:<...è...>
         at junit.framework.Assert.assertEquals(Assert.java:81)
         at junit.framework.Assert.assertEquals(Assert.java:87)
         at
org.apache.tika.parser.xml.DcXMLParserTest.testXMLParser(DcXMLParserTest.java:42)
         at
org.apache.tika.parser.xml.DcXMLParserTest.testXMLParser(DcXMLParserTest.java:42)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at
org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
         at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
         at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
         at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
         at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818)


--
  Sami Siren

-------------------------------------------------------------------------------
Test set: org.apache.tika.parser.xml.DcXMLParserTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.401 sec <<< FAILURE!
testXMLParser(org.apache.tika.parser.xml.DcXMLParserTest)  Time elapsed: 0.395 sec  <<< FAILURE!
junit.framework.ComparisonFailure: expected:<...�...> but was:<...è...>
        at junit.framework.Assert.assertEquals(Assert.java:81)
        at junit.framework.Assert.assertEquals(Assert.java:87)
        at org.apache.tika.parser.xml.DcXMLParserTest.testXMLParser(DcXMLParserTest.java:42)
        at org.apache.tika.parser.xml.DcXMLParserTest.testXMLParser(DcXMLParserTest.java:42)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
        at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818)

Reply | Threaded
Open this post in threaded view
|

Re: Current version of trunk doesn't pass unit tests

Bertrand Delacretaz-2
On Jan 23, 2008 6:02 AM, Sami Siren <[hidden email]> wrote:

> Test set: org.apache.tika.parser.xml.DcXMLParserTest
> -------------------------------------------------------------------------------
> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.099
> sec <<< FAILURE!
> testXMLParser(org.apache.tika.parser.xml.DcXMLParserTest)  Time elapsed:
> 0.036 sec  <<< FAILURE!
> junit.framework.ComparisonFailure: expected:<...?...> but was:<...è...>...

Looks like an encoding problem - In revision 614443 I have isolated
the part of the test that fails in DcXMLParserTest, with a TODO to fix
it. Working on that....

-Bertrand
Reply | Threaded
Open this post in threaded view
|

Re: Current version of trunk doesn't pass unit tests

Sami Siren-2
ahh,

I think this is the same issue that bit me in my html parser tests.
The fact is that on different systems the encoding (when reading and
compiling) java files is simply different, we should define the
encoding we use for our .java files with something like the following
and make sure our .java files are properly encoded:

        <build>
                <plugins>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-compiler-plugin</artifactId>
                                <configuration>
                                        <source>1.5</source>
                                        <target>1.5</target>
                                        <encoding>utf-8</encoding>
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                </configuration>
                        </plugin>
                </plugins>
        </build>


--
 Sami Siren


2008/1/23, Bertrand Delacretaz <[hidden email]>:

> On Jan 23, 2008 6:02 AM, Sami Siren <[hidden email]> wrote:
>
> > Test set: org.apache.tika.parser.xml.DcXMLParserTest
> > -------------------------------------------------------------------------------
> > Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.099
> > sec <<< FAILURE!
> > testXMLParser(org.apache.tika.parser.xml.DcXMLParserTest)  Time elapsed:
> > 0.036 sec  <<< FAILURE!
> > junit.framework.ComparisonFailure: expected:<...?...> but was:<...è...>...
>
> Looks like an encoding problem - In revision 614443 I have isolated
> the part of the test that fails in DcXMLParserTest, with a TODO to fix
> it. Working on that....
>
> -Bertrand
>
Reply | Threaded
Open this post in threaded view
|

Re: Current version of trunk doesn't pass unit tests

Bertrand Delacretaz-2
On Jan 23, 2008 8:31 AM, Sami Siren <[hidden email]> wrote:

> ...we should define the
> encoding we use for our .java files with something like the following
> and make sure our .java files are properly encoded...

We could do that, but it's IMHO safer to not use any non-ascii chars
in our source files.

I fixed the problem in revision 614446, using this:

            final String expected = "Archim\u00E8de et Lius \u00E0
Ch\u00E2teauneuf...
            assertEquals(expected,metadata.get(Metadata.RIGHTS));

Writing these escapes is a bit painful, but that should work
everywhere regardless of encoding.

-Bertrand
Reply | Threaded
Open this post in threaded view
|

Re: Current version of trunk doesn't pass unit tests

Jukka Zitting
Hi,

On Jan 23, 2008 9:51 AM, Bertrand Delacretaz <[hidden email]> wrote:
> On Jan 23, 2008 8:31 AM, Sami Siren <[hidden email]> wrote:
> > ...we should define the
> > encoding we use for our .java files with something like the following
> > and make sure our .java files are properly encoded...
>
> We could do that, but it's IMHO safer to not use any non-ascii chars
> in our source files.

Agreed.

> I fixed the problem in revision 614446, using this:
>
>             final String expected = "Archim\u00E8de et Lius \u00E0
> Ch\u00E2teauneuf...
>             assertEquals(expected,metadata.get(Metadata.RIGHTS));

Excellent, thanks!

BR,

Jukka Zitting
Reply | Threaded
Open this post in threaded view
|

Re: Current version of trunk doesn't pass unit tests

Sami Siren-2
In reply to this post by Bertrand Delacretaz-2
Bertrand Delacretaz wrote:
> On Jan 23, 2008 8:31 AM, Sami Siren <[hidden email]> wrote:
>
>> ...we should define the
>> encoding we use for our .java files with something like the following
>> and make sure our .java files are properly encoded...
>
> We could do that, but it's IMHO safer to not use any non-ascii chars
> in our source files.

UTFf-8 was just an example,  if we prefer ascii we can define the
encoding as ascii. By doing this would allow tests to fail equally
everywhere in case someone (like me) accidentally puts something else
but ascii in string literals used in tests.

>
> I fixed the problem in revision 614446, using this:
>
>             final String expected = "Archim\u00E8de et Lius \u00E0
> Ch\u00E2teauneuf...
>             assertEquals(expected,metadata.get(Metadata.RIGHTS));

Cool!


> Writing these escapes is a bit painful, but that should work
> everywhere regardless of encoding.

You can also use native2ascii to convert those.

--
  Sami Siren