You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by Chris Mattmann <ch...@jpl.nasa.gov> on 2008/01/22 19:47:22 UTC

Current version of trunk doesn't pass unit tests

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.
Chris.Mattmann@jpl.nasa.gov
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.



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

Posted by Sami Siren <ss...@gmail.com>.
Bertrand Delacretaz wrote:
> On Jan 23, 2008 8:31 AM, Sami Siren <ss...@gmail.com> 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


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

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Jan 23, 2008 9:51 AM, Bertrand Delacretaz <bd...@apache.org> wrote:
> On Jan 23, 2008 8:31 AM, Sami Siren <ss...@gmail.com> 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

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

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Jan 23, 2008 8:31 AM, Sami Siren <ss...@gmail.com> 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

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

Posted by Sami Siren <ss...@gmail.com>.
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 <bd...@apache.org>:
> On Jan 23, 2008 6:02 AM, Sami Siren <ss...@gmail.com> 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
>

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

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Jan 23, 2008 6:02 AM, Sami Siren <ss...@gmail.com> 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

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

Posted by Sami Siren <ss...@gmail.com>.
Jukka Zitting wrote:
> Hi,
> 
> On Jan 22, 2008 8:47 PM, Chris Mattmann <ch...@jpl.nasa.gov> 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

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

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Jan 22, 2008 8:47 PM, Chris Mattmann <ch...@jpl.nasa.gov> 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