Hi all,

when I upgrade my application from wicket version 1.4.17 to version 1.4.18,
there is one test which fails.
When I test application manually, there is no problem, so I think there is a
problem inside the test.

this is the test which failed with 1.4.18 :

    @Test
    public void testStory06_TA2_RenseignementToutesInfosPersos(){
        tester.startPage(InfosPersoPage.class);
        tester.assertRenderedPage(InfosPersoPage.class);

        //On verifie que les champs sont vides et que le bouton
d'enregistrement est désactivé
        FormTester formTester = tester.newFormTester("infosPersoForm");
        Assert.assertEquals("", formTester.getTextComponentValue("email"));
        Assert.assertEquals("",
formTester.getTextComponentValue("codePostal"));
        Assert.assertEquals("", formTester.getTextComponentValue("ville"));
        Assert.assertEquals("", formTester.getTextComponentValue("taille"));
        Assert.assertEquals("", formTester.getTextComponentValue("poids"));
        tester.assertDisabled("infosPersoForm:boutonEnregistrerInfos");

        //vérification du texte sur le bouton
        Form<?> infosPersoForm = (Form<?>)
tester.getComponentFromLastRenderedPage("infosPersoForm");
        Button submitbutton = (Button)
infosPersoForm.get("boutonEnregistrerInfos");
        Assert.assertEquals("Enregistrer", submitbutton.getValue());

        //on renseigne l'Email et on verifie que le bouton d'enregistrement
est activé
        formTester.setValue("codePostal", cp);
        formTester.setValue("ville", ville);
        formTester.setValue("taille", taille.toString());
        formTester.setValue("poids", poids.toString());
        tester.executeAjaxEvent("infosPersoForm:email", "onkeyup");
        Assert.assertTrue("Le bouton Enregistrer doit être activé",
submitbutton.isEnabled());

        //On vérifie que l'email a bien été enregistré dans les infos perso
de lola

tester.executeAjaxEvent(infosPersoForm.get("boutonEnregistrerInfos"),
"onclick");
        Membre lolaUpdate = serviceMembre.getOne(lola.getIdentifiant());
        Assert.assertNotNull("Pas d'infos perso pour ce membre",
lolaUpdate.getInfosPersoEnregistrees());
        Assert.assertTrue("Infos perso pas enregistrées pour ce membre",
lolaUpdate.getInfosPersoEnregistrees());
       * Assert.assertEquals(taille, lolaUpdate.getTaille()); //failed at
this line  : expected:<167> but was:<null>*
        Assert.assertEquals(poids, lolaUpdate.getPoids());
        Assert.assertEquals(cp, lolaUpdate.getCodePostal());
        Assert.assertEquals(ville, lolaUpdate.getVille());

        //on vérifie que le membre en session a bien été mis à jour
        Assert.assertEquals(lolaUpdate, session.getMembre());
        //on vérifie qu'il n'y pas de message d'erreur mais un message
d'information
        tester.assertErrorMessages(new String[]{});
        tester.assertInfoMessages(new String[]{"Données enregistrées"});
    }

I read changelog of version 1.4.18, but I did not find any change which can
explain that failed.
Is there a mistake in my test?

Thanks.
Mathilde

PS : this is the stacktrace of this test failure :

junit.framework.AssertionFailedError: expected:<167> 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
fr.statlife.protoE4N.wicket.TestStory06_QuestionnaireEntree.testStory06_TA2_RenseignementToutesInfosPersos(TestStory06_QuestionnaireEntree.java:162)
    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.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.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
    at
org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
    at
org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
    at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)
    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.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    at
org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)
    at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
    at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Reply via email to