gwtproject / gwt

GWT Open Source Project
http://www.gwtproject.org
1.52k stars 374 forks source link

java.lang.UnsatisfiedLinkError When Running Test #7297

Closed dankurka closed 9 years ago

dankurka commented 9 years ago

Originally reported on Google Code with ID 7300

Found in GWT Release 2.4.0

Encountered on OS / Browser Ubuntu 11.10 32-bit

Detailed description:
I've update from GWT 1.7 to 2.4. When I run the GWT test, I get the following:

com.google.gwt.user.client.ui.PotentialElement.isPotential(Lcom/google/gwt/core/client/JavaScriptObject;)Z

java.lang.UnsatisfiedLinkError: com.google.gwt.user.client.ui.PotentialElement.isPotential(Lcom/google/gwt/core/client/JavaScriptObject;)Z
at com.google.gwt.user.client.ui.PotentialElement.isPotential(Native Method)
at com.google.gwt.user.client.ui.Composite.initWidget(Composite.java:152)
at com.inwk.estore.gwt.admin.client.customization.checkoutfields.EstoreCheckoutFieldsCustomizationView.initializeViewComponents(EstoreCheckoutFieldsCustomizationView.java:59)
at com.inwk.estore.gwt.admin.client.customization.checkoutfields.EstoreCheckoutFieldsCustomizationView.<init>(EstoreCheckoutFieldsCustomizationView.java:45)
at com.inwk.estore.gwt.admin.client.customization.checkoutfields.EstoreCheckoutFieldsCustomizationViewTest$1.<init>(EstoreCheckoutFieldsCustomizationViewTest.java:85)
at com.inwk.estore.gwt.admin.client.customization.checkoutfields.EstoreCheckoutFieldsCustomizationViewTest.setup(EstoreCheckoutFieldsCustomizationViewTest.java:85)

public void populateCustomCheckoutFieldsGeneratesRemainingWidgetsAndCreatesSevenRows()
{
        EstoreCustomCheckoutFieldDTO attention = new EstoreCustomCheckoutFieldDTOBuilder().withId(1L).withName("Attention").build();
        EstoreCustomCheckoutFieldDTO phoneNo = new EstoreCustomCheckoutFieldDTOBuilder().withId(2L).withName("Phone
No").build();
        EstoreCustomCheckoutFieldDTO address = new EstoreCustomCheckoutFieldDTOBuilder().withId(2L).withName("Address").build();

        view.populateCustomFields(Arrays.asList(attention, phoneNo, address));
        verify(checkoutFields).clear();
        verify(checkoutFields, times(7)).appendRow((Label) anyObject(), (TextBox) anyObject(),
(CheckBox) anyObject(), 
                                                   (CheckBox) anyObject(), (CheckBox)
anyObject(), (TextAreaBasedListCreator) anyObject(), (Hidden) anyObject());
    }

Shortest code snippet which demonstrates issue (please indicate where
actual result differs from expected result):

void initializeViewComponents() {
        VerticalPanel checkoutFieldsForm = widgetFactory.verticalPanel("checkout-fields");
        message = widgetFactory.messageLabel(MessageLabel.MessageType.NOTICE);
        Label heading = widgetFactory.label("Setup Custom Fields", "heading");
        checkoutFields = widgetFactory.formTable("checkout-fields", "padding-5");
        Button saveButton = widgetFactory.button("Save", "save-custom-checkout-fields",
controller.saveButtonHandler());
        checkoutFieldsForm.add(message);
        checkoutFieldsForm.add(heading);
        checkoutFieldsForm.add(checkoutFields);
        checkoutFieldsForm.add(widgetFactory.label("*De-activate an active field to
edit its name", "warning subheading red"));
        checkoutFieldsForm.add(saveButton);
        initWidget(checkoutFieldsForm); <-- fails here.
    }

Am I possibly missing jar files or have the wrong jar files? I at a complete loss right
now.

Reported by tdespenza on 2012-04-04 16:28:07

dankurka commented 9 years ago
Is this a GWTTestCase? If not, the error is expected.

Reported by t.broyer on 2012-04-04 16:37:05

dankurka commented 9 years ago
Ahh so the test class has to extend GWTTestCase?

Reported by tdespenza on 2012-04-04 18:16:38

dankurka commented 9 years ago
Yes. See https://developers.google.com/web-toolkit/doc/latest/DevGuideTesting
But that was already the case in 1.7

Reported by t.broyer on 2012-04-04 23:12:13

dankurka commented 9 years ago
Thank you so much.

Reported by tdespenza on 2012-04-05 13:07:07

dankurka commented 9 years ago
Please reconsider the "AsDesigned" stand point.  Up until gwt 2.4.0 it was very much
possible (and easy and fast) to create standard junit (not derived from GWTTestCase)
test for classes extending Composite.  This allowed for the use of mock frameworks
such as Mockito to test BDD style interactions.

Granted, proper separation of concerns (e.g. MVP) puts the real testing elsewhere but
it was nice to be able to test UI behaviors that don't belong in the presenter without
the speed penalty of a gwt test case.

Reported by sbdaaaaaaave on 2012-09-06 22:41:58

dankurka commented 9 years ago
With the introduction of IsWidget, Composite has become rather moot.
See also https://groups.google.com/d/topic/google-web-toolkit-contributors/k6vUNULtDGs/discussion
And well, this is really "as designed", you were just lucky that it worked before for
COmposite, but you knew you shouldn't have relied on it.

Reported by t.broyer on 2012-09-07 05:40:22

dankurka commented 9 years ago
Yeah, yeah.  I don't disagree.  Thanks.

Reported by sbdaaaaaaave on 2012-09-07 16:11:04