Skip to content
Snippets Groups Projects
Commit e9551a16 authored by jakubs's avatar jakubs
Browse files

BIS-226 SP-341 enhance the vocabularies api dropbox test

SVN: 27570
parent 47fd2e0f
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,7 @@ def process(transaction): ...@@ -29,7 +29,7 @@ def process(transaction):
vocabulary = transaction.getVocabularyForUpdate("TEST_VOCABULARY") vocabulary = transaction.getVocabularyForUpdate("TEST_VOCABULARY")
vocabulary.setDescription("modified description") vocabulary.setDescription("modified description")
vocabulary.setManagedInternally(True) vocabulary.setManagedInternally(True)
vocabulary.setInternalNamespace(True) # vocabulary.setInternalNamespace(True) # setting this would make the vocabulary invisible for search
vocabulary.setChosenFromList(False) vocabulary.setChosenFromList(False)
vocabulary.setUrlTemplate("localuri") vocabulary.setUrlTemplate("localuri")
......
...@@ -61,27 +61,29 @@ public class VocabularyDropboxApiSystemTest extends SystemTestCase ...@@ -61,27 +61,29 @@ public class VocabularyDropboxApiSystemTest extends SystemTestCase
assertEquals("RAT", property.getVocabularyTerm().getCode()); 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_A");
assertSampleForVocabularyTermExists(openBISService, "TEST_TERM_B"); assertSampleForVocabularyTermExists(openBISService, "TEST_TERM_B");
VocabularyTerm term = assertSampleForVocabularyTermExists(openBISService, "NEW_TERM"); VocabularyTerm term = assertSampleForVocabularyTermExists(openBISService, "NEW_TERM");
assertEquals(new Long(3), term.getOrdinal()); assertEquals(new Long(3), term.getOrdinal());
assertEquals("new description", term.getDescription()); assertEquals("new description", term.getDescription());
assertEquals("new label", term.getLabel()); 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()); assertEquals(3, vocabulary.getTerms().size());
} }
private VocabularyTerm assertSampleForVocabularyTermExists( private VocabularyTerm assertSampleForVocabularyTermExists(
IEncapsulatedOpenBISService openBISService, IEncapsulatedOpenBISService openBISService, String term)
String term)
{ {
Sample sample = Sample sample =
openBISService.tryGetSampleWithExperiment(SampleIdentifier.create("VOC", "NORMAL_" openBISService.tryGetSampleWithExperiment(SampleIdentifier.create("VOC", "NORMAL_"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment