[OLINGO-260] fix type seraialization + opentype integration test extension
This commit is contained in:
parent
e1e637f9e2
commit
c8ede38f65
|
@ -119,9 +119,9 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
|
||||||
assertEquals(String.class, rowIndex.getAdditionalProperty("aString").getClass());
|
assertEquals(String.class, rowIndex.getAdditionalProperty("aString").getClass());
|
||||||
assertEquals(Boolean.class, rowIndex.getAdditionalProperty("aBoolean").getClass());
|
assertEquals(Boolean.class, rowIndex.getAdditionalProperty("aBoolean").getClass());
|
||||||
assertEquals(Double.class, rowIndex.getAdditionalProperty("aDouble").getClass());
|
assertEquals(Double.class, rowIndex.getAdditionalProperty("aDouble").getClass());
|
||||||
// assertEquals(Short.class, rowIndex.getAdditionalProperty("aByte").getClass()); // trova integer
|
assertEquals(Byte.class, rowIndex.getAdditionalProperty("aByte").getClass());
|
||||||
// assertEquals(Byte.MAX_VALUE, rowIndex.getAdditionalProperty("aByte"));
|
assertEquals(Byte.MAX_VALUE, rowIndex.getAdditionalProperty("aByte"));
|
||||||
// assertEquals(Calendar.class, rowIndex.getAdditionalProperty("aDate").getClass()); // trova stringa
|
assertTrue(Calendar.class.isAssignableFrom(rowIndex.getAdditionalProperty("aDate").getClass()));
|
||||||
// assertEquals(ContactDetails.class, rowIndex.getAdditionalProperty("aContact").getClass().getInterfaces()[0]);
|
// assertEquals(ContactDetails.class, rowIndex.getAdditionalProperty("aContact").getClass().getInterfaces()[0]);
|
||||||
|
|
||||||
entityContext.detachAll();
|
entityContext.detachAll();
|
||||||
|
|
|
@ -81,7 +81,7 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
|
||||||
final Integer id = 1426;
|
final Integer id = 1426;
|
||||||
|
|
||||||
ODataEntity rowIndex = getClient().getObjectFactory().newEntity(
|
ODataEntity rowIndex = getClient().getObjectFactory().newEntity(
|
||||||
new FullQualifiedName("Microsoft.Test.OData.Services.OpenTypesServiceV3.RowIndex"));
|
new FullQualifiedName("Microsoft.Test.OData.Services.OpenTypesService.RowIndex"));
|
||||||
getClient().getBinder().add(rowIndex,
|
getClient().getBinder().add(rowIndex,
|
||||||
getClient().getObjectFactory().newPrimitiveProperty("Id",
|
getClient().getObjectFactory().newPrimitiveProperty("Id",
|
||||||
getClient().getObjectFactory().newPrimitiveValueBuilder().buildInt32(id)));
|
getClient().getObjectFactory().newPrimitiveValueBuilder().buildInt32(id)));
|
||||||
|
@ -106,7 +106,7 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
|
||||||
build()));
|
build()));
|
||||||
|
|
||||||
final ODataComplexValue<ODataProperty> contactDetails = getClient().getObjectFactory().newComplexValue(
|
final ODataComplexValue<ODataProperty> contactDetails = getClient().getObjectFactory().newComplexValue(
|
||||||
"Microsoft.Test.OData.Services.OpenTypesServiceV3.ContactDetails");
|
"Microsoft.Test.OData.Services.OpenTypesService.ContactDetails");
|
||||||
contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("FirstContacted",
|
contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("FirstContacted",
|
||||||
getClient().getObjectFactory().newPrimitiveValueBuilder().buildBinary("text".getBytes())));
|
getClient().getObjectFactory().newPrimitiveValueBuilder().buildBinary("text".getBytes())));
|
||||||
contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("LastContacted",
|
contactDetails.add(getClient().getObjectFactory().newPrimitiveProperty("LastContacted",
|
||||||
|
@ -161,7 +161,7 @@ public class OpenTypeTestITCase extends AbstractTestITCase {
|
||||||
assertTrue(rowIndex.getProperty("aDate").hasPrimitiveValue());
|
assertTrue(rowIndex.getProperty("aDate").hasPrimitiveValue());
|
||||||
assertEquals(EdmPrimitiveTypeKind.DateTime, rowIndex.getProperty("aDate").getPrimitiveValue().getTypeKind());
|
assertEquals(EdmPrimitiveTypeKind.DateTime, rowIndex.getProperty("aDate").getPrimitiveValue().getTypeKind());
|
||||||
assertTrue(rowIndex.getProperty("aContact").hasComplexValue());
|
assertTrue(rowIndex.getProperty("aContact").hasComplexValue());
|
||||||
assertEquals("Microsoft.Test.OData.Services.OpenTypesServiceV3.ContactDetails",
|
assertEquals("Microsoft.Test.OData.Services.OpenTypesService.ContactDetails",
|
||||||
rowIndex.getProperty("aContact").getValue().getTypeName());
|
rowIndex.getProperty("aContact").getValue().getTypeName());
|
||||||
assertTrue(rowIndex.getProperty("aContact").getComplexValue().get("SignedByte").hasPrimitiveValue());
|
assertTrue(rowIndex.getProperty("aContact").getComplexValue().get("SignedByte").hasPrimitiveValue());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue