Package org.eclipse.orion.server.cf.manifest.v2

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


  private static String INCORRECT_MANIFEST_LOCATION = "testData/manifestTest/incorrect"; //$NON-NLS-1$

  private ManifestParseTree parse(InputStream inputStream) throws IOException, TokenizerException, ParserException {
    Preprocessor preprocessor = new ManifestPreprocessor();
    List<InputLine> contents = preprocessor.process(inputStream);
    Tokenizer tokenizer = new ManifestTokenizer(contents);

    Parser parser = new ManifestParser();
    return parser.parse(tokenizer);
  }
View Full Code Here


  }

  private ManifestParseTree parse(InputStream inputStream) throws IOException, TokenizerException, ParserException {
    Preprocessor preprocessor = new ManifestPreprocessor();
    List<InputLine> contents = preprocessor.process(inputStream);
    Tokenizer tokenizer = new ManifestTokenizer(contents);

    Parser parser = new ManifestParser();
    return parser.parse(tokenizer);
  }
View Full Code Here

    File manifestFile = new File(FileLocator.toFileURL(entry).getPath().concat(manifestName));

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

    ManifestTransformator transformator = new ManifestTransformator();
    transformator.apply(manifest);

    ManifestParseTree applications = manifest.get("applications"); //$NON-NLS-1$
    for (ManifestParseTree application : applications.getChildren())
      assertTrue(application.get("propertyA").getValue().equals("valueA") && application.get("propertyB").getValue().equals("valueB")); //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$

    manifestName = "02.yml"; //$NON-NLS-1$
    manifestFile = new File(FileLocator.toFileURL(entry).getPath().concat(manifestName));

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

    transformator = new ManifestTransformator();
    transformator.apply(manifest);

    applications = manifest.get("applications"); //$NON-NLS-1$
    assertEquals("nativeA", applications.get(0).get("A").getValue()); //$NON-NLS-1$//$NON-NLS-2$
    assertEquals("nativeB", applications.get(0).get("B").getValue()); //$NON-NLS-1$//$NON-NLS-2$
    assertEquals("overriddenC", applications.get(0).get("C").getValue()); //$NON-NLS-1$//$NON-NLS-2$
View Full Code Here

    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);
    SymbolResolver resolver = new SymbolResolver("api.sauron.mordor.com"); //$NON-NLS-1$
    resolver.apply(manifest);

    assertEquals("api.sauron.mordor.com", manifest.get("applications").get(0).get("domain").getValue()); //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$
    assertTrue(manifest.get("applications").get(0).get("url").getValue().endsWith(".api.sauron.mordor.com")); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
  }
View Full Code Here

TOP

Related Classes of org.eclipse.orion.server.cf.manifest.v2.ManifestParseTree

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.