Exemplo n.º 1
0
  public Bootstrap generateBootstrap(List<DeploymentFile> files) {
    BootstrapGatherer gatherer = new BootstrapGatherer();

    for (DeploymentFile deploymentFile : files) {
      parser.parse(deploymentFile, gatherer);
    }

    Bootstrap result = new Bootstrap();

    Iterator<BootstrapContent> bootstrapContentIterator = gatherer.getBootstrapContent().iterator();

    while (bootstrapContentIterator.hasNext()) {
      BootstrapContent bootstrapContent = bootstrapContentIterator.next();

      // we don't bootstrap content that is never defined (these are either system templates
      // or errors), so remove those from the bootstrap.
      if (gatherer.isDefined(bootstrapContent.getExternalId())) {
        result.add(bootstrapContent);
      } else {
        result.addNeverCreatedButReferenced(bootstrapContent);
      }
    }

    return result;
  }
 private void assertBootstrap(BootstrapContent bootstrapContent) {
   BootstrapContent next = bootstrapIterator.next();
   assertEquals(bootstrapContent, next);
   // major is not part of bootstrapcontent's equals
   assertEquals(bootstrapContent.getMajor(), next.getMajor());
 }