Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassCastException when a GwtBootstrap Button is instanced #47

Open
Pintouch opened this issue Dec 5, 2014 · 0 comments
Open

ClassCastException when a GwtBootstrap Button is instanced #47

Pintouch opened this issue Dec 5, 2014 · 0 comments

Comments

@Pintouch
Copy link

Pintouch commented Dec 5, 2014

I'm using GwtMockito v1.1.4 for tests and I use GwtBootstrap in my project.
I'm getting this exception when I instantiate my widget :

java.lang.ClassCastException: com.google.gwt.dom.client.Text$$EnhancerByMockitoWithCGLIB$$bfd15ee6 cannot be cast to com.google.gwt.dom.client.Element
    at com.github.gwtbootstrap.client.ui.base.TextNode.setText(TextNode.java:34)
    at com.github.gwtbootstrap.client.ui.base.TextNode.<init>(TextNode.java:19)
    at com.github.gwtbootstrap.client.ui.base.IconAnchor.<init>(IconAnchor.java:75)
    at com.github.gwtbootstrap.client.ui.Button.<init>(Button.java:74)
    at com.github.gwtbootstrap.client.ui.Button.<init>(Button.java:95)
    at fr.mycompany.ga.client.ui.mainWidgets.userContent.UserContentImpl.<init>(UserContentImpl.java:52)
    at fr.mycompany.ga.client.ui.mainWidgets.userContent.UserContentTest.setUp(GreenUserContentTest.java:22)
    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:606)
    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.RunBefores.evaluate(RunBefores.java:27)
    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 com.google.gwtmockito.GwtMockitoTestRunner.run(GwtMockitoTestRunner.java:301)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    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)

I tried using GwtMockito V 1.1.5-SNAPSHOT, but I'm getting an error related to "com.google.gwt.user.client.impl.HistoryImpl".

I'm just crating a new Button in my constructor, I'm trying to find a workaround.

ekuefler added a commit that referenced this issue Dec 8, 2014
…n't do

anything about so that we can at least provide an error messages to users
hinting how they can work around the problem.

Refs #4, #22, #43, #47.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant