You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Andrea Del Bene (JIRA)" <ji...@apache.org> on 2016/04/12 14:17:25 UTC

[jira] [Updated] (WICKET-6133) Failing test SpringBeanWithGenericsTest in 7.3.0.0 SNAPSHOT

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

Andrea Del Bene updated WICKET-6133:
------------------------------------
    Affects Version/s:     (was: 7.3.0)
                       7.2.0

> Failing test SpringBeanWithGenericsTest in 7.3.0.0 SNAPSHOT
> -----------------------------------------------------------
>
>                 Key: WICKET-6133
>                 URL: https://issues.apache.org/jira/browse/WICKET-6133
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-spring
>    Affects Versions: 7.2.0
>         Environment: Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
> Maven home: C:\Program Files\Apache Software Foundation\Maven\bin\..
> Java version: 1.7.0_80, vendor: Oracle Corporation
> Java home: C:\Program Files\Java\jdk1.7.0_80\jre
> Default locale: de_DE, platform encoding: Cp1252
> OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "windows"
>            Reporter: Thorsten Schöning
>            Assignee: Andrea Del Bene
>             Fix For: 7.3.0, 8.0.0-M1
>
>         Attachments: SpringBeanWithGenericsTest.java.patch
>
>
> I try to build 7.3.0.0-SNAPSHOT from source, but there's at least the
> following failing test. Skipping the tests builds OK and the results
> seem to work.
> {CODE}
> [...]
> Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.398 sec - in org.apache.wicket.spring.injection.annot.SpringBeanTest
> Running org.apache.wicket.spring.injection.annot.SpringBeanWithGenericsTest
> Tests run: 7, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.557 sec <<< FAILURE! - in org.apache.wicket.spring.injection.annot.SpringBeanWithGenericsTestlistField(org.apache.wicket.spring.injection.annot.SpringBeanWithGenericsTest)
> Time elapsed: 0.072 sec  <<< FAILURE!
> java.lang.AssertionError: expected:<3> but was:<1>
>         at org.junit.Assert.fail(Assert.java:88)
>         at org.junit.Assert.failNotEquals(Assert.java:834)
>         at org.junit.Assert.assertEquals(Assert.java:645)
>         at org.junit.Assert.assertEquals(Assert.java:631)
>         at org.apache.wicket.spring.injection.annot.SpringBeanWithGenericsTest.listField(SpringBeanWithGenericsTest.java:143)
> [...]
> {CODE}
> The mentioned line is the last one of the following quote:
> {CODE}
>         @Test
>         public void listField() throws Exception
>         {
>                 AnnotatedListField page =
>                         tester.startPage(new AnnotatedListField());
>                 assertNotNull(page.getStringsList());
>                 assertEquals(3, page.getStringsList().size());
> {CODE}
> I've tested different versions of Maven, with and without a .m2 folder and even with changes to the source code of the test and my feeling is that the error I see is somewhat non deterministic. Without an available .m2 folder the test seems to PASS very often, but only during the first execution, directly afterwards with the same commands the test FAILs most of the time. I executed the test the whole morning today and it failed always, only to succeed some minutes ago before writing this report between lots of failing executions.
> I think the problem is with creating the test data properly and found the following commit, which introduced "getStringsList":
> https://github.com/apache/wicket/commit/f0340a3ef62a18df14badb26acee01bf102b9a2c
> The interesting part for me about that commit is that
> "ConfigContextWithGenerics.getStrings" in the same file was NOT
> changed as well. So I renamed to .stringsList and that did have an
> effect, now another test is failing instead:
> {CODE}
> Failed tests:
>   SpringBeanWithGenericsTest.listField:147->Assert.assertThat:923->Assert.assert
> That:956
> Expected: is <3>
>      but: was <1>
> {CODE}
> Looking at the other methods of ConfigContextWithGenerics, I'm pretty sure that "strings" is wrongly named, because all other methods are named after annotated fields. So I guess there's some magic in the background able to ignore the names and map using method signatur or such. And that might fail in most of my executions.
> Having a closer look at the error message, it says that 1 element is found where 3 were expected. The only 1 element list in the class is "myList", so I guess that is used most of times in my executions for whatever reason.
> I had a closer look at SpringComponentInjector and AnnotProxyFieldValueFactory, which e.g. contains getBeanNameOfClass, which resolves beans without any name.
> So in my opinion there's definitely something wrong with this test, at least ConfigContextWithGenerics.getStrings is wrongly named, but changing only that doesn't resolve the issue for me. There are still invocations failing with the 3 expected, 1 recognized error.
> This was discussed on the users list as well:
> http://mail-archives.apache.org/mod_mbox/wicket-users/201603.mbox/<1557500025.20160330120517%40am-soft.de>



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)