use of org.apache.servicecomb.foundation.protobuf.internal.model.User in project java-chassis by ServiceComb.
the class TestBoolSchema method type_invalid.
@Test
public void type_invalid() throws Throwable {
expectedException.expect(IllegalStateException.class);
expectedException.expectMessage(Matchers.is("not support serialize from org.apache.servicecomb.foundation.protobuf.internal.model.User to proto bool, field=org.apache.servicecomb.foundation.protobuf.internal.model.Root:bool"));
scbMap = new HashMap<>();
scbMap.put("bool", new User());
rootSerializer.serialize(scbMap);
}
use of org.apache.servicecomb.foundation.protobuf.internal.model.User in project java-chassis by ServiceComb.
the class TestRepeatedSchema method users.
@Test
public void users() throws Throwable {
builder.addUsers(ProtobufRoot.User.newBuilder().setName("name1").build());
builder.addUsers(ProtobufRoot.User.newBuilder().setName("name2").build());
check();
RootWithArray rootWithArray = new RootWithArray();
rootWithArray.users = new User[] { new User("name1"), new User("name2") };
Assert.assertArrayEquals(protobufBytes, rootSerializer.serialize(rootWithArray));
}
use of org.apache.servicecomb.foundation.protobuf.internal.model.User in project java-chassis by ServiceComb.
the class TestStringSchema method type_invalid.
@Test
public void type_invalid() throws Throwable {
expectedException.expect(IllegalStateException.class);
expectedException.expectMessage(Matchers.is("not support serialize from org.apache.servicecomb.foundation.protobuf.internal.model.User to proto string, field=org.apache.servicecomb.foundation.protobuf.internal.model.Root:string"));
scbMap = new HashMap<>();
scbMap.put("string", new User());
rootSerializer.serialize(scbMap);
}
use of org.apache.servicecomb.foundation.protobuf.internal.model.User in project incubator-servicecomb-java-chassis by apache.
the class TestBoolSchema method type_invalid.
@Test
public void type_invalid() throws Throwable {
expectedException.expect(IllegalStateException.class);
expectedException.expectMessage(Matchers.is("not support serialize from org.apache.servicecomb.foundation.protobuf.internal.model.User to proto bool, field=org.apache.servicecomb.foundation.protobuf.internal.model.Root:bool"));
scbMap = new HashMap<>();
scbMap.put("bool", new User());
rootSerializer.serialize(scbMap);
}
use of org.apache.servicecomb.foundation.protobuf.internal.model.User in project incubator-servicecomb-java-chassis by apache.
the class TestStringSchema method type_invalid.
@Test
public void type_invalid() throws Throwable {
expectedException.expect(IllegalStateException.class);
expectedException.expectMessage(Matchers.is("not support serialize from org.apache.servicecomb.foundation.protobuf.internal.model.User to proto string, field=org.apache.servicecomb.foundation.protobuf.internal.model.Root:string"));
scbMap = new HashMap<>();
scbMap.put("string", new User());
rootSerializer.serialize(scbMap);
}
Aggregations