Package hudson.plugins.scm_sync_configuration.scms

Examples of hudson.plugins.scm_sync_configuration.scms.SCM


  protected SCM createSCMMock(){
    return createSCMMock(getSCMRepositoryURL());
  }
 
  protected SCM createSCMMock(String url){
    SCM mockedSCM = spy(SCM.valueOf(getSCMClass().getName()));
   
    if(scmUnderTest.useCredentials()){
      SCMCredentialConfiguration mockedCredential = new SCMCredentialConfiguration("toto");
      PowerMockito.doReturn(mockedCredential).when(mockedSCM).extractScmCredentials((String)Mockito.notNull());
    }
View Full Code Here


  public void shouldCurrentVersionPluginConfigurationMigrationBeIdemPotent() throws Throwable {
    ScmSyncConfigurationPlugin plugin = ScmSyncConfigurationPlugin.getInstance();
   
    // Plugin has been loaded : let's record scm & repository url
    String expectedRepositoryUrl = plugin.getScmRepositoryUrl();
    SCM expectedScm = plugin.getSCM();
   
    // Persisting data
    mockStatic(SaveableListener.class);
    doNothing().when(SaveableListener.class); SaveableListener.fireOnChange((Saveable)notNull(), (XmlFile)notNull());
    plugin.save();
   
    // Then reloading it...
    PluginUtil.loadPlugin(plugin);
   
    // Verifying repositoryUrl & SCM
    assertThat(plugin.getSCM().getId(), is(equalTo(expectedScm.getId())));
    assertThat(plugin.getScmRepositoryUrl(), is(equalTo(expectedRepositoryUrl)));
  }
View Full Code Here

  public void should0_0_3_pluginConfigurationMigrationBeIdemPotent() throws Throwable {
    ScmSyncConfigurationPlugin plugin = ScmSyncConfigurationPlugin.getInstance();
   
    // Plugin has been loaded : let's record scm & repository url
    String expectedRepositoryUrl = plugin.getScmRepositoryUrl();
    SCM expectedScm = plugin.getSCM();
   
    // Persisting data
    mockStatic(SaveableListener.class);
    doNothing().when(SaveableListener.class); SaveableListener.fireOnChange((Saveable)notNull(), (XmlFile)notNull());
    plugin.save();
   
    // Then reloading it...
    PluginUtil.loadPlugin(plugin);
   
    // Verifying repositoryUrl & SCM
    assertThat(plugin.getSCM().getId(), is(equalTo(expectedScm.getId())));
    assertThat(plugin.getScmRepositoryUrl(), is(equalTo(expectedRepositoryUrl)));
  }
View Full Code Here

  public void should0_0_2_pluginConfigurationMigrationBeIdemPotent() throws Throwable {
    ScmSyncConfigurationPlugin plugin = ScmSyncConfigurationPlugin.getInstance();
   
    // Plugin has been loaded : let's record scm & repository url
    String expectedRepositoryUrl = plugin.getScmRepositoryUrl();
    SCM expectedScm = plugin.getSCM();
   
    // Persisting data
    mockStatic(SaveableListener.class);
    doNothing().when(SaveableListener.class); SaveableListener.fireOnChange((Saveable)notNull(), (XmlFile)notNull());
    plugin.save();
   
    // Then reloading it...
    PluginUtil.loadPlugin(plugin);
   
    // Verifying repositoryUrl & SCM
    assertThat(plugin.getSCM().getId(), is(equalTo(expectedScm.getId())));
    assertThat(plugin.getScmRepositoryUrl(), is(equalTo(expectedRepositoryUrl)));
  }
View Full Code Here

   * @param resetScmRepository
   * @return
   */
  public boolean scmConfigurationSettledUp(ScmContext scmContext, boolean resetScmRepository){
    String scmRepositoryUrl = scmContext.getScmRepositoryUrl();
    SCM scm = scmContext.getScm();
    if(scmRepositoryUrl == null || scm == null){
      return false;
    }
   
    if(resetScmRepository){
      LOGGER.info("Creating scmRepository connection data ..");
      this.scmRepository = scm.getConfiguredRepository(this.scmManager, scmRepositoryUrl);
      try {
        this.scmSpecificFilename = this.scmManager.getProviderByRepository(this.scmRepository).getScmSpecificFilename();
      }
      catch(NoSuchScmProviderException e) {
        LOGGER.throwing(ScmManager.class.getName(), "getScmSpecificFilename", e);
View Full Code Here

TOP

Related Classes of hudson.plugins.scm_sync_configuration.scms.SCM

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.