Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master who merged #62

Merged
merged 30 commits into from
Sep 11, 2024
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f317c9d
Replace spotify docker plugin with maven-exec plugin
matthewhorridge Jul 30, 2024
a995d80
Use maven-exec for docker push
matthewhorridge Aug 1, 2024
afd22e3
Fixes #46
matthewhorridge Aug 2, 2024
d87997a
Merge pull request #47 from protegeproject/fix-issues-46
matthewhorridge Aug 3, 2024
af5fc8a
ci: version bump 6.0.2
Aug 3, 2024
2bc5e4d
Merge pull request #44 from protegeproject/replace-spotify-docker-plugin
matthewhorridge Aug 5, 2024
bec587d
ci: version bump 6.0.3
Aug 5, 2024
10aa8cc
Moved tab presenter and related interfaces/classes to the tab package…
matthewhorridge Aug 5, 2024
03fb8cf
Genericized TabBarPresenter and associated classes
matthewhorridge Aug 5, 2024
b334594
Use maven-exec for docker build and push
matthewhorridge Aug 5, 2024
3e6316b
Merge branch 'master' into docker-push-changes
matthewhorridge Aug 5, 2024
f721649
Merge pull request #49 from protegeproject/docker-push-changes
matthewhorridge Aug 5, 2024
1c49e28
ci: version bump 6.0.4
Aug 5, 2024
62e7625
-am is required
matthewhorridge Aug 6, 2024
9fa6157
Merge branch 'master' into docker-push-changes
matthewhorridge Aug 6, 2024
0e88426
Merge pull request #50 from protegeproject/docker-push-changes
matthewhorridge Aug 6, 2024
c26874d
ci: version bump 6.0.5
Aug 6, 2024
4fa7aa2
Merge branch 'master' into factor-out-tabs-from-forms
matthewhorridge Aug 6, 2024
d5cc278
Merge pull request #48 from protegeproject/factor-out-tabs-from-forms
matthewhorridge Aug 6, 2024
b35afe0
ci: version bump 6.0.6
Aug 6, 2024
d275146
Fixes #56
matthewhorridge Sep 5, 2024
279a4ef
Merge pull request #58 from protegeproject/Fix-56
matthewhorridge Sep 5, 2024
d11a4c1
ci: version bump 6.0.7
Sep 5, 2024
21a3038
Fixes #57
matthewhorridge Sep 5, 2024
c5d1b15
Merge pull request #60 from protegeproject/Fix-57
matthewhorridge Sep 5, 2024
4cfb074
ci: version bump 6.0.8
Sep 5, 2024
49ce7d3
Fixes #59
matthewhorridge Sep 6, 2024
ee50396
Merge pull request #61 from protegeproject/Fix-59
matthewhorridge Sep 6, 2024
1c2e548
ci: version bump 6.0.9
Sep 6, 2024
fa5873a
Merge branch 'master' into master-who
alexsilaghi Sep 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -56,19 +56,20 @@ else if(node.isObject()) {
case "Class" :
return PrimitiveFormControlData.get(df.getOWLClass(iri));
case "owl:ObjectProperty":
case "ObjectProperty":
case "ObjectProperty" :
return PrimitiveFormControlData.get(df.getOWLObjectProperty(iri));
case "owl:DatatypeProperty" :
case "DatatypeProperty" :
case "DataProperty" :
return PrimitiveFormControlData.get(df.getOWLDataProperty(iri));
case "owl:AnnotationProperty":
case "AnnotationProperty":
case "AnnotationProperty" :
return PrimitiveFormControlData.get(df.getOWLAnnotationProperty(iri));
case "rdfs:Datatype" :
case "Datatype" :
return PrimitiveFormControlData.get(df.getOWLDatatype(iri));
case "owl:NamedIndividual" :
case "NamedIndividual" :
case "NamedIndividual" :
return PrimitiveFormControlData.get(df.getOWLNamedIndividual(iri));
}
throw new JsonParseException(p, "Unrecognised entity type: " + type);
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package edu.stanford.bmir.protege.web.server.form;

