Search in sources :

Example 6 with CollectionItemData

use of edu.stanford.bmir.protege.web.shared.collection.CollectionItemData in project webprotege by protegeproject.

the class CollectionElementDataRepository_IT method shouldSaveEmptyCollectionElementData.

@Test
public void shouldSaveEmptyCollectionElementData() {
    repository.save(new CollectionItemData(collectionId, elementId));
    assertThat(datastore.getCount(CollectionItemData.class), is(1L));
}
Also used : CollectionItemData(edu.stanford.bmir.protege.web.shared.collection.CollectionItemData) Test(org.junit.Test)

Example 7 with CollectionItemData

use of edu.stanford.bmir.protege.web.shared.collection.CollectionItemData in project webprotege by protegeproject.

the class CollectionElementDataRepository_IT method shouldSaveNonEmptyCollectionElementData.

@Test
public void shouldSaveNonEmptyCollectionElementData() {
    Map<FormElementId, FormDataValue> map = new HashMap<>();
    map.put(FormElementId.get("theElement"), FormDataPrimitive.get("theValue"));
    FormData formData = new FormData(map);
    repository.save(new CollectionItemData(collectionId, elementId, formData));
    assertThat(datastore.getCount(CollectionItemData.class), is(1L));
}
Also used : FormData(edu.stanford.bmir.protege.web.shared.form.FormData) CollectionItemData(edu.stanford.bmir.protege.web.shared.collection.CollectionItemData) FormElementId(edu.stanford.bmir.protege.web.shared.form.field.FormElementId) HashMap(java.util.HashMap) FormDataValue(edu.stanford.bmir.protege.web.shared.form.data.FormDataValue) Test(org.junit.Test)

Aggregations

CollectionItemData (edu.stanford.bmir.protege.web.shared.collection.CollectionItemData)7 Test (org.junit.Test)5 FormData (edu.stanford.bmir.protege.web.shared.form.FormData)4 FormDataValue (edu.stanford.bmir.protege.web.shared.form.data.FormDataValue)3 FormElementId (edu.stanford.bmir.protege.web.shared.form.field.FormElementId)3 HashMap (java.util.HashMap)3 DefaultPrettyPrinter (com.fasterxml.jackson.core.util.DefaultPrettyPrinter)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 SimpleModule (com.fasterxml.jackson.databind.module.SimpleModule)1 SetFormDataResult (edu.stanford.bmir.protege.web.shared.form.SetFormDataResult)1 BufferedInputStream (java.io.BufferedInputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 URL (java.net.URL)1 Nonnull (javax.annotation.Nonnull)1