Package com.google.devtools.moe.client.testing

Examples of com.google.devtools.moe.client.testing.FileCodebaseCreator


  /**
   * Confirms that the "create"-method does validate the option list.
   * @throws CodebaseCreationError
   */
  public void testValidationCreate() throws Exception {
    FileCodebaseCreator cc = new FileCodebaseCreator();

    // Validate parameters.
    ImmutableMap<String, String> s;
    try {
      cc.create(ImmutableMap.<String, String>of());
      fail("Method does not check for required options.");
    } catch (CodebaseCreationError expected) {}

    try {
      cc.create(ImmutableMap.<String, String>of("path", "FooBar", "unknown", "123"));
      fail("Method does not check for unsupported options.");
    } catch (MoeProblem expected) {}
  }
View Full Code Here


    String folder = "/foo/bar";
    File fileFolder = new File(folder);
    expectDirCopy(fileFolder, new File("/tmp/copy"));

    control.replay();
    FileCodebaseCreator cc = new FileCodebaseCreator();
    Codebase codebase = cc.create(ImmutableMap.<String, String>of("path", folder));
    assertNotNull(codebase);
    assertEquals("public", codebase.getProjectSpace());
    control.verify();
  }
View Full Code Here

    File fileFolder = new File(folder);

    expectDirCopy(fileFolder, new File("/tmp/copy"));

    control.replay();
    FileCodebaseCreator cc = new FileCodebaseCreator();
    Codebase codebase = cc.create(ImmutableMap.<String, String>of("path", folder,
                                                                 "projectspace", "internal"));
    control.verify();

    assertNotNull(codebase);
    assertEquals("internal", codebase.getProjectSpace());
View Full Code Here

    File copyLocation = new File("/tmp/copy");

    expectDirCopy(fileFolder, copyLocation);

    control.replay();
    FileCodebaseCreator cc = new FileCodebaseCreator();
    File newPath = FileCodebaseCreator.getCodebasePath(fileFolder);
    control.verify();

    assertEquals(newPath, copyLocation);
  }
View Full Code Here

  @Override
  public Codebase createCodebase(ProjectContext context) throws CodebaseCreationError {
    String repositoryName = term.identifier;
    CodebaseCreator cc;
    if (repositoryName.equals("file")) {
      cc = new FileCodebaseCreator();
    } else {
      Repository repo = context.repositories.get(repositoryName);
      if (repo == null) {
        throw new CodebaseCreationError("no repository " + repositoryName);
      }
View Full Code Here

TOP

Related Classes of com.google.devtools.moe.client.testing.FileCodebaseCreator

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.