예제 #1
0
  private PluggableSCMMaterialConfig toPluggableScmMaterialConfig(
      CRPluggableScmMaterial crPluggableScmMaterial) {
    SCMs scms = getSCMs();
    String id = crPluggableScmMaterial.getScmId();
    SCM scmConfig = scms.find(id);
    if (scmConfig == null)
      throw new ConfigConvertionException(String.format("Failed to find referenced scm '%s'", id));

    return new PluggableSCMMaterialConfig(
        toMaterialName(crPluggableScmMaterial.getName()),
        scmConfig,
        crPluggableScmMaterial.getDirectory(),
        toFilter(crPluggableScmMaterial.getFilterList()));
  }
예제 #2
0
 @Before
 public void setup() throws Exception {
   initMocks(this);
   result = new HttpLocalizedOperationResult();
   currentUser = new Username(new CaseInsensitiveString("user"));
   cruiseConfig = new GoConfigMother().defaultCruiseConfig();
   scm =
       new SCM(
           "id",
           new PluginConfiguration("plugin-id", "1"),
           new Configuration(
               new ConfigurationProperty(
                   new ConfigurationKey("key"), new ConfigurationValue("value"))));
   scm.setName("material");
   scms = new SCMs();
   scms.add(scm);
   cruiseConfig.setSCMs(scms);
 }