From 7abbb54444d76665d62baa588d74ecefd43d2f25 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Tue, 15 Oct 2019 11:32:43 +0200 Subject: [PATCH] Updated to support Git and Jenkins --- .../client/type/RibbonType.java | 2 +- .../client/GwtTestWidgetCommonEvent.java | 69 +++++++++---------- 2 files changed, 33 insertions(+), 38 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/widgetcommonevent/client/type/RibbonType.java b/src/main/java/org/gcube/portlets/user/td/widgetcommonevent/client/type/RibbonType.java index 5084382..c001dde 100644 --- a/src/main/java/org/gcube/portlets/user/td/widgetcommonevent/client/type/RibbonType.java +++ b/src/main/java/org/gcube/portlets/user/td/widgetcommonevent/client/type/RibbonType.java @@ -11,7 +11,7 @@ package org.gcube.portlets.user.td.widgetcommonevent.client.type; */ public enum RibbonType { OPEN, - CLONE, + CLONE, CLOSE, DELETE, PROPERTIES, diff --git a/src/test/java/org/gcube/portlets/user/td/widgetcommonevent/client/GwtTestWidgetCommonEvent.java b/src/test/java/org/gcube/portlets/user/td/widgetcommonevent/client/GwtTestWidgetCommonEvent.java index 3b2cf2a..68da69e 100644 --- a/src/test/java/org/gcube/portlets/user/td/widgetcommonevent/client/GwtTestWidgetCommonEvent.java +++ b/src/test/java/org/gcube/portlets/user/td/widgetcommonevent/client/GwtTestWidgetCommonEvent.java @@ -8,49 +8,45 @@ import com.google.gwt.junit.client.GWTTestCase; import com.google.web.bindery.event.shared.SimpleEventBus; /** - * Test Event + * Test Event * - * @author Giancarlo Panichi + * @author Giancarlo Panichi * * */ public class GwtTestWidgetCommonEvent extends GWTTestCase { - /** - * Must refer to a valid module that sources this class. - */ - @Override - public String getModuleName() { - return "org.gcube.portlets.user.td.widgetcommonevent.WidgetCommonEventJUnit"; - } + /** + * Must refer to a valid module that sources this class. + */ + @Override + public String getModuleName() { + return "org.gcube.portlets.user.td.widgetcommonevent.WidgetCommonEventJUnit"; + } - - /** - * Test Events fire - */ - @Test - public void testEvents() { - - 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)); - - - } + /** + * Test Events fire + */ + @Test + public void testEvents() { - private void doRibbonCommand(RibbonEvent 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()) { @@ -67,8 +63,7 @@ public class GwtTestWidgetCommonEvent extends GWTTestCase { break; } } catch (Exception e) { - System.out.println("doRibbonCommand Error : " + e.getLocalizedMessage() - + " \n " + e.getMessage()); + System.out.println("doRibbonCommand Error : " + e.getLocalizedMessage() + " \n " + e.getMessage()); } }