Examples of ManifestParseTree


Examples of org.eclipse.orion.server.cf.manifest.v2.ManifestParseTree

    URL entry = ServerTestsActivator.getContext().getBundle().getEntry(MANIFEST_LOCATION);
    File manifestFile = new File(FileLocator.toFileURL(entry).getPath().concat(manifestName));

    InputStream inputStream = new FileInputStream(manifestFile);
    ManifestParseTree manifest = parse(inputStream);

    ManifestParseTree application = manifest.get("applications").get(0); //$NON-NLS-1$
    ManifestParseTree services = application.get("services"); //$NON-NLS-1$

    assertEquals(2, services.getChildren().size());

    String service = services.get(0).getValue();
    assertEquals("Redis Cloud-fo service", service); //$NON-NLS-1$

    service = services.get(1).getValue();
    assertEquals("Redis-two", service); //$NON-NLS-1$
  }
View Full Code Here

Examples of org.eclipse.orion.server.cf.manifest.v2.ManifestParseTree

    String manifestName = "prod-manifest.yml"; //$NON-NLS-1$

    URL entry = ServerTestsActivator.getContext().getBundle().getEntry(MANIFEST_LOCATION);
    IFileStore fs = EFS.getStore(URIUtil.toURI(FileLocator.toFileURL(entry).getPath().concat(manifestName)));

    ManifestParseTree manifest = ManifestUtils.parse(fs.getParent(), fs);
    ManifestParseTree applications = manifest.get("applications"); //$NON-NLS-1$
    assertEquals(4, applications.getChildren().size());

    for (ManifestParseTree application : applications.getChildren()) {
      assertTrue(application.has("domain")); //$NON-NLS-1$
      assertTrue(application.has("instances")); //$NON-NLS-1$
      assertTrue(application.has("path")); //$NON-NLS-1$
      assertTrue(application.has("memory")); //$NON-NLS-1$
    }
View Full Code Here

Examples of org.eclipse.orion.server.cf.manifest.v2.ManifestParseTree

    String manifestName = "prod-manifest.yml"; //$NON-NLS-1$

    URL entry = ServerTestsActivator.getContext().getBundle().getEntry(MANIFEST_LOCATION);
    IFileStore fs = EFS.getStore(URIUtil.toURI(FileLocator.toFileURL(entry).getPath().concat(manifestName)));

    ManifestParseTree manifest = ManifestUtils.parse(fs.getParent().getParent(), fs);
    ManifestParseTree applications = manifest.get("applications"); //$NON-NLS-1$
    assertEquals(2, applications.getChildren().size());

    for (ManifestParseTree application : applications.getChildren()) {
      assertTrue(application.has("domain")); //$NON-NLS-1$
      assertTrue(application.has("instances")); //$NON-NLS-1$
      assertTrue(application.has("path")); //$NON-NLS-1$
      assertTrue(application.has("memory")); //$NON-NLS-1$
    }
View Full Code Here

Examples of org.eclipse.orion.server.cf.manifest.v2.ManifestParseTree

    String manifestName = "prod-manifest.yml"; //$NON-NLS-1$

    URL entry = ServerTestsActivator.getContext().getBundle().getEntry(MANIFEST_LOCATION);
    IFileStore fs = EFS.getStore(URIUtil.toURI(FileLocator.toFileURL(entry).getPath().concat(manifestName)));

    ManifestParseTree manifest = ManifestUtils.parse(fs.getParent(), fs);

    ManifestParseTree applications = manifest.get("applications"); //$NON-NLS-1$
    assertEquals(1, applications.getChildren().size());

    ManifestParseTree application = applications.get(0);

    assertEquals("512M", application.get("memory").getValue()); //$NON-NLS-1$//$NON-NLS-2$
    assertEquals("2", application.get("instances").getValue()); //$NON-NLS-1$//$NON-NLS-2$
    assertEquals("example.com", application.get("domain").getValue()); //$NON-NLS-1$//$NON-NLS-2$
    assertEquals(".", application.get("path").getValue()); //$NON-NLS-1$//$NON-NLS-2$
  }
