incubator-odf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Svante Schubert (JIRA)" <j...@apache.org>
Subject [jira] [Reopened] (ODFTOOLKIT-342) MetaDocumentStatisticTest sometimes fails
Date Sat, 16 Mar 2013 18:02:13 GMT

     [ https://issues.apache.org/jira/browse/ODFTOOLKIT-342?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Svante Schubert reopened ODFTOOLKIT-342:
----------------------------------------

      Assignee: Svante Schubert  (was: Florian Hopf)

Nice work Florian.

But I fear there is one more test that had been added with dependencies among the tests: DocumentCreationTest
http://svn.apache.org/viewvc/incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/DocumentCreationTest.java?view=markup

I took a slightly different approach. Instead to rewrite completely existing tests (of others),
who expected erroneously the execution of JUnit tests in order of appearance.
Instead I extended JUnit by a class that allows the order of tests by their alphabetical order
of method names.
For OfficeMetaTest I added only for the getter/setter pairs a number and for DocumentCreationTest
I have added a continuous number to all methods.
That should settle our problem.

In addition I have changed OfficeMetaTest accordingly and a test file is being saved to a
different name not to trigger a race condition on tests that might work on all test files
(e.g. a potential validation).
http://svn.apache.org/viewvc/incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/incubator/meta/OfficeMetaTest.java?view=markup


PS: I fixed an additional problem for DocumentCreationTest, the test string " find truth"
is not a good idea, as a space as first character in a paragraph has to be a <text:s/>
element to be preserved for roundtripping, see http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#White-space_Characters

                
> MetaDocumentStatisticTest sometimes fails
> -----------------------------------------
>
>                 Key: ODFTOOLKIT-342
>                 URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-342
>             Project: ODF Toolkit
>          Issue Type: Bug
>          Components: simple api
>    Affects Versions: 0.5-incubating
>         Environment: Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
> Java version: 1.7.0_03
> Default locale: de_DE, platform encoding: UTF-8
> OS name: "linux" version: "2.6.32-44-generic" arch: "i386" Family: "unix"
>            Reporter: Florian Hopf
>            Assignee: Svante Schubert
>             Fix For: 0.6-incubating
>
>
> The tests are sometimes failing for me. It works when invoked with mvn clean test but
doesn't work when invoked with mvn test afterwards. I am not sure if this can be reproduced
all the time. 
> -------------------------------------------------------------------------------
> Test set: org.odftoolkit.simple.meta.MetaDocumentStatisticTest
> -------------------------------------------------------------------------------
> Tests run: 31, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.717 sec <<<
FAILURE!
> testGetRowCount(org.odftoolkit.simple.meta.MetaDocumentStatisticTest)  Time elapsed:
0.05 sec  <<< FAILURE!
> junit.framework.AssertionFailedError: expected:<11> but was:<null>
>         at junit.framework.Assert.fail(Assert.java:47)
>         at junit.framework.Assert.failNotEquals(Assert.java:283)
>         at junit.framework.Assert.assertEquals(Assert.java:64)
>         at junit.framework.Assert.assertEquals(Assert.java:71)
>         at org.odftoolkit.simple.meta.MetaDocumentStatisticTest.testGetRowCount(MetaDocumentStatisticTest.java:187)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:601)
>         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>         at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>         at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>         at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
>         at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
>         at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>         at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:120)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:103)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:169)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:601)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message