static void verifyNested(Message hello, Message response,
            Message responseInner, Message requestInner)
    {
        assertNotNull(hello);

        Service s = hello.getNestedService("S");
        assertNotNull(s);

        RpcMethod greet = s.getRpcMethod("greet");
        assertNotNull(greet);

        Message req = greet.getArgType();
        assertTrue(req == hello);

        Message res = greet.getReturnType();
        assertTrue(res == response);

        Service i = responseInner.getNestedService("I");
        assertNotNull(i);

        RpcMethod getChild = i.getRpcMethod("getChild");
        assertNotNull(getChild);
        assertNotNull(getChild.getArgType());
        assertTrue(getChild.getArgType() == responseInner);
        assertNotNull(getChild.getReturnType());
        assertTrue(getChild.getReturnType() == responseInner.getNestedMessage("Deeper"));

        RpcMethod getParent = i.getRpcMethod("getParent");
        assertNotNull(getParent);
        assertNotNull(getParent.getArgType());
        assertTrue(getParent.getArgType() == responseInner);
        assertNotNull(getParent.getReturnType());
        assertTrue(getParent.getReturnType() == responseInner.getParentMessage());

        RpcMethod getHello = i.getRpcMethod("getHello");
        assertNotNull(getHello);
        assertNotNull(getHello.getArgType());
        assertTrue(getHello.getArgType() == responseInner);
        assertNotNull(getHello.getReturnType());
        assertTrue(getHello.getReturnType() == hello);

        RpcMethod fetchChild = i.getRpcMethod("fetchChild");
        assertNotNull(fetchChild);
        assertNotNull(fetchChild.getArgType());
        assertTrue(fetchChild.getArgType() == requestInner);
        assertNotNull(fetchChild.getReturnType());
        assertTrue(fetchChild.getReturnType() == requestInner.getNestedMessage("Deeper"));

        RpcMethod fetchParent = i.getRpcMethod("fetchParent");
        assertNotNull(fetchParent);
        assertNotNull(fetchParent.getArgType());
        assertTrue(fetchParent.getArgType() == requestInner);
        assertNotNull(fetchParent.getReturnType());
        assertTrue(fetchParent.getReturnType() == requestInner.getParentMessage());

        RpcMethod fetchHello = i.getRpcMethod("fetchHello");
        assertNotNull(fetchHello);
        assertNotNull(fetchHello.getArgType());
        assertTrue(fetchHello.getArgType() == requestInner);
        assertNotNull(fetchHello.getReturnType());
        assertTrue(fetchHello.getReturnType() == hello);
    }
Tests for parsing service/rpc components in the .proto file.

@author David Yu
@created Jun 19, 2010
protostuff-parser/src/test/java/io/protostuff/parser/ProtoServiceTest.java