Package hudson

Examples of hudson.XmlFile


   
    sscItemListener.onCreated(mockedItem);
   
    verifyCurrentScmContentMatchesHierarchy("expected-scm-hierarchies/InitRepositoryTest.shouldSynchronizeHudsonFiles/");
   
    sscConfigurationSaveableListener.onChange(mockedItem, new XmlFile(configFile));
   
    verifyCurrentScmContentMatchesHierarchy("expected-scm-hierarchies/HudsonExtensionsTest.shouldJobAddBeCorrectlyImpactedOnSCM/");
   
    assertStatusManagerIsOk();
  }
View Full Code Here


    Item mockedItem = Mockito.mock(TopLevelItem.class);
    when(mockedItem.getRootDir()).thenReturn(jobDirectory);
   
    sscItemListener.onCreated(mockedItem);

    sscConfigurationSaveableListener.onChange(mockedItem, new XmlFile(configFile));
   
    verifyCurrentScmContentMatchesHierarchy("expected-scm-hierarchies/InitRepositoryTest.shouldSynchronizeHudsonFiles/");
   
    FileUtils.copyFile(new ClassPathResource("expected-scm-hierarchies/HudsonExtensionsTest.shouldJobModificationBeCorrectlyImpactedOnSCM/jobs/fakeJob/config.xml").getFile(), configFile);
   
    sscConfigurationSaveableListener.onChange(mockedItem, new XmlFile(configFile));
   
    verifyCurrentScmContentMatchesHierarchy("expected-scm-hierarchies/HudsonExtensionsTest.shouldJobModificationBeCorrectlyImpactedOnSCM/");
   
    assertStatusManagerIsOk();
  }
View Full Code Here

    // Creating fake new job
    Item mockedItem = Mockito.mock(Item.class);
    when(mockedItem.getRootDir()).thenReturn(configFile);

    sscItemListener.onCreated(mockedItem);
    sscConfigurationSaveableListener.onChange(mockedItem, new XmlFile(configFile));

    verifyCurrentScmContentMatchesHierarchy("expected-scm-hierarchies/InitRepositoryTest.shouldSynchronizeHudsonFiles/");

    FileUtils.copyFile(new ClassPathResource("expected-scm-hierarchies/HudsonExtensionsTest.shouldConfigModificationBeCorrectlyImpactedOnSCM/hudson.tasks.Shell.xml").getFile(), configFile);

    sscConfigurationSaveableListener.onChange(mockedItem, new XmlFile(configFile));

    verifyCurrentScmContentMatchesHierarchy("expected-scm-hierarchies/HudsonExtensionsTest.shouldConfigModificationBeCorrectlyImpactedOnSCM/");

    assertStatusManagerIsOk();
  }
View Full Code Here

        // Creating fake new item
        Job mockedItem = Mockito.mock(Job.class);
        when(mockedItem.getRootDir()).thenReturn(subModuleConfigFile.getParentFile());

        sscConfigurationSaveableListener.onChange(mockedItem, new XmlFile(subModuleConfigFile));

    verifyCurrentScmContentMatchesHierarchy("expected-scm-hierarchies/JobConfigScmSyncStrategyTest.shouldConfigInSubmodulesNotSynced/");

    assertStatusManagerIsOk();
    }
View Full Code Here

        Object lock = getFileLockItem(project);
       
        synchronized(lock) {
            if (file.exists()) {
                try {
                    return (List<SubversionSCM.External>) new XmlFile(XSTREAM, file).read();
                } catch (IOException e) {
                    // in < 1.180 this file was a text file, so it may fail to parse as XML,
                    // in which case let's just fall back
                }
            }
View Full Code Here

     */
    public static void writeExternalsFile(Job project, List<SubversionSCM.External> externals) throws IOException {
        Object lock = getFileLockItem(project);
       
        synchronized (lock) {
            new XmlFile(XSTREAM, getExternalsFile(project)).write(externals);
        }
    }
View Full Code Here

    private final Map<String,Credential> credentials = new Hashtable<String,Credential>();
   
    PerJobCredentialStore(AbstractProject<?,?> project) {
        this.project = project;
        // read existing credential
        XmlFile xml = getXmlFile();
        try {
            if (xml.exists())
                xml.unmarshal(this);
        } catch (IOException e) {
            // ignore the failure to unmarshal, or else we'll never get through beyond this point.
            LOGGER.log(INFO,"Failed to retrieve Subversion credentials from "+xml,e);
        }
    }
View Full Code Here

            IS_SAVING.remove();
        }
    }

    private XmlFile getXmlFile() {
        return new XmlFile(new File(project.getRootDir(),"subversion.credentials"));
    }
View Full Code Here

        ensureSerialization("project.ser.xml");
    }

    @Override
    protected XmlFile createXmlFile(final File file) {
        return new XmlFile(XSTREAM, file);
    }
View Full Code Here

    private static XmlFile getConfigFile() throws IOException {
        Jenkins j = Jenkins.getInstance();
        if (j == null) {
            throw new IOException("Jenkins is not running");
        }
        return new XmlFile(new File(j.getRootDir(), StageStep.class.getName() + ".xml"));
    }
View Full Code Here

TOP

Related Classes of hudson.XmlFile

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.