package com.avpanasovich.client;
import com.avpanasovich.model.ItemType;
import com.google.gwt.core.client.GWT;
import com.google.gwt.junit.client.GWTTestCase;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.Timer;
import org.junit.Test;
/**
*
* @author Panason
*/
public class GwtTestMyFirstTestCase extends GWTTestCase {
ItemTypeServiceAsync itemTypeServiceAsync ;
AsyncCallback<Long> callback;
@Override
public String getModuleName() {
return "com.avpanasovich.itemManager";
// return null;
}
@Override
public void gwtSetUp() {
itemTypeServiceAsync = GWT.create(ItemTypeService.class);
callback = new AsyncCallback<Long>() {
@Override
public void onFailure(Throwable caught) {
GWT.log(caught.getMessage());
}
@Override
public void onSuccess(Long result) {
GWT.log("###############"+result);
}
};
}
@Test
public void testSomething() {
String moduleBaseURL = GWT.getModuleBaseURL();
Timer timer = new Timer() {
public void run()
{
ItemType itemType=new ItemType();
itemType.setNameItemType("dcccccccccccc");
itemTypeServiceAsync.create(itemType, callback);
finishTest();
}
};
timer.schedule(200);
delayTestFinish(10000);
}
}