diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractAsyncCallback.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractAsyncCallback.java index 5535ceddc9421d687722e4a2d9dc66676172bb73..490d711c1414f66767e656fc8f50ade335689144 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractAsyncCallback.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/AbstractAsyncCallback.java @@ -161,6 +161,12 @@ public abstract class AbstractAsyncCallback<T> implements AsyncCallback<T> return id; } + @Override + public String toString() + { + return getCallbackId(); + } + // // AsyncCallback // diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/AbstractGenericEntityRegistrationForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/AbstractGenericEntityRegistrationForm.java index 9f6453d7d45459252a19d66e730fd50834f7b807..da3fd028833ad0ad14b750a0fdbaf3cea8c00295 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/AbstractGenericEntityRegistrationForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/AbstractGenericEntityRegistrationForm.java @@ -121,7 +121,7 @@ public abstract class AbstractGenericEntityRegistrationForm<T extends EntityType * Creates unique id based on {@link #createSimpleId(TechId, EntityKind)} and application * specific ID prefix. */ - protected static final String createId(TechId techId, EntityKind entityKind) + public static final String createId(TechId techId, EntityKind entityKind) { return ID_PREFIX + createSimpleId(techId, entityKind); } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationForm.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationForm.java index b9e3cf83cc3748fb84f7e60b4f87e3065912e026..a6c939e7cee21d1e56fbea906cc44ab9c6c04a51 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationForm.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationForm.java @@ -22,8 +22,6 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.IViewConte import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.AbstractRegistrationForm; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.GroupSelectionWidget; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.StringUtils; -import ch.systemsx.cisd.openbis.generic.shared.basic.IIdentifiable; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Group; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewSample; @@ -37,11 +35,6 @@ import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.IGenericClientS */ public final class GenericSampleRegistrationForm extends AbstractGenericSampleRegisterEditForm { - private static final IIdentifiable REGISTRATION_IDENTIFIER = null; - - // For tests only - public static final String ID = createId(REGISTRATION_IDENTIFIER, EntityKind.SAMPLE); - private final SampleType sampleType; public GenericSampleRegistrationForm( diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/SystemTestSuite.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/SystemTestSuite.java index b2ae7c50371635b03f1de4c509f2818e604b9db0..050a669eda76396b8dfa26c5f0b8bc7877dc07a4 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/SystemTestSuite.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/SystemTestSuite.java @@ -38,6 +38,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.SampleBrow import ch.systemsx.cisd.openbis.generic.client.web.client.application.SearchTest; import ch.systemsx.cisd.openbis.generic.client.web.client.application.VocabularyBrowserTest; import ch.systemsx.cisd.openbis.generic.client.web.client.application.VocabularyRegistrationTest; +import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.dataset.GenericDataSetViewerTest; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.experiment.GenericExperimentAttachmentDownloadTest; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.experiment.GenericExperimentEditorTest; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.experiment.GenericExperimentViewerTest; @@ -57,6 +58,7 @@ public class SystemTestSuite extends GWTTestSuite testSuite.addTestSuite(VocabularyBrowserTest.class); testSuite.addTestSuite(FileFormatTypeGridTest.class); testSuite.addTestSuite(DataSetSearchTest.class); + testSuite.addTestSuite(GenericDataSetViewerTest.class); testSuite.addTestSuite(AuthorizationManagementConsolTest.class); testSuite.addTestSuite(SampleBrowserTest.class); testSuite.addTestSuite(GenericSampleViewerTest.class); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/DataSetSearchTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/DataSetSearchTest.java index bedc22b3cc1504f885a1a6eee558c0e6686a40a4..9d7d853cf1dfc2ea1ab7929741e3d9fc3d33948d 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/DataSetSearchTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/DataSetSearchTest.java @@ -19,7 +19,7 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application; import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.TopMenu.ActionMenuKind; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.specific.data.CommonExternalDataColDefKind; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.DataSetSearchHitGrid; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.DataSetSearchRow; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.columns.DataSetSearchRow; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.search.FillSearchCriteria; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractGWTTestCase; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.CheckTableCommand; @@ -38,7 +38,7 @@ public class DataSetSearchTest extends AbstractGWTTestCase public final void testSearchByDataSetProperty() { - loginAndGotoTab(); + loginAndGotoSearchTab(); FillSearchCriteria fillCriteriaCmd = new FillSearchCriteria(); fillCriteriaCmd.addPropertyCriterion("Comment", "no comment"); remoteConsole.prepare(fillCriteriaCmd); @@ -57,7 +57,7 @@ public class DataSetSearchTest extends AbstractGWTTestCase public final void testSearchForFileType() { - loginAndGotoTab(); + loginAndGotoSearchTab(); FillSearchCriteria fillCriteriaCmd = new FillSearchCriteria(); fillCriteriaCmd.addAttributeCriterion(DataSetAttributeSearchFieldKind.FILE_TYPE, "tiff"); @@ -78,7 +78,8 @@ public class DataSetSearchTest extends AbstractGWTTestCase private Row createTiffRow() { - return new Row().withCell(CommonExternalDataColDefKind.FILE_FORMAT_TYPE.id(), "TIFF"); + return new DataSetSearchRow().withCell(CommonExternalDataColDefKind.FILE_FORMAT_TYPE.id(), + "TIFF"); } private static CheckTableCommand createCheckSearchGridCmd() @@ -86,7 +87,7 @@ public class DataSetSearchTest extends AbstractGWTTestCase return new CheckTableCommand(DataSetSearchHitGrid.GRID_ID); } - private void loginAndGotoTab() + private void loginAndGotoSearchTab() { loginAndInvokeAction(ActionMenuKind.DATA_SET_MENU_SEARCH); } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ExperimentBrowserTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ExperimentBrowserTest.java index a9abcb67d8629f433de229df43c38966fc4d5608..c8f92ecbab9db393216bab6ec335eb1354795451 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ExperimentBrowserTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ExperimentBrowserTest.java @@ -18,8 +18,8 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application; import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.TopMenu.ActionMenuKind; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment.CheckExperimentTable; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment.ExperimentRow; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment.ListExperiments; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment.columns.ExperimentRow; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractGWTTestCase; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityType; diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/columns/BrowseDataSet.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/BrowseDataSet.java similarity index 99% rename from openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/columns/BrowseDataSet.java rename to openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/BrowseDataSet.java index 329989649903d4492858672bbcfe66701d86f147..3509845bd03d2dced527cb5d2cd30f5c4434c1e2 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/columns/BrowseDataSet.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/BrowseDataSet.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.columns; +package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data; import static ch.systemsx.cisd.openbis.generic.shared.GenericSharedConstants.DATA_STORE_SERVER_WEB_APPLICATION_NAME; diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/ShowDataSet.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/ShowDataSet.java new file mode 100644 index 0000000000000000000000000000000000000000..e56489f9cc280f87ea890b0163f6bde0c9c8ad1e --- /dev/null +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/ShowDataSet.java @@ -0,0 +1,57 @@ +/* + * 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.data; + +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.application.model.BaseEntityModel; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.specific.experiment.CommonExperimentColDefKind; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.util.GridTestUtils; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractDefaultTestCommand; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestUtil; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ExternalData; + +/** + * A {@link AbstractDefaultTestCommand} extension for showing detail view of a data set with given + * code. View is displayed because of simulation of a click on show details button in a toolbar of a + * data set search results browser. + * + * @author Piotr Buczek + */ +public class ShowDataSet extends AbstractDefaultTestCommand +{ + private final String code; + + public ShowDataSet(final String code) + { + this.code = code; + addCallbackClass(DataSetSearchHitGrid.GRID_ID); + } + + @SuppressWarnings("unchecked") + public void execute() + { + final Widget widget = GWTTestUtil.getWidgetWithID(DataSetSearchHitGrid.GRID_ID); + assertTrue(widget instanceof Grid<?>); + final Grid<BaseEntityModel<ExternalData>> table = + (Grid<BaseEntityModel<ExternalData>>) widget; + GridTestUtils.fireSelectRow(table, CommonExperimentColDefKind.CODE.id(), code); + GWTTestUtil.clickButtonWithID(DataSetSearchHitGrid.BROWSER_ID + + DataSetSearchHitGrid.SHOW_DETAILS_BUTTON_ID_SUFFIX); + } +} diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/ShowDataSetEditor.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/ShowDataSetEditor.java new file mode 100644 index 0000000000000000000000000000000000000000..0579fe80f0d6c69a20bb84fdef6ecd58ec87677d --- /dev/null +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/ShowDataSetEditor.java @@ -0,0 +1,55 @@ +/* + * Copyright 2009 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.data; + +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractDefaultTestCommand; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestUtil; +import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.dataset.GenericDataSetViewer; + +/** + * @author Piotr Buczek + */ + +/** + * A {@link AbstractDefaultTestCommand} extension for showing edit view of a data set that assuming + * that opening its detail view was triggered before. + * + * @author Piotr Buczek + */ +public class ShowDataSetEditor extends AbstractDefaultTestCommand +{ + private final TechId dataSetId; + + public ShowDataSetEditor() + { + this(TechId.createWildcardTechId()); + } + + private ShowDataSetEditor(final TechId dataSetId) + { + this.dataSetId = dataSetId; + addCallbackClass(GenericDataSetViewer.DataSetInfoCallback.class); + } + + public void execute() + { + GWTTestUtil.clickButtonWithID(GenericDataSetViewer.createId(dataSetId) + + GenericDataSetViewer.ID_EDIT_SUFFIX); + } + +} diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetSearchRow.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/columns/DataSetSearchRow.java similarity index 83% rename from openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetSearchRow.java rename to openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/columns/DataSetSearchRow.java index 56a75c96f5e5f00d23edb12fdfee261e37ba8d2f..75ed1c69ad06ecc53ad490790a52af8f42657c92 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/DataSetSearchRow.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/data/columns/DataSetSearchRow.java @@ -14,8 +14,9 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data; +package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.columns; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.specific.data.CommonExternalDataColDefKind; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.util.GridTestUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.Row; @@ -27,6 +28,15 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.Row; public class DataSetSearchRow extends Row { + public DataSetSearchRow() + { + } + + public DataSetSearchRow(final String code) + { + withCell(CommonExternalDataColDefKind.CODE.id(), code); + } + /** * Creates a {@link Row} with given <var>propertyCode</var> associated to given <i>value</i>. */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ShowExperiment.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ShowExperiment.java index a4feb6c84ba454a48c12434c9630350c5c96da94..b468a2b78238b1e1e382463f877e08d2a6c35781 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ShowExperiment.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ShowExperiment.java @@ -27,7 +27,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestU import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment; /** - * A {@link AbstractDefaultTestCommand} extension for showing a experiment of given code. + * A {@link AbstractDefaultTestCommand} extension for showing details view of an experiment with + * given code. * * @author Franz-Josef Elmer */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentRow.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/columns/ExperimentRow.java similarity index 98% rename from openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentRow.java rename to openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/columns/ExperimentRow.java index 09f96a29bb4eedc0fbeb69da9b81477a74dd24ce..af4d75351b79ba1310fe0d388bc419f1fed74697 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/ExperimentRow.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/experiment/columns/ExperimentRow.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment; +package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment.columns; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.framework.renderers.SimpleYesNoRenderer; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.specific.experiment.CommonExperimentColDefKind; diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/columns/ShowSample.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/ShowSample.java similarity index 94% rename from openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/columns/ShowSample.java rename to openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/ShowSample.java index 5a891b735020f6196be58b4cd65952eb5b0a28d9..6dfcf217a230eaea58f28a75880a8b09b8ed9ee8 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/columns/ShowSample.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/ShowSample.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample.columns; +package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample; import com.extjs.gxt.ui.client.widget.grid.Grid; import com.google.gwt.user.client.ui.Widget; @@ -28,7 +28,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestU import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; /** - * A {@link AbstractDefaultTestCommand} extension for showing a sample of given code. + * A {@link AbstractDefaultTestCommand} extension for showing details view of a sample with given + * code. * * @author Franz-Josef Elmer */ diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/FillSearchCriteria.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/FillSearchCriteria.java index d9a31d6e9eaca261f8fc4ac3dc188926288c7570..1b7fb59f88bc9dcf17ea8ddb9c61281d3e6b1bb4 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/FillSearchCriteria.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/search/FillSearchCriteria.java @@ -27,6 +27,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.Ma import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractDefaultTestCommand; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestUtil; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetAttributeSearchFieldKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DetailedSearchFieldKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IAttributeSearchFieldKind; @@ -44,6 +45,15 @@ public final class FillSearchCriteria extends AbstractDefaultTestCommand private Boolean matchAll; + public static final FillSearchCriteria searchForDataSetWithCode(final String code) + { + FillSearchCriteria result = new FillSearchCriteria(); + // FIXME 2009-09-18, Piotr Buczek: search for code with '-x' suffix doesn't work + final String codeWithoutSuffix = code.substring(0, code.indexOf("-")) + "*"; + result.addAttributeCriterion(DataSetAttributeSearchFieldKind.CODE, codeWithoutSuffix); + return result; + } + public FillSearchCriteria() { criteria = new ArrayList<Criterion>(); 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 6d300a53e5f9d3f2cf500fe2b89a16ca79e89205..e26ad4cd7f1e7a88e4da09842ee59bfb3a2017a8 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 @@ -265,14 +265,21 @@ public final class GWTTestUtil /** * Selects {@link TabItem} with <var>tabItemId</var>. + * <p> + * NOTE: both arguments are treated as regular expression (wildcards are working) */ public final static void selectTabItemWithId(final String tabPanelId, final String tabItemId) { final TabPanel tabPanel = getTabPanelWithID(tabPanelId); - final TabItem tabItem = tabPanel.findItem(tabItemId, false); - Assert.assertTrue("No tab item with id '" + tabItemId + "' could be found.", - tabItem != null); - tabPanel.setSelection(tabItem); + for (TabItem tabItem : tabPanel.getItems()) + { + if (tabItem.getId().matches(tabItemId)) + { + tabPanel.setSelection(tabItem); + return; + } + } + Assert.fail("No tab item with id '" + tabItemId + "' could be found."); } /** diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/CheckDataSet.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/CheckDataSet.java new file mode 100644 index 0000000000000000000000000000000000000000..a7b1c8e0fc44be6043222b150588d98b36038a74 --- /dev/null +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/CheckDataSet.java @@ -0,0 +1,109 @@ +/* + * 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.plugin.generic.client.web.client.application.dataset; + +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.grid.entity.PropertyTypesCriteriaProvider.ListPropertyTypesCallback; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractDefaultTestCommand; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.CheckTableCommand; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.IPropertyChecker; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.IValueAssertion; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.PropertyCheckingManager; +import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetRelationshipRole; +import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.dataset.GenericDataSetViewer.DataSetInfoCallback; + +/** + * * {@link AbstractDefaultTestCommand} extension checking e.g. properties displayed in data set + * detail view. + * + * @author Piotr Buczek + */ +public class CheckDataSet extends AbstractDefaultTestCommand implements + IPropertyChecker<CheckDataSet> +{ + + private final TechId datasetId; + + private final String childrenGridId; + + private final String parentsGridId; + + private final PropertyCheckingManager propertyCheckingManager; + + private CheckTableCommand checkChildrenTable; + + private CheckTableCommand checkParentsTable; + + public CheckDataSet() + { + this(TechId.createWildcardTechId()); + } + + private CheckDataSet(final TechId datasetId) + { + this.datasetId = datasetId; + this.propertyCheckingManager = new PropertyCheckingManager(); + this.childrenGridId = + DataSetRelationshipBrowser.createGridId(datasetId, DataSetRelationshipRole.PARENT); + this.parentsGridId = + DataSetRelationshipBrowser.createGridId(datasetId, DataSetRelationshipRole.CHILD); + addCallbackClass(DataSetInfoCallback.class); + addCallbackClass(ListPropertyTypesCallback.class); + addCallbackClass(childrenGridId); + addCallbackClass(parentsGridId); + } + + public Property property(final String name) + { + return new Property(name, this); + } + + public CheckDataSet property(final String name, final IValueAssertion<?> valueAssertion) + { + propertyCheckingManager.addExcpectedProperty(name, valueAssertion); + return this; + } + + public void execute() + { + propertyCheckingManager.assertPropertiesOf(DataSetPropertiesPanel.PROPERTIES_ID_PREFIX + + datasetId); + + if (checkChildrenTable != null) + { + checkChildrenTable.execute(); + } + + if (checkParentsTable != null) + { + checkParentsTable.execute(); + } + } + + public CheckTableCommand childrenTable() + { + checkChildrenTable = new CheckTableCommand(childrenGridId); + return checkChildrenTable; + } + + public CheckTableCommand parentsTable() + { + checkParentsTable = new CheckTableCommand(parentsGridId); + return checkParentsTable; + } + +} diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/FillDataSetEditForm.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/FillDataSetEditForm.java new file mode 100644 index 0000000000000000000000000000000000000000..8e15ea5d1fa93ac9f651332842cc778127fdd0f1 --- /dev/null +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/FillDataSetEditForm.java @@ -0,0 +1,101 @@ +/* + * 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.plugin.generic.client.web.client.application.dataset; + +import java.util.ArrayList; +import java.util.List; + +import com.extjs.gxt.ui.client.widget.form.Field; +import com.extjs.gxt.ui.client.widget.form.TextArea; +import com.google.gwt.user.client.ui.Widget; + +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.AbstractRegistrationForm; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractDefaultTestCommand; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestUtil; +import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; +import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.PropertyField; + +/** + * A {@link AbstractDefaultTestCommand} extension for editing data set. + * + * @author Piotr Buczek + */ +public final class FillDataSetEditForm extends AbstractDefaultTestCommand +{ + private final String formId; + + private final List<PropertyField> properties; + + // private String newSampleOrNull; + + private String modifiedParentsOrNull; + + // private String newFileFormatTypeOrNull; + + public FillDataSetEditForm() + { + this(TechId.createWildcardTechId()); + } + + private FillDataSetEditForm(final TechId dataSetId) + { + this.formId = GenericDataSetEditForm.createId(dataSetId, EntityKind.DATA_SET); + this.properties = new ArrayList<PropertyField>(); + addCallbackClass(GenericDataSetEditForm.DataSetInfoCallback.class); + addCallbackClass(GenericDataSetEditForm.ListParentsCallback.class); + } + + public final FillDataSetEditForm addProperty(final PropertyField property) + { + assert property != null : "Unspecified property"; + properties.add(property); + return this; + } + + public final void execute() + { + String simpleId = formId.substring(GenericDataSetEditForm.ID_PREFIX.length()); + for (final PropertyField property : properties) + { + final Widget widget = + GWTTestUtil.getWidgetWithID(formId + property.getPropertyFieldId()); + if (widget instanceof Field<?>) + { + ((Field<?>) widget).setRawValue(property.getPropertyFieldValue()); + } else + { + throw new IllegalStateException("Wrong widget type"); + } + } + if (modifiedParentsOrNull != null) + { + System.err.println(modifiedParentsOrNull); + final TextArea parentsField = + (TextArea) GWTTestUtil.getWidgetWithID(DataSetParentsArea.createId(simpleId)); + parentsField.setRawValue(modifiedParentsOrNull); + } + GWTTestUtil.clickButtonWithID(formId + AbstractRegistrationForm.SAVE_BUTTON); + } + + public final FillDataSetEditForm modifyParents(final String modifiedParents) + { + this.modifiedParentsOrNull = modifiedParents; + return this; + } + +} diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetEditorTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetEditorTest.java new file mode 100644 index 0000000000000000000000000000000000000000..0ad9fb3b80f3345b595196f52fe44588a3545d5d --- /dev/null +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetEditorTest.java @@ -0,0 +1,170 @@ +/* + * 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.plugin.generic.client.web.client.application.dataset; + +import java.util.List; + +import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.MainTabPanel; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.TopMenu.ActionMenuKind; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.ShowDataSet; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.ShowDataSetEditor; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.search.FillSearchCriteria; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractDefaultTestCommand; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractGWTTestCase; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.CheckTableCommand; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestUtil; +import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.PropertyField; + +/** + * A {@link AbstractGWTTestCase} extension to test {@link GenericDataSetEditForm}. + * + * @author Piotr Buczek + */ +public class GenericDataSetEditorTest extends AbstractGWTTestCase +{ + + private static final String DS_WITH_ONE_PARENT_CODE = "20081105092159188-3"; + + private static final String DS_WITH_ONE_PARENT_PARENTS_CODE = "20081105092158673-1"; + + private static final String DS_WITH_ONE_PARENT_NEW_PARENTS_CODE = "20081105092159111-1"; + + public final void testEditDataSetComment() + { + prepareShowDataSetEditor(DS_WITH_ONE_PARENT_CODE); + + final String newCommentColumnValue = "new comment"; + remoteConsole.prepare(new FillDataSetEditForm().addProperty(new PropertyField("comment", + newCommentColumnValue))); + final AbstractDefaultTestCommand showUpdatedDataSet = new ShowUpdatedDataSet(); + remoteConsole.prepare(new AbstractDefaultTestCommand() + { + @Override + public List<AbstractAsyncCallback<Object>> tryValidOnSucess( + List<AbstractAsyncCallback<Object>> callbackObjects, Object result) + { + return showUpdatedDataSet.tryValidOnSucess(callbackObjects, result); + } + + public void execute() + { + showUpdatedDataSet.execute(); + + final CheckDataSet checkDataSet = new CheckDataSet(); + checkDataSet.property("Comment").asProperty(newCommentColumnValue); + remoteConsole.prepare(checkDataSet); + } + }); + launchTest(20 * SECOND); + } + + public final void testEditDataSetAddParent() + { + prepareShowDataSetEditor(DS_WITH_ONE_PARENT_CODE); + + remoteConsole.prepare(new FillDataSetEditForm() + .modifyParents(DS_WITH_ONE_PARENT_PARENTS_CODE + "," + + DS_WITH_ONE_PARENT_NEW_PARENTS_CODE)); + + final AbstractDefaultTestCommand showUpdatedDataSet = new ShowUpdatedDataSet(); + // remoteConsole.prepare(new ShowUpdatedDataSet()); + remoteConsole.prepare(new AbstractDefaultTestCommand() + { + @Override + public List<AbstractAsyncCallback<Object>> tryValidOnSucess( + List<AbstractAsyncCallback<Object>> callbackObjects, Object result) + { + return showUpdatedDataSet.tryValidOnSucess(callbackObjects, result); + } + + public void execute() + { + showUpdatedDataSet.execute(); + final CheckTableCommand checkParents = + new CheckDataSet().parentsTable().expectedSize(2); + // checkParents.expectedRow(new DataSetRow(DS_WITH_ONE_PARENT_PARENTS_CODE)); + // checkParents.expectedRow(new + // DataSetRow(DS_WITH_ONE_PARENT_NEW_PARENTS_CODE)); + + remoteConsole.prepare(checkParents); + } + }); + + launchTest(20 * SECOND); + } + + // public final void testEditDataSetRemoveAllParents() + // { + // prepareShowDataSetEditor(DS_WITH_ONE_PARENT_CODE); + // + // remoteConsole.prepare(new FillDataSetEditForm().modifyParents("")); + // remoteConsole.prepare(new ShowUpdatedDataSet()); + // final CheckTableCommand checkParents = new CheckDataSet().parentsTable().expectedSize(0); + // remoteConsole.prepare(checkParents); + // launchTest(20 * SECOND); + // } + + private class ShowUpdatedDataSet extends AbstractDefaultTestCommand + { + public ShowUpdatedDataSet() + { + addCallbackClass(GenericDataSetEditForm.UpdateDataSetCallback.class); + } + + public void execute() + { + String tabItemId = + GenericDataSetViewer.createId(TechId.createWildcardTechId()) + + MainTabPanel.TAB_SUFFIX; + GWTTestUtil.selectTabItemWithId(MainTabPanel.ID, tabItemId); + } + } + + // + // public final void testEditExperimentProject() + // { + // String oldProject = NEMO; + // String newProject = DEFAULT; + // String experiment = EXP11; + // prepareShowExperimentEditor(CISD, oldProject, SIRNA_HCS, experiment); + // remoteConsole.prepare(new FillExperimentEditForm().changeProject(identifier(CISD, + // newProject))); + // remoteConsole.prepare(new ListExperiments(withGroup(CISD, newProject), SIRNA_HCS, + // GenericExperimentEditForm.UpdateExperimentCallback.class)); + // CheckExperimentTable table = new CheckExperimentTable(); + // table.expectedRow(new ExperimentRow(experiment)); + // remoteConsole.prepare(table); + // launchTest(20 * SECOND); + // } + + private void prepareShowDataSetEditor(String dataSetCode) + { + // Open data set editor by simulating 3 steps: + // - search for data set with given code, + // - click on a result row and then on 'show details' button, + // - click on edit button in data set detail view. + // It could be also done without 3rd step and with clicking on 'edit' button + // in 2nd step instead. + loginAndInvokeAction(ActionMenuKind.DATA_SET_MENU_SEARCH); + remoteConsole.prepare(FillSearchCriteria.searchForDataSetWithCode(dataSetCode)); + remoteConsole.prepare(new ShowDataSet(dataSetCode)); + remoteConsole.prepare(new ShowDataSetEditor()); + } + +} diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewerTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewerTest.java new file mode 100644 index 0000000000000000000000000000000000000000..6ad9a8e880653b83d44b5048d985a4e1cb8496ec --- /dev/null +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/GenericDataSetViewerTest.java @@ -0,0 +1,125 @@ +/* + * 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.plugin.generic.client.web.client.application.dataset; + +import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.TopMenu.ActionMenuKind; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.ShowDataSet; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.columns.DataSetRow; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.search.FillSearchCriteria; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractGWTTestCase; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.CheckTableCommand; + +/** + * A {@link AbstractGWTTestCase} extension to test {@link GenericDataSetViewer}. + * + * @author Piotr Buczek + */ +public class GenericDataSetViewerTest extends AbstractGWTTestCase +{ + + private static final String PARENT_DATASET_CODE_WITH_SAMPLE = "20081105092159111-1"; + + private static final String CHILD_DATASET_CODE = "20081105092259000-9"; + + private static final String EXP_TEST_1 = "/CISD/NEMO/EXP-TEST-1"; + + private static final String EXP_REUSE_ID = "/CISD/DEFAULT/EXP-REUSE"; + + private static final String SAMPLE_TEST_1 = "CP-TEST-1"; + + private static final String DS_TYPE_HCS_IMAGE = "HCS_IMAGE"; + + public final void testShowDataSetWithDetailsAndSample() + { + final String parentCodes[] = {}; + final String childCodes[] = + { "20081105092259000-9" }; + + prepareShowDataSet(PARENT_DATASET_CODE_WITH_SAMPLE); + + final CheckDataSet checkDataSet = new CheckDataSet(); + // attributes + checkDataSet.property("Data Set Type").asCode(DS_TYPE_HCS_IMAGE); + checkDataSet.property("Source Type").asString("MEASUREMENT"); + checkDataSet.property("Location").asString("a/1"); + checkDataSet.property("Data Store").asCode("STANDARD"); + checkDataSet.property("File Type").asString("TIFF"); + // properties + checkDataSet.property("Comment").asProperty("no comment"); + checkDataSet.property("Gender").asProperty("FEMALE"); + checkDataSet.property("any_material").asProperty("1000_C (OLIGO)"); + checkDataSet.property("bacterium").asProperty("BACTERIUM1 (BACTERIUM)"); + // high level entity relationships + checkDataSet.property("Experiment").asString(EXP_TEST_1); + checkDataSet.property("Sample").asCode(SAMPLE_TEST_1); + checkDataSetRelationships(checkDataSet.parentsTable(), parentCodes); + checkDataSetRelationships(checkDataSet.childrenTable(), childCodes); + + remoteConsole.prepare(checkDataSet); + + launchTest(40 * SECOND); + } + + public final void testShowExperimentDataSetWithParents() + { + final String parentCodes[] = + { "20081105092158673-1", "20081105092159111-1", "20081105092159222-2", + "20081105092159333-3" }; + final String childCodes[] = + { "20081105092259900-0", "20081105092259900-1" }; + + prepareShowDataSet(CHILD_DATASET_CODE); + + final CheckDataSet checkDataSet = new CheckDataSet(); + // attributes + checkDataSet.property("Data Set Type").asCode(DS_TYPE_HCS_IMAGE); + checkDataSet.property("Source Type").asString("DERIVED"); + checkDataSet.property("Location").asString("xml/result-9"); + checkDataSet.property("Data Store").asCode("STANDARD"); + checkDataSet.property("File Type").asString("XML"); + // properties + checkDataSet.property("Comment").asProperty("no comment"); + // high level entity relationships + checkDataSet.property("Experiment").asString(EXP_REUSE_ID); + checkDataSetRelationships(checkDataSet.parentsTable(), parentCodes); + checkDataSetRelationships(checkDataSet.childrenTable(), childCodes); + + remoteConsole.prepare(checkDataSet); + + launchTest(40 * SECOND); + } + + private void checkDataSetRelationships(CheckTableCommand checkTable, String[] expectedCodes) + { + checkTable.expectedSize(expectedCodes.length); + for (String code : expectedCodes) + { + checkTable.expectedRow(new DataSetRow(code)); + } + } + + private void prepareShowDataSet(String dataSetCode) + { + // Open data set viewer by simulating 2 steps: + // - search for data set with given code, + // - click on a result row and then on 'show details' button. + loginAndInvokeAction(ActionMenuKind.DATA_SET_MENU_SEARCH); + remoteConsole.prepare(FillSearchCriteria.searchForDataSetWithCode(dataSetCode)); + remoteConsole.prepare(new ShowDataSet(dataSetCode)); + } + +} diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/Property.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/Property.java new file mode 100644 index 0000000000000000000000000000000000000000..d44d1390d685ea77d5cfcefaf10a14002837ba34 --- /dev/null +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/dataset/Property.java @@ -0,0 +1,49 @@ +/* + * 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.plugin.generic.client.web.client.application.dataset; + +import junit.framework.Assert; + +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractProperty; +import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.IValueAssertion; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Person; + +/** + * Extends {@link AbstractProperty} with methods for {@link Person} + * + * @author Franz-Josef Elmer + */ +public class Property extends AbstractProperty<CheckDataSet> +{ + public Property(final String key, final CheckDataSet checker) + { + super(key, checker); + } + + public CheckDataSet asPerson(final String personAsString) + { + return by(new IValueAssertion<Person>() + { + public void assertValue(final Person value) + { + String actualName = value.getLastName() + ", " + value.getFirstName(); + Assert.assertEquals(message, personAsString, actualName); + } + }); + } + +} diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/FillExperimentEditForm.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/FillExperimentEditForm.java index 2bac9d2b3cad7ed32bfbfb3c248c0afb93416c3f..64e8b98381908e52212de4dcce2b999d21217c7b 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/FillExperimentEditForm.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/FillExperimentEditForm.java @@ -31,6 +31,7 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUt import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractDefaultTestCommand; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestUtil; import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.PropertyField; /** @@ -40,8 +41,7 @@ import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.Pro */ public final class FillExperimentEditForm extends AbstractDefaultTestCommand { - - private final TechId experimentId; + private final String formId; private final List<PropertyField> properties; @@ -56,7 +56,7 @@ public final class FillExperimentEditForm extends AbstractDefaultTestCommand private FillExperimentEditForm(final TechId experimentId) { - this.experimentId = experimentId; + this.formId = GenericExperimentEditForm.createId(experimentId, EntityKind.EXPERIMENT); this.properties = new ArrayList<PropertyField>(); addCallbackClass(GenericExperimentEditForm.ExperimentInfoCallback.class); addCallbackClass(GenericExperimentEditForm.ListSamplesCallback.class); @@ -79,11 +79,11 @@ public final class FillExperimentEditForm extends AbstractDefaultTestCommand public final void execute() { - String simpleId = "generic-experiment-edit_" + experimentId + "_form"; - String id = GenericExperimentEditForm.ID_PREFIX + simpleId; + String simpleId = formId.substring(GenericExperimentEditForm.ID_PREFIX.length()); for (final PropertyField property : properties) { - final Widget widget = GWTTestUtil.getWidgetWithID(id + property.getPropertyFieldId()); + final Widget widget = + GWTTestUtil.getWidgetWithID(formId + property.getPropertyFieldId()); if (widget instanceof Field<?>) { ((Field<?>) widget).setRawValue(property.getPropertyFieldValue()); @@ -107,7 +107,7 @@ public final class FillExperimentEditForm extends AbstractDefaultTestCommand .getWidgetWithID(ExperimentSamplesArea.createId(simpleId)); samplesField.setRawValue(samplesOrNull); } - GWTTestUtil.clickButtonWithID(id + AbstractRegistrationForm.SAVE_BUTTON); + GWTTestUtil.clickButtonWithID(formId + AbstractRegistrationForm.SAVE_BUTTON); } public FillExperimentEditForm changeProject(String newProject) diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/FillExperimentRegistrationForm.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/FillExperimentRegistrationForm.java index c57782f12a6f15e36370a2b3484d58ef47d67c89..3489735a409516f35ace4624ede8d9a88686b472 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/FillExperimentRegistrationForm.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/FillExperimentRegistrationForm.java @@ -23,12 +23,14 @@ import com.extjs.gxt.ui.client.widget.form.Field; import com.extjs.gxt.ui.client.widget.form.TextArea; import com.google.gwt.user.client.ui.Widget; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.GenericConstants; import ch.systemsx.cisd.openbis.generic.client.web.client.application.model.ModelDataPropertyNames; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.AbstractRegistrationForm; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment.ProjectSelectionWidget; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractDefaultTestCommand; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestUtil; +import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.AbstractGenericEntityRegistrationForm; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.PropertyField; @@ -40,6 +42,11 @@ import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.Pro */ public final class FillExperimentRegistrationForm extends AbstractDefaultTestCommand { + private static String FORM_ID = + GenericExperimentRegistrationForm.createId((TechId) null, EntityKind.EXPERIMENT); + + private static String FORM_SIMPLE_ID = FORM_ID.substring(GenericConstants.ID_PREFIX.length()); + private final String code; private final String projectNameOrNull; @@ -48,9 +55,6 @@ public final class FillExperimentRegistrationForm extends AbstractDefaultTestCom private final String samples; - private static String DUMMY_ID = - GenericExperimentRegistrationForm.createId(null, EntityKind.EXPERIMENT); - public FillExperimentRegistrationForm(final String project, final String code, final String samples) { @@ -74,16 +78,16 @@ public final class FillExperimentRegistrationForm extends AbstractDefaultTestCom public final void execute() { - GWTTestUtil.setTextField(DUMMY_ID - + AbstractGenericEntityRegistrationForm.ID_SUFFIX_CODE, code); + GWTTestUtil.setTextField(FORM_ID + AbstractGenericEntityRegistrationForm.ID_SUFFIX_CODE, + code); final ProjectSelectionWidget projectSelector = (ProjectSelectionWidget) GWTTestUtil.getWidgetWithID(ProjectSelectionWidget.ID - + ProjectSelectionWidget.SUFFIX + DUMMY_ID); + + ProjectSelectionWidget.SUFFIX + FORM_SIMPLE_ID); GWTUtils.setSelectedItem(projectSelector, ModelDataPropertyNames.CODE, projectNameOrNull); final TextArea samplesField = - (TextArea) GWTTestUtil.getWidgetWithID(ExperimentSamplesArea.createId(DUMMY_ID)); + (TextArea) GWTTestUtil.getWidgetWithID(ExperimentSamplesArea.createId(FORM_ID)); samplesField.setRawValue(samples); for (final PropertyField property : properties) @@ -97,6 +101,6 @@ public final class FillExperimentRegistrationForm extends AbstractDefaultTestCom throw new IllegalStateException("Wrong widget type"); } } - GWTTestUtil.clickButtonWithID(DUMMY_ID + AbstractRegistrationForm.SAVE_BUTTON); + GWTTestUtil.clickButtonWithID(FORM_ID + AbstractRegistrationForm.SAVE_BUTTON); } } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentEditorTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentEditorTest.java index efc1806f7997647fcb5c4650bf4971ad359abdcd..70868fb2e12e73ee27cc7a6dfa1081d83f3a202f 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentEditorTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentEditorTest.java @@ -20,10 +20,10 @@ import java.util.Date; import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.TopMenu.ActionMenuKind; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment.CheckExperimentTable; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment.ExperimentRow; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment.ListExperiments; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment.ShowExperiment; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment.ShowExperimentEditor; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment.columns.ExperimentRow; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractGWTTestCase; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.PropertyField; @@ -34,7 +34,6 @@ import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.Pro */ public class GenericExperimentEditorTest extends AbstractGWTTestCase { - private static final String SIRNA_HCS = "SIRNA_HCS"; private static final String CISD = "CISD"; diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentRegistrationTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentRegistrationTest.java index 0ae1d1da857a95f7d23629b81d1fb5b06a0fb78c..bee7a305362b9e37c0a85c56455ab832e7e97fdb 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentRegistrationTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/experiment/GenericExperimentRegistrationTest.java @@ -21,12 +21,13 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.TopMe import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.InvokeActionMenu; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment.CheckExperimentTable; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment.ChooseTypeOfNewExperiment; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment.ExperimentRow; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment.ListExperiments; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment.columns.ExperimentRow; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample.CheckSampleTable; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample.ListSamples; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample.columns.SampleRow; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractGWTTestCase; +import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.PropertyField; @@ -37,8 +38,25 @@ import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.Pro */ public class GenericExperimentRegistrationTest extends AbstractGWTTestCase { - private static String DUMMY_ID = - GenericExperimentRegistrationForm.createId(null, EntityKind.EXPERIMENT); + + /** + * Don't use directly - use {@link #getFormID()}. + * <p> + * NOTE: Cannot set value statically - tests construction fails. + */ + @Deprecated + private static String FORM_ID; + + private static String getFormID() + { + if (FORM_ID == null) + { + FORM_ID = + GenericExperimentRegistrationForm + .createId((TechId) null, EntityKind.EXPERIMENT); + } + return FORM_ID; + } private final void loginAndPreprareRegistration(final String sampleType) { @@ -52,10 +70,10 @@ public class GenericExperimentRegistrationTest extends AbstractGWTTestCase loginAndPreprareRegistration(experimentTypeCode); remoteConsole.prepare(new FillExperimentRegistrationForm("DEFAULT", "NEW_EXP_1", "") .addProperty( - new PropertyField(DUMMY_ID + "user-description", + new PropertyField(getFormID() + "user-description", "New test experiment description.")).addProperty( - new PropertyField(DUMMY_ID + "user-gender", "MALE")).addProperty( - new PropertyField(DUMMY_ID + "user-purchase-date", "2008-12-17"))); + new PropertyField(getFormID() + "user-gender", "MALE")).addProperty( + new PropertyField(getFormID() + "user-purchase-date", "2008-12-17"))); remoteConsole.prepare(new InvokeActionMenu(TopMenu.ActionMenuKind.EXPERIMENT_MENU_BROWSE, GenericExperimentRegistrationForm.RegisterExperimentCallback.class)); remoteConsole.prepare(new ListExperiments("DEFAULT", experimentTypeCode)); @@ -74,10 +92,10 @@ public class GenericExperimentRegistrationTest extends AbstractGWTTestCase remoteConsole.prepare(new FillExperimentRegistrationForm(project, experimentCode, sampleCode).addProperty( - new PropertyField(DUMMY_ID + "user-description", + new PropertyField(getFormID() + "user-description", "New test experiment with samples.")).addProperty( - new PropertyField(DUMMY_ID + "user-gender", "MALE")).addProperty( - new PropertyField(DUMMY_ID + "user-purchase-date", "2008-12-18"))); + new PropertyField(getFormID() + "user-gender", "MALE")).addProperty( + new PropertyField(getFormID() + "user-purchase-date", "2008-12-18"))); remoteConsole.prepare(new InvokeActionMenu(TopMenu.ActionMenuKind.SAMPLE_MENU_BROWSE, GenericExperimentRegistrationForm.RegisterExperimentCallback.class)); remoteConsole.prepare(new ListSamples("CISD", "CELL_PLATE")); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/FillSampleRegistrationForm.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/FillSampleRegistrationForm.java index 91dbf6c1b73b85917105041954ef70e5e08d8292..8feec3b3bdec048f583ad2b1f72ae194c913552a 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/FillSampleRegistrationForm.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/FillSampleRegistrationForm.java @@ -32,6 +32,8 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUt import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.StringUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractDefaultTestCommand; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.GWTTestUtil; +import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.AbstractGenericEntityRegistrationForm; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.PropertyField; @@ -42,6 +44,9 @@ import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.Pro */ public final class FillSampleRegistrationForm extends AbstractDefaultTestCommand { + private static String FORM_ID = + GenericSampleRegistrationForm.createId((TechId) null, EntityKind.SAMPLE); + private final String code; private final String groupNameOrNull; @@ -92,36 +97,34 @@ public final class FillSampleRegistrationForm extends AbstractDefaultTestCommand public final void execute() { - GWTTestUtil.setTextField(GenericSampleRegistrationForm.ID - + AbstractGenericEntityRegistrationForm.ID_SUFFIX_CODE, code); + + GWTTestUtil.setTextField(FORM_ID + AbstractGenericEntityRegistrationForm.ID_SUFFIX_CODE, + code); final GroupSelectionWidget groupSelector = (GroupSelectionWidget) GWTTestUtil.getWidgetWithID(GroupSelectionWidget.ID - + GroupSelectionWidget.SUFFIX + GenericSampleRegistrationForm.ID); + + GroupSelectionWidget.SUFFIX + FORM_ID); GWTUtils.setSelectedItem(groupSelector, ModelDataPropertyNames.CODE, groupNameOrNull); if (StringUtils.isBlank(parent) == false) { final SampleChooserField parentField = - (SampleChooserField) GWTTestUtil - .getWidgetWithID(GenericSampleRegistrationForm.ID - + GenericSampleRegistrationForm.ID_SUFFIX_PARENT); + (SampleChooserField) GWTTestUtil.getWidgetWithID(FORM_ID + + GenericSampleRegistrationForm.ID_SUFFIX_PARENT); parentField.setValue(parent); } if (StringUtils.isBlank(container) == false) { final SampleChooserField containerField = - (SampleChooserField) GWTTestUtil - .getWidgetWithID(GenericSampleRegistrationForm.ID - + GenericSampleRegistrationForm.ID_SUFFIX_CONTAINER); + (SampleChooserField) GWTTestUtil.getWidgetWithID(FORM_ID + + GenericSampleRegistrationForm.ID_SUFFIX_CONTAINER); containerField.setValue(container); } if (StringUtils.isBlank(experimentIdentifier) == false) { final ExperimentChooserField expField = - (ExperimentChooserField) GWTTestUtil - .getWidgetWithID(GenericSampleRegistrationForm.ID - + GenericSampleRegistrationForm.ID_SUFFIX_EXPERIMENT); + (ExperimentChooserField) GWTTestUtil.getWidgetWithID(FORM_ID + + GenericSampleRegistrationForm.ID_SUFFIX_EXPERIMENT); expField.setValue(experimentIdentifier); } for (final PropertyField property : properties) @@ -135,8 +138,7 @@ public final class FillSampleRegistrationForm extends AbstractDefaultTestCommand throw new IllegalStateException("Wrong widget type"); } } - GWTTestUtil.clickButtonWithID(GenericSampleRegistrationForm.ID - + AbstractRegistrationForm.SAVE_BUTTON); + GWTTestUtil.clickButtonWithID(FORM_ID + AbstractRegistrationForm.SAVE_BUTTON); } public final FillSampleRegistrationForm experiment(final String experiment) diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationTest.java index 4d30d814eb1d7ffaa389776587c7579a5294050b..99492dffb8f25f1aa6323f7bb0e36e9ab34f5cf5 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationTest.java @@ -26,14 +26,16 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample.CheckSampleTable; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample.ChooseTypeOfNewSample; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample.ListSamples; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample.ShowSample; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample.columns.SampleRow; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample.columns.ShowSample; import ch.systemsx.cisd.openbis.generic.client.web.client.application.util.GWTUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractGWTTestCase; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.CheckTableCommand; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.FailureExpectation; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.Row; import ch.systemsx.cisd.openbis.generic.shared.IPluginCommonServer; +import ch.systemsx.cisd.openbis.generic.shared.basic.TechId; +import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityKind; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewSample; import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.PropertyField; @@ -44,6 +46,23 @@ import ch.systemsx.cisd.openbis.plugin.generic.client.web.client.application.Pro */ public class GenericSampleRegistrationTest extends AbstractGWTTestCase { + /** + * Don't use directly - use {@link #getFormID()}. + * <p> + * NOTE: Cannot set value statically - tests construction fails. + */ + @Deprecated + private static String FORM_ID; + + private static String getFormID() + { + if (FORM_ID == null) + { + FORM_ID = GenericSampleRegistrationForm.createId((TechId) null, EntityKind.SAMPLE); + } + return FORM_ID; + } + private static final String PLATE_GEOMETRY = "$plate_geometry"; private static final String CONTROL_LAYOUT = "CONTROL_LAYOUT"; @@ -69,7 +88,7 @@ public class GenericSampleRegistrationTest extends AbstractGWTTestCase final String sampleTypeCode = CONTROL_LAYOUT; loginAndPreprareRegistration(sampleTypeCode); remoteConsole.prepare(new FillSampleRegistrationForm("CISD", GROUP_CL, true) - .addProperty(new PropertyField(GenericSampleRegistrationForm.ID + .addProperty(new PropertyField(getFormID() + GWTUtils.escapeToFormId(PLATE_GEOMETRY), "1536_WELLS_32X48"))); remoteConsole.prepare(new InvokeActionMenu(TopMenu.ActionMenuKind.SAMPLE_MENU_BROWSE, GenericSampleRegistrationForm.RegisterSampleCallback.class)); @@ -88,7 +107,7 @@ public class GenericSampleRegistrationTest extends AbstractGWTTestCase loginAndInvokeAction("observer", "observer", ActionMenuKind.SAMPLE_MENU_NEW); remoteConsole.prepare(new ChooseTypeOfNewSample(CONTROL_LAYOUT)); remoteConsole.prepare(new FillSampleRegistrationForm("TESTGROUP", GROUP_CL + "1", true) - .addProperty(new PropertyField(GenericSampleRegistrationForm.ID + .addProperty(new PropertyField(getFormID() + GWTUtils.escapeToFormId(PLATE_GEOMETRY), "1536_WELLS_32X48"))); FailureExpectation failureExpectation = new FailureExpectation(GenericSampleRegistrationForm.RegisterSampleCallback.class) @@ -161,10 +180,9 @@ public class GenericSampleRegistrationTest extends AbstractGWTTestCase final String description = "A very nice control layout."; remoteConsole.prepare(new FillSampleRegistrationForm( GroupSelectionWidget.SHARED_GROUP_CODE, SHARED_CL, true).addProperty( - new PropertyField(GenericSampleRegistrationForm.ID + "description", description)) - .addProperty( - new PropertyField(GenericSampleRegistrationForm.ID - + GWTUtils.escapeToFormId(PLATE_GEOMETRY), "1536_WELLS_32X48"))); + new PropertyField(getFormID() + "description", description)).addProperty( + new PropertyField(getFormID() + GWTUtils.escapeToFormId(PLATE_GEOMETRY), + "1536_WELLS_32X48"))); remoteConsole.prepare(new InvokeActionMenu(TopMenu.ActionMenuKind.SAMPLE_MENU_BROWSE, GenericSampleRegistrationForm.RegisterSampleCallback.class)); remoteConsole.prepare(new ListSamples(GroupSelectionWidget.SHARED_GROUP_CODE, diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewerTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewerTest.java index d8d48fdce60b6a5c622684b80caa0ea183c87e2b..082ed8c91eee888f971bebc8a915bc406611c14a 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewerTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleViewerTest.java @@ -25,10 +25,10 @@ import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAs import ch.systemsx.cisd.openbis.generic.client.web.client.application.menu.TopMenu.ActionMenuKind; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.specific.data.CommonExternalDataColDefKind; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.specific.sample.CommonSampleColDefKind; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.columns.BrowseDataSet; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.BrowseDataSet; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.data.columns.DataSetRow; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample.ListSamples; -import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample.columns.ShowSample; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample.ShowSample; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.util.GridTestUtils; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractDefaultTestCommand; import ch.systemsx.cisd.openbis.generic.client.web.client.testframework.AbstractGWTTestCase; diff --git a/openbis/sourceTest/lucene/indices/ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE/_0.cfs b/openbis/sourceTest/lucene/indices/ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE/_0.cfs index a047cd0d694eef91e81ca2b3ceed7f5e563e7462..3923a23fb0169531ba5d1140fa453ed6909d688c 100644 Binary files a/openbis/sourceTest/lucene/indices/ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE/_0.cfs and b/openbis/sourceTest/lucene/indices/ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE/_0.cfs differ diff --git a/openbis/sourceTest/lucene/indices/ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE/segments_2 b/openbis/sourceTest/lucene/indices/ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE/segments_2 index 676f39b76fc17afc668dfcc12f32e1adc74b8829..02ad4acc9e1dd0014ff6e9b30c7a3a8a70c80923 100644 Binary files a/openbis/sourceTest/lucene/indices/ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE/segments_2 and b/openbis/sourceTest/lucene/indices/ch.systemsx.cisd.openbis.generic.shared.dto.ExternalDataPE/segments_2 differ diff --git a/openbis/sourceTest/sql/postgresql/041/008=data_set_properties.tsv b/openbis/sourceTest/sql/postgresql/041/008=data_set_properties.tsv index 2531c69aa96ae4c05340df0f2c7813591bf9ffd7..e729af1e2f0bb0ecbcce5df1e6f1b2cd097ee6c5 100644 --- a/openbis/sourceTest/sql/postgresql/041/008=data_set_properties.tsv +++ b/openbis/sourceTest/sql/postgresql/041/008=data_set_properties.tsv @@ -3,6 +3,11 @@ 3 5 1 no comment \N \N 2 2009-04-24 14:45:06.348563+02 2009-04-24 14:45:07.09+02 4 6 1 no comment \N \N 2 2009-04-24 14:45:06.348563+02 2009-04-24 14:45:07.09+02 5 7 1 no comment \N \N 2 2009-04-24 14:45:06.348563+02 2009-04-24 14:45:07.091+02 -6 5 4 \N 12 \N 2 2009-09-15 08:45:48.059548+02 2009-09-15 08:45:48.639+02 -7 5 3 \N \N 22 2 2009-09-15 08:45:48.059548+02 2009-09-15 08:45:48.64+02 -8 5 2 \N \N 2498 2 2009-09-15 08:45:48.059548+02 2009-09-15 08:45:48.64+02 +6 8 1 no comment \N \N 2 2009-04-24 14:45:06.348563+02 2009-04-24 14:45:07.091+02 +7 9 1 no comment \N \N 2 2009-04-24 14:45:06.348563+02 2009-04-24 14:45:07.091+02 +8 10 1 no comment \N \N 2 2009-04-24 14:45:06.348563+02 2009-04-24 14:45:07.091+02 +9 11 1 no comment \N \N 2 2009-04-24 14:45:06.348563+02 2009-04-24 14:45:07.091+02 +10 12 1 no comment \N \N 2 2009-04-24 14:45:06.348563+02 2009-04-24 14:45:07.091+02 +11 5 4 \N 12 \N 2 2009-09-15 08:45:48.059548+02 2009-09-15 08:45:48.639+02 +12 5 3 \N \N 22 2 2009-09-15 08:45:48.059548+02 2009-09-15 08:45:48.64+02 +13 5 2 \N \N 2498 2 2009-09-15 08:45:48.059548+02 2009-09-15 08:45:48.64+02