Bonjour,
j'ai du mal à comprendre ce message d'erreur
java.lang.ExceptionInInitializerError
....etc...
Caused by: java.lang.UnsupportedOperationException: ERROR: GWT.create() is only usable in client code! It cannot be called, for example, from server code. If you are running a unit test, check that your test case extends GWTTestCase and that GWT.create() is not called from within an initializer or constructor.
at com.google.gwt.core.client.GWT.create(GWT.java:92)
at com.google.gwt.i18n.client.LocaleInfo.<clinit>(LocaleInfo.java:36)
... 25 more
En fait je veux tester une méthode statique avec JUnit pour être sür qu'elle fait bien son job.
Avec cette ligne DateTimeFormat fmt = DateTimeFormat.getFormat("mm:ss");
, mon test unit explose qd j'appelle cette méthode(la méthode est défini dans la partie cliente du projet GWT et mon test se trouve dans un autre arborescence à la base de test).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
public static String computeTotalTime(Mod... model)
{
String time="00:00";
//....code.......
String timeInitial=model.getTextTime();
DateTimeFormat fmt = DateTimeFormat.getFormat("mm:ss");
Date date=fmt.parse(timeInitial);
int minut=date.getMinutes();
int second=date.getSeconds();
//....code.......
return time; |
je comprends pas pourquoi cette ligne pose problème ???
DateTimeFormat fmt = DateTimeFormat.getFormat("mm:ss");
merci de votre aide.....
Partager