From 3879dd01bb6da25aa6073cf43051a31a9918592d Mon Sep 17 00:00:00 2001
From: fedoreno <fedoreno>
Date: Tue, 27 Jan 2015 14:59:40 +0000
Subject: [PATCH] SSDM-1441: Hashmap and exceptions are dependencies, fixed
 tests

SVN: 33341
---
 .../openbis-v3-api-test/html/index.html       |  3 ++-
 .../html/models/dto/deletion/Deletion.js      |  4 +--
 .../dto/entity/attachment/Attachment.js       |  8 +++---
 .../html/models/dto/entity/dataset/DataSet.js | 24 ++++++++---------
 .../dto/entity/experiment/Experiment.js       | 16 ++++++------
 .../entity/experiment/ExperimentCreation.js   |  2 +-
 .../dto/entity/experiment/ExperimentUpdate.js |  2 +-
 .../html/models/dto/entity/person/Person.js   |  6 ++---
 .../html/models/dto/entity/project/Project.js |  8 +++---
 .../html/models/dto/entity/sample/Sample.js   | 26 +++++++++----------
 .../dto/entity/sample/SampleCreation.js       |  2 +-
 .../models/dto/entity/sample/SampleUpdate.js  |  2 +-
 .../html/models/dto/entity/space/Space.js     |  4 +--
 .../html/models/dto/entity/tag/Tag.js         |  4 +--
 .../html/models/dto/id/ObjectIdentifier.js    |  4 +--
 .../html/models/dto/id/ObjectPermId.js        |  4 +--
 .../html/models/dto/id/ObjectTechId.js        |  4 +--
 .../dto/id/attachment/AttachmentFileName.js   |  4 +--
 .../html/models/dto/id/tag/TagCode.js         |  4 +--
 .../dto/search/DateFieldSearchCriterion.js    |  4 +--
 .../html/models/sys/exceptions.js             | 25 ++++++++++++++++++
 .../html/models/sys/hashmap.js                |  8 ++++++
 .../html/openbis-v3-api-test.js               |  6 +++--
 .../html/openbis-v3-api.js                    |  4 ++-
 .../html/support/type_registry.js             |  4 +--
 25 files changed, 110 insertions(+), 72 deletions(-)
 create mode 100644 js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/sys/exceptions.js
 create mode 100644 js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/sys/hashmap.js

diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/index.html b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/index.html
index 0162c0b78bd..4d33cf86576 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/index.html
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/index.html
@@ -12,7 +12,8 @@
         "qunit": "support/qunit",
         "qunit-report": "support/qunit-reporter-junit",  
         "common-test": "../common-test/common-test",
