Updated to support Git and Jenkins
This commit is contained in:
parent
e2fc47e47f
commit
145f7c9ae9
|
@ -1,68 +0,0 @@
|
||||||
package org.gcube.portlets.user.td.widgetcommonevent.client;
|
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.RibbonEvent;
|
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.RibbonType;
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import com.google.gwt.junit.client.GWTTestCase;
|
|
||||||
import com.google.web.bindery.event.shared.SimpleEventBus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test Event
|
|
||||||
*
|
|
||||||
* @author Giancarlo Panichi
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class GwtTestWidgetCommonEvent {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Must refer to a valid module that sources this class.
|
|
||||||
*/
|
|
||||||
public String getModuleName() {
|
|
||||||
return "org.gcube.portlets.user.td.widgetcommonevent.WidgetCommonEventJUnit";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test Events fire
|
|
||||||
*/
|
|
||||||
public void testEvents() {
|
|
||||||
System.out.println("Test Ribbon Event");
|
|
||||||
SimpleEventBus eventBus = new SimpleEventBus();
|
|
||||||
|
|
||||||
eventBus.addHandler(RibbonEvent.TYPE, new RibbonEvent.RibbonEventHandler() {
|
|
||||||
|
|
||||||
public void onRibbon(RibbonEvent event) {
|
|
||||||
doRibbonCommand(event);
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
eventBus.fireEvent(new RibbonEvent(RibbonType.IMPORT_SDMX));
|
|
||||||
eventBus.fireEvent(new RibbonEvent(RibbonType.IMPORT_CSV));
|
|
||||||
eventBus.fireEvent(new RibbonEvent(RibbonType.IMPORT_JSON));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void doRibbonCommand(RibbonEvent event) {
|
|
||||||
System.out.println("doRibbonCommand Type: " + event.getRibbonType());
|
|
||||||
try {
|
|
||||||
switch (event.getRibbonType()) {
|
|
||||||
case IMPORT_SDMX:
|
|
||||||
System.out.println("Start Import SDMX");
|
|
||||||
break;
|
|
||||||
case IMPORT_CSV:
|
|
||||||
System.out.println("Start Import CSV");
|
|
||||||
break;
|
|
||||||
case IMPORT_JSON:
|
|
||||||
System.out.println("Start Import JSON");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
System.out.println("doRibbonCommand Error : " + e.getLocalizedMessage() + " \n " + e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module rename-to="GwtTestWidgetCommonEventJUnit">
|
|
||||||
<!-- Inherit our applications main module. -->
|
|
||||||
|
|
||||||
<!-- <inherits name='org.gcube.portlets.user.td.gwtservice.TDGWTService' /> -->
|
|
||||||
<!-- Specify the path to any remote services. -->
|
|
||||||
<!-- <servlet path="/TDGWTService"
|
|
||||||
class="org.gcube.portlets.user.td.gwtservice.server.TDGWTServiceImpl" /> -->
|
|
||||||
<!-- <entry-point class='org.gcube.portlets.user.td.widgetcommonevent.client.GwtTestWidgetCommonEvent'/> -->
|
|
||||||
|
|
||||||
<!-- Specify the paths for translatable code -->
|
|
||||||
<source path='client' />
|
|
||||||
</module>
|
|
Loading…
Reference in New Issue