@Override public String name() { return "arrayformat-" + Build.getInstance().getVersion() + "-" + Build.getInstance().getShortHash(); }
/* method initializes Issue fields */ private Issue initIssue(HttpServletRequest req, String issueID) throws LogicException { FeatureLogic fl = new FeatureLogic(); IssueLogic il = new IssueLogic(); Project project = new Project(); Build build = new Build(); HttpSession session = req.getSession(false); Member modifiedBy = (Member) session.getAttribute("member"); project.setId(Integer.parseInt(req.getParameter(PARAM_PROJECT))); build.setId(Integer.parseInt(req.getParameter(PARAM_BUILD))); Issue issue = il.issueToView(Integer.parseInt(issueID)); issue.setModifiedBy(modifiedBy); issue.setSummary(req.getParameter(PARAM_SUMMARY)); issue.setDescription(req.getParameter(PARAM_DESC)); issue.setStatus(fl.findFeature(STATUS, Integer.parseInt(req.getParameter(PARAM_STATUS)))); issue.setType(fl.findFeature(TYPE, Integer.parseInt(req.getParameter(PARAM_TYPE)))); issue.setPriority(fl.findFeature(PRIORITY, Integer.parseInt(req.getParameter(PARAM_PRIORITY)))); issue.setProject(project); issue.setBuild(build); if (req.getParameter(PARAM_ASSIGNEE) != null) { Member member = new Member(); member.setId(Integer.parseInt(req.getParameter(PARAM_ASSIGNEE))); issue.setAssignee(member); } return issue; }
@Override public String getEntityDisplayName() { return String.format( "Promotion run %s/%s/%s/%s", build.getBranch().getProject().getName(), build.getBranch().getName(), build.getName(), promotionLevel.getName()); }
protected void createChange(Build build) { try { BuildModel buildModel = build.getModel(); if (buildModel.isStale()) { buildModel.reconciled(buildModel.getDocument()); } BuildEntry buildEntry = (BuildEntry) build.getEntry(fEntry); if (buildEntry == null) buildEntry = new BuildEntry(fEntry, buildModel); if (fToken != null) buildEntry.addToken(fToken); } catch (CoreException e) { } }
@Before public void before() { SecurityService securityService = mock(SecurityService.class); ValidationRunStatusService validationRunStatusService = mock(ValidationRunStatusService.class); structureRepository = mock(StructureRepository.class); EventPostService eventService = mock(EventPostService.class); EventFactory eventFactory = mock(EventFactory.class); ExtensionManager extensionManager = mock(ExtensionManager.class); PropertyService propertyService = mock(PropertyService.class); PredefinedPromotionLevelService predefinedPromotionLevelService = mock(PredefinedPromotionLevelService.class); PredefinedValidationStampService predefinedValidationStampService = mock(PredefinedValidationStampService.class); DecorationService decorationService = mock(DecorationService.class); ProjectFavouriteService projectFavouriteService = mock(ProjectFavouriteService.class); service = new StructureServiceImpl( securityService, eventService, eventFactory, validationRunStatusService, structureRepository, extensionManager, propertyService, predefinedPromotionLevelService, predefinedValidationStampService, decorationService, projectFavouriteService); // Model Project project = Project.of(nd("P", "Project")).withId(ID.of(1)); Branch branch = Branch.of(project, nd("B", "Branch")).withId(ID.of(1)); copper = PromotionLevel.of(branch, nd("COPPER", "")).withId(ID.of(1)); build = Build.of(branch, nd("1", "Build 1"), Signature.of("test")).withId(ID.of(1)); }
private Map<String, Build> buildLastJobResultMap(String[][] datas) { Map<String, Build> expectedJobBuildMap = new HashMap<String, Build>(); for (String[] data : datas) { expectedJobBuildMap.put(data[0], Build.createBuild(data[1], data[2], data[3], "false")); } return expectedJobBuildMap; }
@Override public boolean matches(Build jenkinsBuild) { Date date = new Date(jenkinsBuild.getTimestamp()); if (date.after(start) && date.before(end)) { return true; } return false; }
public Model toMavenModel() { Model model = new Model(); model.setBuild(new Build()); model.setDescription(description); model.setUrl(url); model.setName(projectId.getArtifact()); model.setGroupId(projectId.getGroup()); model.setVersion(projectId.getVersion()); model.setArtifactId(projectId.getArtifact()); model.setModelVersion("4.0.0"); // parent if (parent != null) { model.setParent(parent); } model.setPackaging(packaging); if (properties != null) { Properties modelProperties = new Properties(); for (Property p : properties) { modelProperties.setProperty(p.getKey(), p.getValue()); } model.setProperties(modelProperties); } // Add jar repository urls. if (null != repositories) { for (String repoUrl : repositories.getRepositories()) { Repository repository = new Repository(); repository.setId(Integer.toString(repoUrl.hashCode())); repository.setUrl(repoUrl); model.addRepository(repository); } } // Add dependency management if (overrides != null) { DependencyManagement depMan = new DependencyManagement(); for (Id dep : overrides) { Dependency dependency = new Dependency(); dependency.setGroupId(dep.getGroup()); dependency.setArtifactId(dep.getArtifact()); dependency.setVersion(dep.getVersion()); // JVZ: We need to parse these dependency.setType("jar"); if (null != dep.getClassifier()) { dependency.setClassifier(dep.getClassifier()); } depMan.addDependency(dependency); } model.setDependencyManagement(depMan); } // Add project dependencies. if (deps != null) { for (Id dep : deps) { Dependency dependency = new Dependency(); dependency.setGroupId(dep.getGroup()); dependency.setArtifactId(dep.getArtifact()); dependency.setVersion(dep.getVersion()); // JVZ: We need to parse these dependency.setType("jar"); if (null != dep.getClassifier()) { dependency.setClassifier(dep.getClassifier()); } model.addDependency(dependency); } } if (modules != null) { model.setModules(modules); } if (pluginOverrides != null) { PluginManagement management = new PluginManagement(); management.setPlugins(pluginOverrides); model.getBuild().setPluginManagement(management); } if (plugins != null) { model.getBuild().setPlugins(plugins); } // Optional source dirs customization. if (dirs != null) { Build build = new Build(); String srcDir = dirs.get("src"); String testDir = dirs.get("test"); if (null != srcDir) build.setSourceDirectory(srcDir); if (null != testDir) build.setTestSourceDirectory(testDir); model.setBuild(build); } if (null != scm) { Scm scm = new Scm(); scm.setConnection(this.scm.getConnection()); scm.setDeveloperConnection(this.scm.getDeveloperConnection()); scm.setUrl(this.scm.getUrl()); model.setScm(scm); } return model; }
public Build getBuild() { return Build.getBuild(project); }
public static void main(String[] args) { Build build = JkInit.instanceOf(Build.class, args); build.doDefault(); build.runJar(); }