code
stringlengths
23
201k
docstring
stringlengths
17
96.2k
func_name
stringlengths
0
235
language
stringclasses
1 value
repo
stringlengths
8
72
path
stringlengths
11
317
url
stringlengths
57
377
license
stringclasses
7 values
@Override public ServerHealthState success(HealthStateType healthStateType) { return kickMe(ServerHealthState.success(healthStateType), true); }
Understands how to report results of common operations to the user
success
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
Apache-2.0
@Override public ServerHealthState forbidden(String message, String description, HealthStateType id) { throw new RuntimeException("Not yet implemented"); }
Understands how to report results of common operations to the user
forbidden
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
Apache-2.0
@Override public void conflict(String message, String description, HealthStateType healthStateType) { throw new RuntimeException("Not yet implemented"); }
Understands how to report results of common operations to the user
conflict
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
Apache-2.0
@Override public void notFound(String message, String description, HealthStateType healthStateType) { throw new RuntimeException("Not yet implemented"); }
Understands how to report results of common operations to the user
notFound
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
Apache-2.0
@Override public void accepted(String message, String description, HealthStateType healthStateType) { throw new RuntimeException("Not yet implemented"); }
Understands how to report results of common operations to the user
accepted
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
Apache-2.0
@Override public void ok(String message) { throw new RuntimeException("Not yet implemented"); }
Understands how to report results of common operations to the user
ok
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
Apache-2.0
@Override public void notAcceptable(String message, final HealthStateType type) { throw new RuntimeException("Not yet implemented"); }
Understands how to report results of common operations to the user
notAcceptable
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
Apache-2.0
@Override public void internalServerError(String message, HealthStateType type) { throw new RuntimeException("Not yet implemented"); }
Understands how to report results of common operations to the user
internalServerError
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
Apache-2.0
@Override public void insufficientStorage(String message, String description, HealthStateType type) { error(message, description, type); }
Understands how to report results of common operations to the user
insufficientStorage
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
Apache-2.0
@Override public void notAcceptable(String message, String description, final HealthStateType type) { throw new RuntimeException("Not yet implemented"); }
Understands how to report results of common operations to the user
notAcceptable
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
Apache-2.0
@Override public void unprocessableEntity(String message, String description, HealthStateType healthStateType) { error(message, description, healthStateType); }
Understands how to report results of common operations to the user
unprocessableEntity
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
Apache-2.0
@Override public void badRequest(String message, String description, HealthStateType healthStateType) { error(message, description, healthStateType); }
Understands how to report results of common operations to the user
badRequest
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthServiceUpdatingOperationResult.java
Apache-2.0
@Override public double priority() { return 6.0; }
Understands Dumping all the server health messages
priority
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/support/ServerHealthInformationProvider.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/support/ServerHealthInformationProvider.java
Apache-2.0
@Override public Map<String, Object> asJson() { LinkedHashMap<String, Object> json = new LinkedHashMap<>(); ServerHealthStates allLogs = service.logsSorted(); json.put("Messages Count", allLogs.size()); List<Map<String, String>> messages = new ArrayList<>(); for (ServerHealt...
Understands Dumping all the server health messages
asJson
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/support/ServerHealthInformationProvider.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/support/ServerHealthInformationProvider.java
Apache-2.0
@Override public String name() { return "Server Health Information"; }
Understands Dumping all the server health messages
name
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/support/ServerHealthInformationProvider.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/support/ServerHealthInformationProvider.java
Apache-2.0
public FeatureToggles userToggles() { FeatureToggles userToggles = goCache.get(USER_DEF_TOGGLES); if (userToggles != null) { return userToggles; } synchronized (CACHE_ACCESS_MUTEX) { userToggles = goCache.get(USER_DEF_TOGGLES); if (userToggles != null...
All user toggles, not just the ones we know about in available.toggles. Need this to support route toggling where the toggle keys may be dynamically generated. @return all user toggles.
userToggles
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/support/toggle/FeatureToggleService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/support/toggle/FeatureToggleService.java
Apache-2.0
public FeatureToggles allToggles() { FeatureToggles allToggles = goCache.get(KNOWN_TOGGLES); if (allToggles != null) { return allToggles; } synchronized (CACHE_ACCESS_MUTEX) { allToggles = goCache.get(KNOWN_TOGGLES); if (allToggles != null) { ...
All user toggles, not just the ones we know about in available.toggles. Need this to support route toggling where the toggle keys may be dynamically generated. @return all user toggles.
allToggles
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/support/toggle/FeatureToggleService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/support/toggle/FeatureToggleService.java
Apache-2.0
public void changeValueOfToggle(String key, boolean newValue) { if (allToggles().find(key) == null) { throw new RecordNotFoundException(MessageFormat.format("Feature toggle: ''{0}'' is not valid.", key)); } synchronized (CACHE_ACCESS_MUTEX) { repository.changeValueOfTogg...
All user toggles, not just the ones we know about in available.toggles. Need this to support route toggling where the toggle keys may be dynamically generated. @return all user toggles.
changeValueOfToggle
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/support/toggle/FeatureToggleService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/support/toggle/FeatureToggleService.java
Apache-2.0
public void registerListener(String key, FeatureToggleListener listener) { listeners.put(key, listener); listener.toggleChanged(isToggleOn(key)); }
All user toggles, not just the ones we know about in available.toggles. Need this to support route toggling where the toggle keys may be dynamically generated. @return all user toggles.
registerListener
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/service/support/toggle/FeatureToggleService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/service/support/toggle/FeatureToggleService.java
Apache-2.0
@Override public Iterator<JobInstance> iterator() { return jobInstances.iterator(); }
Understands how to represent a paginated list of jobs on the UI
iterator
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/ui/JobInstancesModel.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/ui/JobInstancesModel.java
Apache-2.0
public boolean isEmpty() { return jobInstances.isEmpty(); }
Understands how to represent a paginated list of jobs on the UI
isEmpty
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/ui/JobInstancesModel.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/ui/JobInstancesModel.java
Apache-2.0
public JobInstances getJobInstances() { return jobInstances; }
Understands how to represent a paginated list of jobs on the UI
getJobInstances
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/ui/JobInstancesModel.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/ui/JobInstancesModel.java
Apache-2.0
public Pagination getPagination() { return pagination; }
Understands how to represent a paginated list of jobs on the UI
getPagination
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/ui/JobInstancesModel.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/ui/JobInstancesModel.java
Apache-2.0
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } JobInstancesModel that = (JobInstancesModel) o; if (jobInstances != null ? !jobInstances.equals(that.jo...
Understands how to represent a paginated list of jobs on the UI
equals
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/ui/JobInstancesModel.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/ui/JobInstancesModel.java
Apache-2.0
@Override public int hashCode() { int result = jobInstances != null ? jobInstances.hashCode() : 0; result = 31 * result + (pagination != null ? pagination.hashCode() : 0); return result; }
Understands how to represent a paginated list of jobs on the UI
hashCode
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/ui/JobInstancesModel.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/ui/JobInstancesModel.java
Apache-2.0
public PipelineId getPipelineId() { return pipelineId; }
Understands association of material revisions of a pipeline
getPipelineId
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/ui/ModificationForPipeline.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/ui/ModificationForPipeline.java
Apache-2.0
public Author getAuthor() { return Author.getAuthorInfo(materialType, modification); }
Understands association of material revisions of a pipeline
getAuthor
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/ui/ModificationForPipeline.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/ui/ModificationForPipeline.java
Apache-2.0
@Override public String toString() { return "ModificationForPipeline{" + "pipelineId=" + pipelineId + ", modification=" + modification + '}'; }
Understands association of material revisions of a pipeline
toString
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/ui/ModificationForPipeline.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/ui/ModificationForPipeline.java
Apache-2.0
public String getMaterialFingerprint() { return materialFingerprint; }
Understands association of material revisions of a pipeline
getMaterialFingerprint
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/ui/ModificationForPipeline.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/ui/ModificationForPipeline.java
Apache-2.0
public String getPipelineName() { return pipelineName; }
Understands identifying a pipeline uniquely in both config and db
getPipelineName
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/ui/PipelineId.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/ui/PipelineId.java
Apache-2.0
public Long getPipelineId() { return pipelineId; }
Understands identifying a pipeline uniquely in both config and db
getPipelineId
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/ui/PipelineId.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/ui/PipelineId.java
Apache-2.0
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PipelineId that = (PipelineId) o; if (pipelineId != null ? !pipelineId.equals(that.pipelineId) : that.p...
Understands identifying a pipeline uniquely in both config and db
equals
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/ui/PipelineId.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/ui/PipelineId.java
Apache-2.0
@Override public int hashCode() { int result = pipelineName != null ? pipelineName.hashCode() : 0; result = 31 * result + (pipelineId != null ? pipelineId.hashCode() : 0); return result; }
Understands identifying a pipeline uniquely in both config and db
hashCode
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/ui/PipelineId.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/ui/PipelineId.java
Apache-2.0
@Override public String toString() { return "PipelineId{" + "pipelineName='" + pipelineName + '\'' + ", pipelineId=" + pipelineId + '}'; }
Understands identifying a pipeline uniquely in both config and db
toString
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/ui/PipelineId.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/ui/PipelineId.java
Apache-2.0
public Pagination getPagination() { return pagination; }
Understands how to represent a paginated list of stages with pagination
getPagination
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/ui/StageSummaryModels.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/ui/StageSummaryModels.java
Apache-2.0
public void setPagination(Pagination pagination) { this.pagination = pagination; }
Understands how to represent a paginated list of stages with pagination
setPagination
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/ui/StageSummaryModels.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/ui/StageSummaryModels.java
Apache-2.0
public boolean pastWaitingPeriod() { return (System.currentTimeMillis() - recentOperationTime) > waitFor; }
Understands when an operation was last performed and how long it needs to wait till it retries
pastWaitingPeriod
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/util/LastOperationTime.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/util/LastOperationTime.java
Apache-2.0
public void refresh() { recentOperationTime = System.currentTimeMillis(); }
Understands when an operation was last performed and how long it needs to wait till it retries
refresh
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/util/LastOperationTime.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/util/LastOperationTime.java
Apache-2.0
public static void retry(Predicate<Integer> action, String label, int times, long delay) throws TooManyRetriesException { if (times < 1) { throw new IllegalArgumentException("Retry block must try at least 1 time"); } if (delay < 1) { throw new IllegalArgumentException("M...
Simple retry logic with constant delay period, which retries until {@link Predicate} returns true. If you require a backoff instead of static delay, it should be very easy to implement. @param action {@link Predicate<Integer>} defining the action to perform, taking the attempt number as input @param label a user-defi...
retry
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/util/Retryable.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/util/Retryable.java
Apache-2.0
public File getRootFolder() { return rootFolder; }
This represents a directory tree and is used ONLY to create json and html views
getRootFolder
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/ArtifactFolder.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/ArtifactFolder.java
Apache-2.0
public DirectoryEntries allEntries() { bombUnless(rootFolder.isDirectory(), () -> rootFolder + " is not a folder"); return new DirectoryReader(jobIdentifier).listEntries(rootFolder, relativePath); }
This represents a directory tree and is used ONLY to create json and html views
allEntries
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/ArtifactFolder.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/ArtifactFolder.java
Apache-2.0
@SuppressWarnings("unused") // May be used within FreeMarker templates public String renderArtifactFiles(String requestContext) { HtmlRenderer renderer = new HtmlRenderer(requestContext); allEntries().render(renderer); return renderer.asString(); }
This represents a directory tree and is used ONLY to create json and html views
renderArtifactFiles
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/ArtifactFolder.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/ArtifactFolder.java
Apache-2.0
@Override public List<Map<String, Object>> toJson() { return allEntries().toJson(); }
This represents a directory tree and is used ONLY to create json and html views
toJson
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/ArtifactFolder.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/ArtifactFolder.java
Apache-2.0
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ArtifactFolder that = (ArtifactFolder) o; return Objects.equals(relativePath, that.relativePath) && ...
This represents a directory tree and is used ONLY to create json and html views
equals
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/ArtifactFolder.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/ArtifactFolder.java
Apache-2.0
@Override public int hashCode() { int result; result = (jobIdentifier != null ? jobIdentifier.hashCode() : 0); result = 31 * result + (rootFolder != null ? rootFolder.hashCode() : 0); result = 31 * result + (relativePath != null ? relativePath.hashCode() : 0); return result; ...
This represents a directory tree and is used ONLY to create json and html views
hashCode
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/ArtifactFolder.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/ArtifactFolder.java
Apache-2.0
@Override public String toString() { return "[ArtifactFolder" + " job=" + jobIdentifier + " rootFolder=" + rootFolder + " relativePath=" + relativePath + "]"; }
This represents a directory tree and is used ONLY to create json and html views
toString
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/ArtifactFolder.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/ArtifactFolder.java
Apache-2.0
@Override public int compareTo(ArtifactFolder o) { return Integer.compare(this.hashCode(), o.hashCode()); }
This represents a directory tree and is used ONLY to create json and html views
compareTo
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/ArtifactFolder.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/ArtifactFolder.java
Apache-2.0
@Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { String url = request.getRequestURI(); if (isBackupFinishJsonUrl(url)) { response.setHeader("Cache-Control", "private, max-age=0, n...
Understands redirecting all requests to a service unavailable page when the server is being backed up.
doFilterInternal
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/BackupFilter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/BackupFilter.java
Apache-2.0
private boolean isWhitelisted(HttpServletRequest request) { return REQUESTS_ALLOWED_WHILE_BACKUP_RUNNING_MATCHER.matches(request); }
Understands redirecting all requests to a service unavailable page when the server is being backed up.
isWhitelisted
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/BackupFilter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/BackupFilter.java
Apache-2.0
private String generateHTMLResponse() throws IOException { String path = "/backup_in_progress.html"; try (InputStream resourceAsStream = Objects.requireNonNull(getClass().getResourceAsStream(path))) { return replaceStringLiterals(new String(resourceAsStream.readAllBytes(), UTF_8)); }...
Understands redirecting all requests to a service unavailable page when the server is being backed up.
generateHTMLResponse
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/BackupFilter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/BackupFilter.java
Apache-2.0
String replaceStringLiterals(String content) { return content .replaceAll("%backup_initiated_by%", HtmlUtils.htmlEscape(backupService.backupRunningSinceISO8601().orElse(""))) .replaceAll("%backup_started_by%", HtmlUtils.htmlEscape(backupService.backupStartedBy().orElse(""))); }
Understands redirecting all requests to a service unavailable page when the server is being backed up.
replaceStringLiterals
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/BackupFilter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/BackupFilter.java
Apache-2.0
private boolean isBackupFinishJsonUrl(String url) { return "/go/is_backup_finished.json".equals(url); }
Understands redirecting all requests to a service unavailable page when the server is being backed up.
isBackupFinishJsonUrl
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/BackupFilter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/BackupFilter.java
Apache-2.0
private void generateResponseForIsBackupFinishedAPI(ServletResponse response) { response.setContentType("application/json"); JsonObject json = new JsonObject(); json.addProperty("is_backing_up", backupService.isBackingUp()); try { response.getWriter().print(json); } c...
Understands redirecting all requests to a service unavailable page when the server is being backed up.
generateResponseForIsBackupFinishedAPI
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/BackupFilter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/BackupFilter.java
Apache-2.0
@Override public void destroy() { }
Understands redirecting all requests to a service unavailable page when the server is being backed up.
destroy
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/BackupFilter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/BackupFilter.java
Apache-2.0
@Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { try { FlashMessageService.useFlash(loadFlash(request)); filterChain.doFilter(request, response); } finally { ...
Understands loading flash object from session
doFilterInternal
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/FlashLoadingFilter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/FlashLoadingFilter.java
Apache-2.0
private FlashMessageService.Flash loadFlash(HttpServletRequest req) { HttpSession session = req.getSession(); FlashMessageService.Flash flash = (FlashMessageService.Flash) session.getAttribute(FLASH_SESSION_KEY); if (flash == null) { flash = new FlashMessageService.Flash(); ...
Understands loading flash object from session
loadFlash
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/FlashLoadingFilter.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/FlashLoadingFilter.java
Apache-2.0
public String add(FlashMessageModel message) { String key = UUID.randomUUID().toString(); getFlash().put(key, message); return key; }
Understands persisting and retrieving messages from flash(session store, but deleted on read)
add
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/FlashMessageService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/FlashMessageService.java
Apache-2.0
private Flash getFlash() { Flash flash = requestFlash.get(); if (flash == null) { throw new NullPointerException("No flash context found, this call should only be made within a request."); } return flash; }
Understands persisting and retrieving messages from flash(session store, but deleted on read)
getFlash
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/FlashMessageService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/FlashMessageService.java
Apache-2.0
public FlashMessageModel get(String key) { return getFlash().get(key); }
Understands persisting and retrieving messages from flash(session store, but deleted on read)
get
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/FlashMessageService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/FlashMessageService.java
Apache-2.0
public void put(String key, FlashMessageModel message) { messages.put(key, message); }
Understands persisting and retrieving messages from flash(session store, but deleted on read)
put
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/FlashMessageService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/FlashMessageService.java
Apache-2.0
public FlashMessageModel get(String key) { return messages.remove(key); }
Understands persisting and retrieving messages from flash(session store, but deleted on read)
get
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/FlashMessageService.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/FlashMessageService.java
Apache-2.0
@Override public Object put(String s, Object json) { throw bomb("This is a fake map with a single list element"); }
ModelAndView object requires a Map. This will fake a map when all we care about is a list
put
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/JsonFakeMap.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/JsonFakeMap.java
Apache-2.0
@Override public void putAll(Map<? extends String, ?> map) { throw bomb("This is a fake map with a single list element"); }
ModelAndView object requires a Map. This will fake a map when all we care about is a list
putAll
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/JsonFakeMap.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/JsonFakeMap.java
Apache-2.0
@Override public Object get(Object o) { if (json instanceof JsonAware){ return ((JsonAware) json).toJson(); } return json; }
ModelAndView object requires a Map. This will fake a map when all we care about is a list
get
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/web/JsonFakeMap.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/web/JsonFakeMap.java
Apache-2.0
@Override public void init() throws ServletException { WebApplicationContext wac = WebApplicationContextUtils.getWebApplicationContext(getServletContext()); socketCreator = wac.getBean(ConsoleLogSocketCreator.class); securityService = wac.getBean(SecurityService.class); super.init(...
Handles upgrade request for console log WebSocket connections. Validates that user is authorized to view the pipeline.
init
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/websocket/ConsoleLogSocketServlet.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/websocket/ConsoleLogSocketServlet.java
Apache-2.0
@Override public void configure(JettyWebSocketServletFactory factory) { factory.setCreator(socketCreator); }
Handles upgrade request for console log WebSocket connections. Validates that user is authorized to view the pipeline.
configure
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/websocket/ConsoleLogSocketServlet.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/websocket/ConsoleLogSocketServlet.java
Apache-2.0
@Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Username userName = SessionUtils.currentUsername(); String pipeline = pipeline(request); if (authorizedToViewPipeline(userName, pipeline)) { super.se...
Handles upgrade request for console log WebSocket connections. Validates that user is authorized to view the pipeline.
service
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/websocket/ConsoleLogSocketServlet.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/websocket/ConsoleLogSocketServlet.java
Apache-2.0
private boolean authorizedToViewPipeline(Username username, String pipelineName) { return securityService.hasViewPermissionForPipeline(username, pipelineName); }
Handles upgrade request for console log WebSocket connections. Validates that user is authorized to view the pipeline.
authorizedToViewPipeline
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/websocket/ConsoleLogSocketServlet.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/websocket/ConsoleLogSocketServlet.java
Apache-2.0
private String pipeline(HttpServletRequest request) { return request.getPathInfo().split("/")[1]; }
Handles upgrade request for console log WebSocket connections. Validates that user is authorized to view the pipeline.
pipeline
java
gocd/gocd
server/src/main/java/com/thoughtworks/go/server/websocket/ConsoleLogSocketServlet.java
https://github.com/gocd/gocd/blob/master/server/src/main/java/com/thoughtworks/go/server/websocket/ConsoleLogSocketServlet.java
Apache-2.0
@BeforeEach public void setup() throws Exception { configHelper.initializeConfigFile(); }
there is a risk that dao will misbehave when config is merged with remotes Which is why this tests run on merged configuration confirming that case that executes on sole file passes here as well.
setup
java
gocd/gocd
server/src/test-fast/java/com/thoughtworks/go/config/GoConfigDaoMergedTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-fast/java/com/thoughtworks/go/config/GoConfigDaoMergedTest.java
Apache-2.0
@BeforeEach public void setUp() { when(systemEnvironment.isFetchArtifactTemplateAutoSuggestEnabled()).thenReturn(true); when(systemEnvironment.get(SystemEnvironment.FETCH_ARTIFACT_AUTO_SUGGEST)).thenReturn(true); PipelineConfig random = PipelineConfigMother.pipelineConfig("random_pipeline"...
PIPELINES + TEMPLATE + random_other + [mingle] + + template-1 random_pipe...
setUp
java
gocd/gocd
server/src/test-fast/java/com/thoughtworks/go/server/presentation/FetchArtifactViewHelperTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-fast/java/com/thoughtworks/go/server/presentation/FetchArtifactViewHelperTest.java
Apache-2.0
@Test public void shouldNotSuggestIfTurnedOff() { when(systemEnvironment.get(SystemEnvironment.FETCH_ARTIFACT_AUTO_SUGGEST)).thenReturn(false); Map<CaseInsensitiveString, Map<CaseInsensitiveString, ?>> jobForFetchHierarchy = new FetchArtifactViewHelper(systemEnvironment, cruiseConfig, new CaseInsen...
PIPELINES + TEMPLATE + random_other + [mingle] + + template-1 random_pipe...
shouldNotSuggestIfTurnedOff
java
gocd/gocd
server/src/test-fast/java/com/thoughtworks/go/server/presentation/FetchArtifactViewHelperTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-fast/java/com/thoughtworks/go/server/presentation/FetchArtifactViewHelperTest.java
Apache-2.0
@Test public void shouldNotSuggestForTemplatesIfToggleIsTurnedOff() { when(systemEnvironment.get(SystemEnvironment.FETCH_ARTIFACT_AUTO_SUGGEST)).thenReturn(true); when(systemEnvironment.isFetchArtifactTemplateAutoSuggestEnabled()).thenReturn(false); Map<CaseInsensitiveString, Map<CaseInsensi...
PIPELINES + TEMPLATE + random_other + [mingle] + + template-1 random_pipe...
shouldNotSuggestForTemplatesIfToggleIsTurnedOff
java
gocd/gocd
server/src/test-fast/java/com/thoughtworks/go/server/presentation/FetchArtifactViewHelperTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-fast/java/com/thoughtworks/go/server/presentation/FetchArtifactViewHelperTest.java
Apache-2.0
@Test public void shouldSuggest_AncestorFetch_validForFetchArtifactCall_fromLocalPipeline() { Map<CaseInsensitiveString, Map<CaseInsensitiveString, ?>> jobForFetchHierarchy = new FetchArtifactViewHelper(systemEnvironment, cruiseConfig, new CaseInsensitiveString("uppest"), new CaseInsensitiveString("uppest_s...
PIPELINES + TEMPLATE + random_other + [mingle] + + template-1 random_pipe...
shouldSuggest_AncestorFetch_validForFetchArtifactCall_fromLocalPipeline
java
gocd/gocd
server/src/test-fast/java/com/thoughtworks/go/server/presentation/FetchArtifactViewHelperTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-fast/java/com/thoughtworks/go/server/presentation/FetchArtifactViewHelperTest.java
Apache-2.0
@Test public void shouldSuggest_AncestorFetch_validForFetchArtifactCall_fromDirectUpstream() { Map<CaseInsensitiveString, Map<CaseInsensitiveString, ?>> jobForFetchHierarchy = new FetchArtifactViewHelper(systemEnvironment, cruiseConfig, new CaseInsensitiveString("upper"), new CaseInsensitiveString("upper_st...
PIPELINES + TEMPLATE + random_other + [mingle] + + template-1 random_pipe...
shouldSuggest_AncestorFetch_validForFetchArtifactCall_fromDirectUpstream
java
gocd/gocd
server/src/test-fast/java/com/thoughtworks/go/server/presentation/FetchArtifactViewHelperTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-fast/java/com/thoughtworks/go/server/presentation/FetchArtifactViewHelperTest.java
Apache-2.0
@Test public void shouldSuggest_AncestorFetch_validForFetchArtifactCall_fromAncestorUpstream() { Map<CaseInsensitiveString, Map<CaseInsensitiveString, ?>> jobForFetchHierarchy = new FetchArtifactViewHelper(systemEnvironment, cruiseConfig, new CaseInsensitiveString("downest"), new CaseInsensitiveString("down...
PIPELINES + TEMPLATE + random_other + [mingle] + + template-1 random_pipe...
shouldSuggest_AncestorFetch_validForFetchArtifactCall_fromAncestorUpstream
java
gocd/gocd
server/src/test-fast/java/com/thoughtworks/go/server/presentation/FetchArtifactViewHelperTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-fast/java/com/thoughtworks/go/server/presentation/FetchArtifactViewHelperTest.java
Apache-2.0
@Test public void shouldSuggest_AncestorFetch_validForFetchArtifactCall_fromAncestorUpstream_withMultiplePathsToSameDestination() { Map<CaseInsensitiveString, Map<CaseInsensitiveString, ?>> jobForFetchHierarchy = new FetchArtifactViewHelper(systemEnvironment, cruiseConfig, new CaseInsensitiveString("downest...
PIPELINES + TEMPLATE + random_other + [mingle] + + template-1 random_pipe...
shouldSuggest_AncestorFetch_validForFetchArtifactCall_fromAncestorUpstream_withMultiplePathsToSameDestination
java
gocd/gocd
server/src/test-fast/java/com/thoughtworks/go/server/presentation/FetchArtifactViewHelperTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-fast/java/com/thoughtworks/go/server/presentation/FetchArtifactViewHelperTest.java
Apache-2.0
@Test public void shouldSuggest_AllPathsInEntireConfigDependencyGraph_fromAnyStageToAnyUpstreamStage() { Map<CaseInsensitiveString, Map<CaseInsensitiveString, ?>> jobForFetchHierarchy = new FetchArtifactViewHelper(systemEnvironment, cruiseConfig, new CaseInsensitiveString("template-1"), new CaseInsensitiveS...
PIPELINES + TEMPLATE + random_other + [mingle] + + template-1 random_pipe...
shouldSuggest_AllPathsInEntireConfigDependencyGraph_fromAnyStageToAnyUpstreamStage
java
gocd/gocd
server/src/test-fast/java/com/thoughtworks/go/server/presentation/FetchArtifactViewHelperTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-fast/java/com/thoughtworks/go/server/presentation/FetchArtifactViewHelperTest.java
Apache-2.0
@Test public void shouldProvideNoAutoSuggestionWhenThereIsOnlyOneTemplateAndAPipelineIsUsingThatTemplate() { when(systemEnvironment.isFetchArtifactTemplateAutoSuggestEnabled()).thenReturn(true); when(systemEnvironment.get(SystemEnvironment.FETCH_ARTIFACT_AUTO_SUGGEST)).thenReturn(true); cru...
PIPELINES + TEMPLATE + random_other + [mingle] + + template-1 random_pipe...
shouldProvideNoAutoSuggestionWhenThereIsOnlyOneTemplateAndAPipelineIsUsingThatTemplate
java
gocd/gocd
server/src/test-fast/java/com/thoughtworks/go/server/presentation/FetchArtifactViewHelperTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-fast/java/com/thoughtworks/go/server/presentation/FetchArtifactViewHelperTest.java
Apache-2.0
@Test public void shouldProvideAutoSuggestionForTemplateOfPipelinesWhichAreNotUsingThatTemplate() { when(systemEnvironment.isFetchArtifactTemplateAutoSuggestEnabled()).thenReturn(true); when(systemEnvironment.get(SystemEnvironment.FETCH_ARTIFACT_AUTO_SUGGEST)).thenReturn(true); cruiseConfig...
PIPELINES + TEMPLATE + random_other + [mingle] + + template-1 random_pipe...
shouldProvideAutoSuggestionForTemplateOfPipelinesWhichAreNotUsingThatTemplate
java
gocd/gocd
server/src/test-fast/java/com/thoughtworks/go/server/presentation/FetchArtifactViewHelperTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-fast/java/com/thoughtworks/go/server/presentation/FetchArtifactViewHelperTest.java
Apache-2.0
@Override public void checkClientTrusted(X509Certificate[] certificates, String string) throws CertificateException { this.standardTrustManager.checkClientTrusted(certificates, string); }
From https://github.com/test-load-balancer/tlb (pre http-components) e19d4911b089eeaf1a2c
checkClientTrusted
java
gocd/gocd
server/src/test-fast/java/com/thoughtworks/go/server/web/PermissiveX509TrustManager.java
https://github.com/gocd/gocd/blob/master/server/src/test-fast/java/com/thoughtworks/go/server/web/PermissiveX509TrustManager.java
Apache-2.0
@Override public void checkServerTrusted(X509Certificate[] certificates, String string) throws CertificateException { if ((certificates != null) && (certificates.length == 1)) { X509Certificate certificate = certificates[0]; try { certificate.checkValidity(); ...
From https://github.com/test-load-balancer/tlb (pre http-components) e19d4911b089eeaf1a2c
checkServerTrusted
java
gocd/gocd
server/src/test-fast/java/com/thoughtworks/go/server/web/PermissiveX509TrustManager.java
https://github.com/gocd/gocd/blob/master/server/src/test-fast/java/com/thoughtworks/go/server/web/PermissiveX509TrustManager.java
Apache-2.0
@Override public X509Certificate[] getAcceptedIssuers() { return this.standardTrustManager.getAcceptedIssuers(); }
From https://github.com/test-load-balancer/tlb (pre http-components) e19d4911b089eeaf1a2c
getAcceptedIssuers
java
gocd/gocd
server/src/test-fast/java/com/thoughtworks/go/server/web/PermissiveX509TrustManager.java
https://github.com/gocd/gocd/blob/master/server/src/test-fast/java/com/thoughtworks/go/server/web/PermissiveX509TrustManager.java
Apache-2.0
@Override public long stream(Consumer<String> action) { // this is necessary for showing no logs has been missed out even after job completion if(mockedLines.length <= count) { return mockedLines.length; } action.accept(mockedLines[count]); ...
allows us to simulate log appending by doing reads with multiple invocations to stream()
stream
java
gocd/gocd
server/src/test-fast/java/com/thoughtworks/go/server/websocket/ConsoleLogSenderTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-fast/java/com/thoughtworks/go/server/websocket/ConsoleLogSenderTest.java
Apache-2.0
@Override public long totalLinesConsumed() { return count; }
allows us to simulate log appending by doing reads with multiple invocations to stream()
totalLinesConsumed
java
gocd/gocd
server/src/test-fast/java/com/thoughtworks/go/server/websocket/ConsoleLogSenderTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-fast/java/com/thoughtworks/go/server/websocket/ConsoleLogSenderTest.java
Apache-2.0
@Override public void close() { }
allows us to simulate log appending by doing reads with multiple invocations to stream()
close
java
gocd/gocd
server/src/test-fast/java/com/thoughtworks/go/server/websocket/ConsoleLogSenderTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-fast/java/com/thoughtworks/go/server/websocket/ConsoleLogSenderTest.java
Apache-2.0
@Test public void shouldCreateWork_withAncestorFetchArtifactCalls_resolvedToRelevantStage() { configHelper.addPipeline("uppest", "uppest-stage"); configHelper.addStageToPipeline("uppest", "uppest-stage-2"); PipelineConfig uppest = configHelper.addStageToPipeline("uppest", "uppest-stage-3"); ...
(uppest/2/uppest-stage/1) |------------------> upper-peer ------- | ...................................|............................................... | . | . [ uppest-stage ............................|...................... {bar.zip u...
shouldCreateWork_withAncestorFetchArtifactCalls_resolvedToRelevantStage
java
gocd/gocd
server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
Apache-2.0
private BuildCause buildCauseForDependency(DependencyMaterial material, Stage upstreamStage) { return BuildCause.createManualForced(new MaterialRevisions(materialRevisionForDownstream(material, upstreamStage)), loserUser); }
(uppest/2/uppest-stage/1) |------------------> upper-peer ------- | ...................................|............................................... | . | . [ uppest-stage ............................|...................... {bar.zip u...
buildCauseForDependency
java
gocd/gocd
server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
Apache-2.0
private MaterialRevision materialRevisionForDownstream(DependencyMaterial material, Stage upstreamStage) { StageIdentifier identifier = upstreamStage.getIdentifier(); String rev = identifier.getStageLocator(); String pipelineLabel = identifier.getPipelineLabel(); return new MaterialRevis...
(uppest/2/uppest-stage/1) |------------------> upper-peer ------- | ...................................|............................................... | . | . [ uppest-stage ............................|...................... {bar.zip u...
materialRevisionForDownstream
java
gocd/gocd
server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
Apache-2.0
private AgentIdentifier agent(Agent agent) { agentService.saveOrUpdate(agent); return agentService.findAgent(agent.getUuid()).getAgentIdentifier(); }
(uppest/2/uppest-stage/1) |------------------> upper-peer ------- | ...................................|............................................... | . | . [ uppest-stage ............................|...................... {bar.zip u...
agent
java
gocd/gocd
server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
Apache-2.0
@Test public void shouldNotScheduleIfAgentDoesNotHaveResources() { JobConfig plan = evolveConfig.findBy(new CaseInsensitiveString(STAGE_NAME)).jobConfigByInstanceName("unit", true); plan.addResourceConfig("some-resource"); scheduleHelper.schedule(evolveConfig, modifySomeFiles(evolveConfig),...
(uppest/2/uppest-stage/1) |------------------> upper-peer ------- | ...................................|............................................... | . | . [ uppest-stage ............................|...................... {bar.zip u...
shouldNotScheduleIfAgentDoesNotHaveResources
java
gocd/gocd
server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
Apache-2.0
@Test public void shouldNotScheduleIfAgentDoesNotHaveMatchingResources() { JobConfig plan = evolveConfig.findBy(new CaseInsensitiveString(STAGE_NAME)).jobConfigByInstanceName("unit", true); plan.addResourceConfig("some-resource"); scheduleHelper.schedule(evolveConfig, modifySomeFiles(evolve...
(uppest/2/uppest-stage/1) |------------------> upper-peer ------- | ...................................|............................................... | . | . [ uppest-stage ............................|...................... {bar.zip u...
shouldNotScheduleIfAgentDoesNotHaveMatchingResources
java
gocd/gocd
server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
Apache-2.0
@Test public void shouldScheduleIfAgentMatchingResources() { JobConfig jobConfig = evolveConfig.findBy(new CaseInsensitiveString(STAGE_NAME)).jobConfigByInstanceName("unit", true); jobConfig.addResourceConfig("some-resource"); scheduleHelper.schedule(evolveConfig, modifySomeFiles(evolveConf...
(uppest/2/uppest-stage/1) |------------------> upper-peer ------- | ...................................|............................................... | . | . [ uppest-stage ............................|...................... {bar.zip u...
shouldScheduleIfAgentMatchingResources
java
gocd/gocd
server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
Apache-2.0
@Test public void shouldNotScheduleJobsDuringServerMaintenanceMode() { maintenanceModeService.update(new ServerMaintenanceMode(true, "admin", new Date())); JobConfig jobConfig = evolveConfig.findBy(new CaseInsensitiveString(STAGE_NAME)).jobConfigByInstanceName("unit", true); jobConfig.addRe...
(uppest/2/uppest-stage/1) |------------------> upper-peer ------- | ...................................|............................................... | . | . [ uppest-stage ............................|...................... {bar.zip u...
shouldNotScheduleJobsDuringServerMaintenanceMode
java
gocd/gocd
server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
Apache-2.0
@Test public void shouldReScheduleToCorrectAgent() { JobConfig plan = evolveConfig.findBy(new CaseInsensitiveString(STAGE_NAME)).jobConfigByInstanceName("unit", true); plan.addResourceConfig("some-resource"); scheduleHelper.schedule(evolveConfig, modifySomeFiles(evolveConfig), DEFAULT_APPRO...
(uppest/2/uppest-stage/1) |------------------> upper-peer ------- | ...................................|............................................... | . | . [ uppest-stage ............................|...................... {bar.zip u...
shouldReScheduleToCorrectAgent
java
gocd/gocd
server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
Apache-2.0
@Test public void shouldRemoveAllJobPlansThatAreNotInConfig() { CruiseConfig oldConfig = goConfigService.getCurrentConfig(); ScheduleTestUtil.AddedPipeline p1 = u.saveConfigWith("p1", "s1", u.m(new HgMaterial("hg", null))); Pipeline p1_1 = instanceFactory.createPipelineInstance(p1.config, mo...
(uppest/2/uppest-stage/1) |------------------> upper-peer ------- | ...................................|............................................... | . | . [ uppest-stage ............................|...................... {bar.zip u...
shouldRemoveAllJobPlansThatAreNotInConfig
java
gocd/gocd
server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
Apache-2.0
@Test public void shouldCancelAScheduledJobInCaseStageHasBeenRenamed() { Material hgMaterial = new HgMaterial("url", "folder"); String[] hgRevs = new String[]{"h1"}; u.checkinInOrder(hgMaterial, hgRevs); ScheduleTestUtil.AddedPipeline p1 = u.saveConfigWith("PIPELINE_WHICH_WILL_EVENT...
(uppest/2/uppest-stage/1) |------------------> upper-peer ------- | ...................................|............................................... | . | . [ uppest-stage ............................|...................... {bar.zip u...
shouldCancelAScheduledJobInCaseStageHasBeenRenamed
java
gocd/gocd
server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
Apache-2.0
@Test public void shouldNotCancelAScheduledJobInCaseThePipelineAndStageHaveBeenRenamedWithADifferentCase() { Material hgMaterial = new HgMaterial("url", "folder"); String[] hgRevs = new String[]{"h1"}; u.checkinInOrder(hgMaterial, hgRevs); ScheduleTestUtil.AddedPipeline p1 = u.saveC...
(uppest/2/uppest-stage/1) |------------------> upper-peer ------- | ...................................|............................................... | . | . [ uppest-stage ............................|...................... {bar.zip u...
shouldNotCancelAScheduledJobInCaseThePipelineAndStageHaveBeenRenamedWithADifferentCase
java
gocd/gocd
server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
Apache-2.0
private JobInstance buildOf(Pipeline pipeline) { return pipeline.getStages().first().getJobInstances().first(); }
(uppest/2/uppest-stage/1) |------------------> upper-peer ------- | ...................................|............................................... | . | . [ uppest-stage ............................|...................... {bar.zip u...
buildOf
java
gocd/gocd
server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-integration/java/com/thoughtworks/go/server/service/BuildAssignmentServiceIntegrationTest.java
Apache-2.0
@Test public void shouldNotGetModificationWhenCheckInFilesInIgnoredList() throws Exception { prepareAPipelineWithHistory(); checkInFiles("helper/resources/images/cruise/StageActivity.png", "helper/topics/upgrading_go.xml", "helper/topics/whats_new_in_go.xml"); ...
/*.*"))); workingFolder = TempDirUtils.createTempDirectoryIn(tempDir, "workingFolder").toFile(); outputStreamConsumer = inMemoryConsumer(); mingleConfig = configHelper.addPipeline("cruise", STAGE_NAME, this.hgMaterial.config(), "unit", "functional"); } @AfterEach public void teardow...
shouldNotGetModificationWhenCheckInFilesInIgnoredList
java
gocd/gocd
server/src/test-integration/java/com/thoughtworks/go/server/service/BuildCauseProducerServiceIntegrationHgTest.java
https://github.com/gocd/gocd/blob/master/server/src/test-integration/java/com/thoughtworks/go/server/service/BuildCauseProducerServiceIntegrationHgTest.java
Apache-2.0