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 |
|---|---|---|---|---|---|---|---|
@Test
void shouldGenerateFingerprintForGivenMaterialUrlAndBranch() {
GitMaterial gitMaterial = new GitMaterial("https://bob:pass@github.com/gocd", "feature");
gitMaterial.setUserName("bob");
gitMaterial.setPassword("badger");
assertThat(gitMaterial.getFingerprint... | A git abbreviated hash is 7 chars. See the git documentation. | shouldGenerateFingerprintForGivenMaterialUrlAndBranch | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | Apache-2.0 |
@Test
void shouldBuildFromConfigObject() {
final GitMaterialConfig materialConfig = git(new UrlArgument("http://example.com"), "bob", "pass", "master", "sub_module_folder",
true, Filter.create("igrnored"), false, "destination",
new CaseInsensitiveString("example"), fa... | A git abbreviated hash is 7 chars. See the git documentation. | shouldBuildFromConfigObject | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | Apache-2.0 |
@Test
void shouldBuildConfigFromMaterialObject() {
final GitMaterial gitMaterial = new GitMaterial("http://example.com", "master", "sub_module_folder", true);
gitMaterial.setUserName("bob");
gitMaterial.setPassword("pass");
gitMaterial.setAutoUpdate(true);
... | A git abbreviated hash is 7 chars. See the git documentation. | shouldBuildConfigFromMaterialObject | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | Apache-2.0 |
@Test
void shouldBeTheConfiguredUrlForTheMaterial() {
final GitMaterial gitMaterial = new GitMaterial("http://bob:pass@exampele.com");
assertThat(gitMaterial.urlForCommandLine()).isEqualTo("http://bob:pass@exampele.com");
} | A git abbreviated hash is 7 chars. See the git documentation. | shouldBeTheConfiguredUrlForTheMaterial | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | Apache-2.0 |
@Test
void shouldIncludeUserInfoIfProvidedAsUsernameAndPasswordAttributes() {
final GitMaterial gitMaterial = new GitMaterial("http://exampele.com");
gitMaterial.setUserName("bob");
gitMaterial.setPassword("pass");
assertThat(gitMaterial.urlForCommandLine()).isEq... | A git abbreviated hash is 7 chars. See the git documentation. | shouldIncludeUserInfoIfProvidedAsUsernameAndPasswordAttributes | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | Apache-2.0 |
@Test
void shouldIncludeUserNameIfProvidedAsUsernameAttributes() {
final GitMaterial gitMaterial = new GitMaterial("http://exampele.com");
gitMaterial.setUserName("bob");
assertThat(gitMaterial.urlForCommandLine()).isEqualTo("http://bob@exampele.com");
} | A git abbreviated hash is 7 chars. See the git documentation. | shouldIncludeUserNameIfProvidedAsUsernameAttributes | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | Apache-2.0 |
@Test
void shouldIncludePasswordIfProvidedAsPasswordAttributes() {
final GitMaterial gitMaterial = new GitMaterial("http://exampele.com");
gitMaterial.setPassword("pass");
assertThat(gitMaterial.urlForCommandLine()).isEqualTo("http://:pass@exampele.com");
} | A git abbreviated hash is 7 chars. See the git documentation. | shouldIncludePasswordIfProvidedAsPasswordAttributes | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | Apache-2.0 |
@Test
void shouldEncodeUserInfoIfProvidedAsUsernamePasswordAttributes() {
final GitMaterial gitMaterial = new GitMaterial("http://exampele.com");
gitMaterial.setUserName("bob@example.com");
gitMaterial.setPassword("p@ssw:rd");
assertThat(gitMaterial.urlForCommand... | A git abbreviated hash is 7 chars. See the git documentation. | shouldEncodeUserInfoIfProvidedAsUsernamePasswordAttributes | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | Apache-2.0 |
@Test
void shouldHaveResolvedUserInfoIfSecretParamsIsPresent() {
final GitMaterial gitMaterial = new GitMaterial("http://exampele.com");
gitMaterial.setUserName("bob@example.com");
String password = "{{SECRET:[test][id]}}";
gitMaterial.setPassword(password);
... | A git abbreviated hash is 7 chars. See the git documentation. | shouldHaveResolvedUserInfoIfSecretParamsIsPresent | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | Apache-2.0 |
@Test
void shouldCreateMaterialInstanceObject() {
final GitMaterial gitMaterial = new GitMaterial("http://exampele.com", "feature");
gitMaterial.setUserName("bob");
MaterialInstance materialInstance = gitMaterial.createMaterialInstance();
assertThat(materialInst... | A git abbreviated hash is 7 chars. See the git documentation. | shouldCreateMaterialInstanceObject | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | Apache-2.0 |
@Test
void shouldCopyOverSecretResolvedParams() {
GitMaterial gitMaterial = new GitMaterial("http://exampele.com");
gitMaterial.setPassword("{{SECRET:[secret_config_id][git_password]}}");
gitMaterial.getSecretParams().findFirst("git_password").ifPresent(param -> param.setValu... | A git abbreviated hash is 7 chars. See the git documentation. | shouldCopyOverSecretResolvedParams | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | Apache-2.0 |
@Test
void populateEnvContextShouldSetMaterialEnvVars() {
GitMaterial material = new GitMaterial("https://user:password@github.com/bob/my-project", "branchName");
EnvironmentVariableContext ctx = new EnvironmentVariableContext();
final List<Modification> modifications = new ArrayList<>();
... | A git abbreviated hash is 7 chars. See the git documentation. | populateEnvContextShouldSetMaterialEnvVars | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | Apache-2.0 |
@Test
void shouldPopulateBranchWithDefaultIfNotSet() {
GitMaterial material = new GitMaterial("https://user:password@github.com/bob/my-project");
EnvironmentVariableContext ctx = new EnvironmentVariableContext();
final List<Modification> modifications = new ArrayList<>();
modificat... | A git abbreviated hash is 7 chars. See the git documentation. | shouldPopulateBranchWithDefaultIfNotSet | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | Apache-2.0 |
private void assertWorkingCopyNotCheckedOut(File localWorkingDir) {
assertThat(localWorkingDir.listFiles()).isEqualTo(new File[]{new File(localWorkingDir, ".git")});
} | A git abbreviated hash is 7 chars. See the git documentation. | assertWorkingCopyNotCheckedOut | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/git/GitMaterialTest.java | Apache-2.0 |
@Test
void shouldtruncateHashTo12charsforAShortRevision() {
Material hgMaterial = new HgMaterial("file:///foo", null);
assertThat(hgMaterial.getShortRevision("dc3d7e656831d1b203d8b7a63c4de82e26604e52")).isEqualTo("dc3d7e656831");
assertThat(hgMaterial.getShortRevision("dc3d7e65683")).isEqual... | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldtruncateHashTo12charsforAShortRevision | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldNotDisplayPasswordInToString() {
HgMaterial hgMaterial = new HgMaterial("https://user:loser@foo.bar/baz?quux=bang", null);
assertThat(hgMaterial.toString()).doesNotContain("loser");
} | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldNotDisplayPasswordInToString | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldGetLongDescriptionForMaterial() {
HgMaterial material = new HgMaterial("http://url/", "folder");
assertThat(material.getLongDescription()).isEqualTo("URL: http://url/");
} | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldGetLongDescriptionForMaterial | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldFindTheBranchName() {
HgMaterial material = new HgMaterial("http://url/##foo", "folder");
assertThat(material.getBranch()).isEqualTo("foo");
} | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldFindTheBranchName | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldSetDefaultAsBranchNameIfBranchNameIsNotSpecifiedInUrl() {
HgMaterial material = new HgMaterial("http://url/", "folder");
assertThat(material.getBranch()).isEqualTo("default");
} | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldSetDefaultAsBranchNameIfBranchNameIsNotSpecifiedInUrl | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldMaskThePasswordInDisplayName() {
HgMaterial material = new HgMaterial("http://user:pwd@url##branch", "folder");
assertThat(material.getDisplayName()).isEqualTo("http://user:******@url##branch");
} | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldMaskThePasswordInDisplayName | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldGetAttributesWithSecureFields() {
HgMaterial material = new HgMaterial("http://username:password@hgrepo.com", null);
Map<String, Object> attributes = material.getAttributes(true);
assertThat(attributes.get("type")).isEqualTo("mercurial");
@SuppressWarnings("unchecke... | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldGetAttributesWithSecureFields | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldGetAttributesWithoutSecureFields() {
HgMaterial material = new HgMaterial("http://username:password@hgrepo.com", null);
Map<String, Object> attributes = material.getAttributes(false);
assertThat(attributes.get("type")).isEqualTo("mercurial");
@SuppressWarnings("unch... | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldGetAttributesWithoutSecureFields | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldBeEqualIfObjectsHaveSameUrlAndBranch() {
final HgMaterial material_1 = new HgMaterial("http://example.com", "master");
material_1.setUserName("bob");
material_1.setBranch("feature");
final HgMaterial material_2 = new HgMaterial("http://example.co... | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldBeEqualIfObjectsHaveSameUrlAndBranch | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldGenerateFingerprintForGivenMaterialUrl() {
HgMaterial hgMaterial = new HgMaterial("https://bob:pass@github.com/gocd#feature", "dest");
assertThat(hgMaterial.getFingerprint()).isEqualTo("d84d91f37da0367a9bd89fff0d48638f5c1bf993d637735ec26f13c21c23da19");
} | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldGenerateFingerprintForGivenMaterialUrl | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldConsiderBranchWhileGeneratingFingerprint_IfBranchSpecifiedAsAnAttribute() {
HgMaterial hgMaterial = new HgMaterial("https://bob:pass@github.com/gocd", "dest");
hgMaterial.setBranch("feature");
assertThat(hgMaterial.getFingerprint()).isEqualTo("db13278ed2b804... | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldConsiderBranchWhileGeneratingFingerprint_IfBranchSpecifiedAsAnAttribute | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void branchInUrlShouldGenerateFingerprintWhichIsOtherFromBranchInAttribute() {
HgMaterial hgMaterialWithBranchInUrl = new HgMaterial("https://github.com/gocd##feature", "dest");
HgMaterial hgMaterialWithBranchAsAttribute = new HgMaterial("https://github.com/gocd", "dest");
... | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | branchInUrlShouldGenerateFingerprintWhichIsOtherFromBranchInAttribute | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void fingerprintGeneratedByHgMaterialAndHgMaterialConfigShouldBeSame() {
HgMaterial hgMaterial = new HgMaterial("https://github.com/gocd#feature", "dest");
assertThat(hgMaterial.getFingerprint()).isEqualTo(hgMaterial.config().getFingerprint());
} | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | fingerprintGeneratedByHgMaterialAndHgMaterialConfigShouldBeSame | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void fingerprintGeneratedByHgMaterialAndHgMaterialConfigShouldBeSameWhenBranchProvidedAsAttribute() {
HgMaterial hgMaterial = new HgMaterial("https://github.com/gocd", "dest");
hgMaterial.setBranch("feature");
assertThat(hgMaterial.getFingerprint()).isE... | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | fingerprintGeneratedByHgMaterialAndHgMaterialConfigShouldBeSameWhenBranchProvidedAsAttribute | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldBeTheBranchAttributeIfSpecified() {
HgMaterial hgMaterial = new HgMaterial("https://github.com/gocd", "dest");
hgMaterial.setBranch("feature");
assertThat(hgMaterial.getBranch()).isEqualTo("feature");
} | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldBeTheBranchAttributeIfSpecified | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldBeBranchFromUrlIfBranchNotSpecifedAsAttribute() {
HgMaterial hgMaterial = new HgMaterial("https://github.com/gocd#from_url", "dest");
assertThat(hgMaterial.getBranch()).isEqualTo("from_url");
} | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldBeBranchFromUrlIfBranchNotSpecifedAsAttribute | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldBeDefaultBranchIfBranchNotSpecified() {
HgMaterial hgMaterial = new HgMaterial("https://github.com/gocd", "dest");
assertThat(hgMaterial.getBranch()).isEqualTo("default");
} | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldBeDefaultBranchIfBranchNotSpecified | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldBuildFromConfigObject() {
final HgMaterialConfig materialConfig = hg(new HgUrlArgument("http://example.com"), "bob", "pass",
"feature", true, Filter.create("igrnored"), false, "destination",
new CaseInsensitiveString("example"));
... | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldBuildFromConfigObject | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldBuildConfigFromMaterialObject() {
final HgMaterial hgMaterial = new HgMaterial("http://example.com", "destination");
hgMaterial.setUserName("bob");
hgMaterial.setPassword("pass");
hgMaterial.setBranch("feature");
hgMaterial.setAutoUpda... | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldBuildConfigFromMaterialObject | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldBeSameAsTheConfiguredUrlForTheMaterial() {
final HgMaterial hgMaterial = new HgMaterial("http://bob:pass@exampele.com", "destination");
assertThat(hgMaterial.urlForCommandLine()).isEqualTo("http://bob:pass@exampele.com");
} | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldBeSameAsTheConfiguredUrlForTheMaterial | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldIncludeUserInfoIfProvidedAsUsernameAndPasswordAttributes() {
final HgMaterial hgMaterial = new HgMaterial("http://exampele.com", "destination");
hgMaterial.setUserName("bob");
hgMaterial.setPassword("pass");
assertThat(hgMaterial.urlForCommandLin... | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldIncludeUserInfoIfProvidedAsUsernameAndPasswordAttributes | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldIncludeUserNameIfProvidedAsUsernameAttributes() {
final HgMaterial hgMaterial = new HgMaterial("http://exampele.com", "destination");
hgMaterial.setUserName("bob");
assertThat(hgMaterial.urlForCommandLine()).isEqualTo("http://bob@exampele.com");
} | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldIncludeUserNameIfProvidedAsUsernameAttributes | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldIncludePasswordIfProvidedAsPasswordAttribute() {
final HgMaterial hgMaterial = new HgMaterial("http://exampele.com", "destination");
hgMaterial.setPassword("pass");
assertThat(hgMaterial.urlForCommandLine()).isEqualTo("http://:pass@exampele.com");
} | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldIncludePasswordIfProvidedAsPasswordAttribute | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldEncodeUserInfoIfProvidedAsUsernamePasswordAttributes() {
final HgMaterial hgMaterial = new HgMaterial("http://exampele.com", "destination");
hgMaterial.setUserName("bob@example.com");
hgMaterial.setPassword("p@ssw:rd");
assertThat(hgMaterial.urlF... | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldEncodeUserInfoIfProvidedAsUsernamePasswordAttributes | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldHaveResolvedUserInfoIfSecretParamsIsPresent() {
final HgMaterial gitMaterial = new HgMaterial("http://exampele.com", "destination");
gitMaterial.setUserName("bob@example.com");
String password = "{{SECRET:[test][id]}}";
gitMaterial.setPassword(pas... | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldHaveResolvedUserInfoIfSecretParamsIsPresent | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldCreateMaterialInstanceObject() {
final HgMaterial hgMaterial = new HgMaterial("http://exampele.com#feature", "destination");
hgMaterial.setUserName("bob");
MaterialInstance materialInstance = hgMaterial.createMaterialInstance();
assertThat(mater... | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldCreateMaterialInstanceObject | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldCreateMaterialInstanceObjectWithBranchProvidedAttributeInMaterial() {
final HgMaterial hgMaterial = new HgMaterial("http://exampele.com", "destination");
hgMaterial.setUserName("bob");
hgMaterial.setBranch("branch-as-attribute");
MaterialInstance... | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldCreateMaterialInstanceObjectWithBranchProvidedAttributeInMaterial | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldReplaceUrlForCommandLineWithUrlForDisplay_whenCredntialsAreProvidedInUrl() {
HgMaterial hgMaterial = new HgMaterial("https://bob:pass@example.com", "destinations");
String info = hgMaterial.secrets().get(0).replaceSecretInfo("https://bob:pass@example.com");
... | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldReplaceUrlForCommandLineWithUrlForDisplay_whenCredntialsAreProvidedInUrl | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldReplaceUrlForCommandLineWithUrlForDisplay_whenCredentialsAreProvidedAsAttributes() {
HgMaterial hgMaterial = new HgMaterial("https://example.com", "destinations");
hgMaterial.setUserName("bob");
hgMaterial.setPassword("pass");
String info = hgMat... | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldReplaceUrlForCommandLineWithUrlForDisplay_whenCredentialsAreProvidedAsAttributes | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void populateEnvContextShouldSetMaterialEnvVars() {
HgMaterial material = new HgMaterial("https://user:password@github.com/bob/my-project", "folder");
material.setBranch("branchName");
EnvironmentVariableContext ctx = new EnvironmentVariableContext();
final List<Modification> ... | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | populateEnvContextShouldSetMaterialEnvVars | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Test
void shouldPopulateBranchWithDefaultIfNotSet() {
HgMaterial material = new HgMaterial("https://user:password@github.com/bob/my-project", "folder");
EnvironmentVariableContext ctx = new EnvironmentVariableContext();
final List<Modification> modifications = new ArrayList<>();
m... | An hg abbreviated hash is 12 chars. See the hg documentation.
%h: short-form changeset hash (12 bytes of hexadecimal) | shouldPopulateBranchWithDefaultIfNotSet | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/config/materials/mercurial/HgMaterialTest.java | Apache-2.0 |
@Override
public String getUrl() {
return url;
} | ChrisS and ChrisT :
Note iBatis requires a concrete class here for the XSD but it does not actually use it.
Dummy material is just used to help iBatis and should not be used in real code. | getUrl | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | Apache-2.0 |
@Override
public String urlForCommandLine() {
return url;
} | ChrisS and ChrisT :
Note iBatis requires a concrete class here for the XSD but it does not actually use it.
Dummy material is just used to help iBatis and should not be used in real code. | urlForCommandLine | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | Apache-2.0 |
@Override
protected UrlArgument getUrlArgument() {
return new UrlArgument(url);
} | ChrisS and ChrisT :
Note iBatis requires a concrete class here for the XSD but it does not actually use it.
Dummy material is just used to help iBatis and should not be used in real code. | getUrlArgument | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | Apache-2.0 |
@Override
public String getLongDescription() {
return "Dummy";
} | ChrisS and ChrisT :
Note iBatis requires a concrete class here for the XSD but it does not actually use it.
Dummy material is just used to help iBatis and should not be used in real code. | getLongDescription | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | Apache-2.0 |
public void setUrl(String url) {
this.url = url;
} | ChrisS and ChrisT :
Note iBatis requires a concrete class here for the XSD but it does not actually use it.
Dummy material is just used to help iBatis and should not be used in real code. | setUrl | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | Apache-2.0 |
@Override
protected String getLocation() {
return getUrl();
} | ChrisS and ChrisT :
Note iBatis requires a concrete class here for the XSD but it does not actually use it.
Dummy material is just used to help iBatis and should not be used in real code. | getLocation | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | Apache-2.0 |
@Override
public String getTypeForDisplay() {
return "Dummy";
} | ChrisS and ChrisT :
Note iBatis requires a concrete class here for the XSD but it does not actually use it.
Dummy material is just used to help iBatis and should not be used in real code. | getTypeForDisplay | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | Apache-2.0 |
@Override
public Class<MaterialInstance> getInstanceType() {
throw new UnsupportedOperationException("dummy material doesn't have a type");
} | ChrisS and ChrisT :
Note iBatis requires a concrete class here for the XSD but it does not actually use it.
Dummy material is just used to help iBatis and should not be used in real code. | getInstanceType | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | Apache-2.0 |
@Override
public MaterialInstance createMaterialInstance() {
throw new UnsupportedOperationException();
} | ChrisS and ChrisT :
Note iBatis requires a concrete class here for the XSD but it does not actually use it.
Dummy material is just used to help iBatis and should not be used in real code. | createMaterialInstance | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | Apache-2.0 |
@Override
public void updateTo(ConsoleOutputStreamConsumer outputStreamConsumer, File baseDir, RevisionContext revisionContext, final SubprocessExecutionContext execCtx) {
throw unsupported();
} | ChrisS and ChrisT :
Note iBatis requires a concrete class here for the XSD but it does not actually use it.
Dummy material is just used to help iBatis and should not be used in real code. | updateTo | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | Apache-2.0 |
@Override
public void checkout(File baseDir, Revision revision, SubprocessExecutionContext execCtx) {
throw unsupported();
} | ChrisS and ChrisT :
Note iBatis requires a concrete class here for the XSD but it does not actually use it.
Dummy material is just used to help iBatis and should not be used in real code. | checkout | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | Apache-2.0 |
public ValidationBean checkConnection(final SubprocessExecutionContext execCtx) {
throw unsupported();
} | ChrisS and ChrisT :
Note iBatis requires a concrete class here for the XSD but it does not actually use it.
Dummy material is just used to help iBatis and should not be used in real code. | checkConnection | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | Apache-2.0 |
@Override
public boolean isCheckExternals() {
throw unsupported();
} | ChrisS and ChrisT :
Note iBatis requires a concrete class here for the XSD but it does not actually use it.
Dummy material is just used to help iBatis and should not be used in real code. | isCheckExternals | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | Apache-2.0 |
private UnsupportedOperationException unsupported() {
return new UnsupportedOperationException("This class is only for iBatis and should not be used.");
} | ChrisS and ChrisT :
Note iBatis requires a concrete class here for the XSD but it does not actually use it.
Dummy material is just used to help iBatis and should not be used in real code. | unsupported | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | Apache-2.0 |
@Override
protected void appendCriteria(Map<String, Object> parameters) {
throw unsupported();
} | ChrisS and ChrisT :
Note iBatis requires a concrete class here for the XSD but it does not actually use it.
Dummy material is just used to help iBatis and should not be used in real code. | appendCriteria | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | Apache-2.0 |
@Override
protected void appendAttributes(Map<String, Object> parameters) {
throw unsupported();
} | ChrisS and ChrisT :
Note iBatis requires a concrete class here for the XSD but it does not actually use it.
Dummy material is just used to help iBatis and should not be used in real code. | appendAttributes | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/DummyMaterial.java | Apache-2.0 |
protected ConsoleResult git_C(File dir, String... args) {
CommandLine commandLine = CommandLine.createCommandLine("git");
commandLine.withArgs(args);
commandLine.withEncoding(UTF_8);
assertTrue(dir.exists());
commandLine.setWorkingDir(dir);
return commandLine.runOrBomb(tr... | Like {@code git -C <dir> command [args...]}
@param dir the directory to set as CWD
@param args the args to pass to {@code git}
@return a {@link ConsoleResult} | git_C | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/git/GitCommandIntegrationTestBase.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/git/GitCommandIntegrationTestBase.java | Apache-2.0 |
protected void setColoring() {
gitInRepo("config", "color.diff", "always");
gitInRepo("config", "color.status", "always");
gitInRepo("config", "color.interactive", "always");
gitInRepo("config", "color.branch", "always");
} | Like {@code git -C <dir> command [args...]}
@param dir the directory to set as CWD
@param args the args to pass to {@code git}
@return a {@link ConsoleResult} | setColoring | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/git/GitCommandIntegrationTestBase.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/git/GitCommandIntegrationTestBase.java | Apache-2.0 |
protected void setLogDecoration() {
gitInRepo("config", "log.decorate", "true");
} | Like {@code git -C <dir> command [args...]}
@param dir the directory to set as CWD
@param args the args to pass to {@code git}
@return a {@link ConsoleResult} | setLogDecoration | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/git/GitCommandIntegrationTestBase.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/git/GitCommandIntegrationTestBase.java | Apache-2.0 |
private void unsetLogDecoration() {
gitInRepo("config", "log.decorate", "off");
} | Like {@code git -C <dir> command [args...]}
@param dir the directory to set as CWD
@param args the args to pass to {@code git}
@return a {@link ConsoleResult} | unsetLogDecoration | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/git/GitCommandIntegrationTestBase.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/git/GitCommandIntegrationTestBase.java | Apache-2.0 |
private void unsetColoring() {
gitInRepo("config", "color.diff", "auto");
gitInRepo("config", "color.status", "auto");
gitInRepo("config", "color.interactive", "auto");
gitInRepo("config", "color.branch", "auto");
} | Like {@code git -C <dir> command [args...]}
@param dir the directory to set as CWD
@param args the args to pass to {@code git}
@return a {@link ConsoleResult} | unsetColoring | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/git/GitCommandIntegrationTestBase.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/git/GitCommandIntegrationTestBase.java | Apache-2.0 |
protected void assertWorkingCopyNotCheckedOut() {
assertArrayEquals(new File[]{new File(gitLocalRepoDir, ".git")}, gitLocalRepoDir.listFiles());
} | Like {@code git -C <dir> command [args...]}
@param dir the directory to set as CWD
@param args the args to pass to {@code git}
@return a {@link ConsoleResult} | assertWorkingCopyNotCheckedOut | java | gocd/gocd | domain/src/test/java/com/thoughtworks/go/domain/materials/git/GitCommandIntegrationTestBase.java | https://github.com/gocd/gocd/blob/master/domain/src/test/java/com/thoughtworks/go/domain/materials/git/GitCommandIntegrationTestBase.java | Apache-2.0 |
public static JavaVersion toVersion(Object value) throws IllegalArgumentException {
if (value == null) {
return null;
}
if (value instanceof JavaVersion) {
return (JavaVersion) value;
}
if (value instanceof Integer) {
return getVersionForMajor(... | Converts the given object into a {@code JavaVersion}.
@param value An object whose toString() value is to be converted. May be null.
@return The version, or null if the provided value is null.
@throws IllegalArgumentException when the provided value cannot be converted. | toVersion | java | gocd/gocd | jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | https://github.com/gocd/gocd/blob/master/jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | Apache-2.0 |
public static JavaVersion current() {
if (currentJavaVersion == null) {
currentJavaVersion = toVersion(System.getProperty("java.version"));
}
return currentJavaVersion;
} | Returns the version of the current JVM.
@return The version of the current JVM. | current | java | gocd/gocd | jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | https://github.com/gocd/gocd/blob/master/jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | Apache-2.0 |
public boolean isCompatibleWith(JavaVersion otherVersion) {
return this.compareTo(otherVersion) >= 0;
} | Returns if this version is compatible with the given version | isCompatibleWith | java | gocd/gocd | jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | https://github.com/gocd/gocd/blob/master/jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | Apache-2.0 |
@Override
public String toString() {
return versionName;
} | Returns if this version is compatible with the given version | toString | java | gocd/gocd | jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | https://github.com/gocd/gocd/blob/master/jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | Apache-2.0 |
public String getMajorVersion() {
return String.valueOf(ordinal() + 1);
} | Returns if this version is compatible with the given version | getMajorVersion | java | gocd/gocd | jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | https://github.com/gocd/gocd/blob/master/jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | Apache-2.0 |
private static JavaVersion getVersionForMajor(int major) {
return major >= values().length ? JavaVersion.VERSION_HIGHER : values()[major - 1];
} | Returns if this version is compatible with the given version | getVersionForMajor | java | gocd/gocd | jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | https://github.com/gocd/gocd/blob/master/jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | Apache-2.0 |
public static int parseMajorVersion(String fullVersion) {
int firstNonVersionCharIndex = findFirstNonVersionCharIndex(fullVersion);
String[] versionStrings = fullVersion.substring(0, firstNonVersionCharIndex).split("\\.");
List<Integer> versions = convertToNumber(fullVersion, versio... | Shared code between {@link JavaVersion} and other code for parsing a full
Java version string. | parseMajorVersion | java | gocd/gocd | jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | https://github.com/gocd/gocd/blob/master/jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | Apache-2.0 |
private static void assertTrue(String value, boolean condition) {
if (!condition) {
throw new IllegalArgumentException("Could not determine Java version from '" + value + "'.");
}
} | Shared code between {@link JavaVersion} and other code for parsing a full
Java version string. | assertTrue | java | gocd/gocd | jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | https://github.com/gocd/gocd/blob/master/jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | Apache-2.0 |
private static boolean isLegacyVersion(List<Integer> versions) {
return 1 == versions.get(0) && versions.size() > 1;
} | Shared code between {@link JavaVersion} and other code for parsing a full
Java version string. | isLegacyVersion | java | gocd/gocd | jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | https://github.com/gocd/gocd/blob/master/jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | Apache-2.0 |
private static List<Integer> convertToNumber(String value, String[] versionStrs) {
List<Integer> result = new ArrayList<>();
for (String s : versionStrs) {
assertTrue(value, !isNumberStartingWithZero(s));
try {
result.add(Integer.parseInt(s));
... | Shared code between {@link JavaVersion} and other code for parsing a full
Java version string. | convertToNumber | java | gocd/gocd | jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | https://github.com/gocd/gocd/blob/master/jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | Apache-2.0 |
private static boolean isNumberStartingWithZero(String number) {
return number.length() > 1 && number.startsWith("0");
} | Shared code between {@link JavaVersion} and other code for parsing a full
Java version string. | isNumberStartingWithZero | java | gocd/gocd | jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | https://github.com/gocd/gocd/blob/master/jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | Apache-2.0 |
private static int findFirstNonVersionCharIndex(String s) {
assertTrue(s, !s.isEmpty());
for (int i = 0; i < s.length(); ++i) {
if (!isDigitOrPeriod(s.charAt(i))) {
assertTrue(s, i != 0);
return i;
}
}
... | Shared code between {@link JavaVersion} and other code for parsing a full
Java version string. | findFirstNonVersionCharIndex | java | gocd/gocd | jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | https://github.com/gocd/gocd/blob/master/jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | Apache-2.0 |
private static boolean isDigitOrPeriod(char c) {
return (c >= '0' && c <= '9') || c == '.';
} | Shared code between {@link JavaVersion} and other code for parsing a full
Java version string. | isDigitOrPeriod | java | gocd/gocd | jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | https://github.com/gocd/gocd/blob/master/jar-class-loader/src/main/java/com/thoughtworks/gocd/JavaVersion.java | Apache-2.0 |
@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException {
if (isWebAppStarting()) {
handleQueriesWhenWebAppIsStarting(baseRequest, response);
} else if ("/".equals(target)) {
... | When GoCD is starting. This is the only handler that will be active (till the web application context handler is up).
During that time, this handler shows a 503 for all requests, while waiting for the rest of the server to be up. | handle | java | gocd/gocd | jetty/src/main/java/com/thoughtworks/go/server/GoServerLoadingIndicationHandler.java | https://github.com/gocd/gocd/blob/master/jetty/src/main/java/com/thoughtworks/go/server/GoServerLoadingIndicationHandler.java | Apache-2.0 |
private void handleQueriesWhenWebAppIsStarting(Request baseRequest, HttpServletResponse response) throws IOException {
if (acceptHeaderValue(baseRequest).contains("json")) {
respondWith503(baseRequest, response, APPLICATION_JSON.asString(), "{ \"message\": \"GoCD server is starting\" }");
... | When GoCD is starting. This is the only handler that will be active (till the web application context handler is up).
During that time, this handler shows a 503 for all requests, while waiting for the rest of the server to be up. | handleQueriesWhenWebAppIsStarting | java | gocd/gocd | jetty/src/main/java/com/thoughtworks/go/server/GoServerLoadingIndicationHandler.java | https://github.com/gocd/gocd/blob/master/jetty/src/main/java/com/thoughtworks/go/server/GoServerLoadingIndicationHandler.java | Apache-2.0 |
private void respondWith503(Request baseRequest, HttpServletResponse response, String contentType, String body) throws IOException {
addHeaders(response);
response.setStatus(HttpStatus.SERVICE_UNAVAILABLE_503);
response.setContentType(contentType);
response.getWriter().pr... | When GoCD is starting. This is the only handler that will be active (till the web application context handler is up).
During that time, this handler shows a 503 for all requests, while waiting for the rest of the server to be up. | respondWith503 | java | gocd/gocd | jetty/src/main/java/com/thoughtworks/go/server/GoServerLoadingIndicationHandler.java | https://github.com/gocd/gocd/blob/master/jetty/src/main/java/com/thoughtworks/go/server/GoServerLoadingIndicationHandler.java | Apache-2.0 |
private String acceptHeaderValue(Request baseRequest) {
List<String> qualityCSV = baseRequest.getHttpFields().getQualityCSV(HttpHeader.ACCEPT);
return qualityCSV.isEmpty() ? MimeTypes.Type.TEXT_HTML.asString() : qualityCSV.get(0);
} | When GoCD is starting. This is the only handler that will be active (till the web application context handler is up).
During that time, this handler shows a 503 for all requests, while waiting for the rest of the server to be up. | acceptHeaderValue | java | gocd/gocd | jetty/src/main/java/com/thoughtworks/go/server/GoServerLoadingIndicationHandler.java | https://github.com/gocd/gocd/blob/master/jetty/src/main/java/com/thoughtworks/go/server/GoServerLoadingIndicationHandler.java | Apache-2.0 |
private boolean isWebAppStarting() {
if (!isWebAppStarting) {
return false;
}
isWebAppStarting = !webAppContext.isAvailable();
return isWebAppStarting;
} | When GoCD is starting. This is the only handler that will be active (till the web application context handler is up).
During that time, this handler shows a 503 for all requests, while waiting for the rest of the server to be up. | isWebAppStarting | java | gocd/gocd | jetty/src/main/java/com/thoughtworks/go/server/GoServerLoadingIndicationHandler.java | https://github.com/gocd/gocd/blob/master/jetty/src/main/java/com/thoughtworks/go/server/GoServerLoadingIndicationHandler.java | Apache-2.0 |
private void addHeaders(HttpServletResponse response) {
response.setHeader("Cache-Control", "no-cache, must-revalidate, no-store");
response.setHeader("X-XSS-Protection", "1; mode=block");
response.setHeader("X-Content-Type-Options", "nosniff");
response.setHeader("X-Fram... | When GoCD is starting. This is the only handler that will be active (till the web application context handler is up).
During that time, this handler shows a 503 for all requests, while waiting for the rest of the server to be up. | addHeaders | java | gocd/gocd | jetty/src/main/java/com/thoughtworks/go/server/GoServerLoadingIndicationHandler.java | https://github.com/gocd/gocd/blob/master/jetty/src/main/java/com/thoughtworks/go/server/GoServerLoadingIndicationHandler.java | Apache-2.0 |
static String loadingPage() throws IOException {
try (InputStream in = Objects.requireNonNull(GoServerLoadingIndicationHandler.class.getResourceAsStream("/loading.page.html"))) {
return new String(in.readAllBytes(), StandardCharsets.UTF_8);
}
} | When GoCD is starting. This is the only handler that will be active (till the web application context handler is up).
During that time, this handler shows a 503 for all requests, while waiting for the rest of the server to be up. | loadingPage | java | gocd/gocd | jetty/src/main/java/com/thoughtworks/go/server/GoServerLoadingIndicationHandler.java | https://github.com/gocd/gocd/blob/master/jetty/src/main/java/com/thoughtworks/go/server/GoServerLoadingIndicationHandler.java | Apache-2.0 |
@Override
public void initializeGoApplicationAccessor(GoApplicationAccessor goApplicationAccessor) {
this.goApplicationAccessor = goApplicationAccessor;
} | Initializes GoApplicationAccessor with an instance of GoApplicationAccessor
@param goApplicationAccessor An instance of GoApplicationAccessor | initializeGoApplicationAccessor | java | gocd/gocd | plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/AbstractGoPlugin.java | https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/AbstractGoPlugin.java | Apache-2.0 |
public String getExtension() {
return extension;
} | Gets extension name
@return Extension name | getExtension | java | gocd/gocd | plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/GoPluginIdentifier.java | https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/GoPluginIdentifier.java | Apache-2.0 |
public List<String> getSupportedExtensionVersions() {
return supportedExtensionVersions;
} | Gets list of supported extension versions
@return List of supported extension versions | getSupportedExtensionVersions | java | gocd/gocd | plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/GoPluginIdentifier.java | https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/GoPluginIdentifier.java | Apache-2.0 |
public static Logger getLoggerFor(Class<?> loggerClass) {
String id;
try {
Class<?> defaultGoPluginActivator = loggerClass.getClassLoader().loadClass("com.thoughtworks.go.plugin.activation.DefaultGoPluginActivator");
id = (String) getPluginIdStaticFieldFrom(defaultGoPluginActivat... | Logger for use by plugin developers.
@author GoCD Team
@see <a href="https://developer.gocd.org/current/writing_go_plugins/go_plugins_basics.html" target="_blank">Go Plugin Documentation</a> | getLoggerFor | java | gocd/gocd | plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java | https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java | Apache-2.0 |
public static Logger getLoggerFor(Class<?> loggerClass, String pluginId) {
return new Logger(loggerClass.getName(), pluginId);
} | Logger for use by plugin developers.
@author GoCD Team
@see <a href="https://developer.gocd.org/current/writing_go_plugins/go_plugins_basics.html" target="_blank">Go Plugin Documentation</a> | getLoggerFor | java | gocd/gocd | plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java | https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java | Apache-2.0 |
public static void initialize(LoggingService loggingService) {
Logger.loggingService = loggingService;
} | Logger for use by plugin developers.
@author GoCD Team
@see <a href="https://developer.gocd.org/current/writing_go_plugins/go_plugins_basics.html" target="_blank">Go Plugin Documentation</a> | initialize | java | gocd/gocd | plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java | https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java | Apache-2.0 |
public void debug(String message) {
if (loggingService == null) {
System.out.println(message);
return;
}
loggingService.debug(pluginId, loggerName, message);
} | Messages to be logged in debug mode.
@param message a string containing the message to be logged. | debug | java | gocd/gocd | plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java | https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java | Apache-2.0 |
public void debug(String message, Throwable throwable) {
if (loggingService == null) {
System.out.println(message);
return;
}
loggingService.debug(pluginId, loggerName, message, throwable);
} | Messages to be logged in debug mode.
@param message a string containing the message to be logged.
@param throwable error to be logged | debug | java | gocd/gocd | plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java | https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java | Apache-2.0 |
public void debug(String message, Object arg) {
if (loggingService == null) {
System.out.println(message);
return;
}
loggingService.debug(pluginId, loggerName, message, arg);
} | Messages to be logged in debug mode according to the specified format
and argument.
<p>This form avoids unnecessary object creation when the logger
is disabled for the DEBUG level. </p>
@param message the format string.
@param arg the argument | debug | java | gocd/gocd | plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java | https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java | Apache-2.0 |
public void debug(String message, Object arg1, Object arg2) {
if (loggingService == null) {
System.out.println(message);
return;
}
loggingService.debug(pluginId, loggerName, message, arg1, arg2);
} | Messages to be logged in debug mode according to the specified format
and arguments.
<p>This form avoids unnecessary object creation when the logger
is disabled for the DEBUG level. </p>
@param message the format string.
@param arg1 the first argument
@param arg2 the second argument | debug | java | gocd/gocd | plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java | https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java | Apache-2.0 |
public void debug(String message, Object... arguments) {
if (loggingService == null) {
System.out.println(message);
return;
}
loggingService.debug(pluginId, loggerName, message, arguments);
} | Messages to be logged in debug mode according to the specified format
and arguments.
<p>This form avoids unnecessary object creation when the logger
is disabled for the DEBUG level. </p>
@param message the format string.
@param arguments a list of 3 or more arguments | debug | java | gocd/gocd | plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java | https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java | Apache-2.0 |
public void info(String message) {
if (loggingService == null) {
System.out.println(message);
return;
}
loggingService.info(pluginId, loggerName, message);
} | Messages to be logged in info mode.
@param message a string containing the message to be logged. | info | java | gocd/gocd | plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java | https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java | Apache-2.0 |
public void info(String message, Throwable throwable) {
if (loggingService == null) {
System.out.println(message);
return;
}
loggingService.info(pluginId, loggerName, message, throwable);
} | Messages to be logged in info mode.
@param message a string containing the message to be logged.
@param throwable error to be lgoged | info | java | gocd/gocd | plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java | https://github.com/gocd/gocd/blob/master/plugin-infra/go-plugin-api/src/main/java/com/thoughtworks/go/plugin/api/logging/Logger.java | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.