Package org.infinispan.protostream.impl.parser

Examples of org.infinispan.protostream.impl.parser.SquareProtoParser


      assertTrue(descriptors.get("file1.proto").getTypes().containsKey("p.A"));
      assertTrue(descriptors.get("file2.proto").getTypes().containsKey("org.infinispan.B"));
   }

   private Map<String, FileDescriptor> parseAndResolve(FileDescriptorSource fileDescriptorSource) {
      return new SquareProtoParser().parseAndResolve(fileDescriptorSource);
   }
View Full Code Here


   @Test
   public void testInputFromFile() throws Exception {
      File f1 = asFile("org/infinispan/protostream/lib/base.proto");
      File f2 = asFile("org/infinispan/protostream/lib/base2.proto");
      FileDescriptorSource fileDescriptorSource = FileDescriptorSource.fromFiles(f1, f2);
      Map<String, FileDescriptor> parseResult = new SquareProtoParser().parse(fileDescriptorSource);
      assertThat(parseResult).isNotEmpty();
   }
View Full Code Here

                      " import invalid.proto;\n" +
                      " message M {\n" +
                      "    required string a = 1;\n" +
                      "}";

      new SquareProtoParser().parse(FileDescriptorSource.fromString("dummy.proto", file));

   }
View Full Code Here

      FileDescriptorSource source = new FileDescriptorSource();
      source.addProtoFile("test.proto", file1);
      source.addProtoFile("test2.proto", file2);

      new SquareProtoParser().parse(source);

   }
View Full Code Here

      FileDescriptorSource fileDescriptorSource = FileDescriptorSource.fromResources(
              "org/infinispan/protostream/test/message.proto",
              "org/infinispan/protostream/lib/base.proto",
              "org/infinispan/protostream/lib/base2.proto");

      Map<String, FileDescriptor> files = new SquareProtoParser().parse(fileDescriptorSource);

      FileDescriptor descriptor = files.get("org/infinispan/protostream/test/message.proto");

      assertThat(descriptor.getMessageTypes()).hasSize(3);
      assertThat(descriptor.getEnumTypes()).hasSize(1);
View Full Code Here

TOP

Related Classes of org.infinispan.protostream.impl.parser.SquareProtoParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.