Results 1 to 2 of 2

Thread: Testing GXT applications

  1. #1

    Default Testing GXT applications

    Hi All,

    Can any body suggest a Functional and Unit Testing tools for Sencha GXT applications.

    I tried with JUnit testing tool. But while trying to create a instance of a java class which consist of GXT components is throwing the following exception
    'java.lang.ExceptionInInitializerError'

    Following is my test case code.

    public class Test1 extends GWTTestCase {


    @AfterClass
    public static void tearDownAfterClass() throws Exception {
    System.out.println("After Class");
    }


    @Test
    public void test() {
    System.out.println("test.........");
    MyClass_GXT inst = new MyClass_GXT();
    inst.onModuleLoad();
    }


    @Before
    public void initialsetup() {
    System.out.println("intial setup");
    MyClass_GXT inst= new MyClass_GXT();
    }


    @Override
    public String getModuleName() {
    return null; // Even I tried by returning my module name(MyClass_GXT) as same it is mentioned in gwt.xml //file it is showing java.lang.NoSuchMethodError
    }
    }


    One more thing is that I'm making an service call using Request builder to one of my service and it returns a proper response in Chrome browser and Internet Explorer 10, but it does return with a status code as '0' in Firefox browser (Confirmed programatically).

    I checked the status of the service call using Firebug tool, in XHR console view it is showing the service call status as '200 OK'. Can some body can explain where I'm making a mistake or should any parameter should be specified while making a service in firefox browser.
    Attached Images Attached Images

  2. #2
    Sencha User
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,737
    Answers
    109

    Default

    The main important part is this method:
    Code:
    @Override
     public String getModuleName() {
      return null; // Even I tried by returning  my module name(MyClass_GXT)  as same it is mentioned in gwt.xml //file it is showing  java.lang.NoSuchMethodError 
     }
    }
    This must be a module that exists - in your case something like "com.gxt.aoe.Test" or whatever the module is. This is the package to the .gwt.xml file - if you have a com/company/project/app/App.gwt.xml file, then you should return "com.company.project.app.App" from this method.

    Note that running onModuleLoad probably isn't all that helpful since it will just turn on the app and then quit right away - you should probably be verifying that something happens when the app starts.

    Without seeing the full test setup and whatever it is calling, it is hard to make suggestions for the ajax error, but a 0 response code almost always means that the client couldn't even reach the server.


    Check out the https://developers.google.com/web-to...evGuideTesting document for more details on how to get started with GWTTestCase - you can skip down to the heading labeled "Client Side Example", as much of the opening of that article is more about project setup than the tests themselves.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •