/** * ToもToRelationも存在しない場合にDcCoreExceptionが発生すること. */ @Test(expected = DcCoreException.class) public final void ToもToRelationも存在しない場合にDcCoreExceptionが発生すること() { String to = (String) OProperties.null_(SentMessage.P_TO.getName(), EdmSimpleType.STRING).getValue(); String toRelation = (String) OProperties.null_(SentMessage.P_TO_RELATION.getName(), EdmSimpleType.STRING).getValue(); MessageODataResource.validateToAndToRelation(to, toRelation); }
/** * ToがなくてToRelationがある場合にDcCoreExceptionが発生しないこと. */ @Test public final void ToがなくてToRelationがある場合にDcCoreExceptionが発生しないこと() { String to = (String) OProperties.null_(SentMessage.P_TO.getName(), EdmSimpleType.STRING).getValue(); String toRelation = "http://example.com/toRelation"; MessageODataResource.validateToAndToRelation(to, toRelation); }
/** * Typeが関係登録依頼でRequestRelationがない場合にDcCoreExceptionが発生すること. */ @Test(expected = DcCoreException.class) public final void Typeが関係登録依頼でRequestRelationがない場合にDcCoreExceptionが発生すること() { String type = ReceivedMessage.TYPE_REQ_RELATION_BUILD; String requestRelation = (String) OProperties.null_( SentMessage.P_REQUEST_RELATION.getName(), EdmSimpleType.STRING).getValue(); String requestRelationTarget = "http://example.com/reqRelation"; MessageODataResource.validateReqRelation(type, requestRelation, requestRelationTarget); }
/** * Typeが関係削除依頼でRequestRelationがない場合にDcCoreExceptionが発生すること. */ @Test(expected = DcCoreException.class) public final void Typeが関係削除依頼でRequestRelationがない場合にDcCoreExceptionが発生すること() { String type = ReceivedMessage.TYPE_REQ_RELATION_BREAK; String requestRelation = (String) OProperties.null_( SentMessage.P_REQUEST_RELATION.getName(), EdmSimpleType.STRING).getValue(); String requestRelationTarget = "http://example.com/reqRelation"; MessageODataResource.validateReqRelation(type, requestRelation, requestRelationTarget); }
/** * Typeが関係削除依頼でRequestRelationTargetがない場合にDcCoreExceptionが発生すること. */ @Test(expected = DcCoreException.class) public final void Typeが関係削除依頼でRequestRelationTargetがない場合にDcCoreExceptionが発生すること() { String type = ReceivedMessage.TYPE_REQ_RELATION_BREAK; String requestRelation = "http://example.com/reqRelation"; String requestRelationTarget = (String) OProperties.null_( SentMessage.P_REQUEST_RELATION_TARGET.getName(), EdmSimpleType.STRING).getValue(); MessageODataResource.validateReqRelation(type, requestRelation, requestRelationTarget); }
/** * ToがあってToRelationがない場合にDcCoreExceptionが発生しないこと. */ @Test public final void ToがあってToRelationがない場合にDcCoreExceptionが発生しないこと() { String to = "http://example.com/toAddress"; String toRelation = (String) OProperties.null_(SentMessage.P_TO_RELATION.getName(), EdmSimpleType.STRING).getValue(); MessageODataResource.validateToAndToRelation(to, toRelation); }
/** * Typeが関係登録依頼でRequestRelationTargetがない場合にDcCoreExceptionが発生すること. */ @Test(expected = DcCoreException.class) public final void Typeが関係登録依頼でRequestRelationTargetがない場合にDcCoreExceptionが発生すること() { String type = ReceivedMessage.TYPE_REQ_RELATION_BUILD; String requestRelation = "http://example.com/reqRelation"; String requestRelationTarget = (String) OProperties.null_( SentMessage.P_REQUEST_RELATION_TARGET.getName(), EdmSimpleType.STRING).getValue(); MessageODataResource.validateReqRelation(type, requestRelation, requestRelationTarget); }
return OProperties.string(name, value); else if (value == null) return OProperties.null_(name, type); else if (EdmSimpleType.STRING.equals(type)) if (tokenType == JsonTokenType.STRING)
return OProperties.string(name, value); else if (value == null) return OProperties.null_(name, type); else if (EdmSimpleType.STRING.equals(type)) if (tokenType == JsonTokenType.STRING)
/** * ToがNullの場合にNullOPropertyが返却されること. */ @Test public final void ToがNullの場合にNullOPropertyが返却されること() { OProperty<?> expected = OProperties.null_(SentMessage.P_TO.getName(), EdmSimpleType.STRING); OProperty<?> result = this.setDefaultValue(SentMessage.P_TO.build(), SentMessage.P_TO.getName(), OProperties.string(SentMessage.P_TO.getName(), AbstractCase.STRING_LENGTH_129)); assertEquals(expected.getValue(), result.getValue()); }
/** * ToRelationがnullの場合にNullOPropertyが返却されること. */ @Test public final void ToRelationがnullの場合にNullOPropertyが返却されること() { OProperty<?> expected = OProperties.null_(SentMessage.P_TO_RELATION.getName(), EdmSimpleType.STRING); OProperty<?> result = this.setDefaultValue(SentMessage.P_TO_RELATION.build(), SentMessage.P_TO_RELATION.getName(), OProperties.string(SentMessage.P_TO_RELATION.getName(), "")); assertEquals(expected.getValue(), result.getValue()); }
/** * MulticastToがNullの場合にNullOPropertyが返却されること. */ @Test public final void MulticastToがNullの場合にNullOPropertyが返却されること() { OProperty<?> expected = OProperties.null_(ReceivedMessage.P_MULTICAST_TO.getName(), EdmSimpleType.STRING); OProperty<?> result = this.setDefaultValue(ReceivedMessage.P_MULTICAST_TO.build(), ReceivedMessage.P_MULTICAST_TO.getName(), OProperties.string(ReceivedMessage.P_MULTICAST_TO.getName(), AbstractCase.STRING_LENGTH_129)); assertEquals(expected.getValue(), result.getValue()); }
/** * InReplyToがNullの場合にNullOPropertyが返却されること. */ @Test public final void InReplyToがNullの場合にNullOPropertyが返却されること() { OProperty<?> expected = OProperties.null_(ReceivedMessage.P_IN_REPLY_TO.getName(), EdmSimpleType.STRING); OProperty<?> result = this.setDefaultValue(ReceivedMessage.P_IN_REPLY_TO.build(), ReceivedMessage.P_IN_REPLY_TO.getName(), OProperties.string(ReceivedMessage.P_IN_REPLY_TO.getName(), "")); assertEquals(expected.getValue(), result.getValue()); }
/** * RequestRelationがNullの場合にNullOPropertyが返却されること. */ @Test public final void RequestRelationがNullの場合にNullOPropertyが返却されること() { OProperty<?> expected = OProperties.null_(ReceivedMessage.P_REQUEST_RELATION.getName(), EdmSimpleType.STRING); OProperty<?> result = this.setDefaultValue(ReceivedMessage.P_REQUEST_RELATION.build(), ReceivedMessage.P_REQUEST_RELATION.getName(), OProperties.string(ReceivedMessage.P_REQUEST_RELATION.getName(), AbstractCase.STRING_LENGTH_129)); assertEquals(expected.getValue(), result.getValue()); }
/** * InReplyToがNullの場合にNullOPropertyが返却されること. */ @Test public final void InReplyToがNullの場合にNullOPropertyが返却されること() { OProperty<?> expected = OProperties.null_(SentMessage.P_IN_REPLY_TO.getName(), EdmSimpleType.STRING); OProperty<?> result = this.setDefaultValue(SentMessage.P_IN_REPLY_TO.build(), SentMessage.P_IN_REPLY_TO.getName(), OProperties.string(SentMessage.P_IN_REPLY_TO.getName(), "")); assertEquals(expected.getValue(), result.getValue()); }
/** * RequestRelationがNullの場合にNullOPropertyが返却されること. */ @Test public final void RequestRelationがNullの場合にNullOPropertyが返却されること() { OProperty<?> expected = OProperties.null_(SentMessage.P_REQUEST_RELATION.getName(), EdmSimpleType.STRING); OProperty<?> result = this.setDefaultValue(SentMessage.P_REQUEST_RELATION.build(), SentMessage.P_REQUEST_RELATION.getName(), OProperties.string(SentMessage.P_REQUEST_RELATION.getName(), AbstractCase.STRING_LENGTH_129)); assertEquals(expected.getValue(), result.getValue()); }
/** * RequestRelationTargetがNullの場合にNullOPropertyが返却されること. */ @Test public final void RequestRelationTargetがNullの場合にNullOPropertyが返却されること() { OProperty<?> expected = OProperties.null_(SentMessage.P_REQUEST_RELATION_TARGET.getName(), EdmSimpleType.STRING); OProperty<?> result = this.setDefaultValue(SentMessage.P_REQUEST_RELATION_TARGET.build(), SentMessage.P_REQUEST_RELATION_TARGET.getName(), OProperties.string(SentMessage.P_REQUEST_RELATION_TARGET.getName(), AbstractCase.STRING_LENGTH_129)); assertEquals(expected.getValue(), result.getValue()); }
/** * RequestRelationTargetがNullの場合にNullOPropertyが返却されること. */ @Test public final void RequestRelationTargetがNullの場合にNullOPropertyが返却されること() { OProperty<?> expected = OProperties.null_(ReceivedMessage.P_REQUEST_RELATION_TARGET.getName(), EdmSimpleType.STRING); OProperty<?> result = this.setDefaultValue(ReceivedMessage.P_REQUEST_RELATION_TARGET.build(), ReceivedMessage.P_REQUEST_RELATION_TARGET.getName(), OProperties.string(ReceivedMessage.P_MULTICAST_TO.getName(), AbstractCase.STRING_LENGTH_129)); assertEquals(expected.getValue(), result.getValue()); }