View Full Code Here

Examples of org.eclipse.orion.server.cf.manifest.v2.ManifestParseTree

    String manifestName = "prod-manifest.yml"; //$NON-NLS-1$

    URL entry = ServerTestsActivator.getContext().getBundle().getEntry(MANIFEST_LOCATION);
    IFileStore fs = EFS.getStore(URIUtil.toURI(FileLocator.toFileURL(entry).getPath().concat(manifestName)));

    ManifestParseTree manifest = ManifestUtils.parse(fs.getParent(), fs);
    ManifestParseTree applications = manifest.get("applications"); //$NON-NLS-1$
    assertEquals(2, applications.getChildren().size());
  }
View Full Code Here

Examples of org.eclipse.orion.server.cf.manifest.v2.ManifestParseTree

    String manifestName = "final-manifest.yml"; //$NON-NLS-1$

    URL entry = ServerTestsActivator.getContext().getBundle().getEntry(MANIFEST_LOCATION);
    IFileStore fs = EFS.getStore(URIUtil.toURI(FileLocator.toFileURL(entry).getPath().concat(manifestName)));

    ManifestParseTree manifest = ManifestUtils.parse(fs.getParent(), fs);
    ManifestParseTree applications = manifest.get("applications"); //$NON-NLS-1$
    assertEquals(2, applications.getChildren().size());

    for (ManifestParseTree application : applications.getChildren()) {
      assertTrue(application.has("domain")); //$NON-NLS-1$
      assertTrue(application.has("instances")); //$NON-NLS-1$
      assertTrue(application.has("memory")); //$NON-NLS-1$

      if ("A".equals(application.get("name").getValue())) //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

Examples of org.eclipse.orion.server.cf.manifest.v2.ManifestParseTree

    String manifestName = "final-manifest.yml"; //$NON-NLS-1$

    URL entry = ServerTestsActivator.getContext().getBundle().getEntry(MANIFEST_LOCATION);
    IFileStore fs = EFS.getStore(URIUtil.toURI(FileLocator.toFileURL(entry).getPath().concat(manifestName)));

    ManifestParseTree manifest = ManifestUtils.parse(fs.getParent().getParent().getParent(), fs);
    ManifestParseTree applications = manifest.get("applications"); //$NON-NLS-1$
    assertEquals(2, applications.getChildren().size());

    for (ManifestParseTree application : applications.getChildren()) {
      assertTrue(application.has("domain")); //$NON-NLS-1$
      assertTrue(application.has("instances")); //$NON-NLS-1$
      assertTrue(application.has("memory")); //$NON-NLS-1$

      if ("A".equals(application.get("name").getValue())) //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

Examples of org.eclipse.orion.server.cf.manifest.v2.ManifestParseTree

    String manifestName = "prod-manifest.yml"; //$NON-NLS-1$

    URL entry = ServerTestsActivator.getContext().getBundle().getEntry(MANIFEST_LOCATION);
    IFileStore fs = EFS.getStore(URIUtil.toURI(FileLocator.toFileURL(entry).getPath().concat(manifestName)));

    ManifestParseTree manifest = ManifestUtils.parse(fs.getParent(), fs);

    ManifestParseTree applications = manifest.get("applications"); //$NON-NLS-1$
    assertEquals(1, applications.getChildren().size());

    ManifestParseTree env = manifest.get("env"); //$NON-NLS-1$
    assertEquals(2, env.getChildren().size());

    assertEquals("base", env.get("TEST").getValue()); //$NON-NLS-1$//$NON-NLS-2$
    assertEquals("overridden", env.get("TEST2").getValue()); //$NON-NLS-1$//$NON-NLS-2$
  }
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.