Package com.google.eclipse.protobuf.protobuf

Examples of com.google.eclipse.protobuf.protobuf.Package


  private QualifiedName addPackage(EObject obj, QualifiedName qualifiedName) {
    if (qualifiedName == null || obj instanceof Package) {
      return qualifiedName;
    }
    Package p = modelObjects.packageOf(obj);
    if (p == null) {
      return qualifiedName;
    }
    List<String> segments = packages.segmentsOf(p);
    if (segments.isEmpty()) {
View Full Code Here


        descriptions.addAll(publicImported(rootOfImported, strategy, criteria));
        if (arePackagesRelated(fromImporter, rootOfImported)) {
          descriptions.addAll(local(rootOfImported, strategy, criteria, 0));
          continue;
        }
        Package packageOfImported = modelObjects.packageOf(rootOfImported);
        descriptions.addAll(imported(fromImporter, packageOfImported, imported, strategy, criteria));
      }
    }
    return descriptions;
  }
View Full Code Here

    ResourceSet resourceSet = start.eResource().getResourceSet();
    return imported(allImports, modelObjects.packageOf(start), resourceSet, strategy, criteria);
  }

  private boolean arePackagesRelated(Package aPackage, EObject root) {
    Package p = modelObjects.packageOf(root);
    return packages.areRelated(aPackage, p);
  }
View Full Code Here

  // message Person {
  //   optional int32 id = 1;
  // }
  @Test public void should_return_package_if_proto_has_one() {
    MessageField field = xtext.find("id", MessageField.class);
    Package aPackage = modelObjects.packageOf(field);
    assertThat(aPackage.getName(), equalTo("person.test"));
  }
View Full Code Here

  // syntax = "proto2";
  //
  // package com.google.proto.test;
  @Test public void should_return_name_of_Package() {
    Package aPackage = xtext.find("com.google.proto.test", Package.class);
    String name = resolver.nameOf(aPackage);
    assertThat(name, equalTo("com.google.proto.test"));
  }
View Full Code Here

  // syntax = "proto2";
  //
  // package com.google.protobuf;
  // package com.google.eclipse;
  @Test public void should_create_error_if_there_are_more_than_one_package_definitions() {
    Package p = xtext.find("com.google.eclipse", Package.class);
    validator.checkOnlyOnePackageDefinition(p);
    verify(messageAcceptor).acceptError(multiplePackages, p, PACKAGE__NAME, INSIGNIFICANT_INDEX, MORE_THAN_ONE_PACKAGE_ERROR);
  }
View Full Code Here

  // syntax = "proto2";
  //
  // package com.google.eclipse;
  @Test public void should_not_create_error_if_there_is_only_one_package_definition() {
    Package p = xtext.find("com.google.eclipse", Package.class);
    validator.checkOnlyOnePackageDefinition(p);
    verifyZeroInteractions(messageAcceptor);
  }
View Full Code Here

  // syntax = "proto2";
  //
  // package com.google.test;
  @Test public void should_create_a_qualified_name_per_segment_in_package_name() {
    Package aPackage = xtext.find("com.google.test", Package.class);
    Collection<QualifiedName> names = packages.addPackageNameSegments(aPackage, QualifiedName.create("Person"));
    assertThat(names, contains("test.Person", "google.test.Person"));
  }
View Full Code Here

  // syntax = "proto2";
  //
  // package google;
  @Test public void should_return_empty_list_if_package_has_only_one_segment() {
    Package aPackage = xtext.find("google", Package.class);
    Collection<QualifiedName> names = packages.addPackageNameSegments(aPackage, QualifiedName.create("Person"));
    assertTrue(names.isEmpty());
  }
View Full Code Here

  // syntax = "proto2";
  //
  // package com.google.proto.test;
  @Test public void should_return_image_for_package() {
    Package aPackage = xtext.findFirst(Package.class);
    String image = images.imageFor(aPackage);
    assertThat(image, equalTo("package.gif"));
    assertThat(image, existsInProject());
  }
View Full Code Here

TOP

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

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.