Package com.google.devtools.moe.client.codebase

Examples of com.google.devtools.moe.client.codebase.Codebase


    expect(fileSystem.isExecutable(f("/codebase/foo"))).andReturn(false);
    expect(fileSystem.isExecutable(f("/writer/foo"))).andReturn(false);
    fileSystem.makeDirsForFile(f("/writer/foo"));
    fileSystem.copyFile(f("/codebase/foo"), f("/writer/foo"));
    control.replay();
    Codebase c = new Codebase(f("/codebase"), "public",
                              e("public", ImmutableMap.<String, String>of()));
    SvnWriter e = new SvnWriter(mockConfig, null, f("/writer"));
    e.putFile("foo", c);
    control.verify();
  }
View Full Code Here


    expect(fileSystem.isExecutable(f("/writer/foo"))).andReturn(false);
    fileSystem.makeDirsForFile(f("/writer/foo"));
    fileSystem.copyFile(f("/codebase/foo"), f("/writer/foo"));
    expectSvnCommand(ImmutableList.of("add", "--parents", "foo"), "/writer", "", cmd);
    control.replay();
    Codebase c = new Codebase(f("/codebase"), "public",
                              e("public", ImmutableMap.<String, String>of()));
    SvnWriter e = new SvnWriter(mockConfig, null, f("/writer"));
    e.putFile("foo", c);
    control.verify();
  }
View Full Code Here

    expectSvnCommand(ImmutableList.of("add", "--parents", "test.html"), "/writer", "", cmd);
    expectSvnCommand(ImmutableList.of("propset", "svn:mime-type", "text/html", "test.html"),
        "/writer", "", cmd);
    control.replay();

    Codebase c = new Codebase(f("/codebase"), "public",
                              e("public", ImmutableMap.<String, String>of()));
    SvnWriter e = new SvnWriter(mockConfig, null, f("/writer"));
    e.putFile("test.html", c);
    control.verify();
  }
View Full Code Here

    expect(fileSystem.isExecutable(f("/writer/foo"))).andReturn(false);
    fileSystem.makeDirsForFile(f("/writer/foo"));
    fileSystem.copyFile(f("/codebase/foo"), f("/writer/foo"));
    expectSvnCommand(ImmutableList.of("propset", "svn:executable", "*", "foo"), "/writer", "", cmd);
    control.replay();
    Codebase c = new Codebase(f("/codebase"), "public",
                              e("public", ImmutableMap.<String, String>of()));
    SvnWriter e = new SvnWriter(mockConfig, null, f("/writer"));
    e.putFile("foo", c);
    control.verify();
  }
View Full Code Here

    expect(fileSystem.isExecutable(f("/writer/foo"))).andReturn(true);
    fileSystem.makeDirsForFile(f("/writer/foo"));
    fileSystem.copyFile(f("/codebase/foo"), f("/writer/foo"));
    expectSvnCommand(ImmutableList.of("propdel", "svn:executable", "foo"), "/writer", "", cmd);
    control.replay();
    Codebase c = new Codebase(
        f("/codebase"), "public",
        e("public", ImmutableMap.<String, String>of()));
    SvnWriter e = new SvnWriter(mockConfig, null, f("/writer"));
    e.putFile("foo", c);
    control.verify();
View Full Code Here

                     "svn propset -r HEAD svn:author \"author\" --revprop",
                     script);
    fileSystem.setExecutable(script);

    control.replay();
    Codebase c = new Codebase(f("/codebase"), "public",
                              e("public", ImmutableMap.<String, String>of()));
    RevisionMetadata rm = new RevisionMetadata("rev1", "author", "data", "desc",
                                               ImmutableList.<Revision>of());
    SvnWriter e = new SvnWriter(mockConfig, null, f("/writer"));
    DraftRevision r = e.putCodebase(c, rm);
View Full Code Here

    // Filter files in the codebase by RepositoryConfig#ignoreFileRes.
    Predicate<CharSequence> nonIgnoredFilePred =
        Utils.nonMatchingPredicateFromRes(headClone.getConfig().getIgnoreFileRes());
    Utils.filterFiles(archiveLocation, nonIgnoredFilePred);

    return new Codebase(
        archiveLocation,
        projectSpace,
        new RepositoryExpression(new Term(headClone.getRepositoryName(), options)));
  }
View Full Code Here

    control = EasyMock.createControl();
    mockFs = control.createMock(FileSystem.class);
    mockCmd = control.createMock(CommandRunner.class);
    AppContext.RUN.cmd = mockCmd;
    AppContext.RUN.fileSystem = mockFs;
    codebase = new Codebase(CODEBASE_ROOT, PROJECT_SPACE, CODEBASE_EXPR);
    mockRevClone = control.createMock(HgClonedRepository.class);
    mockRepoConfig = control.createMock(RepositoryConfig.class);

    expect(mockRevClone.getLocalTempDir()).andReturn(WRITER_ROOT).anyTimes();
    expect(mockRevClone.getConfig()).andReturn(mockRepoConfig).anyTimes();
View Full Code Here

    expect(AppContext.RUN.fileSystem.findFiles(new File("/dummy/path/45")))
        .andReturn(ImmutableSet.<File>of());

    control.replay();
    CodebaseCreator cc = new SvnCodebaseCreator("testing", mockConfig, revisionHistory);
    Codebase r = cc.create(ImmutableMap.of("revision", "46"));
    assertEquals("/dummy/path/45", r.getPath().getAbsolutePath());
    assertEquals("internal", r.getProjectSpace());
    control.verify();
  }
View Full Code Here

    File scrubberRun = new File("/scrubber_run_foo");
    File outputTar = new File(scrubberRun, "scrubbed.tar");
    File codebaseFile = new File("/codebase");
    File expandedDir = new File("/expanded_tar_foo");
   
    Codebase codebase = new Codebase(codebaseFile,
                                     "internal",
                                     null /* CodebaseExpression is not needed here. */);

    Gson gson = ProjectConfig.makeGson();
    JsonObject scrubberConfig = gson.fromJson("{\"foo\":\"bar\"}", JsonObject.class);
View Full Code Here

TOP

Related Classes of com.google.devtools.moe.client.codebase.Codebase

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.