Examples of IHrefProducer


Examples of com.puppetlabs.geppetto.graph.IHrefProducer

  @Test
  public void githubHrefProducer() {
    Injector injector = Guice.createInjector(new DependencyGraphModule(
      GraphHrefType.GITHUB.getHrefProducerClass(), "https://github.com/puppetlabs/geppetto/master"));
    IHrefProducer producer = injector.getInstance(IHrefProducer.class);

    Export fakeExport = new Export() {

      private static final long serialVersionUID = 1L;

      @Override
      public String getDefaultValueText() {
        return null;
      }

      @Override
      public EClass getEClass() {
        return null;
      }

      @Override
      public File getFile() {
        return new File("/foo/bar/about.html");
      }

      @Override
      public String getLastNameSegment() {
        return ".html";
      }

      @Override
      public int getLength() {
        return -1;
      }

      @Override
      public int getLine() {
        return 23;
      }

      @Override
      public String getName() {
        return null;
      }

      @Override
      public String getNameWithoutLastSegment() {
        return null;
      }

      @Override
      public String getParentName() {
        return null;
      }

      @Override
      public int getStart() {
        return -1;
      }

    };
    String result = producer.href(fakeExport, new File("/foo/bar/"));
    assertEquals("https://github.com/puppetlabs/geppetto/master/about.html#L23", result);

  }
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.