From 5172eb4c232ac18f942380c6ce8a8534d54e94d1 Mon Sep 17 00:00:00 2001 From: felmer <felmer> Date: Tue, 30 Sep 2014 10:14:48 +0000 Subject: [PATCH] SSDM-949: fixing broken tests. SVN: 32529 --- .../webapps/common-test/html/common-test.js | 10 +++++++++- .../webapps/openbis-test/html/openbis-test.js | 20 +++++++++---------- .../echo-database/plugin.properties | 2 +- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/common-test/html/common-test.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/common-test/html/common-test.js index 06a1f8a450a..f47040f39a5 100644 --- a/js-test/servers/common/core-plugins/tests/1/as/webapps/common-test/html/common-test.js +++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/common-test/html/common-test.js @@ -75,11 +75,19 @@ var assertObjectsCount = function(objects, count){ equal(objects.length, count, 'Got ' + count + ' object(s)'); } +var accessProperty = function(object, propertyName) { + var propertyNames = propertyName.split('.'); + for (var pn in propertyNames) { + object = object[propertyNames[pn]]; + } + return object; +} + var assertObjectsWithValues = function(objects, propertyName, propertyValues){ var values = {}; $.each(objects, function(index, object){ - var value = object[propertyName]; + var value = accessProperty(object, propertyName); if(value in values == false){ values[value] = true; } diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-test/html/openbis-test.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-test/html/openbis-test.js index 470e6ac873e..88282163b1e 100644 --- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-test/html/openbis-test.js +++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-test/html/openbis-test.js @@ -818,17 +818,15 @@ test("searchOnSearchDomain()", function() { "positionInSequence" : "2" }) } - - facade.searchForDataSetsWithSequences(preferredSearchDomainOrNull, sequenceSnippet, optionalParametersOrNull, function(response) { + + facade.searchOnSearchDomain(preferredSearchDomainOrNull, sequenceSnippet, optionalParametersOrNull, function(response) { assertObjectsCount(response.result, 2); - searchDomain = response.result['searchDomain']; - assertObjectsWithValues(searchDomain, 'name', [ "echo-database" ]); - assertObjectsWithValues(searchDomain, 'label', [ "Echo database" ]); - location = response.result['resultLocation']; - assertObjectsWithValues(location, 'dataSetCode', [ "20130415093804724-403" ]); - assertObjectsWithValues(location, 'pathInDataSet', [ "PATH-2" ]); - assertObjectsWithValues(location, 'sequenceIdentifier', [ "ID-2" ]); - assertObjectsWithValues(location, 'positionInSequence', [ "2" ]); + assertObjectsWithValues(response.result, 'searchDomain.name', [ "echo-database" ]); + assertObjectsWithValues(response.result, 'searchDomain.label', [ "Echo database" ]); + assertObjectsWithValues(response.result, 'resultLocation.dataSetCode', [ "20130415093804724-403" ]); + assertObjectsWithValues(response.result, 'resultLocation.pathInDataSet', [ "PATH-2" ]); + assertObjectsWithValues(response.result, 'resultLocation.identifier', [ "ID-2" ]); + assertObjectsWithValues(response.result, 'resultLocation.position', [ "2" ]); facade.close(); }); }); @@ -840,7 +838,7 @@ test("listAvailableSearchDomains()", function() { facade.listAvailableSearchDomains(function(response) { assertObjectsCount(response.result, 2); assertObjectsWithValues(response.result, 'name', [ "echo-database" ]); - assertObjectsWithValues(response.result, 'name', [ "Echo database" ]); + assertObjectsWithValues(response.result, 'label', [ "Echo database" ]); facade.close(); }); }); diff --git a/js-test/servers/common/core-plugins/tests/1/dss/search-domain-services/echo-database/plugin.properties b/js-test/servers/common/core-plugins/tests/1/dss/search-domain-services/echo-database/plugin.properties index 23e72f58ca0..0406b9157d0 100644 --- a/js-test/servers/common/core-plugins/tests/1/dss/search-domain-services/echo-database/plugin.properties +++ b/js-test/servers/common/core-plugins/tests/1/dss/search-domain-services/echo-database/plugin.properties @@ -1,2 +1,2 @@ -.class = ch.systemsx.cisd.openbis.dss.generic.server.api.v2.sequencedatabases.EchoDatabase +class = ch.systemsx.cisd.openbis.dss.generic.server.api.v2.sequencedatabases.EchoDatabase label = Echo database -- GitLab