Package org.eclipse.emf.common.util

Examples of org.eclipse.emf.common.util.URI


    TargetPlatformStandaloneSetup.doSetup();
    Injector injector = TargetPlatformBundleActivator.getInstance().getInjector(TargetPlatformBundleActivator.TARGET_PLATFORM_LANGUAGE_NAME);
    Converter converter = new Converter();
    injector.injectMembers(converter);

    URI uri = normalize(org.eclipse.emf.common.util.URI.createURI(path));
   
    Diagnostic diagnostic = converter.generateTargetDefinitionFile(uri, createPrintingMonitor());
   
    if (diagnostic.getSeverity() >= Diagnostic.WARNING) {
      for (Diagnostic child : diagnostic.getChildren()) {
View Full Code Here


  }
 
  private static URI normalize(URI uri) {
    String fragment = uri.fragment();
    String query = uri.query();
    URI trimmedURI = uri.trimFragment().trimQuery();
    URI result = trimmedURI;
    String scheme = result.scheme();
    if (scheme == null) {
      if (result.hasAbsolutePath()) {
        result = URI.createURI("file:" + result);
      } else {
        result = URI.createFileURI(new File(result.toString())
            .getAbsolutePath());
      }
    }

    if (result == trimmedURI) {
      return uri;
    }

    if (query != null) {
      result = result.appendQuery(query);
    }
    if (fragment != null) {
      result = result.appendFragment(fragment);
    }

    return result;
  }
View Full Code Here

  public void testIncludeOverrideOrder() {
    try {
      final XtextResourceSet resourceSet = this.resourceSetProvider.get();
      StringConcatenation _builder = new StringConcatenation();
      _builder.append("target \"o\" include \"a.tpd\" include \"b.tpd\" include \"c.tpd\"");
      URI _createURI = URI.createURI("tmp:/o.tpd");
      final TargetPlatform o = this.parser.parse(_builder, _createURI, resourceSet);
      StringConcatenation _builder_1 = new StringConcatenation();
      _builder_1.append("target \"a\" include \"d.tpd\" include \"e.tpd\" include \"f.tpd\"");
      URI _createURI_1 = URI.createURI("tmp:/a.tpd");
      this.parser.parse(_builder_1, _createURI_1, resourceSet);
      StringConcatenation _builder_2 = new StringConcatenation();
      _builder_2.append("target \"b\" include \"g.tpd\" include \"h.tpd\" include \"i.tpd\"");
      URI _createURI_2 = URI.createURI("tmp:/b.tpd");
      this.parser.parse(_builder_2, _createURI_2, resourceSet);
      StringConcatenation _builder_3 = new StringConcatenation();
      _builder_3.append("target \"c\" include \"j.tpd\" include \"k.tpd\" include \"l.tpd\"");
      URI _createURI_3 = URI.createURI("tmp:/c.tpd");
      this.parser.parse(_builder_3, _createURI_3, resourceSet);
      for (final String tp : Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("d", "e", "f", "g", "h", "i", "j", "k", "l"))) {
        StringConcatenation _builder_4 = new StringConcatenation();
        _builder_4.append("target \"");
        _builder_4.append(tp, "");
        _builder_4.append("\"");
        StringConcatenation _builder_5 = new StringConcatenation();
        _builder_5.append("tmp:/");
        _builder_5.append(tp, "");
        _builder_5.append(".tpd");
        URI _createURI_4 = URI.createURI(_builder_5.toString());
        this.parser.parse(_builder_4, _createURI_4, resourceSet);
      }
      LinkedList<TargetPlatform> _importedTargetPlatforms = this.indexBuilder.getImportedTargetPlatforms(o);
      final Function1<TargetPlatform, String> _function = new Function1<TargetPlatform, String>() {
        public String apply(final TargetPlatform it) {
View Full Code Here

      _builder.append("target \"o\" include \"a.tpd\" include \"b.tpd\" include \"c.tpd\"");
      _builder.newLine();
      _builder.append("\t\t");
      _builder.append("location \"o1\"");
      _builder.newLine();
      URI _createURI = URI.createURI("tmp:/o.tpd");
      final TargetPlatform o = this.parser.parse(_builder, _createURI, resourceSet);
      StringConcatenation _builder_1 = new StringConcatenation();
      _builder_1.append("target \"a\" include \"d.tpd\" include \"e.tpd\" include \"f.tpd\"");
      _builder_1.newLine();
      _builder_1.append("\t\t");
      _builder_1.append("location \"a1\"");
      _builder_1.newLine();
      URI _createURI_1 = URI.createURI("tmp:/a.tpd");
      this.parser.parse(_builder_1, _createURI_1, resourceSet);
      StringConcatenation _builder_2 = new StringConcatenation();
      _builder_2.append("target \"b\" include \"g.tpd\" include \"h.tpd\" include \"i.tpd\"");
      _builder_2.newLine();
      _builder_2.append("\t\t");
      _builder_2.append("location \"b1\"");
      URI _createURI_2 = URI.createURI("tmp:/b.tpd");
      this.parser.parse(_builder_2, _createURI_2, resourceSet);
      StringConcatenation _builder_3 = new StringConcatenation();
      _builder_3.append("target \"c\" include \"j.tpd\" include \"k.tpd\" include \"l.tpd\"");
      _builder_3.newLine();
      _builder_3.append("\t\t");
      _builder_3.append("location \"c1\"");
      URI _createURI_3 = URI.createURI("tmp:/c.tpd");
      this.parser.parse(_builder_3, _createURI_3, resourceSet);
      for (final String tp : Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("d", "e", "f", "g", "h", "i", "j", "k", "l"))) {
        StringConcatenation _builder_4 = new StringConcatenation();
        _builder_4.append("target \"");
        _builder_4.append(tp, "");
        _builder_4.append("\"");
        _builder_4.newLineIfNotEmpty();
        _builder_4.append("\t\t\t");
        _builder_4.append("location \"");
        _builder_4.append(tp, "\t\t\t");
        _builder_4.append("1\"");
        StringConcatenation _builder_5 = new StringConcatenation();
        _builder_5.append("tmp:/");
        _builder_5.append(tp, "");
        _builder_5.append(".tpd");
        URI _createURI_4 = URI.createURI(_builder_5.toString());
        this.parser.parse(_builder_4, _createURI_4, resourceSet);
      }
      ListMultimap<String, Location> _locationIndex = this.indexBuilder.getLocationIndex(o);
      Set<String> _keySet = _locationIndex.keySet();
      Assert.assertArrayEquals(
View Full Code Here

      _builder.append("location \"o1\"");
      _builder.newLine();
      _builder.append("\t\t");
      _builder.append("include \"c.tpd\"");
      _builder.newLine();
      URI _createURI = URI.createURI("tmp:/o.tpd");
      final TargetPlatform o = this.parser.parse(_builder, _createURI, resourceSet);
      StringConcatenation _builder_1 = new StringConcatenation();
      _builder_1.append("target \"a\" ");
      _builder_1.newLine();
      _builder_1.append("\t\t");
      _builder_1.append("include \"d.tpd\" ");
      _builder_1.newLine();
      _builder_1.append("\t\t");
      _builder_1.append("location \"a1\"");
      _builder_1.newLine();
      _builder_1.append("\t\t");
      _builder_1.append("include \"e.tpd\" ");
      _builder_1.newLine();
      _builder_1.append("\t\t");
      _builder_1.append("include \"f.tpd\"");
      _builder_1.newLine();
      URI _createURI_1 = URI.createURI("tmp:/a.tpd");
      this.parser.parse(_builder_1, _createURI_1, resourceSet);
      StringConcatenation _builder_2 = new StringConcatenation();
      _builder_2.append("target \"b\" ");
      _builder_2.newLine();
      _builder_2.append("\t\t");
      _builder_2.append("location \"b1\"");
      _builder_2.newLine();
      _builder_2.append("\t\t");
      _builder_2.append("include \"g.tpd\" ");
      _builder_2.newLine();
      _builder_2.append("\t\t");
      _builder_2.append("include \"h.tpd\" ");
      _builder_2.newLine();
      _builder_2.append("\t\t");
      _builder_2.append("include \"i.tpd\"");
      URI _createURI_2 = URI.createURI("tmp:/b.tpd");
      this.parser.parse(_builder_2, _createURI_2, resourceSet);
      StringConcatenation _builder_3 = new StringConcatenation();
      _builder_3.append("target \"c\" ");
      _builder_3.newLine();
      _builder_3.append("\t\t");
      _builder_3.append("include \"j.tpd\" ");
      _builder_3.newLine();
      _builder_3.append("\t\t");
      _builder_3.append("include \"k.tpd\" ");
      _builder_3.newLine();
      _builder_3.append("\t\t");
      _builder_3.append("include \"l.tpd\"");
      _builder_3.newLine();
      _builder_3.append("\t\t");
      _builder_3.append("location \"c1\"");
      URI _createURI_3 = URI.createURI("tmp:/c.tpd");
      this.parser.parse(_builder_3, _createURI_3, resourceSet);
      for (final String tp : Collections.<String>unmodifiableList(CollectionLiterals.<String>newArrayList("d", "e", "f", "g", "h", "i", "j", "k", "l"))) {
        StringConcatenation _builder_4 = new StringConcatenation();
        _builder_4.append("target \"");
        _builder_4.append(tp, "");
        _builder_4.append("\"");
        _builder_4.newLineIfNotEmpty();
        _builder_4.append("\t\t\t");
        _builder_4.append("location \"");
        _builder_4.append(tp, "\t\t\t");
        _builder_4.append("1\"");
        StringConcatenation _builder_5 = new StringConcatenation();
        _builder_5.append("tmp:/");
        _builder_5.append(tp, "");
        _builder_5.append(".tpd");
        URI _createURI_4 = URI.createURI(_builder_5.toString());
        this.parser.parse(_builder_4, _createURI_4, resourceSet);
      }
      ListMultimap<String, Location> _locationIndex = this.indexBuilder.getLocationIndex(o);
      Set<String> _keySet = _locationIndex.keySet();
      Assert.assertArrayEquals(
View Full Code Here

      StringConcatenation _builder = new StringConcatenation();
      _builder.append("target \"o\" ");
      _builder.newLine();
      _builder.append("include \"http://git.eclipse.org/c/emfcompare/org.eclipse.emf.compare.git/plain/org.eclipse.emf.compare-parent/targetPlatforms/kepler-sdk.targetplatform?id=e9fbfd866f648083df83174d566ee1b9d61daeca\" ");
      _builder.newLine();
      URI _createURI = URI.createURI("tmp:/o.tpd");
      final TargetPlatform o = this.parser.parse(_builder, _createURI, resourceSet);
      final ListMultimap<String, Location> index = this.indexBuilder.getLocationIndex(o);
      int _size = index.size();
      Assert.assertEquals(4, _size);
    } catch (Throwable _e) {
View Full Code Here

      _builder.newLine();
      _builder.append("include \"b.tpd\"");
      _builder.newLine();
      _builder.append("location \"locationURI1\"");
      _builder.newLine();
      URI _createURI = URI.createURI("tmp:/a.tpd");
      final TargetPlatform tpa = this.parser.parse(_builder, _createURI, resourceSet);
      StringConcatenation _builder_1 = new StringConcatenation();
      _builder_1.append("target \"tp.b\"");
      _builder_1.newLine();
      _builder_1.append("location \"locationURI1\"");
      _builder_1.newLine();
      URI _createURI_1 = URI.createURI("tmp:/b.tpd");
      this.parser.parse(_builder_1, _createURI_1, resourceSet);
      Resource _eResource = tpa.eResource();
      EList<Resource.Diagnostic> _errors = _eResource.getErrors();
      boolean _isEmpty = _errors.isEmpty();
      Assert.assertTrue(_isEmpty);
View Full Code Here

      _builder.newLine();
      _builder.append("include \"b.tpd\"");
      _builder.newLine();
      _builder.append("location A \"locationURI1\"");
      _builder.newLine();
      URI _createURI = URI.createURI("tmp:/a.tpd");
      final TargetPlatform tpa = this.parser.parse(_builder, _createURI, resourceSet);
      StringConcatenation _builder_1 = new StringConcatenation();
      _builder_1.append("target \"tp.b\"");
      _builder_1.newLine();
      _builder_1.append("location A \"locationURI2\"");
      _builder_1.newLine();
      URI _createURI_1 = URI.createURI("tmp:/b.tpd");
      final TargetPlatform tpb = this.parser.parse(_builder_1, _createURI_1, resourceSet);
      Resource _eResource = tpa.eResource();
      EList<Resource.Diagnostic> _errors = _eResource.getErrors();
      boolean _isEmpty = _errors.isEmpty();
      Assert.assertTrue(_isEmpty);
View Full Code Here

      _builder.newLine();
      _builder.append("include \"b.tpd\"");
      _builder.newLine();
      _builder.append("location A \"locationURI1\"");
      _builder.newLine();
      URI _createURI = URI.createURI("tmp:/a.tpd");
      final TargetPlatform tpa = this.parser.parse(_builder, _createURI, resourceSet);
      StringConcatenation _builder_1 = new StringConcatenation();
      _builder_1.append("target \"tp.b\"");
      _builder_1.newLine();
      _builder_1.append("location A \"locationURI1\"");
      _builder_1.newLine();
      URI _createURI_1 = URI.createURI("tmp:/b.tpd");
      final TargetPlatform tpb = this.parser.parse(_builder_1, _createURI_1, resourceSet);
      Resource _eResource = tpa.eResource();
      EList<Resource.Diagnostic> _errors = _eResource.getErrors();
      boolean _isEmpty = _errors.isEmpty();
      Assert.assertTrue(_isEmpty);
View Full Code Here

      StringConcatenation _builder = new StringConcatenation();
      _builder.append("target \"tp.a\"");
      _builder.newLine();
      _builder.append("include \"b.tpd\"");
      _builder.newLine();
      URI _createURI = URI.createURI("tmp:/a.tpd");
      final TargetPlatform tpa = this.parser.parse(_builder, _createURI, resourceSet);
      StringConcatenation _builder_1 = new StringConcatenation();
      _builder_1.append("target \"tp.b\"");
      _builder_1.newLine();
      URI _createURI_1 = URI.createURI("tmp:/b.tpd");
      this.parser.parse(_builder_1, _createURI_1, resourceSet);
      Resource _eResource = tpa.eResource();
      EList<Resource.Diagnostic> _errors = _eResource.getErrors();
      boolean _isEmpty = _errors.isEmpty();
      Assert.assertTrue(_isEmpty);
View Full Code Here

TOP

Related Classes of org.eclipse.emf.common.util.URI

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.