Issue Details (XML | Word | Printable)

Key: FACESTESTER-8
Type: Bug Bug
Status: In Progress In Progress
Priority: Major Major
Assignee: jasondlee
Reporter: IngoHofmann
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
facestester

ClassCastException since latest 0.3 when using testGetterAndSetter()

Created: 04/Jun/09 10:45 AM   Updated: 22/Jul/09 01:16 PM
Component/s: FacesTester
Affects Version/s: 0.3
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Java Archive File facestester-0.3-SNAPSHOT.jar (58 kB) 22/Jul/09 12:41 PM - jasondlee


Tags: ClassCastException testGetterAndSetter


 Description  « Hide

Since the changes from today, some of our testGetterAndSetter() tests don't run green any more.
This has been a successful test before:

@Test
public void testTestingGettersAndSetters() throws Exception { tester.testGetterAndSetter(HtmlForm.COMPONENT_TYPE); }

Now I am getting:

java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to java.util.Map
at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1286)
at com.steeplesoft.jsf.facestester.FacesTester.testStateSaving(FacesTester.java:207)
at com.steeplesoft.jsf.facestester.FacesTester.testStateSaving(FacesTester.java:149)
at com.csg.webtester.test.WebTesterTests.testTestingGettersAndSetters(WebTesterTests.java:112)
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.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

I am not sure if the HtmlForm class is corrupt or the testGetterAndSetter() method was it before.



IngoHofmann added a comment - 05/Jun/09 12:10 PM

Sorry, the method's name is, of course, testStateSaving().
I was confused with my own tests.


jasondlee added a comment - 15/Jun/09 12:32 PM

Could you paste a sample test case here so I can test on my end? All of my state saving tests are still working, so I'm not sure how to reproduce this. Thanks!


IngoHofmann added a comment - 15/Jun/09 12:41 PM - edited

This simple line leads now to the exception pasted above:

tester.testStateSaving(HtmlForm.COMPONENT_TYPE);

All other components seem to work fine. Until the recent changes, also the HtmlForm worked. I am not interested in testing the HtmlForm component, but that shows that there is a gap, doesn't it?


jasondlee added a comment - 15/Jun/09 12:51 PM

It certainly does. I'll take a look.


jasondlee added a comment - 22/Jul/09 04:37 AM

I added this test to WhenTestingStateSaving.java:

@Test
public void shouldBeAbleToTestHtmlForm() { facesTester.testStateSaving(HtmlForm.COMPONENT_TYPE); }

All tests pass, so I think this may have been resolved. Somehow. Could you test with 0.3-SNAPSHOT (which I'm about to upload to the repo) and let me know how it goes. I want to make sure this is squashed before we push out 0.3

Thanks


IngoHofmann added a comment - 22/Jul/09 07:26 AM

It would be great if you attached the built Snapshot jar, please. Unfortunately I don't have access to external mercurial repos due to security reasons. There has been a lot of changes and I don't want to copy all files from the web access (what I have always done so far).


jasondlee added a comment - 22/Jul/09 12:41 PM

I wasn't aware of that restriction. I'm working on an automated upload to Kenai solution too, as time permits, so hopefully this will happen automagically in the near future.


IngoHofmann added a comment - 22/Jul/09 01:16 PM

Thanks!
Hmm... It still doesn't work (getting same exception), but I faced some other issues related to the HtmlForm component. I am assuming that this is a problem with our JSF implementation, but not with the FacesTester. Though I am wondering why this test case worked once, this should be an environment issue. Thanks and sorry for your effort on this.