Package com.google.eclipse.protobuf.protobuf

Examples of com.google.eclipse.protobuf.protobuf.Message


  // }
  @Test public void should_provide_message_fields_for_first_field_in_field_custom_option() {
    CustomFieldOption option = xtext.find("type", ")", CustomFieldOption.class);
    MessageOptionField codeOptionField = (MessageOptionField) option.getFields().get(0);
    IScope scope = scopeProvider.scope_OptionField_target(codeOptionField, reference);
    Message typeMessage = xtext.find("Type", " {", Message.class);
    assertThat(descriptionsIn(scope), containAllFieldsIn(typeMessage));
  }
View Full Code Here


  // }
  @Test public void should_provide_message_fields_for_field_in_field_custom_option() {
    CustomFieldOption option = xtext.find("type", ")", CustomFieldOption.class);
    MessageOptionField numberOptionField = (MessageOptionField) option.getFields().get(1);
    IScope scope = scopeProvider.scope_OptionField_target(numberOptionField, reference);
    Message codeMessage = xtext.find("Code", " {", Message.class);
    assertThat(descriptionsIn(scope), containAllFieldsIn(codeMessage));
  }
View Full Code Here

  //   optional string name = 1;
  // }
  //
  // extend Person {}
  @Test public void should_return_extensions_of_message() {
    Message m = xtext.find("Person", " {", Message.class);
    List<TypeExtension> extensions = newArrayList(messages.localExtensionsOf(m));
    Message referred = (Message) extensions.get(0).getType().getTarget();
    assertSame(m, referred);
  }
View Full Code Here

  // };
  @Test public void should_provide_sources_for_aggregate_field() {
    ValueField field = xtext.find("code", ":", ValueField.class);
    NormalFieldName name = (NormalFieldName) field.getName();
    IScope scope = scopeProvider.scope_FieldName_target(name, reference);
    Message message = xtext.find("Type", " {", Message.class);
    assertThat(descriptionsIn(scope), containAllFieldsIn(message));
  }
View Full Code Here

  // };
  @Test public void should_provide_sources_for_nested_field_notation_in_option() {
    ValueField field = xtext.find("value", ":", ValueField.class);
    NormalFieldName name = (NormalFieldName) field.getName();
    IScope scope = scopeProvider.scope_FieldName_target(name, reference);
    Message message = xtext.find("Names", " {", Message.class);
    assertThat(descriptionsIn(scope), containAllFieldsIn(message));
  }
View Full Code Here

  // }
  @Test public void should_provide_sources_for_field_notation_in_field_option() {
    ValueField field = xtext.find("code", ":", ValueField.class);
    NormalFieldName name = (NormalFieldName) field.getName();
    IScope scope = scopeProvider.scope_FieldName_target(name, reference);
    Message message = xtext.find("Type", " {", Message.class);
    assertThat(descriptionsIn(scope), containAllFieldsIn(message));
  }
View Full Code Here

  // }
  @Test public void should_provide_sources_for_nested_field_notation_in_field_option() {
    ValueField field = xtext.find("value", ":", ValueField.class);
    NormalFieldName name = (NormalFieldName) field.getName();
    IScope scope = scopeProvider.scope_FieldName_target(name, reference);
    Message message = xtext.find("Names", " {", Message.class);
    assertThat(descriptionsIn(scope), containAllFieldsIn(message));
  }
View Full Code Here

  //
  // message Person {
  //   optional string name = 1;
  // }
  @Test public void should_include_existing_package_name_as_part_of_message_FQN() {
    Message message = xtext.find("Person", Message.class);
    QualifiedName fqn = provider.getFullyQualifiedName(message);
    assertThat(fqn.toString(), equalTo("fqn.test.Person"));
  }
View Full Code Here

  //
  // message Person {
  //   optional string name = 1;
  // }
  @Test public void should_not_include_package_name_as_part_of_message_FQN_if_package_is_not_specified() {
    Message message = xtext.find("Person", Message.class);
    QualifiedName fqn = provider.getFullyQualifiedName(message);
    assertThat(fqn.toString(), equalTo("Person"));
  }
View Full Code Here

  // syntax = "proto2";
  //
  // message Person {}
  @Test public void should_return_name_of_Message() {
    Message message = xtext.find("Person", Message.class);
    String name = resolver.nameOf(message);
    assertThat(name, equalTo("Person"));
  }
View Full Code Here

TOP

Related Classes of com.google.eclipse.protobuf.protobuf.Message

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.