[java-support] branch maint-7 updated: GEN-264 - Adapt to changing HEAD branch on repositories
Ian Young
ian at iay.org.uk
Sun Aug 16 09:28:13 UTC 2020
This is an automated email from the git hooks/post-receive script.
iay pushed a commit to branch maint-7
in repository java-support.
View the commit online:
http://git.shibboleth.net/view/?p=java-support.git;a=commit;h=4e541649ab3569dd172251471564cbac1b5b2cf6
The following commit(s) were added to refs/heads/maint-7 by this push:
new 4e54164 GEN-264 - Adapt to changing HEAD branch on repositories
4e54164 is described below
commit 4e541649ab3569dd172251471564cbac1b5b2cf6
Author: Ian Young <ian at iay.org.uk>
AuthorDate: Sun Aug 16 10:11:39 2020 +0100
GEN-264 - Adapt to changing HEAD branch on repositories
https://issues.shibboleth.net/jira/browse/GEN-264
---
.../java/support/repository/RepositorySupport.java | 5 ++--
.../support/repository/RepositorySupportTest.java | 32 ++++++++++++++++++++++
2 files changed, 34 insertions(+), 3 deletions(-)
diff --git a/src/test/java/net/shibboleth/utilities/java/support/repository/RepositorySupport.java b/src/test/java/net/shibboleth/utilities/java/support/repository/RepositorySupport.java
index b31062c..5db2a33 100644
--- a/src/test/java/net/shibboleth/utilities/java/support/repository/RepositorySupport.java
+++ b/src/test/java/net/shibboleth/utilities/java/support/repository/RepositorySupport.java
@@ -62,10 +62,9 @@ public final class RepositorySupport {
}
if (https) {
- return String.format("https://test.shibboleth.net/git/view/?p=%s.git&a=blob_plain&f=%s&hb=master", repo, path);
- } else {
- return String.format("http://git.shibboleth.net/view/?p=%s.git&a=blob_plain&f=%s&hb=master", repo, path);
+ return String.format("https://test.shibboleth.net/git/view/?p=%s.git&a=blob_plain&f=%s&hb=HEAD", repo, path);
}
+ return String.format("http://git.shibboleth.net/view/?p=%s.git&a=blob_plain&f=%s&hb=HEAD", repo, path);
}
diff --git a/src/test/java/net/shibboleth/utilities/java/support/repository/RepositorySupportTest.java b/src/test/java/net/shibboleth/utilities/java/support/repository/RepositorySupportTest.java
new file mode 100644
index 0000000..c20c24d
--- /dev/null
+++ b/src/test/java/net/shibboleth/utilities/java/support/repository/RepositorySupportTest.java
@@ -0,0 +1,32 @@
+
+package net.shibboleth.utilities.java.support.repository;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+
+public class RepositorySupportTest {
+
+ @Test
+ public void testBuildHTTPResourceURLTest() throws IOException {
+ final String s = RepositorySupport.buildHTTPResourceURL("java-support",
+ "src/test/java/net/shibboleth/utilities/java/support/repository/RepositorySupport.java", false);
+ final URL u = new URL(s);
+ Assert.assertNotNull(u);
+ Assert.assertNotNull(u.getContent());
+ }
+
+ @Test
+ public void testBuildHTTPSResourceURLTest() throws IOException {
+ final String s = RepositorySupport.buildHTTPSResourceURL("java-support",
+ "src/test/java/net/shibboleth/utilities/java/support/repository/RepositorySupport.java");
+ final URL u = new URL(s);
+ Assert.assertNotNull(u);
+ // Can't dereference, as test.shibboleth.net has a non-commercial certificate
+ // Real uses need to take this into account.
+ // Assert.assertNotNull(u.getContent());
+ }
+}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list