Browse Source

Ensure all http tests are run and fix broken tests

HttpClientTests were broken. This wasn't discovered since
maven-surefire-plugin's by default only executes test classes
matching **/*Test.java. Fix this by also including **/*.Tests.java
and fix the failing tests.

Change-Id: I487a30fb333de993a9f8d8fff491d3b0e7fb02cc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-4.3
Matthias Sohn 9 years ago
parent
commit
80bf52dfe4
  1. 4
      org.eclipse.jgit.http.test/pom.xml
  2. 7
      org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java

4
org.eclipse.jgit.http.test/pom.xml

@ -134,6 +134,10 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Djava.io.tmpdir=${project.build.directory} -Xmx300m</argLine>
<includes>
<include>**/*Test.java</include>
<include>**/*Tests.java</include>
</includes>
</configuration>
</plugin>
</plugins>

7
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java

@ -303,7 +303,7 @@ public class HttpClientTests extends HttpTestCase {
fail("connection opened even info/refs needs auth basic");
} catch (TransportException err) {
String exp = dumbAuthBasicURI + ": "
+ JGitText.get().notAuthorized;
+ JGitText.get().noCredentialsProvider;
assertEquals(exp, err.getMessage());
}
} finally {
@ -347,7 +347,7 @@ public class HttpClientTests extends HttpTestCase {
fail("connection opened even though service disabled");
} catch (TransportException err) {
String exp = smartAuthBasicURI + ": "
+ JGitText.get().notAuthorized;
+ JGitText.get().noCredentialsProvider;
assertEquals(exp, err.getMessage());
}
} finally {
@ -369,7 +369,8 @@ public class HttpClientTests extends HttpTestCase {
t.openFetch();
fail("connection opened even though service disabled");
} catch (TransportException err) {
String exp = smartAuthNoneURI + ": Git access forbidden";
String exp = smartAuthNoneURI + ": "
+ JGitText.get().serviceNotEnabledNoName;
assertEquals(exp, err.getMessage());
}
} finally {

Loading…
Cancel
Save