Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SmartGWT Version Test

    Hello,
    I want to test on build time what smartgwt version is used in order to avoid building WAR file with an old version of smartGWT.
    I want to include an unit test that can do this, so I write the follow test class:

    import java.util.Date;

    import org.junit.Test;

    import com.google.gwt.junit.client.GWTTestCase;
    import com.smartgwt.client.Version;

    /**
    * @author mcristes
    *
    */
    public class SmartGWTVersionTest extends GWTTestCase {

    @Override
    public String getModuleName() {
    return "com.package.CoreModule";
    }
    public void gwtSetUp() {
    new CoreModuleEntryPoint().onModuleLoad();
    }

    @Test
    public void testSmartGWTVersion() {
    Date localSmartGWTDate = Version.getBuildDate();
    Date goodVersionDate = new Date(112, 03, 10);
    if (localSmartGWTDate.before(goodVersionDate)) {
    assertTrue(false);
    } else {
    assertTrue(true);
    }
    }

    }

    and I received the following error:

    Can you please tell me what is wrong in the code???

    Exception in thread "htmlUnit client thread" java.lang.NoSuchMethodError: org.apache.commons.lang.StringUtils.startsWithIgnoreCase(Ljava/lang/String;Ljava/lang/String;)Z
    at com.gargoylesoftware.htmlunit.util.URLCreator$URLCreatorStandard.toUrlUnsafeClassic(URLCreator.java:66)
    at com.gargoylesoftware.htmlunit.util.UrlUtils.toUrlUnsafe(UrlUtils.java:193)
    at com.gargoylesoftware.htmlunit.util.UrlUtils.toUrlSafe(UrlUtils.java:171)
    at com.gargoylesoftware.htmlunit.WebClient.<clinit>(WebClient.java:162)
    at com.google.gwt.junit.RunStyleHtmlUnit$HtmlUnitThread.run(RunStyleHtmlUnit.java:95)

    #2
    Google that error message - the first few results suggest it's a problem with .jars in Tomcat or Geronimo that shouldn't be there.

    Comment

    Working...
    X