Examples of Enum


Examples of com.google.eclipse.protobuf.protobuf.Enum

  //
  // option (type) = ONE;
  @Test public void should_provide_Literals_for_source_of_custom_option() {
    Option option = xtext.find("type", ")", Option.class);
    IScope scope = scopeProvider.scope_LiteralLink_target(valueOf(option), reference);
    Enum typeEnum = xtext.find("Type", " {", Enum.class);
    assertThat(descriptionsIn(scope), containAllLiteralsIn(typeEnum));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.Enum

  //
  // option (info).type = ONE;
  @Test public void should_provide_Literals_for_source_of_field_of_custom_option() {
    Option option = xtext.find("info", ")", Option.class);
    IScope scope = scopeProvider.scope_LiteralLink_target(valueOf(option), reference);
    Enum typeEnum = xtext.find("Type", " {", Enum.class);
    assertThat(descriptionsIn(scope), containAllLiteralsIn(typeEnum));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.Enum

  //  }
  @Test public void should_provide_Literals_for_source_of_native_field_option() {
    FieldOption option = xtext.find("ctype", FieldOption.class);
    IScope scope = scopeProvider.scope_LiteralLink_target(valueOf(option), reference);
    ProtoDescriptor descriptor = descriptorProvider.primaryDescriptor();
    Enum cTypeEnum = descriptor.enumByName("CType");
    assertThat(descriptionsIn(scope), containAllLiteralsIn(cTypeEnum));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.Enum

  //   optional boolean active = 1 [(type) = ONE];
  // }
  @Test public void should_provide_Literals_for_source_of_custom_field_option() {
    FieldOption option = xtext.find("type", ")", FieldOption.class);
    IScope scope = scopeProvider.scope_LiteralLink_target(valueOf(option), reference);
    Enum typeEnum = xtext.find("Type", " {", Enum.class);
    assertThat(descriptionsIn(scope), containAllLiteralsIn(typeEnum));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.Enum

  //   optional boolean active = 1 [(info).type = ONE];
  // }
  @Test public void should_provide_Literals_for_source_of_field_in_custom_field_option() {
    FieldOption option = xtext.find("info", ")", FieldOption.class);
    IScope scope = scopeProvider.scope_LiteralLink_target(valueOf(option), reference);
    Enum typeEnum = xtext.find("Type", " {", Enum.class);
    assertThat(descriptionsIn(scope), containAllLiteralsIn(typeEnum));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.Enum

    descriptor = descriptorProvider.primaryDescriptor();
  }

  @Test public void should_return_Enum_if_field_type_is_enum() {
    MessageField option = descriptor.option("optimize_for", FILE);
    Enum anEnum = descriptor.enumTypeOf(option);
    assertThat(anEnum.getName(), equalTo("OptimizeMode"));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.Enum

  // message PhoneNumber {
  //   optional PhoneType type = 1;
  // }
  @Test public void should_return_enum_if_field_type_is_enum() {
    MessageField field = xtext.find("type", MessageField.class);
    Enum anEnum = fields.enumTypeOf(field);
    assertThat(anEnum.getName(), equalTo("PhoneType"));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.Enum

  // syntax = "proto2";
  //
  // enum PhoneType {}
  @Test public void should_return_name_of_Enum() {
    Enum anEnum = xtext.find("PhoneType", Enum.class);
    String name = resolver.nameOf(anEnum);
    assertThat(name, equalTo("PhoneType"));
  }
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.Enum

  //       WORK = 1;
  //     }
  //   }
  // }
  @Test public void should_return_all_possible_local_names() {
    Enum phoneType = xtext.find("PhoneType", " {", Enum.class);
    List<QualifiedName> names = namesProvider.localNames(phoneType, normalNamingStrategy);
    assertThat(names.get(0).toString(), equalTo("PhoneType"));
    assertThat(names.get(1).toString(), equalTo("PhoneNumber.PhoneType"));
    assertThat(names.get(2).toString(), equalTo("Person.PhoneNumber.PhoneType"));
    assertThat(names.get(3).toString(), equalTo("names.Person.PhoneNumber.PhoneType"));
View Full Code Here

Examples of com.google.eclipse.protobuf.protobuf.Enum

    MessageField optionSource = (MessageField) options.rootSourceOf(option);
    if (optionSource == null) {
      return;
    }
    ProtoDescriptor descriptor = descriptorProvider.primaryDescriptor();
    Enum enumType = descriptor.enumTypeOf(optionSource);
    if (enumType != null) {
      proposeAndAccept(enumType, context, acceptor);
      return;
    }
    proposePrimitiveValues(optionSource, context, acceptor);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.