Пример #1
0
  @Test
  public void testCompareRemoteRevisionWithAllExcluded() throws IOException, InterruptedException {
    CVSSCM scm =
        new CVSSCM(
            CVSROOT,
            "module",
            BRANCH,
            null,
            true,
            true,
            false,
            "src/main/web/.*\\.java\nsrc/main/web/.*\\.xml") {
          @Override
          List<String> update(
              ModuleLocation moduleLocation,
              boolean dryRun,
              Launcher launcher,
              FilePath workspace,
              TaskListener listener,
              Date date)
              throws IOException, InterruptedException {
            return newArrayList("src/main/web/pom.xml", "src/main/web/Test2.java");
          }

          @Override
          String isUpdatable(ModuleLocation location, FilePath dir)
              throws IOException, InterruptedException {
            return null;
          }
        };
    PollingResult result = scm.compareRemoteRevisionWith(null, null, null, null, null);
    assertEquals(result, PollingResult.NO_CHANGES);
  }
Пример #2
0
 @Test
 public void testLegacy() {
   CVSSCM scm = new CVSSCM(CVSROOT, "module", BRANCH, null, true, true, false, null);
   // there are 1 modules, but enabled legacy mode
   assertFalse(scm.isFlatten());
   assertTrue(scm.isLegacy());
   assertEquals(scm.getModuleLocations().length, 1);
 }
Пример #3
0
 @Test
 public void testLegacyGetModuleLocations() {
   CVSSCM scm = new CVSSCM(CVSROOT, MODULES, BRANCH, null, true, false, false, null);
   // there are 3 modules
   assertFalse(scm.isFlatten());
   assertTrue(scm.isLegacy());
   assertEquals(scm.getModuleLocations().length, 1);
 }
Пример #4
0
 @Test
 public void testGetModuleLocations() {
   CVSSCM scm =
       new CVSSCM(
           Arrays.asList(new ModuleLocationImpl(CVSROOT, MODULES, BRANCH, false, LOCAL_DIR)),
           null,
           true,
           false,
           null,
           false);
   // there are 3 modules
   assertFalse(scm.isFlatten());
   assertTrue(scm.isLegacy());
   assertEquals(scm.getModuleLocations().length, 1);
   assertEquals(scm.getAllModules().length, 3);
 }
Пример #5
0
 @Test
 public void testRemoveInvalidEntries() {
   CVSSCM scm = new CVSSCM(null, MODULES, BRANCH, null, true, false, false, null);
   assertEquals(scm.getModuleLocations().length, 0);
 }