-        "dto": "models/dto"
+        "dto": "models/dto",
+        "sys": "models/sys"
       },
       shim: {
         "qunit": {
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/deletion/Deletion.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/deletion/Deletion.js
index 01439330830..a9d7fa7219c 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/deletion/Deletion.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/deletion/Deletion.js
@@ -1,7 +1,7 @@
 /**
  *  @author pkupczyk
  */
-define(["support/stjs"], function (stjs) {
+define(["support/stjs", "sys/exceptions"], function (stjs, exceptions) {
     var Deletion = function() {};
     stjs.extend(Deletion, null, [], function(constructor, prototype) {
         prototype['@type'] = 'Deletion';
@@ -32,7 +32,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasDeletedObjects()) {
                 return this.deletedObjects;
             } else {
-                 throw new NotFetchedException("Deleted objects have not been fetched.");
+                 throw new exceptions.NotFetchedException("Deleted objects have not been fetched.");
             }
         };
         prototype.setDeletedObjects = function(deletedObjects) {
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/attachment/Attachment.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/attachment/Attachment.js
index dda900c1a6a..f14d0f61fd8 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/attachment/Attachment.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/attachment/Attachment.js
@@ -1,7 +1,7 @@
 /**
  *  Class automatically generated with {@link ch.ethz.sis.openbis.generic.shared.api.v3.dto.generators.DtoGenerator}
  */
-define(["support/stjs"], function (stjs) {
+define(["support/stjs", "sys/exceptions"], function (stjs, exceptions) {
     var Attachment = function() {};
     stjs.extend(Attachment, null, [], function(constructor, prototype) {
         prototype['@type'] = 'Attachment';
@@ -69,7 +69,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasRegistrator()) {
                 return this.registrator;
             } else {
-                 throw new NotFetchedException("Registrator has not been fetched.");
+                 throw new exceptions.NotFetchedException("Registrator has not been fetched.");
             }
         };
         prototype.setRegistrator = function(registrator) {
@@ -79,7 +79,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasPreviousVersion()) {
                 return this.previousVersion;
             } else {
-                 throw new NotFetchedException("Previous version of attachment  has not been fetched.");
+                 throw new exceptions.NotFetchedException("Previous version of attachment  has not been fetched.");
             }
         };
         prototype.setPreviousVersion = function(previousVersion) {
@@ -89,7 +89,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasContent()) {
                 return this.content;
             } else {
-                 throw new NotFetchedException("Content has not been fetched.");
+                 throw new exceptions.NotFetchedException("Content has not been fetched.");
             }
         };
         prototype.setContent = function(content) {
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/dataset/DataSet.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/dataset/DataSet.js
index 235c193f330..6c36573259a 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/dataset/DataSet.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/dataset/DataSet.js
@@ -1,7 +1,7 @@
 /**
  *  Class automatically generated with {@link ch.ethz.sis.openbis.generic.shared.api.v3.dto.generators.DtoGenerator}
  */
-define(["support/stjs"], function (stjs) {
+define(["support/stjs", "sys/exceptions"], function (stjs, exceptions) {
     var DataSet = function() {};
     stjs.extend(DataSet, null, [], function(constructor, prototype) {
         prototype['@type'] = 'DataSet';
@@ -65,7 +65,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasParents()) {
                 return this.parents;
             } else {
-                 throw new NotFetchedException("Parents has not been fetched.");
+                 throw new exceptions.NotFetchedException("Parents has not been fetched.");
             }
         };
         prototype.setParents = function(parents) {
@@ -75,7 +75,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasChildren()) {
                 return this.children;
             } else {
-                 throw new NotFetchedException("Children has not been fetched.");
+                 throw new exceptions.NotFetchedException("Children has not been fetched.");
             }
         };
         prototype.setChildren = function(children) {
@@ -85,7 +85,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasContainers()) {
                 return this.containers;
             } else {
-                 throw new NotFetchedException("Container data sets has not been fetched.");
+                 throw new exceptions.NotFetchedException("Container data sets has not been fetched.");
             }
         };
         prototype.setContainers = function(containers) {
@@ -95,7 +95,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasContained()) {
                 return this.contained;
             } else {
-                 throw new NotFetchedException("Contained data sets has not been fetched.");
+                 throw new exceptions.NotFetchedException("Contained data sets has not been fetched.");
             }
         };
         prototype.setContained = function(contained) {
@@ -105,7 +105,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasTags()) {
                 return this.tags;
             } else {
-                 throw new NotFetchedException("Tags has not been fetched.");
+                 throw new exceptions.NotFetchedException("Tags has not been fetched.");
             }
         };
         prototype.setTags = function(tags) {
@@ -115,7 +115,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasType()) {
                 return this.type;
             } else {
-                 throw new NotFetchedException("Data Set type has not been fetched.");
+                 throw new exceptions.NotFetchedException("Data Set type has not been fetched.");
             }
         };
         prototype.setType = function(type) {
@@ -131,7 +131,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasModifier()) {
                 return this.modifier;
             } else {
-                 throw new NotFetchedException("Modifier has not been fetched.");
+                 throw new exceptions.NotFetchedException("Modifier has not been fetched.");
             }
         };
         prototype.setModifier = function(modifier) {
@@ -147,7 +147,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasRegistrator()) {
                 return this.registrator;
             } else {
-                 throw new NotFetchedException("Registrator has not been fetched.");
+                 throw new exceptions.NotFetchedException("Registrator has not been fetched.");
             }
         };
         prototype.setRegistrator = function(registrator) {
@@ -157,7 +157,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasExperiment()) {
                 return this.experiment;
             } else {
-                 throw new NotFetchedException("Experiment has not been fetched.");
+                 throw new exceptions.NotFetchedException("Experiment has not been fetched.");
             }
         };
         prototype.setExperiment = function(experiment) {
@@ -167,7 +167,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasSample()) {
                 return this.sample;
             } else {
-                 throw new NotFetchedException("Sample has not been fetched.");
+                 throw new exceptions.NotFetchedException("Sample has not been fetched.");
             }
         };
         prototype.setSample = function(sample) {
@@ -177,7 +177,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasProperties()) {
                 return this.properties;
             } else {
-                 throw new NotFetchedException("Properties has not been fetched.");
+                 throw new exceptions.NotFetchedException("Properties has not been fetched.");
             }
         };
         prototype.setProperties = function(properties) {
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/experiment/Experiment.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/experiment/Experiment.js
index 287739dd9e4..882f594391a 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/experiment/Experiment.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/experiment/Experiment.js
@@ -1,7 +1,7 @@
 /**
  *  Class automatically generated with {@link ch.ethz.sis.openbis.generic.shared.api.v3.dto.generators.DtoGenerator}
  */
-define(["support/stjs"], function (stjs) {
+define(["support/stjs", "sys/exceptions"], function (stjs, exceptions) {
     var Experiment = function() {};
     stjs.extend(Experiment, null, [], function(constructor, prototype) {
         prototype['@type'] = 'Experiment';
@@ -59,7 +59,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasType()) {
                 return this.type;
             } else {
-                 throw new NotFetchedException("Experiment type has not been fetched.");
+                 throw new exceptions.NotFetchedException("Experiment type has not been fetched.");
             }
         };
         prototype.setType = function(type) {
@@ -69,7 +69,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasProject()) {
                 return this.project;
             } else {
-                 throw new NotFetchedException("Project has not been fetched.");
+                 throw new exceptions.NotFetchedException("Project has not been fetched.");
             }
         };
         prototype.setProject = function(project) {
@@ -79,7 +79,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasProperties()) {
                 return this.properties;
             } else {
-                 throw new NotFetchedException("Properties has not been fetched.");
+                 throw new exceptions.NotFetchedException("Properties has not been fetched.");
             }
         };
         prototype.setProperties = function(properties) {
@@ -89,7 +89,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasTags()) {
                 return this.tags;
             } else {
-                 throw new NotFetchedException("Tags has not been fetched.");
+                 throw new exceptions.NotFetchedException("Tags has not been fetched.");
             }
         };
         prototype.setTags = function(tags) {
@@ -99,7 +99,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasRegistrator()) {
                 return this.registrator;
             } else {
-                 throw new NotFetchedException("Registrator has not been fetched.");
+                 throw new exceptions.NotFetchedException("Registrator has not been fetched.");
             }
         };
         prototype.setRegistrator = function(registrator) {
@@ -109,7 +109,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasModifier()) {
                 return this.modifier;
             } else {
-                 throw new NotFetchedException("Modifier has not been fetched.");
+                 throw new exceptions.NotFetchedException("Modifier has not been fetched.");
             }
         };
         prototype.setModifier = function(modifier) {
@@ -119,7 +119,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasAttachments()) {
                 return this.attachments;
             } else {
-                 throw new NotFetchedException("Attachments has not been fetched.");
+                 throw new exceptions.NotFetchedException("Attachments has not been fetched.");
             }
         };
         prototype.setAttachments = function(attachments) {
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/experiment/ExperimentCreation.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/experiment/ExperimentCreation.js
index f88c6031fb8..33bf8181a46 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/experiment/ExperimentCreation.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/experiment/ExperimentCreation.js
@@ -1,7 +1,7 @@
 /**
  *  @author pkupczyk
  */
-define(["support/stjs"], function (stjs) {
+define(["support/stjs", "sys/hashmap"], function (stjs, HashMap) {
     var ExperimentCreation = function() {};
     stjs.extend(ExperimentCreation, null, [], function(constructor, prototype) {
         prototype['@type'] = 'ExperimentCreation';
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/experiment/ExperimentUpdate.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/experiment/ExperimentUpdate.js
index e4e2bfb2e15..7da35aa95c4 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/experiment/ExperimentUpdate.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/experiment/ExperimentUpdate.js
@@ -1,7 +1,7 @@
 /**
  *  @author pkupczyk
  */
-define(["support/stjs"], function (stjs) {
+define(["support/stjs", "sys/hashmap"], function (stjs, HashMap) {
     var ExperimentUpdate = function() {};
     stjs.extend(ExperimentUpdate, null, [], function(constructor, prototype) {
         prototype['@type'] = 'ExperimentUpdate';
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/person/Person.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/person/Person.js
index 66adbc5bf3d..c86c4150de4 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/person/Person.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/person/Person.js
@@ -1,7 +1,7 @@
 /**
  *  Class automatically generated with {@link ch.ethz.sis.openbis.generic.shared.api.v3.dto.generators.DtoGenerator}
  */
-define(["support/stjs"], function (stjs) {
+define(["support/stjs", "sys/exceptions"], function (stjs, exceptions) {
     var Person = function() {};
     stjs.extend(Person, null, [], function(constructor, prototype) {
         prototype['@type'] = 'Person';
@@ -61,7 +61,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasSpace()) {
                 return this.space;
             } else {
-                 throw new NotFetchedException("Space has not been fetched.");
+                 throw new exceptions.NotFetchedException("Space has not been fetched.");
             }
         };
         prototype.setSpace = function(space) {
@@ -71,7 +71,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasRegistrator()) {
                 return this.registrator;
             } else {
-                 throw new NotFetchedException("Registrator has not been fetched.");
+                 throw new exceptions.NotFetchedException("Registrator has not been fetched.");
             }
         };
         prototype.setRegistrator = function(registrator) {
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/project/Project.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/project/Project.js
index cbcf04e1969..72845cdbd55 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/project/Project.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/project/Project.js
@@ -1,7 +1,7 @@
 /**
  *  Class automatically generated with {@link ch.ethz.sis.openbis.generic.shared.api.v3.dto.generators.DtoGenerator}
  */
-define(["support/stjs"], function (stjs) {
+define(["support/stjs", "sys/exceptions"], function (stjs, exceptions) {
     var Project = function() {};
     stjs.extend(Project, null, [], function(constructor, prototype) {
         prototype['@type'] = 'Project';
@@ -62,7 +62,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasSpace()) {
                 return this.space;
             } else {
-                 throw new NotFetchedException("Space has not been fetched.");
+                 throw new exceptions.NotFetchedException("Space has not been fetched.");
             }
         };
         prototype.setSpace = function(space) {
@@ -72,7 +72,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasRegistrator()) {
                 return this.registrator;
             } else {
-                 throw new NotFetchedException("Registrator has not been fetched.");
+                 throw new exceptions.NotFetchedException("Registrator has not been fetched.");
             }
         };
         prototype.setRegistrator = function(registrator) {
@@ -82,7 +82,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasModifier()) {
                 return this.modifier;
             } else {
-                 throw new NotFetchedException("Modifier has not been fetched.");
+                 throw new exceptions.NotFetchedException("Modifier has not been fetched.");
             }
         };
         prototype.setModifier = function(modifier) {
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/sample/Sample.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/sample/Sample.js
index c80ca277c10..945e05c31f4 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/sample/Sample.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/sample/Sample.js
@@ -1,7 +1,7 @@
 /**
  *  Class automatically generated with {@link ch.ethz.sis.openbis.generic.shared.api.v3.dto.generators.DtoGenerator}
  */
-define(["support/stjs"], function (stjs) {
+define(["support/stjs", "sys/exceptions"], function (stjs, exceptions) {
     var Sample = function() {};
     stjs.extend(Sample, null, [], function(constructor, prototype) {
         prototype['@type'] = 'Sample';
@@ -64,7 +64,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasType()) {
                 return this.type;
             } else {
-                 throw new NotFetchedException("Sample type has not been fetched.");
+                 throw new exceptions.NotFetchedException("Sample type has not been fetched.");
             }
         };
         prototype.setType = function(type) {
@@ -74,7 +74,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasSpace()) {
                 return this.space;
             } else {
-                 throw new NotFetchedException("Space has not been fetched.");
+                 throw new exceptions.NotFetchedException("Space has not been fetched.");
             }
         };
         prototype.setSpace = function(space) {
@@ -84,7 +84,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasExperiment()) {
                 return this.experiment;
             } else {
-                 throw new NotFetchedException("Experiment has not been fetched.");
+                 throw new exceptions.NotFetchedException("Experiment has not been fetched.");
             }
         };
         prototype.setExperiment = function(experiment) {
@@ -94,7 +94,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasProperties()) {
                 return this.properties;
             } else {
-                 throw new NotFetchedException("Properties has not been fetched.");
+                 throw new exceptions.NotFetchedException("Properties has not been fetched.");
             }
         };
         prototype.setProperties = function(properties) {
@@ -104,7 +104,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasParents()) {
                 return this.parents;
             } else {
-                 throw new NotFetchedException("Parents has not been fetched.");
+                 throw new exceptions.NotFetchedException("Parents has not been fetched.");
             }
         };
         prototype.setParents = function(parents) {
@@ -114,7 +114,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasChildren()) {
                 return this.children;
             } else {
-                 throw new NotFetchedException("Children has not been fetched.");
+                 throw new exceptions.NotFetchedException("Children has not been fetched.");
             }
         };
         prototype.setChildren = function(children) {
@@ -124,7 +124,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasContainer()) {
                 return this.container;
             } else {
-                 throw new NotFetchedException("Container sample has not been fetched.");
+                 throw new exceptions.NotFetchedException("Container sample has not been fetched.");
             }
         };
         prototype.setContainer = function(container) {
@@ -134,7 +134,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasContained()) {
                 return this.contained;
             } else {
-                 throw new NotFetchedException("Contained samples has not been fetched.");
+                 throw new exceptions.NotFetchedException("Contained samples has not been fetched.");
             }
         };
         prototype.setContained = function(contained) {
@@ -144,7 +144,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasTags()) {
                 return this.tags;
             } else {
-                 throw new NotFetchedException("Tags has not been fetched.");
+                 throw new exceptions.NotFetchedException("Tags has not been fetched.");
             }
         };
         prototype.setTags = function(tags) {
@@ -154,7 +154,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasRegistrator()) {
                 return this.registrator;
             } else {
-                 throw new NotFetchedException("Registrator has not been fetched.");
+                 throw new exceptions.NotFetchedException("Registrator has not been fetched.");
             }
         };
         prototype.setRegistrator = function(registrator) {
@@ -164,7 +164,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasModifier()) {
                 return this.modifier;
             } else {
-                 throw new NotFetchedException("Modifier has not been fetched.");
+                 throw new exceptions.NotFetchedException("Modifier has not been fetched.");
             }
         };
         prototype.setModifier = function(modifier) {
@@ -174,7 +174,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasAttachments()) {
                 return this.attachments;
             } else {
-                 throw new NotFetchedException("Attachments has not been fetched.");
+                 throw new exceptions.NotFetchedException("Attachments has not been fetched.");
             }
         };
         prototype.setAttachments = function(attachments) {
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/sample/SampleCreation.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/sample/SampleCreation.js
index 3df7ec1ae6d..e1a0050bf50 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/sample/SampleCreation.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/sample/SampleCreation.js
@@ -1,7 +1,7 @@
 /**
  *  @author pkupczyk
  */
-define(["support/stjs"], function (stjs) {
+define(["support/stjs", "sys/hashmap"], function (stjs, HashMap) {
     var SampleCreation = function() {};
     stjs.extend(SampleCreation, null, [], function(constructor, prototype) {
         prototype['@type'] = 'SampleCreation';
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/sample/SampleUpdate.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/sample/SampleUpdate.js
index fcf8960311d..f93af65b3f3 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/sample/SampleUpdate.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/sample/SampleUpdate.js
@@ -1,7 +1,7 @@
 /**
  *  @author pkupczyk
  */
-define(["support/stjs"], function (stjs) {
+define(["support/stjs", "sys/hashmap"], function (stjs, HashMap) {
     var SampleUpdate = function() {};
     stjs.extend(SampleUpdate, null, [], function(constructor, prototype) {
         prototype['@type'] = 'SampleUpdate';
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/space/Space.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/space/Space.js
index 08fbfce8ce9..34f36850ce3 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/space/Space.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/space/Space.js
@@ -1,7 +1,7 @@
 /**
  *  Class automatically generated with {@link ch.ethz.sis.openbis.generic.shared.api.v3.dto.generators.DtoGenerator}
  */
-define(["support/stjs"], function (stjs) {
+define(["support/stjs", "sys/exceptions"], function (stjs, exceptions) {
     var Space = function() {};
     stjs.extend(Space, null, [], function(constructor, prototype) {
         prototype['@type'] = 'Space';
@@ -46,7 +46,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasRegistrator()) {
                 return this.registrator;
             } else {
-                 throw new NotFetchedException("Registrator has not been fetched.");
+                 throw new exceptions.NotFetchedException("Registrator has not been fetched.");
             }
         };
         prototype.setRegistrator = function(registrator) {
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/tag/Tag.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/tag/Tag.js
index 255edb3c0e8..90de10df56c 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/tag/Tag.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/entity/tag/Tag.js
@@ -1,7 +1,7 @@
 /**
  *  Class automatically generated with {@link ch.ethz.sis.openbis.generic.shared.api.v3.dto.generators.DtoGenerator}
  */
-define(["support/stjs"], function (stjs) {
+define(["support/stjs", "sys/exceptions"], function (stjs, exceptions) {
     var Tag = function() {};
     stjs.extend(Tag, null, [], function(constructor, prototype) {
         prototype['@type'] = 'Tag';
@@ -53,7 +53,7 @@ define(["support/stjs"], function (stjs) {
             if (this.getFetchOptions().hasOwner()) {
                 return this.owner;
             } else {
-                 throw new NotFetchedException("Owner has not been fetched.");
+                 throw new exceptions.NotFetchedException("Owner has not been fetched.");
             }
         };
         prototype.setOwner = function(owner) {
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/id/ObjectIdentifier.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/id/ObjectIdentifier.js
index 07efff10a74..976d4ad15a9 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/id/ObjectIdentifier.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/id/ObjectIdentifier.js
@@ -5,7 +5,7 @@
  *  
  *  @author pkupczyk
  */
-define(["support/stjs", "dto/id/IObjectId"], function (stjs, IObjectId) {
+define(["support/stjs", "sys/exceptions", "dto/id/IObjectId"], function (stjs, exceptions, IObjectId) {
     var ObjectIdentifier = function(identifier) {
         this.setIdentifier(identifier);
     };
@@ -18,7 +18,7 @@ define(["support/stjs", "dto/id/IObjectId"], function (stjs, IObjectId) {
         };
         prototype.setIdentifier = function(identifier) {
             if (identifier == null) {
-//                 throw new IllegalArgumentException("Identifier id cannot be null");
+//                 throw new exceptions.IllegalArgumentException("Identifier id cannot be null");
             }
             this.identifier = identifier;
         };
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/id/ObjectPermId.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/id/ObjectPermId.js
index 3d6fdbd953b..d61a6bbb868 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/id/ObjectPermId.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/id/ObjectPermId.js
@@ -5,7 +5,7 @@
  *  
  *  @author pkupczyk
  */
-define(["support/stjs", "dto/id/IObjectId"], function (stjs, IObjectId) {
+define(["support/stjs", "sys/exceptions", "dto/id/IObjectId"], function (stjs, exceptions, IObjectId) {
     var ObjectPermId = function(permId) {
         this.setPermId(permId);
     };
@@ -18,7 +18,7 @@ define(["support/stjs", "dto/id/IObjectId"], function (stjs, IObjectId) {
         };
         prototype.setPermId = function(permId) {
             if (permId == null) {
-                 //TODO throw new IllegalArgumentException("PermId cannot be null");
+                 //TODO throw new exceptions.IllegalArgumentException("PermId cannot be null");
             }
             this.permId = permId;
         };
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/id/ObjectTechId.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/id/ObjectTechId.js
index 6ac972a1226..ac23e114628 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/id/ObjectTechId.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/id/ObjectTechId.js
@@ -1,7 +1,7 @@
 /**
  *  @author pkupczyk
  */
-define(["support/stjs", "dto/id/IObjectId"], function (stjs, IObjectId) {
+define(["support/stjs", "sys/exceptions", "dto/id/IObjectId"], function (stjs, exceptions, IObjectId) {
     var ObjectTechId = function(techId) {
         this.setTechId(techId);
     };
@@ -14,7 +14,7 @@ define(["support/stjs", "dto/id/IObjectId"], function (stjs, IObjectId) {
         };
         prototype.setTechId = function(techId) {
             if (techId == null) {
-                 throw new IllegalArgumentException("TechId cannot be null");
+                 throw new exceptions.IllegalArgumentException("TechId cannot be null");
             }
             this.techId = techId;
         };
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/id/attachment/AttachmentFileName.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/id/attachment/AttachmentFileName.js
index 8136708e149..6028c9333d0 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/id/attachment/AttachmentFileName.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/id/attachment/AttachmentFileName.js
@@ -3,7 +3,7 @@
  *  
  *  @author pkupczyk
  */
-define(["support/stjs", "dto/id/attachment/IAttachmentId"], function (stjs, IAttachmentId) {
+define(["support/stjs", "sys/exceptions", "dto/id/attachment/IAttachmentId"], function (stjs, exceptions, IAttachmentId) {
     var AttachmentFileName = /**
      *  @param fileName Attachment file name, e.g. "my_file.txt".
      */
@@ -19,7 +19,7 @@ define(["support/stjs", "dto/id/attachment/IAttachmentId"], function (stjs, IAtt
         };
         prototype.setFileName = function(fileName) {
             if (fileName == null) {
-                 throw new IllegalArgumentException("File name cannot be null");
+                 throw new exceptions.IllegalArgumentException("File name cannot be null");
             }
             this.fileName = fileName;
         };
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/id/tag/TagCode.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/id/tag/TagCode.js
index fbbc8356bb2..91ba41cf893 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/id/tag/TagCode.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/id/tag/TagCode.js
@@ -4,7 +4,7 @@
  *  @author Franz-Josef Elmer
  *  @author Jakub Straszewski
  */
-define(["support/stjs", "dto/id/tag/ITagId"], function (stjs, ITagId) {
+define(["support/stjs", "sys/exceptions", "dto/id/tag/ITagId"], function (stjs, exceptions, ITagId) {
     var TagCode = /**
      *  @param code Tag code, e.g. "MY_TAG".
      */
@@ -20,7 +20,7 @@ define(["support/stjs", "dto/id/tag/ITagId"], function (stjs, ITagId) {
         };
         prototype.setCode = function(code) {
             if (code == null) {
-                 throw new IllegalArgumentException("Code cannot be null");
+                 throw new exceptions.IllegalArgumentException("Code cannot be null");
             }
             this.code = code;
         };
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/search/DateFieldSearchCriterion.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/search/DateFieldSearchCriterion.js
index 31bd915248c..71f9f436ff4 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/search/DateFieldSearchCriterion.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/dto/search/DateFieldSearchCriterion.js
@@ -1,4 +1,4 @@
-define(["support/stjs"], function (stjs, AbstractFieldSearchCriterion) {
+define(["support/stjs", "sys/exceptions"], function (stjs, exceptions, AbstractFieldSearchCriterion) {
     var DateFieldSearchCriterion = function(fieldName, fieldType) {
         AbstractFieldSearchCriterion.call(this, fieldName, fieldType);
     };
@@ -53,7 +53,7 @@ define(["support/stjs"], function (stjs, AbstractFieldSearchCriterion) {
                         return;
                     }catch (e) {}
                 }
-                 throw new IllegalArgumentException("Date value: " + value + " does not match any of the supported formats: " + DateFieldSearchCriterion.DATE_FORMATS);
+                 throw new exceptions.IllegalArgumentException("Date value: " + value + " does not match any of the supported formats: " + DateFieldSearchCriterion.DATE_FORMATS);
             }
         };
     }, {DATE_FORMATS: {name: "List", arguments: ["IDateFormat"]}, timeZone: "ITimeZone", fieldType: {name: "Enum", arguments: ["SearchFieldType"]}});
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/sys/exceptions.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/sys/exceptions.js
new file mode 100644
index 00000000000..eb531c76255
--- /dev/null
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/sys/exceptions.js
@@ -0,0 +1,25 @@
+define(function() {
+	function RuntimeException(message) {
+	    this.name = "RuntimeException";
+	    this.message = (message || "");
+	}
+	RuntimeException.prototype = Error.prototype;
+
+	function IllegalArgumentException(message) {
+	    this.name = "IllegalArgumentException";
+	    this.message = (message || "");
+	}
+	IllegalArgumentException.prototype = Error.prototype;
+
+	function NotFetchedException(message) {
+	    this.name = "NotFetchedException";
+	    this.message = (message || "");
+	}
+	NotFetchedException.prototype = Error.prototype;
+
+	return {
+		RuntimeException: RuntimeException,
+		IllegalArgumentException: IllegalArgumentException,
+		NotFetchedException: NotFetchedException
+	}
+})
\ No newline at end of file
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/sys/hashmap.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/sys/hashmap.js
new file mode 100644
index 00000000000..7575ffa7fd7
--- /dev/null
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/models/sys/hashmap.js
@@ -0,0 +1,8 @@
+define(function() {
+	var HashMap = function() {}
+	HashMap.prototype.put = function(key, val) {
+		this[key] = val;
+	};
+	
+	return HashMap;
+})
\ No newline at end of file
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/openbis-v3-api-test.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/openbis-v3-api-test.js
index 9e64e48e4fc..4eb70296879 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/openbis-v3-api-test.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/openbis-v3-api-test.js
@@ -198,9 +198,11 @@ define(['jquery', 'openbis-v3-api'], function($, openbis){
 				})
 			})
 			.done(function(samples) {
-				assertObjectsCount(samples, 1);
+				var keys = Object.keys(samples);
+				assertObjectsCount(keys, 1);
+
+				var sample = samples[keys[0]];
 	
-				var sample = samples[0];
 				equal(sample.code, "PLATE-1", "Sample code");
 				equal(sample.type.code, "PLATE", "Type code");
 				equal(sample.experiment.code, "EXP-1", "Experiment code");
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/openbis-v3-api.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/openbis-v3-api.js
index b574067487c..575829374cd 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/openbis-v3-api.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/openbis-v3-api.js
@@ -96,7 +96,9 @@ define(['jquery', 'support/Utils'], function($, stjsUtil) {
 				}
 			})
 			.done(function(experiments) {
-				require(['dto/entity/experiment/Experiment'], function() {
+				require(['dto/entity/experiment/Experiment', 
+				         'dto/entity/tag/Tag',
+				         'dto/id/tag/TagPermId'], function() {
 					var experimentDTOs = {};
 					for(var experimentPermId  in experiments) {
 						var experimentJson = experiments[experimentPermId];
diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/support/type_registry.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/support/type_registry.js
index a949103753a..1382c07b065 100644
--- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/support/type_registry.js
+++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/support/type_registry.js
@@ -1,4 +1,4 @@
-define([], function() {
+define(["sys/exceptions"], function(exceptions) {
 	var store = {};
 	return {
 		register: function(name, type) {
@@ -8,7 +8,7 @@ define([], function() {
 		
 		get: function(name) {
 			if (!store.hasOwnProperty(name)) {
-				throw new IllegalArgumentException("Type [" + name + "] was not registered yet.");
+				throw new exceptions.IllegalArgumentException("Type [" + name + "] was not registered yet.");
 			}
 			return store[name];
 		}
-- 
GitLab