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
public int httpCode() { return httpCode; }
Understands localized operation result for http
httpCode
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpLocalizedOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpLocalizedOperationResult.java
Apache-2.0
public String message() { return message; }
Understands localized operation result for http
message
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpLocalizedOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpLocalizedOperationResult.java
Apache-2.0
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; HttpLocalizedOperationResult that = (HttpLocalizedOperationResult) o; if (httpCode != that.httpCode) return false; if (healthStateType != null ...
Understands localized operation result for http
equals
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpLocalizedOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpLocalizedOperationResult.java
Apache-2.0
@Override public int hashCode() { int result = message != null ? message.hashCode() : 0; result = 31 * result + (healthStateType != null ? healthStateType.hashCode() : 0); result = 31 * result + httpCode; return result; }
Understands localized operation result for http
hashCode
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpLocalizedOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpLocalizedOperationResult.java
Apache-2.0
@Override public String toString() { return "HttpLocalizedOperationResult{" + "message=" + message + ", healthStateType=" + healthStateType + ", httpCode=" + httpCode + '}'; }
Understands localized operation result for http
toString
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpLocalizedOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpLocalizedOperationResult.java
Apache-2.0
@Override public ServerHealthState success(HealthStateType healthStateType) { return serverHealthStateOperationResult.success(healthStateType); }
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
success
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
@Override public ServerHealthState error(String message, String description, HealthStateType type) { httpCode = 400; this.message = message; return serverHealthStateOperationResult.error(message, description, type); }
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
error
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
@Override public void insufficientStorage(String message, String description, HealthStateType type) { httpCode = 507; this.message = message; serverHealthStateOperationResult.error(message, description, type); }
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
insufficientStorage
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
@Override public void badRequest(String message, String description, HealthStateType healthStateType) { error(message, description, healthStateType); httpCode = 400; }
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
badRequest
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
@Override public void unprocessableEntity(String message, String description, HealthStateType healthStateType) { error(message, description, healthStateType); httpCode = 422; }
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
unprocessableEntity
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
public boolean isSuccess() { return httpCode >= 200 && httpCode <= 299; }
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
isSuccess
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
@Override public ServerHealthState warning(String message, String description, HealthStateType type) { this.message = message; return serverHealthStateOperationResult.warning(message, description, type); }
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
warning
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
@Override public ServerHealthState getServerHealthState() { return serverHealthStateOperationResult.getServerHealthState(); }
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
getServerHealthState
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
@Override public boolean canContinue() { return serverHealthStateOperationResult.canContinue(); }
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
canContinue
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
@Override public ServerHealthState forbidden(String message, String description, HealthStateType id) { this.message = message; httpCode = SC_FORBIDDEN; return serverHealthStateOperationResult.forbidden(message, description, id); }
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
forbidden
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
@Override public void conflict(String message, String description, HealthStateType healthStateType) { serverHealthStateOperationResult.conflict(message, description, healthStateType); this.message = message; httpCode = 409; }
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
conflict
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
@Override public void notFound(String message, String description, HealthStateType healthStateType) { serverHealthStateOperationResult.notFound(message, description, healthStateType); httpCode = 404; this.message = message; }
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
notFound
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
public int httpCode() { return httpCode; }
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
httpCode
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
public String message() { return message; }
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
message
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
@Override public void accepted(String message, String description, HealthStateType healthStateType) { httpCode = 202; this.message = message; }
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
accepted
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
@Override public void ok(String message) { httpCode = 200; this.message = message; }
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
ok
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
@Override public void notAcceptable(String message, final HealthStateType type) { notAcceptable(message, "", type); }
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
notAcceptable
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
@Override public void internalServerError(String message, HealthStateType type) { serverHealthStateOperationResult.internalServerError(message, type); httpCode = 500; this.message = message; }
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
internalServerError
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
@Override public void notAcceptable(String message, String description, final HealthStateType type) { serverHealthStateOperationResult.notAcceptable(message, description, type); httpCode = 406; this.message = message; }
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
notAcceptable
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
public String fullMessage() { ServerHealthState serverHealthState = serverHealthStateOperationResult.getServerHealthState(); String desc = BLANK_STRING; if (serverHealthState != null && !StringUtils.equals(serverHealthState.getDescription(), message)) { desc = serverHealthState.getDe...
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
fullMessage
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
public String detailedMessage() { //cache me if gc mandates so -jj return fullMessage() + "\n"; }
Understands how to turn the problems that can occur during api calls into human-readable form and http codes
detailedMessage
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/HttpOperationResult.java
Apache-2.0
@Override public ServerHealthState success(HealthStateType healthStateType) { return add(ServerHealthState.success(healthStateType)); }
Understands the current status of the Server Health.
success
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
Apache-2.0
@Override public ServerHealthState error(String message, String description, HealthStateType type) { return add(ServerHealthState.error(message, description, type)); }
Understands the current status of the Server Health.
error
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
Apache-2.0
@Override public ServerHealthState warning(String message, String description, HealthStateType type) { return add(ServerHealthState.warning(message, description, type)); }
Understands the current status of the Server Health.
warning
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
Apache-2.0
@Override public ServerHealthState getServerHealthState() { return lastHealthState; }
Understands the current status of the Server Health.
getServerHealthState
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
Apache-2.0
@Override public boolean canContinue() { return lastHealthState == null || lastHealthState.isSuccess(); }
Understands the current status of the Server Health.
canContinue
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
Apache-2.0
@Override public ServerHealthState forbidden(String message, String description, HealthStateType id) { return error(message, description, id); }
Understands the current status of the Server Health.
forbidden
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
Apache-2.0
@Override public void conflict(String message, String description, HealthStateType healthStateType) { error(message, description, healthStateType); }
Understands the current status of the Server Health.
conflict
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
Apache-2.0
@Override public void notFound(String message, String description, HealthStateType healthStateType) { error(message, description, healthStateType); }
Understands the current status of the Server Health.
notFound
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
Apache-2.0
@Override public void accepted(String message, String description, HealthStateType healthStateType) { success(healthStateType); }
Understands the current status of the Server Health.
accepted
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
Apache-2.0
@Override public void ok(String message) { }
Understands the current status of the Server Health.
ok
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
Apache-2.0
@Override public void notAcceptable(String message, final HealthStateType type) { error(message, message, type); }
Understands the current status of the Server Health.
notAcceptable
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
Apache-2.0
@Override public void internalServerError(String message, HealthStateType type) { error(message, "", type); }
Understands the current status of the Server Health.
internalServerError
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
Apache-2.0
@Override public void insufficientStorage(String message, String description, HealthStateType type) { error(message, description, type); }
Understands the current status of the Server Health.
insufficientStorage
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
Apache-2.0
@Override public void notAcceptable(String message, String description, final HealthStateType type) { error(message, description, type); }
Understands the current status of the Server Health.
notAcceptable
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
Apache-2.0
@Override public void unprocessableEntity(String message, String description, HealthStateType healthStateType) { error(message, description, healthStateType); }
Understands the current status of the Server Health.
unprocessableEntity
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
Apache-2.0
@Override public void badRequest(String message, String description, HealthStateType healthStateType) { error(message, description, healthStateType); }
Understands the current status of the Server Health.
badRequest
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
Apache-2.0
private ServerHealthState add(ServerHealthState newState) { if (lastHealthState == null) { lastHealthState = newState; } else { lastHealthState = lastHealthState.trump(newState); } return lastHealthState; }
Understands the current status of the Server Health.
add
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/server/service/result/ServerHealthStateOperationResult.java
Apache-2.0
public int errorCount() { int errors = 0; for (ServerHealthState serverHealthState : this) { if (!serverHealthState.isSuccess()) { errors++; } } return errors; }
Understands a collection of server health states
errorCount
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/serverhealth/ServerHealthStates.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/serverhealth/ServerHealthStates.java
Apache-2.0
public int warningCount() { int warnings = 0; for (ServerHealthState serverHealthState : this) { if (serverHealthState.isWarning()) { warnings++; } } return warnings; }
Understands a collection of server health states
warningCount
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/serverhealth/ServerHealthStates.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/serverhealth/ServerHealthStates.java
Apache-2.0
public boolean isRealSuccess() { return errorCount() == 0 && warningCount() == 0; }
Understands a collection of server health states
isRealSuccess
java
gocd/gocd
common/src/main/java/com/thoughtworks/go/serverhealth/ServerHealthStates.java
https://github.com/gocd/gocd/blob/master/common/src/main/java/com/thoughtworks/go/serverhealth/ServerHealthStates.java
Apache-2.0
@Test public void shouldStoreFileInsideSymlinkedConfigDirs(@TempDir Path tempDir) throws Exception { Path targetConfig = tempDir.resolve("target-config"); Path symlinkedConfig = tempDir.resolve("symlink-config-dir"); Files.createDirectory(targetConfig); Files.createSymbolicLink(symli...
Validates that we can create files (and ensure directories are created) inside a symlinked config directory. Note that use of Files.createDirectories() inside the IdFileService provider will fail on Linux if the target directory although was finally addressed in 17.0.14 via https://bugs.openjdk.org/browse/JDK-8294193 (...
shouldStoreFileInsideSymlinkedConfigDirs
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/config/IdFileServiceTestBase.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/config/IdFileServiceTestBase.java
Apache-2.0
@Test public void shouldIncludeJavaFileWithSemanticallyEqualsIgnoreFilter() throws Exception { MaterialRevision original = new MaterialRevision(hgMaterial, hgMaterial.modificationsSince(workingFolder, REVISION_0, new TestSubprocessExecutionContext())); Filter filter = new Filter(new...
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldIncludeJavaFileWithSemanticallyEqualsIgnoreFilter
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldNotIgnoreJavaFile() throws Exception { MaterialRevision original = new MaterialRevision(hgMaterial, hgMaterial.modificationsSince(workingFolder, REVISION_0, new TestSubprocessExecutionContext())); Filter filter = new Filter(new IgnoredFiles("**/*.doc")); ...
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldNotIgnoreJavaFile
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldNotIgnoreAnyFileIfFilterIsNotDefinedForTheGivenMaterial() throws Exception { MaterialRevision original = new MaterialRevision(hgMaterial, hgMaterial.modificationsSince(workingFolder, REVISION_0, new TestSubprocessExecutionContext())); Filter filter = new Filt...
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldNotIgnoreAnyFileIfFilterIsNotDefinedForTheGivenMaterial
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldMarkRevisionChangeFalseIfNoNewChangesAvailable() { Modification modificationForRevisionTip = new Modification(new Date(), REVISION_2.getRevision(), "MOCK_LABEL-12", null); MaterialRevision revision = new MaterialRevision(hgMaterial, modificationForRevisionTip); Materi...
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldMarkRevisionChangeFalseIfNoNewChangesAvailable
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldReturnOnlyLatestModificationIfNoNewChangesAvailable() { Modification modificationForRevisionTip = new Modification("Unknown", "Unknown", null, new Date(), REVISION_2.getRevision()); Modification olderModification = new Modification("Unknown", "Unknown", null, new Date(), REVI...
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldReturnOnlyLatestModificationIfNoNewChangesAvailable
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldNotConsiderChangedFlagAsPartOfEqualityAndHashCodeCheck() { Modification modification = oneModifiedFile("revision1"); SvnMaterial material = MaterialsMother.svnMaterial(); MaterialRevision notChanged = new MaterialRevision(material, false, modification); Mater...
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldNotConsiderChangedFlagAsPartOfEqualityAndHashCodeCheck
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldDetectChangedRevision() { Modification modification1 = oneModifiedFile("revision1"); Modification modification2 = oneModifiedFile("revision2"); SvnMaterial material = MaterialsMother.svnMaterial(); MaterialRevision materialRevision1 = new MaterialRevision(mate...
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldDetectChangedRevision
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldDisplayRevisionAsBuildCausedByForDependencyMaterial() { DependencyMaterial dependencyMaterial = new DependencyMaterial(new CaseInsensitiveString("upstream"), new CaseInsensitiveString("stage")); MaterialRevision materialRevision = new MaterialRevision(dependencyMaterial, new ...
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldDisplayRevisionAsBuildCausedByForDependencyMaterial
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldUseLatestMaterial() { MaterialRevision original = new MaterialRevision(hgMaterial, hgMaterial.modificationsSince(workingFolder, REVISION_0, new TestSubprocessExecutionContext())); HgMaterial newMaterial = MaterialsMother.hgMaterial(hgMaterial.getUrl()); ...
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldUseLatestMaterial
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldDetectLatestAndOldestModification() { MaterialRevision materialRevision = new MaterialRevision(hgMaterial, modification("3"), modification("2"), modification("1")); assertThat(materialRevision.getLatestModification()).isEqualTo(modification("3")); assertThat(material...
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldDetectLatestAndOldestModification
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldDetectLatestRevision() { MaterialRevision materialRevision = new MaterialRevision(hgMaterial, modification("3"), modification("2"), modification("1")); assertThat(materialRevision.getRevision()).isEqualTo(new StringRevision("3")); }
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldDetectLatestRevision
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldDetectOldestScmRevision() { MaterialRevision materialRevision = new MaterialRevision(hgMaterial, modification("3"), modification("2"), modification("1")); assertThat(materialRevision.getOldestRevision()).isEqualTo(new StringRevision("1")); }
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldDetectOldestScmRevision
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldDetectOldestAndLatestDependencyRevision() { DependencyMaterial dependencyMaterial = new DependencyMaterial(new CaseInsensitiveString("upstream"), new CaseInsensitiveString("stage")); MaterialRevision materialRevision = new MaterialRevision(dependencyMaterial, new Modification...
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldDetectOldestAndLatestDependencyRevision
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldReturnNullRevisionWhenThereIsNoMaterial() { Revision revision = new MaterialRevision(null).getRevision(); assertThat(revision).isNotNull(); assertThat(revision.getRevision()).isEqualTo(""); }
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldReturnNullRevisionWhenThereIsNoMaterial
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldReturnFullRevisionForTheLatestModification() { assertThat(hgRevision().getLatestRevisionString()).isEqualTo("012345678901234567890123456789"); }
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldReturnFullRevisionForTheLatestModification
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
private MaterialRevision hgRevision() { return new MaterialRevision(hgMaterial, modification("012345678901234567890123456789"), modification("2"), modification("1")); }
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
hgRevision
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldReturnShortRevisionForTheLatestModification() { assertThat(hgRevision().getLatestShortRevision()).isEqualTo("012345678901"); }
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldReturnShortRevisionForTheLatestModification
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldReturnMaterialName() { assertThat(hgRevision().getMaterialName()).isEqualTo((hgMaterial.getDisplayName())); }
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldReturnMaterialName
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldReturnTruncatedMaterialName() { assertThat(hgRevision().getTruncatedMaterialName()).isEqualTo((hgMaterial.getTruncatedDisplayName())); }
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldReturnTruncatedMaterialName
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldReturnMaterialType() { assertThat(hgRevision().getMaterialType()).isEqualTo("Mercurial"); }
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldReturnMaterialType
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldReturnLatestComments() { assertThat(hgRevision().getLatestComment()).isEqualTo("Checkin 012345678901234567890123456789"); }
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldReturnLatestComments
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldReturnLatestUser() { assertThat(hgRevision().getLatestUser()).isEqualTo("user"); }
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldReturnLatestUser
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldRemoveFromThisWhateverModificationIsPresentInThePassedInRevision() { MaterialRevision revision = createHgMaterialWithMultipleRevisions(1, oneModifiedFile("rev2"), oneModifiedFile("rev1")).getMaterialRevision(0); MaterialRevision passedIn = createHgMaterialWithMultipleRevision...
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldRemoveFromThisWhateverModificationIsPresentInThePassedInRevision
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
@Test public void shouldReturnCurrentIfThePassedInDoesNotHaveAnythingThatCurrentHas() { MaterialRevision revision = createHgMaterialWithMultipleRevisions(1, oneModifiedFile("rev2")).getMaterialRevision(0); MaterialRevision passedIn = createHgMaterialWithMultipleRevisions(1, oneModifiedFile("rev1"))....
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
shouldReturnCurrentIfThePassedInDoesNotHaveAnythingThatCurrentHas
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
private Modification modification(String revision) { return new Modification("user", "Checkin " + revision, null, null, revision); }
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
modification
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
private void checkInOneFile(HgMaterial hgMaterial) throws Exception { checkInFiles(hgMaterial, UUID.randomUUID().toString()); }
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
checkInOneFile
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
private void checkInFiles(HgMaterial hgMaterial, String... fileNames) throws Exception { final File localDir = TempDirUtils.createRandomDirectoryIn(tempDir).toFile(); InMemoryStreamConsumer consumer = inMemoryConsumer(); Revision revision = latestRevision(hgMaterial, workingFolder, new TestSubpr...
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
checkInFiles
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
private Revision latestRevision(HgMaterial material, File workingDir, TestSubprocessExecutionContext execCtx) { List<Modification> modifications = material.latestModification(workingDir, execCtx); return new Modifications(modifications).latestRevision(material); }
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
latestRevision
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
public MaterialRevision findNewRevision(MaterialRevision materialRevision, HgMaterial material, File workingFolder, final SubprocessExecutionContext execCtx) { List<Modification> newModifications = material.modificationsSince(workingFolder, materialRevision.getRevision(), execCtx); return materialRevisi...
/*.*")); hgMaterial.setFilter(filter); checkInFiles(hgMaterial, "helper/topics/installing_go_agent.xml", "helper/topics/installing_go_server.xml"); MaterialRevision newRev = findNewRevision(original, hgMaterial, workingFolder, new TestSubprocessExecutionContext(...
findNewRevision
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/MaterialRevisionTest.java
Apache-2.0
protected void assertThatExecutableOutputIncludesArgs(String executableLocation, String[] executableFlags, String... executableArgs) { ExecScript script = new ExecScript(""); InMemoryConsumer output = new InMemoryConsumer(); commandFor(executableLocation, ArrayUtils.addAll(executableFlags, execu...
Executes the passed executable with the passed args, validating that the executable can be found invoked on the filesystem, and that the args were interpreted correctly, by assuming the executable will print the raw args somewhere in its output. <p/> Will likely only work correctly with certain executables or shell bui...
assertThatExecutableOutputIncludesArgs
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/builder/AbstractCommandBuilderScriptRunnerTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/builder/AbstractCommandBuilderScriptRunnerTest.java
Apache-2.0
Path executableWithPathSpaces(Path sourceExecutablePath) throws IOException { Path executable = Files.createDirectory(tempWorkDir.resolve("Directory With Spaces")).resolve(sourceExecutablePath.getFileName()); Files.copy(sourceExecutablePath, executable); return executable; }
Executes the passed executable with the passed args, validating that the executable can be found invoked on the filesystem, and that the args were interpreted correctly, by assuming the executable will print the raw args somewhere in its output. <p/> Will likely only work correctly with certain executables or shell bui...
executableWithPathSpaces
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/builder/AbstractCommandBuilderScriptRunnerTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/builder/AbstractCommandBuilderScriptRunnerTest.java
Apache-2.0
static String trimWrappingQuotesAndWhiteSpace(String arg) { return arg.trim().replaceAll("(^\"*)|(\"*$)", ""); }
Executes the passed executable with the passed args, validating that the executable can be found invoked on the filesystem, and that the args were interpreted correctly, by assuming the executable will print the raw args somewhere in its output. <p/> Will likely only work correctly with certain executables or shell bui...
trimWrappingQuotesAndWhiteSpace
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/builder/AbstractCommandBuilderScriptRunnerTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/builder/AbstractCommandBuilderScriptRunnerTest.java
Apache-2.0
@Test public void shouldStripOutExceptionText() { assertThat(ValidationBean.notValid(new Exception("SVNKITException: The actual message")).getError()) .isEqualTo("The actual message"); }
This is a straight test of what is already there. We are NOT sure that this is the correct behaviour. We think it was there for SVNKIT and can now be removed.
shouldStripOutExceptionText
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/materials/ValidationBeanTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/materials/ValidationBeanTest.java
Apache-2.0
@Test public void shouldSeeOriginalExceptionMessage() { String message = "A message."; assertThat(ValidationBean.notValid(new Exception(message)).getError()).isEqualTo(message); assertThat(ValidationBean.notValid(message).getError()).isEqualTo(message); }
This is a straight test of what is already there. We are NOT sure that this is the correct behaviour. We think it was there for SVNKIT and can now be removed.
shouldSeeOriginalExceptionMessage
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/materials/ValidationBeanTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/materials/ValidationBeanTest.java
Apache-2.0
@Test public void shouldBeValid() { assertThat(valid().isValid()).isTrue(); assertThat(valid().getError()).isEqualTo(""); ValidationBean bean = valid(); assertThat(bean.isValid()).isTrue(); assertThat(bean.toJson().get("isValid")).isEqualTo("true"); }
This is a straight test of what is already there. We are NOT sure that this is the correct behaviour. We think it was there for SVNKIT and can now be removed.
shouldBeValid
java
gocd/gocd
common/src/test/java/com/thoughtworks/go/domain/materials/ValidationBeanTest.java
https://github.com/gocd/gocd/blob/master/common/src/test/java/com/thoughtworks/go/domain/materials/ValidationBeanTest.java
Apache-2.0
public static Agent blankAgent(String uuid) { return new Agent(uuid, "Unknown", "Unknown", "Unknown"); }
<code>Agent</code> is the entity object model class used by Hibernate to represent a record in <code>Agents</code> table. This object model is used to perform crud operations on <code>Agents</code> table. Hence please do not remove the <i>default constructor</i> and do not change anything related to <i>id</i> field as ...
blankAgent
java
gocd/gocd
config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
https://github.com/gocd/gocd/blob/master/config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
Apache-2.0
public void removeEnvironments(List<String> envsToRemove) { this.setEnvironments(remove(this.getEnvironments(), envsToRemove)); }
<code>Agent</code> is the entity object model class used by Hibernate to represent a record in <code>Agents</code> table. This object model is used to perform crud operations on <code>Agents</code> table. Hence please do not remove the <i>default constructor</i> and do not change anything related to <i>id</i> field as ...
removeEnvironments
java
gocd/gocd
config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
https://github.com/gocd/gocd/blob/master/config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
Apache-2.0
public void validate() { validateIpAddress(); if (uuid == null || uuid.isBlank()) { addError(UUID, "UUID cannot be empty"); } validateResources(); }
<code>Agent</code> is the entity object model class used by Hibernate to represent a record in <code>Agents</code> table. This object model is used to perform crud operations on <code>Agents</code> table. Hence please do not remove the <i>default constructor</i> and do not change anything related to <i>id</i> field as ...
validate
java
gocd/gocd
config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
https://github.com/gocd/gocd/blob/master/config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
Apache-2.0
public boolean cookieAssigned() { return cookie != null; }
<code>Agent</code> is the entity object model class used by Hibernate to represent a record in <code>Agents</code> table. This object model is used to perform crud operations on <code>Agents</code> table. Hence please do not remove the <i>default constructor</i> and do not change anything related to <i>id</i> field as ...
cookieAssigned
java
gocd/gocd
config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
https://github.com/gocd/gocd/blob/master/config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
Apache-2.0
private void validateResources() { ResourceConfigs resourceConfigs = new ResourceConfigs(getResources()); if (isElastic() && !resourceConfigs.isEmpty()) { errors.add(RESOURCES, "Elastic agents cannot have resources."); return; } resourceConfigs.validate(null); ...
<code>Agent</code> is the entity object model class used by Hibernate to represent a record in <code>Agents</code> table. This object model is used to perform crud operations on <code>Agents</code> table. Hence please do not remove the <i>default constructor</i> and do not change anything related to <i>id</i> field as ...
validateResources
java
gocd/gocd
config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
https://github.com/gocd/gocd/blob/master/config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
Apache-2.0
private void validateIpAddress() { String ipAddress = getIpaddress(); if (ipAddress == null) { return; } if (ipAddress.isBlank()) { addError(IP_ADDRESS, "IpAddress cannot be empty if it is present."); return; } try { IpAd...
<code>Agent</code> is the entity object model class used by Hibernate to represent a record in <code>Agents</code> table. This object model is used to perform crud operations on <code>Agents</code> table. Hence please do not remove the <i>default constructor</i> and do not change anything related to <i>id</i> field as ...
validateIpAddress
java
gocd/gocd
config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
https://github.com/gocd/gocd/blob/master/config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
Apache-2.0
public void addError(String fieldName, String msg) { errors.add(fieldName, msg); }
<code>Agent</code> is the entity object model class used by Hibernate to represent a record in <code>Agents</code> table. This object model is used to perform crud operations on <code>Agents</code> table. Hence please do not remove the <i>default constructor</i> and do not change anything related to <i>id</i> field as ...
addError
java
gocd/gocd
config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
https://github.com/gocd/gocd/blob/master/config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
Apache-2.0
public ConfigErrors errors() { return errors; }
<code>Agent</code> is the entity object model class used by Hibernate to represent a record in <code>Agents</code> table. This object model is used to perform crud operations on <code>Agents</code> table. Hence please do not remove the <i>default constructor</i> and do not change anything related to <i>id</i> field as ...
errors
java
gocd/gocd
config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
https://github.com/gocd/gocd/blob/master/config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
Apache-2.0
public List<ConfigErrors> errorsAsList() { return List.of(errors); }
<code>Agent</code> is the entity object model class used by Hibernate to represent a record in <code>Agents</code> table. This object model is used to perform crud operations on <code>Agents</code> table. Hence please do not remove the <i>default constructor</i> and do not change anything related to <i>id</i> field as ...
errorsAsList
java
gocd/gocd
config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
https://github.com/gocd/gocd/blob/master/config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
Apache-2.0
public boolean hasErrors() { return errors != null && !errors.isEmpty(); }
<code>Agent</code> is the entity object model class used by Hibernate to represent a record in <code>Agents</code> table. This object model is used to perform crud operations on <code>Agents</code> table. Hence please do not remove the <i>default constructor</i> and do not change anything related to <i>id</i> field as ...
hasErrors
java
gocd/gocd
config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
https://github.com/gocd/gocd/blob/master/config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
Apache-2.0
public boolean hasAllResources(Collection<String> resourcesToCheck) { Set<String> agentResources = this.getResourcesAsList().stream().map(String::toLowerCase).collect(toSet()); Set<String> requiredResources = resourcesToCheck.stream().map(String::toLowerCase).collect(toSet()); return agentResou...
<code>Agent</code> is the entity object model class used by Hibernate to represent a record in <code>Agents</code> table. This object model is used to perform crud operations on <code>Agents</code> table. Hence please do not remove the <i>default constructor</i> and do not change anything related to <i>id</i> field as ...
hasAllResources
java
gocd/gocd
config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
https://github.com/gocd/gocd/blob/master/config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
Apache-2.0
public void removeResources(List<String> resourcesToRemove) { if (resourcesToRemove != null && !resourcesToRemove.isEmpty()) { String resourcesAfterAdd = remove(this.resources, resourcesToRemove); setCommaSeparatedResourceNames(resourcesAfterAdd); } }
<code>Agent</code> is the entity object model class used by Hibernate to represent a record in <code>Agents</code> table. This object model is used to perform crud operations on <code>Agents</code> table. Hence please do not remove the <i>default constructor</i> and do not change anything related to <i>id</i> field as ...
removeResources
java
gocd/gocd
config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
https://github.com/gocd/gocd/blob/master/config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
Apache-2.0
public void addResource(String resource) { if (resource != null && !resource.isBlank()) { addResources(List.of(resource)); } }
<code>Agent</code> is the entity object model class used by Hibernate to represent a record in <code>Agents</code> table. This object model is used to perform crud operations on <code>Agents</code> table. Hence please do not remove the <i>default constructor</i> and do not change anything related to <i>id</i> field as ...
addResource
java
gocd/gocd
config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
https://github.com/gocd/gocd/blob/master/config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
Apache-2.0
public void addResources(List<String> resourcesToAdd) { if (resourcesToAdd != null && !resourcesToAdd.isEmpty()) { String resourcesAfterAdd = append(this.resources, resourcesToAdd); setCommaSeparatedResourceNames(resourcesAfterAdd); } }
<code>Agent</code> is the entity object model class used by Hibernate to represent a record in <code>Agents</code> table. This object model is used to perform crud operations on <code>Agents</code> table. Hence please do not remove the <i>default constructor</i> and do not change anything related to <i>id</i> field as ...
addResources
java
gocd/gocd
config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
https://github.com/gocd/gocd/blob/master/config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
Apache-2.0
public void setResourcesFromList(List<String> resourceList) { String resourceNames = append(null, resourceList); setCommaSeparatedResourceNames(resourceNames); }
<code>Agent</code> is the entity object model class used by Hibernate to represent a record in <code>Agents</code> table. This object model is used to perform crud operations on <code>Agents</code> table. Hence please do not remove the <i>default constructor</i> and do not change anything related to <i>id</i> field as ...
setResourcesFromList
java
gocd/gocd
config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
https://github.com/gocd/gocd/blob/master/config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
Apache-2.0
private void setCommaSeparatedResourceNames(String resourceNames) { if (resourceNames == null || resourceNames.isBlank()) { this.resources = null; return; } this.resources = new ResourceConfigs(resourceNames).getCommaSeparatedResourceNames(); }
<code>Agent</code> is the entity object model class used by Hibernate to represent a record in <code>Agents</code> table. This object model is used to perform crud operations on <code>Agents</code> table. Hence please do not remove the <i>default constructor</i> and do not change anything related to <i>id</i> field as ...
setCommaSeparatedResourceNames
java
gocd/gocd
config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
https://github.com/gocd/gocd/blob/master/config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
Apache-2.0
public boolean isEnabled() { return !isDisabled(); }
<code>Agent</code> is the entity object model class used by Hibernate to represent a record in <code>Agents</code> table. This object model is used to perform crud operations on <code>Agents</code> table. Hence please do not remove the <i>default constructor</i> and do not change anything related to <i>id</i> field as ...
isEnabled
java
gocd/gocd
config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
https://github.com/gocd/gocd/blob/master/config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
Apache-2.0
public boolean isNull() { return false; }
<code>Agent</code> is the entity object model class used by Hibernate to represent a record in <code>Agents</code> table. This object model is used to perform crud operations on <code>Agents</code> table. Hence please do not remove the <i>default constructor</i> and do not change anything related to <i>id</i> field as ...
isNull
java
gocd/gocd
config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
https://github.com/gocd/gocd/blob/master/config/config-api/src/main/java/com/thoughtworks/go/config/Agent.java
Apache-2.0