Package com.google.eclipse.protobuf.protobuf

Examples of com.google.eclipse.protobuf.protobuf.DefaultValueFieldOption


  //
  // message Test {
  //  optional double timeout = 1 [default = 1.0e7];
  // }
  @Test public void should_not_have_syntax_errors() {
    DefaultValueFieldOption option = xtext.find("default", DefaultValueFieldOption.class);
    Value value = option.getValue();
    assertThat(value, instanceOf(DoubleLink.class));
    DoubleLink link = (DoubleLink) value;
    assertThat(link.getTarget(), equalTo(1.0E7d));
  }
View Full Code Here


  //
  // message Test {
  //  optional float ratio = 1 [default = 1e+25];
  // }
  @Test public void should_not_have_syntax_errors() {
    DefaultValueFieldOption option = xtext.find("default", DefaultValueFieldOption.class);
    Value value = option.getValue();
    assertThat(value, instanceOf(DoubleLink.class));
    DoubleLink link = (DoubleLink) value;
    assertThat(link.getTarget(), equalTo(1.0E25d));
  }
View Full Code Here

  //
  // message Person {
  //   optional boolean active = 1 [default = true];
  // }
  @Test public void should_return_name_of_default_value_option() {
    DefaultValueFieldOption option = xtext.find("default", DefaultValueFieldOption.class);
    String name = resolver.nameOf(option);
    assertThat(name, equalTo("default"));
  }
View Full Code Here

  //
  // message Test {
  //   optional double something = 1 [default = 1.];
  // }
  @Test public void should_support_optional_decimals() {
    DefaultValueFieldOption option = xtext.find("default", DefaultValueFieldOption.class);
    DoubleLink link = (DoubleLink) option.getValue();
    assertThat(link.getTarget(), equalTo(1.0d));
  }
View Full Code Here

TOP

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

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.