import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import edu.stanford.bmir.protege.web.MockingUtils;
import edu.stanford.bmir.protege.web.server.jackson.ObjectMapperProvider;
@@ -10,13 +8,15 @@
import edu.stanford.bmir.protege.web.shared.form.data.LiteralFormControlData;
import edu.stanford.bmir.protege.web.shared.form.data.PrimitiveFormControlData;
import edu.stanford.bmir.protege.web.shared.match.JsonSerializationTestUtil;
import org.assertj.core.api.Assertions;
import org.junit.Before;
import org.junit.Test;
import org.semanticweb.owlapi.model.*;

import java.io.IOException;
import java.io.StringReader;

import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

public class FormControlValueDeserializer_TestCase {

@@ -47,33 +47,127 @@ public void shouldRoundTripOwlClass() throws IOException {
JsonSerializationTestUtil.testSerialization(value, PrimitiveFormControlData.class);
}

@Test
public void shouldDeserializeOwlClass() throws IOException {
var json = "{\"@type\":\"owl:Class\",\"iri\":\"http://stuff.com/I1\"}";
var value = objectMapper.readValue(new StringReader(json), PrimitiveFormControlData.class);
Assertions.assertThat(value.asEntity()).containsInstanceOf(OWLClass.class);
}

@Test
public void shouldDeserializeClass() throws IOException {
var json = "{\"@type\":\"Class\",\"iri\":\"http://stuff.com/I1\"}";
var value = objectMapper.readValue(new StringReader(json), PrimitiveFormControlData.class);
Assertions.assertThat(value.asEntity()).containsInstanceOf(OWLClass.class);
}

@Test
public void shouldRoundTripOwlObjectProperty() throws IOException {
var value = EntityFormControlData.get(MockingUtils.mockOWLObjectProperty());
JsonSerializationTestUtil.testSerialization(value, PrimitiveFormControlData.class);
}



@Test
public void shouldDeserializeOwlObjectProperty() throws IOException {
var json = "{\"@type\":\"owl:ObjectProperty\",\"iri\":\"http://stuff.com/I1\"}";
var value = objectMapper.readValue(new StringReader(json), PrimitiveFormControlData.class);
Assertions.assertThat(value.asEntity()).containsInstanceOf(OWLObjectProperty.class);
}

@Test
public void shouldDeserializeObjectProperty() throws IOException {
var json = "{\"@type\":\"ObjectProperty\",\"iri\":\"http://stuff.com/I1\"}";
var value = objectMapper.readValue(new StringReader(json), PrimitiveFormControlData.class);
Assertions.assertThat(value.asEntity()).containsInstanceOf(OWLObjectProperty.class);
}


@Test
public void shouldRoundTripOwlDataProperty() throws IOException {
var value = EntityFormControlData.get(MockingUtils.mockOWLDataProperty());
JsonSerializationTestUtil.testSerialization(value, PrimitiveFormControlData.class);
}

@Test
public void shouldDeserializeOwlDatatypeProperty() throws IOException {
var json = "{\"@type\":\"owl:DatatypeProperty\",\"iri\":\"http://stuff.com/I1\"}";
var value = objectMapper.readValue(new StringReader(json), PrimitiveFormControlData.class);
Assertions.assertThat(value.asEntity()).containsInstanceOf(OWLDataProperty.class);
}

@Test
public void shouldDeserializeDatatypeProperty() throws IOException {
var json = "{\"@type\":\"DatatypeProperty\",\"iri\":\"http://stuff.com/I1\"}";
var value = objectMapper.readValue(new StringReader(json), PrimitiveFormControlData.class);
Assertions.assertThat(value.asEntity()).containsInstanceOf(OWLDataProperty.class);
}

@Test
public void shouldDeserializeDataProperty() throws IOException {
var json = "{\"@type\":\"DataProperty\",\"iri\":\"http://stuff.com/I1\"}";
var value = objectMapper.readValue(new StringReader(json), PrimitiveFormControlData.class);
Assertions.assertThat(value.asEntity()).containsInstanceOf(OWLDataProperty.class);
}

@Test
public void shouldRoundTripOwlAnnotationProperty() throws IOException {
var value = EntityFormControlData.get(MockingUtils.mockOWLAnnotationProperty());
JsonSerializationTestUtil.testSerialization(value, PrimitiveFormControlData.class);
}

@Test
public void shouldDeserializeOwlAnnotationProperty() throws IOException {
var json = "{\"@type\":\"owl:AnnotationProperty\",\"iri\":\"http://stuff.com/I1\"}";
var value = objectMapper.readValue(new StringReader(json), PrimitiveFormControlData.class);
Assertions.assertThat(value.asEntity()).containsInstanceOf(OWLAnnotationProperty.class);
}

@Test
public void shouldDeserializeAnnotationProperty() throws IOException {
var json = "{\"@type\":\"AnnotationProperty\",\"iri\":\"http://stuff.com/I1\"}";
var value = objectMapper.readValue(new StringReader(json), PrimitiveFormControlData.class);
Assertions.assertThat(value.asEntity()).containsInstanceOf(OWLAnnotationProperty.class);
}

@Test
public void shouldRoundTripOwlNamedIndividual() throws IOException {
var value = EntityFormControlData.get(MockingUtils.mockOWLNamedIndividual());
JsonSerializationTestUtil.testSerialization(value, PrimitiveFormControlData.class);
}

@Test
public void shouldDeserializeOwlNamedIndividual() throws IOException {
var json = "{\"@type\":\"owl:NamedIndividual\",\"iri\":\"http://stuff.com/I1\"}";
var value = objectMapper.readValue(new StringReader(json), PrimitiveFormControlData.class);
Assertions.assertThat(value.asEntity()).containsInstanceOf(OWLNamedIndividual.class);
}

@Test
public void shouldDeserializeNamedIndividual() throws IOException {
var json = "{\"@type\":\"NamedIndividual\",\"iri\":\"http://stuff.com/I1\"}";
var value = objectMapper.readValue(new StringReader(json), PrimitiveFormControlData.class);
Assertions.assertThat(value.asEntity()).containsInstanceOf(OWLNamedIndividual.class);
}

@Test
public void shouldRoundTripOwlDatatype() throws IOException {
var value = EntityFormControlData.get(MockingUtils.mockOWLDatatype());
JsonSerializationTestUtil.testSerialization(value, PrimitiveFormControlData.class);
}

@Test
public void shouldDeserializeRdfsDatatype() throws IOException {
var json = "{\"@type\":\"rdfs:Datatype\",\"iri\":\"http://stuff.com/I1\"}";
var value = objectMapper.readValue(new StringReader(json), PrimitiveFormControlData.class);
Assertions.assertThat(value.asEntity()).containsInstanceOf(OWLDatatype.class);
}

@Test
public void shouldDeserializeDatatype() throws IOException {
var json = "{\"@type\":\"Datatype\",\"iri\":\"http://stuff.com/I1\"}";
var value = objectMapper.readValue(new StringReader(json), PrimitiveFormControlData.class);
Assertions.assertThat(value.asEntity()).containsInstanceOf(OWLDatatype.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package edu.stanford.bmir.protege.web.server.form.data;

import com.google.common.collect.ImmutableList;
import edu.stanford.bmir.protege.web.shared.form.data.PrimitiveFormControlDataDto;
import edu.stanford.bmir.protege.web.shared.form.data.SingleChoiceControlDataDto;
import edu.stanford.bmir.protege.web.shared.form.field.FixedChoiceListSourceDescriptor;
import edu.stanford.bmir.protege.web.shared.form.field.SingleChoiceControlDescriptor;
import edu.stanford.bmir.protege.web.shared.form.field.SingleChoiceControlType;
import edu.stanford.bmir.protege.web.shared.match.JsonSerializationTestUtil;
import org.junit.Test;

import java.io.IOException;

public class SingleChoiceControlDataDtoTest {

@Test
public void shouldDeserializeData() throws IOException {
SingleChoiceControlDataDto data = SingleChoiceControlDataDto.get(
SingleChoiceControlDescriptor.get(SingleChoiceControlType.COMBO_BOX,
FixedChoiceListSourceDescriptor.get(ImmutableList.of())),
PrimitiveFormControlDataDto.get("Hello"),
1
);

JsonSerializationTestUtil.testSerialization(data, SingleChoiceControlDataDto.class);
}
}
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ public static SingleChoiceControlDataDto get(@JsonProperty(PropertyNames.CONTROL
@JsonProperty(PropertyNames.CONTROL)
public abstract SingleChoiceControlDescriptor getDescriptor();

@JsonProperty(PropertyNames.CHOICE)
@JsonProperty(PropertyNames.VALUE)
@Nullable
protected abstract PrimitiveFormControlDataDto getChoiceInternal();