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 5a2053f727db00b951399217c75b6f4483ba830c..faeb6212fa40d011b8f7466fe7db3a150af391a0 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/SystemTestSuite.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/SystemTestSuite.java @@ -24,6 +24,7 @@ import com.google.gwt.junit.tools.GWTTestSuite; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AuthenticationTest; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AuthorizationManagementConsolTest; import ch.systemsx.cisd.openbis.generic.client.web.client.application.DataSetSearchTest; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.EntityTypeBrowserTest; import ch.systemsx.cisd.openbis.generic.client.web.client.application.EntityTypePropertyTypeAssignmentTest; import ch.systemsx.cisd.openbis.generic.client.web.client.application.ExperimentBrowserTest; import ch.systemsx.cisd.openbis.generic.client.web.client.application.MaterialBrowserTest; @@ -67,6 +68,7 @@ public class SystemTestSuite extends GWTTestSuite testSuite.addTestSuite(PropertyTypeRegistrationTest.class); testSuite.addTestSuite(GenericExperimentAttachmentDownloadTest.class); testSuite.addTestSuite(ProjectRegistrationTest.class); + testSuite.addTestSuite(EntityTypeBrowserTest.class); return testSuite; } } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/EntityTypeBrowserTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/EntityTypeBrowserTest.java new file mode 100644 index 0000000000000000000000000000000000000000..6fb64094349d15288c55d237be368a5b3194ee2b --- /dev/null +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/EntityTypeBrowserTest.java @@ -0,0 +1,71 @@ +/* + * 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.framework.CategoriesBuilder.MenuCategoryKind; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.framework.CategoriesBuilder.MenuElementKind; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.columns.specific.EntityTypeColDefKind; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.experiment.ExperimentTypeGrid; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.material.MaterialTypeGrid; +import ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.sample.SampleTypeGrid; +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.Row; + +/** + * Tests for sample type, material type and experiment type browsers. + * + * @author Tomasz Pylak + */ +public class EntityTypeBrowserTest extends AbstractGWTTestCase +{ + + public final void testListMaterialTypes() + { + loginAndGotoTab(MenuCategoryKind.MATERIALS, MenuElementKind.BROWSE_TYPES); + CheckTableCommand table = + new CheckTableCommand(MaterialTypeGrid.GRID_ID, + MaterialTypeGrid.ListEntitiesCallback.class); + checkGridRows(table, "BACTERIUM", 7); + } + + public final void testListSampleTypes() + { + loginAndGotoTab(MenuCategoryKind.SAMPLES, MenuElementKind.BROWSE_TYPES); + CheckTableCommand table = + new CheckTableCommand(SampleTypeGrid.GRID_ID, + SampleTypeGrid.ListEntitiesCallback.class); + checkGridRows(table, "WELL", 6); + } + + public final void testListExperimentTypes() + { + loginAndGotoTab(MenuCategoryKind.EXPERIMENTS, MenuElementKind.BROWSE_TYPES); + CheckTableCommand table = + new CheckTableCommand(ExperimentTypeGrid.GRID_ID, + ExperimentTypeGrid.ListEntitiesCallback.class); + checkGridRows(table, "SIRNA_HCS", 2); + } + + private void checkGridRows(CheckTableCommand table, String expectedCode, int expectedRowsNum) + { + table.expectedRow(new Row().withCell(EntityTypeColDefKind.CODE.id(), expectedCode)); + remoteConsole.prepare(table.expectedSize(expectedRowsNum)); + + launchTest(20000); + } +}