From c1a93a808426b2e82f52c07000e4a0573b1e7374 Mon Sep 17 00:00:00 2001 From: felmer <felmer> Date: Wed, 1 Oct 2008 12:22:41 +0000 Subject: [PATCH] LMS-597 Add AuthorizationManagementConsoleTest and commands for creating and checking group SVN: 8513 --- .../client/application/ui/AddGroupDialog.java | 39 ++++++++---- .../web/client/application/ui/GroupModel.java | 3 +- .../web/client/application/ui/GroupsView.java | 35 +++++++---- .../client/application/ui/PersonsView.java | 5 ++ .../application/AuthenticationTest.java | 9 +-- .../AuthorizationManagementConsolTest.java | 51 ++++++++++++++++ .../application/ui/CheckGroupCommand.java | 60 +++++++++++++++++++ .../application/ui/CreateGroupCommand.java | 48 +++++++++++++++ .../client/application/ui/LoginCommand.java | 4 +- .../web/client/testframework/GWTTestUtil.java | 55 +++++++++++------ .../client/testframework/IWidgetHandler.java | 2 +- .../client/testframework/WidgetPicker.java | 6 +- 12 files changed, 263 insertions(+), 54 deletions(-) create mode 100644 openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AuthorizationManagementConsolTest.java create mode 100644 openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/CheckGroupCommand.java create mode 100644 openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/CreateGroupCommand.java diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AddGroupDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AddGroupDialog.java index 5d691b2887b..72ba995b0e7 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AddGroupDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/AddGroupDialog.java @@ -24,6 +24,7 @@ import com.extjs.gxt.ui.client.widget.form.FormPanel; import com.extjs.gxt.ui.client.widget.form.TextField; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericViewContext; /** @@ -34,6 +35,26 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericVie */ public class AddGroupDialog extends Window { + final class RegisterGroupCallback extends AbstractAsyncCallback<Void> + { + private RegisterGroupCallback(GenericViewContext viewContext) + { + super(viewContext); + } + + @Override + public void process(Void result) + { + hide(); + groupList.refresh(); + + } + } + + private static final String PREFIX = "add-group_"; + + static final String CODE_FIELD_ID = GenericConstants.ID_PREFIX + PREFIX + "code-field"; + static final String SAVE_BUTTON_ID = GenericConstants.ID_PREFIX + PREFIX + "save-button"; private final GroupsView groupList; @@ -52,31 +73,25 @@ public class AddGroupDialog extends Window codeField.setWidth(100); codeField.setFieldLabel("Code"); codeField.setAllowBlank(false); + codeField.setId(CODE_FIELD_ID); form.add(codeField); final TextField<String> descriptionField = new TextField<String>(); descriptionField.setFieldLabel("Description"); form.add(descriptionField); - addButton(new Button("Save", new SelectionListener<ComponentEvent>() + Button saveButton = new Button("Save", new SelectionListener<ComponentEvent>() { @Override public void componentSelected(ComponentEvent ce) { viewContext.getService().registerGroup(codeField.getValue(), descriptionField.getValue(), null, - new AbstractAsyncCallback<Void>(viewContext) - { - @Override - public void process(Void result) - { - hide(); - groupList.refresh(); - - } - }); + new RegisterGroupCallback(viewContext)); } - })); + }); + saveButton.setId(SAVE_BUTTON_ID); + addButton(saveButton); addButton(new Button("Cancel", new SelectionListener<ComponentEvent>() { @Override diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/GroupModel.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/GroupModel.java index 364515402a4..0d9134a9752 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/GroupModel.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/GroupModel.java @@ -28,6 +28,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Group; */ public class GroupModel extends BaseModelData { + static final String CODE = "code"; private static final long serialVersionUID = 1L; @@ -37,7 +38,7 @@ public class GroupModel extends BaseModelData public GroupModel(Group g) { - set("code", g.getCode()); + set(CODE, g.getCode()); set("description", g.getDescription()); set("leader", g.getLeader()); set("registrator", g.getRegistrator()); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/GroupsView.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/GroupsView.java index a0940ec9d0a..14e5fea4fef 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/GroupsView.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/GroupsView.java @@ -44,6 +44,7 @@ import com.extjs.gxt.ui.client.widget.toolbar.ToolBar; import com.google.gwt.i18n.client.DateTimeFormat; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Group; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Person; @@ -55,6 +56,24 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Person; */ public class GroupsView extends LayoutContainer { + private static final String PREFIX = "groups-view_"; + + static final String TABLE_ID = GenericConstants.ID_PREFIX + PREFIX + "table"; + static final String ADD_BUTTON_ID = GenericConstants.ID_PREFIX + PREFIX + "add-button"; + + final class ListGroupsCallback extends AbstractAsyncCallback<List<Group>> + { + private ListGroupsCallback(GenericViewContext viewContext) + { + super(viewContext); + } + + @Override + public void process(List<Group> groups) + { + display(groups); + } + } private final GenericViewContext viewContext; @@ -131,9 +150,10 @@ public class GroupsView extends LayoutContainer Grid<GroupModel> grid = new Grid<GroupModel>(store, cm); grid.addPlugin(expander); grid.setBorders(true); + grid.setId(TABLE_ID); cp.add(grid); - Button addGroupBtton = new Button("Add group", new SelectionListener<ComponentEvent>() + Button addGroupButton = new Button("Add group", new SelectionListener<ComponentEvent>() { @Override public void componentSelected(ComponentEvent ce) @@ -141,12 +161,13 @@ public class GroupsView extends LayoutContainer new AddGroupDialog(viewContext, groupList).show(); } }); + addGroupButton.setId(ADD_BUTTON_ID); ToolBar toolBar = new ToolBar(); toolBar.add(new LabelToolItem("Filter:")); toolBar.add(new AdapterToolItem(new ColumnFilter<GroupModel>(store, "code", "code"))); toolBar.add(new SeparatorToolItem()); - toolBar.add(new AdapterToolItem(addGroupBtton)); + toolBar.add(new AdapterToolItem(addGroupButton)); cp.setBottomComponent(toolBar); add(cp); @@ -168,14 +189,6 @@ public class GroupsView extends LayoutContainer { removeAll(); add(new Text("data loading...")); - viewContext.getService().listGroups(null, - new AbstractAsyncCallback<List<Group>>(viewContext) - { - @Override - public void process(List<Group> groups) - { - display(groups); - } - }); + viewContext.getService().listGroups(null, new ListGroupsCallback(viewContext)); } } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/PersonsView.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/PersonsView.java index ea68e39461e..a83e6796f1c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/PersonsView.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/PersonsView.java @@ -41,6 +41,7 @@ import com.extjs.gxt.ui.client.widget.toolbar.ToolBar; import com.google.gwt.i18n.client.DateTimeFormat; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericViewContext; import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Person; @@ -51,6 +52,9 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.dto.Person; */ public class PersonsView extends LayoutContainer { + private static final String PREFIX = "persons-view_"; + + static final String ADD_BUTTON_ID = GenericConstants.ID_PREFIX + PREFIX + "add-button"; private final GenericViewContext viewContext; @@ -143,6 +147,7 @@ public class PersonsView extends LayoutContainer new AddPersonDialog(viewContext, personList).show(); } }); + addPersonButton.setId(ADD_BUTTON_ID); ToolBar toolBar = new ToolBar(); toolBar.add(new LabelToolItem("Filter:")); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AuthenticationTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AuthenticationTest.java index a49bb5ef9fd..a4a3dada807 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AuthenticationTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AuthenticationTest.java @@ -30,10 +30,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.RemoteCo */ public class AuthenticationTest extends AbstractGWTTestCase { - private RemoteConsole remoteConsole; - @Override protected void gwtSetUp() throws Exception { @@ -45,14 +43,17 @@ public class AuthenticationTest extends AbstractGWTTestCase { final Client client = new Client(); client.onModuleLoad(); - remoteConsole.prepare(new LoginCommand("test", "")).prepare(new LogoutCommand()).finish(10000); + remoteConsole.prepare(new LoginCommand("a", "a")); + remoteConsole.prepare(new LogoutCommand()).finish(10000); } public void testFailedLogin() throws Exception { final Client client = new Client(); client.onModuleLoad(); - remoteConsole.prepare(new LoginCommand("", "")).finish(10000); + remoteConsole.prepare(new LoginCommand("u", "")); + remoteConsole.prepare(new LogoutCommand()).finish(10000); } + } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AuthorizationManagementConsolTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AuthorizationManagementConsolTest.java new file mode 100644 index 00000000000..0a48d05d3bd --- /dev/null +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AuthorizationManagementConsolTest.java @@ -0,0 +1,51 @@ +/* + * Copyright 2008 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.generic.client.web.client.application; + +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.CheckGroupCommand; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.CreateGroupCommand; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.LoginCommand; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractGWTTestCase; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.RemoteConsole; + +/** + * + * + * @author Franz-Josef Elmer + */ +public class AuthorizationManagementConsolTest extends AbstractGWTTestCase +{ + private RemoteConsole remoteConsole; + + @Override + protected void gwtSetUp() throws Exception + { + remoteConsole = new RemoteConsole(this); + System.out.println("TEST: " + getName()); + } + + public void testCreateGroup() + { + final Client client = new Client(); + client.onModuleLoad(); + remoteConsole.prepare(new LoginCommand("a", "a")); + remoteConsole.prepare(new CreateGroupCommand("test-group")); + remoteConsole.prepare(new CheckGroupCommand("test-group")).finish(10000); + + } + +} diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/CheckGroupCommand.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/CheckGroupCommand.java new file mode 100644 index 00000000000..03a04877d82 --- /dev/null +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/CheckGroupCommand.java @@ -0,0 +1,60 @@ +/* + * Copyright 2008 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui; + +import junit.framework.Assert; + +import com.extjs.gxt.ui.client.store.ListStore; +import com.extjs.gxt.ui.client.widget.grid.Grid; +import com.google.gwt.user.client.ui.Widget; + +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.CallbackClassCondition; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestUtil; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.ITestCommandWithCondition; + +/** + * + * + * @author Franz-Josef Elmer + */ +public class CheckGroupCommand extends CallbackClassCondition implements ITestCommandWithCondition<Object> +{ + + private final String groupCode; + + public CheckGroupCommand(String groupCode) + { + super(AddGroupDialog.RegisterGroupCallback.class); + this.groupCode = groupCode; + } + + @SuppressWarnings("unchecked") + public void execute() + { + Widget widget = GWTTestUtil.getWidgetWithID(GroupsView.TABLE_ID); + Assert.assertTrue(widget instanceof Grid); + Grid<GroupModel> table = (Grid<GroupModel>) widget; + ListStore<GroupModel> store = table.getStore(); + for (int i = 0, n = store.getCount(); i < n; i++) + { + GroupModel groupModel = store.getAt(i); + Object value = groupModel.get(GroupModel.CODE); + System.out.println(i+":"+value+" "+groupCode); + } + } + +} diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/CreateGroupCommand.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/CreateGroupCommand.java new file mode 100644 index 00000000000..ea460776191 --- /dev/null +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/CreateGroupCommand.java @@ -0,0 +1,48 @@ +/* + * Copyright 2008 ETH Zuerich, CISD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui; + +import com.extjs.gxt.ui.client.Events; + +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.CallbackClassCondition; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestUtil; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.ITestCommandWithCondition; + +/** + * + * + * @author Franz-Josef Elmer + */ +public class CreateGroupCommand extends CallbackClassCondition implements ITestCommandWithCondition<Object> +{ + + private final String groupCode; + + public CreateGroupCommand(String groupCode) + { + super(GroupsView.ListGroupsCallback.class); + this.groupCode = groupCode; + } + + public void execute() + { + GWTTestUtil.clickButtonWithID(GroupsView.ADD_BUTTON_ID); + GWTTestUtil.getTextFieldWithID(AddGroupDialog.CODE_FIELD_ID).setValue(groupCode); + GWTTestUtil.clickButtonWithID(AddGroupDialog.SAVE_BUTTON_ID); + } + +} diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/LoginCommand.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/LoginCommand.java index 5ca92e647be..f3b5d6523f4 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/LoginCommand.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/LoginCommand.java @@ -16,8 +16,6 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui; -import com.extjs.gxt.ui.client.Events; - import ch.systemsx.cisd.openbis.generic.client.web.client.application.SessionContextCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.CallbackClassCondition; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestUtil; @@ -45,7 +43,7 @@ public class LoginCommand extends CallbackClassCondition implements ITestCommand { GWTTestUtil.<String>getTextFieldWithID(LoginWidget.USER_FIELD_ID).setValue(user); GWTTestUtil.<String>getTextFieldWithID(LoginWidget.PASSWORD_FIELD_ID).setValue(password); - GWTTestUtil.getButtonWithID(LoginWidget.BUTTON_ID).fireEvent(Events.Select); + GWTTestUtil.clickButtonWithID(LoginWidget.BUTTON_ID); } } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/GWTTestUtil.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/GWTTestUtil.java index 8f5fb007aec..6b753cbee54 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/GWTTestUtil.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/GWTTestUtil.java @@ -21,11 +21,14 @@ import java.util.List; import junit.framework.Assert; +import com.extjs.gxt.ui.client.Events; import com.extjs.gxt.ui.client.widget.Component; import com.extjs.gxt.ui.client.widget.Container; import com.extjs.gxt.ui.client.widget.ContentPanel; import com.extjs.gxt.ui.client.widget.button.Button; import com.extjs.gxt.ui.client.widget.form.TextField; +import com.extjs.gxt.ui.client.widget.toolbar.AdapterToolItem; +import com.google.gwt.user.client.Element; import com.google.gwt.user.client.ui.ComplexPanel; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; @@ -44,17 +47,17 @@ public class GWTTestUtil } /** - * Gets the {@link Button} with specified id. + * Clicks on the {@link Button} with specified id. * * @throws AssertionError if not found or isn't a button. */ - public static Button getButtonWithID(String id) + public static void clickButtonWithID(String id) { Widget widget = tryToFindByID(id); assertWidgetFound("Button", id, widget); Assert.assertTrue("Widget '" + id + "' isn't a Button: " + widget.getClass(), widget instanceof Button); - return (Button) widget; + ((Button) widget).fireEvent(Events.Select); } /** @@ -83,18 +86,25 @@ public class GWTTestUtil /** * Returns the ID of the specified widget. + * + * @return <code>null</code> if there is no ID. */ - public static String getWidgetID(Widget widget) + public static String tryToGetWidgetID(Widget widgetOrNull) { - String widgetID; - if (widget instanceof Component) + if (widgetOrNull == null) { - widgetID = ((Component) widget).getId(); - } else + return null; + } + if (widgetOrNull instanceof Component) + { + return ((Component) widgetOrNull).getId(); + } + Element element = widgetOrNull.getElement(); + if (element == null) { - widgetID = widget.getElement().getId(); + return null; } - return widgetID; + return element.getId(); } public static Widget getWidgetWithID(String id) @@ -139,10 +149,10 @@ public class GWTTestUtil final List<String> ids = new ArrayList<String>(); traverseRootPanel(new IWidgetHandler<Widget>() { - public boolean handle(Widget widget) + public boolean handle(Widget widgetOrNull) { - String widgetID = getWidgetID(widget); - if (widgetID.startsWith(idPrefix)) + String widgetID = tryToGetWidgetID(widgetOrNull); + if (widgetID != null && widgetID.startsWith(idPrefix)) { ids.add(widgetID); } @@ -162,17 +172,20 @@ public class GWTTestUtil } @SuppressWarnings("unchecked") - public boolean handle(Widget widget) + public boolean handle(Widget widgetOrNull) { - if (widget instanceof ComplexPanel) + if (widgetOrNull instanceof ComplexPanel) { - return new ComplexPanelHandler(this).handle((ComplexPanel) widget); - } else if (widget instanceof Container) + return new ComplexPanelHandler(this).handle((ComplexPanel) widgetOrNull); + } else if (widgetOrNull instanceof Container) { - return new ContainerHandler(this).handle((Container<Component>) widget); + return new ContainerHandler(this).handle((Container<Component>) widgetOrNull); + } else if (widgetOrNull instanceof AdapterToolItem) + { + return handler.handle(((AdapterToolItem) widgetOrNull).getWidget()); } else { - return handler.handle(widget); + return handler.handle(widgetOrNull); } } @@ -230,6 +243,10 @@ public class GWTTestUtil return true; } } + if (handler.handle(contentPanel.getBottomComponent())) + { + return true; + } } return false; } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/IWidgetHandler.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/IWidgetHandler.java index 61e814dd47a..aea2acc1d93 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/IWidgetHandler.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/IWidgetHandler.java @@ -30,5 +30,5 @@ public interface IWidgetHandler<W extends Widget> * * @return <code>true</code> if traversing should be stopped. */ - public boolean handle(W widget); + public boolean handle(W widgetOrNull); } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/WidgetPicker.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/WidgetPicker.java index 67b1dc5c70f..085da676657 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/WidgetPicker.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/testframework/WidgetPicker.java @@ -45,11 +45,11 @@ public class WidgetPicker implements IWidgetHandler<Widget> return pickedWidget; } - public boolean handle(Widget widget) + public boolean handle(Widget widgetOrNull) { - if (id.equals(GWTTestUtil.getWidgetID(widget))) + if (id.equals(GWTTestUtil.tryToGetWidgetID(widgetOrNull))) { - pickedWidget = widget; + pickedWidget = widgetOrNull; return true; } return false; -- GitLab