From e9551a16251c2a67cc15c0109c73fa67d064c7da Mon Sep 17 00:00:00 2001
From: jakubs <jakubs>
Date: Mon, 12 Nov 2012 12:32:02 +0000
Subject: [PATCH] BIS-226 SP-341 enhance the vocabularies api dropbox test

SVN: 27570
---
 .../vocabularies-api/vocabularies-api.py      |  2 +-
 .../VocabularyDropboxApiSystemTest.java       | 20 ++++++++++---------
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/datastore_server/sourceTest/core-plugins/generic-test/1/dss/drop-boxes/vocabularies-api/vocabularies-api.py b/datastore_server/sourceTest/core-plugins/generic-test/1/dss/drop-boxes/vocabularies-api/vocabularies-api.py
index 6fddbd4c6e8..963cc762fbf 100644
--- a/datastore_server/sourceTest/core-plugins/generic-test/1/dss/drop-boxes/vocabularies-api/vocabularies-api.py
+++ b/datastore_server/sourceTest/core-plugins/generic-test/1/dss/drop-boxes/vocabularies-api/vocabularies-api.py
@@ -29,7 +29,7 @@ def process(transaction):
     vocabulary = transaction.getVocabularyForUpdate("TEST_VOCABULARY")
     vocabulary.setDescription("modified description")
     vocabulary.setManagedInternally(True)
-    vocabulary.setInternalNamespace(True)
+    # vocabulary.setInternalNamespace(True) # setting this would make the vocabulary invisible for search
     vocabulary.setChosenFromList(False)
     vocabulary.setUrlTemplate("localuri")
     
diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/openbis/datastoreserver/systemtests/VocabularyDropboxApiSystemTest.java b/datastore_server/sourceTest/java/ch/systemsx/cisd/openbis/datastoreserver/systemtests/VocabularyDropboxApiSystemTest.java
index 3d236df7026..c8517d6c2ea 100644
--- a/datastore_server/sourceTest/java/ch/systemsx/cisd/openbis/datastoreserver/systemtests/VocabularyDropboxApiSystemTest.java
+++ b/datastore_server/sourceTest/java/ch/systemsx/cisd/openbis/datastoreserver/systemtests/VocabularyDropboxApiSystemTest.java
@@ -61,27 +61,29 @@ public class VocabularyDropboxApiSystemTest extends SystemTestCase
 
         assertEquals("RAT", property.getVocabularyTerm().getCode());
 
+        Vocabulary vocabulary = openBISService.tryGetVocabulary("TEST_VOCABULARY");
+
+        assertNotNull(vocabulary);
+        assertEquals("modified description", vocabulary.getDescription());
+        assertEquals(true, vocabulary.isManagedInternally());
+        assertEquals(false, vocabulary.isChosenFromList());
+        assertEquals("localuri", vocabulary.getURLTemplate());
+
         assertSampleForVocabularyTermExists(openBISService, "TEST_TERM_A");
         assertSampleForVocabularyTermExists(openBISService, "TEST_TERM_B");
+
         VocabularyTerm term = assertSampleForVocabularyTermExists(openBISService, "NEW_TERM");
 
         assertEquals(new Long(3), term.getOrdinal());
         assertEquals("new description", term.getDescription());
         assertEquals("new label", term.getLabel());
 
-        Vocabulary vocabulary = openBISService.tryGetVocabulary("TEST_VOCABULARY");
-        assertEquals("modified description", vocabulary.getDescription());
-        assertEquals(true, vocabulary.isManagedInternally());
-        assertEquals(true, vocabulary.isInternalNamespace());
-        assertEquals(false, vocabulary.isChosenFromList());
-        assertEquals("localuri", vocabulary.getURLTemplate());
-
         assertEquals(3, vocabulary.getTerms().size());
+
     }
 
     private VocabularyTerm assertSampleForVocabularyTermExists(
-            IEncapsulatedOpenBISService openBISService,
-            String term)
+            IEncapsulatedOpenBISService openBISService, String term)
     {
         Sample sample =
                 openBISService.tryGetSampleWithExperiment(SampleIdentifier.create("VOC", "NORMAL_"
-- 
GitLab