1
2
3
4
5
6
7
8
9
10 package org.eclipse.jgit.http.test;
11
12 import java.util.Arrays;
13 import java.util.Collection;
14
15 import org.eclipse.jgit.junit.http.HttpTestCase;
16 import org.eclipse.jgit.transport.HttpTransport;
17 import org.eclipse.jgit.transport.http.HttpConnectionFactory;
18 import org.eclipse.jgit.transport.http.JDKHttpConnectionFactory;
19 import org.eclipse.jgit.transport.http.apache.HttpClientConnectionFactory;
20 import org.junit.AfterClass;
21 import org.junit.BeforeClass;
22 import org.junit.Ignore;
23 import org.junit.runner.RunWith;
24 import org.junit.runners.Parameterized;
25 import org.junit.runners.Parameterized.Parameters;
26
27
28
29
30
31
32 @Ignore
33 @RunWith(Parameterized.class)
34 public abstract class AllFactoriesHttpTestCase extends HttpTestCase {
35
36 @Parameters(name = "{0}")
37 public static Collection<Object[]> data() {
38
39 return Arrays.asList(new Object[][] { { new JDKHttpConnectionFactory() {
40 @Override
41 public String toString() {
42 return this.getClass().getSuperclass().getName();
43 }
44 } }, { new HttpClientConnectionFactory() {
45 @Override
46 public String toString() {
47 return this.getClass().getSuperclass().getName();
48 }
49 } } });
50 }
51
52 protected AllFactoriesHttpTestCase(HttpConnectionFactory cf) {
53 HttpTransport.setConnectionFactory(cf);
54 }
55
56 private static HttpConnectionFactory originalFactory;
57
58 @BeforeClass
59 public static void saveConnectionFactory() {
60 originalFactory = HttpTransport.getConnectionFactory();
61 }
62
63 @AfterClass
64 public static void restoreConnectionFactory() {
65 HttpTransport.setConnectionFactory(originalFactory);
66 }
67
68 }