Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8409861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:02:02+00:00 2026-06-10T00:02:02+00:00

I have a java library. I build it with Maven. I want to make

  • 0

I have a java library. I build it with Maven. I want to make sure it can be used by GWT users somewhere. I’ve added @GwtCompatible and @GwtIncompatible where appropriate. Now, I want to test that this will work as expected.

The library is a testing framework in Java (http://github.com/truth0/truth) – it provides various testing propositions, etc. People are going to use it in pure Java unit tests, but they are also going to use it in GWT integration tests (e.g. extends GWTTestCase). I don’t myself have an application for this, but I need to validate that it won’t break when used in GWT.

A normal JUnit test would (trivially) use the code like so:

import static ...Truth.ASSERT;

ASSERT.that(123456).isGreaterThan(12345);

I have created a small GWTTestCase that I wish to build on to fully exercise the GWT compatible subset of this library. The trivial GWTTestCase example goes like this:

import static org.truth.Truth.ASSERT
...
public class TruthGwtTest extends GWTTestCase {
  @Override public String getModuleName() {
    // I have a org/truth/TruthTest.gwt.xml file
    return "org.truth.TruthTest";
  }
  public void testFoo() {
    ASSERT.that(457923).is(1); // want this to fail
  }
}

My TruthTest.gwt.xml looks like this (and I admit I’m “cargo culting” a bit here)

<module>
  <source path=""/>
  <super-source path="super"/>
  <inherits name="com.google.gwt.junit.JUnit"/>
</module>

When I bind the gwt-maven-plugin with a “compile” and “test” execution, both executions properly bind and both run in the output. A little server is generated and run, but the test times out. When I inspect the content of the generated server, I see a lot of generated javascript, but I see no code that relates to the code I wrote in the test anywhere in the generated server.

I chose the value 457923 in the hopes that this magic number would be grep-able in the generated code, but I cannot find it. I’m just not sure, from docs, what I need to do to ensure that I have all the code properly GWT-compiling. I don’t see any code I could relate back to the Truth framework itself, nor the GWTTestCase’s test method.

Any experts out there in gwt-maven-plugin? Note – this isn’t an app, it’s a library – I just want to force the gwt compiler and a GwtTestCase to force the GWT infrastructure to validate that what I think will come out of it will come out of it. Do I need to run the maven-failsafe-plugin on a little test WAR plugin? Gaah.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T00:02:03+00:00Added an answer on June 10, 2026 at 12:02 am

    Ok – I figured it out. The problem seemed to be that I wasn’t specifying any browser emulation for htmlunit, and since there is no default browser, I needed to explicitly set it. Otherwise, it would simply start the server containing the unit-test, and expect you to connect a browser.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jar library. I used Java Class File Editor (CE) to modify
I am using Netbeans to build a Maven project, and have the JTidy java
I currently have a Java testing library which is built with Maven, and distributed
I have a Java background so I’m used to having Maven handle all problem
I have a Grail application that references a Java library (as an IntelliJ Module
Does Java have (or is there a library available) that allows me to have
I have a problem with a specific java client library. Here is the situation:
I have java sdk 1.7. I've always used django/python for web development, this will
I have Java Map (out of Strings and Ints) objects that I want to
We have an internal Java library, that for legacy reasons, needs to be compiled

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.