aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.http.test/tst/org
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.http.test/tst/org')
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AsIsServiceTest.java10
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java17
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java10
-rw-r--r--org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java6
4 files changed, 33 insertions, 10 deletions
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AsIsServiceTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AsIsServiceTest.java
index 2650db2fa8..3442af94db 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AsIsServiceTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AsIsServiceTest.java
@@ -43,6 +43,8 @@
package org.eclipse.jgit.http.test;
+import java.io.IOException;
+
import javax.servlet.http.HttpServletRequestWrapper;
import org.eclipse.jetty.server.Request;
@@ -51,6 +53,7 @@ import org.eclipse.jgit.http.server.resolver.ServiceNotAuthorizedException;
import org.eclipse.jgit.http.server.resolver.ServiceNotEnabledException;
import org.eclipse.jgit.junit.LocalDiskRepositoryTestCase;
import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.lib.StoredConfig;
public class AsIsServiceTest extends LocalDiskRepositoryTestCase {
private Repository db;
@@ -87,8 +90,11 @@ public class AsIsServiceTest extends LocalDiskRepositoryTestCase {
service.access(new R("bob", "1.2.3.4"), db);
}
- public void testCreate_Disabled() throws ServiceNotAuthorizedException {
- db.getConfig().setBoolean("http", null, "getanyfile", false);
+ public void testCreate_Disabled() throws ServiceNotAuthorizedException,
+ IOException {
+ final StoredConfig cfg = db.getConfig();
+ cfg.setBoolean("http", null, "getanyfile", false);
+ cfg.save();
try {
service.access(new R(null, "1.2.3.4"), db);
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java
index 4d05a085c6..81d5f4f51d 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java
@@ -43,6 +43,8 @@
package org.eclipse.jgit.http.test;
+import java.io.IOException;
+
import javax.servlet.http.HttpServletRequestWrapper;
import org.eclipse.jetty.server.Request;
@@ -53,6 +55,7 @@ import org.eclipse.jgit.http.server.resolver.ServiceNotEnabledException;
import org.eclipse.jgit.junit.LocalDiskRepositoryTestCase;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.lib.StoredConfig;
import org.eclipse.jgit.transport.ReceivePack;
public class DefaultReceivePackFactoryTest extends LocalDiskRepositoryTestCase {
@@ -127,8 +130,11 @@ public class DefaultReceivePackFactoryTest extends LocalDiskRepositoryTestCase {
assertEquals(author.getWhen(), id.getWhen());
}
- public void testCreate_Disabled() throws ServiceNotAuthorizedException {
- db.getConfig().setBoolean("http", null, "receivepack", false);
+ public void testCreate_Disabled() throws ServiceNotAuthorizedException,
+ IOException {
+ final StoredConfig cfg = db.getConfig();
+ cfg.setBoolean("http", null, "receivepack", false);
+ cfg.save();
try {
factory.create(new R(null, "localhost"), db);
@@ -153,8 +159,11 @@ public class DefaultReceivePackFactoryTest extends LocalDiskRepositoryTestCase {
}
public void testCreate_Enabled() throws ServiceNotEnabledException,
- ServiceNotAuthorizedException {
- db.getConfig().setBoolean("http", null, "receivepack", true);
+ ServiceNotAuthorizedException, IOException {
+ final StoredConfig cfg = db.getConfig();
+ cfg.setBoolean("http", null, "receivepack", true);
+ cfg.save();
+
ReceivePack rp;
rp = factory.create(new R(null, "1.2.3.4"), db);
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java
index 423361e06b..24bf480dd2 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java
@@ -43,6 +43,8 @@
package org.eclipse.jgit.http.test;
+import java.io.IOException;
+
import javax.servlet.http.HttpServletRequestWrapper;
import org.eclipse.jetty.server.Request;
@@ -52,6 +54,7 @@ import org.eclipse.jgit.http.server.resolver.ServiceNotEnabledException;
import org.eclipse.jgit.http.server.resolver.UploadPackFactory;
import org.eclipse.jgit.junit.LocalDiskRepositoryTestCase;
import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.lib.StoredConfig;
import org.eclipse.jgit.transport.UploadPack;
public class DefaultUploadPackFactoryTest extends LocalDiskRepositoryTestCase {
@@ -104,8 +107,11 @@ public class DefaultUploadPackFactoryTest extends LocalDiskRepositoryTestCase {
assertSame(db, up.getRepository());
}
- public void testCreate_Disabled() throws ServiceNotAuthorizedException {
- db.getConfig().setBoolean("http", null, "uploadpack", false);
+ public void testCreate_Disabled() throws ServiceNotAuthorizedException,
+ IOException {
+ final StoredConfig cfg = db.getConfig();
+ cfg.setBoolean("http", null, "uploadpack", false);
+ cfg.save();
try {
factory.create(new R(null, "localhost"), db);
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java
index c4912d4055..6cf282f3be 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java
@@ -68,6 +68,7 @@ import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.RefUpdate;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
+import org.eclipse.jgit.storage.file.FileBasedConfig;
import org.eclipse.jgit.storage.file.FileRepository;
import org.eclipse.jgit.transport.FetchConnection;
import org.eclipse.jgit.transport.Transport;
@@ -336,8 +337,9 @@ public class HttpClientTests extends HttpTestCase {
public void testListRemote_Smart_UploadPackDisabled() throws Exception {
FileRepository src = remoteRepository.getRepository();
- src.getConfig().setBoolean("http", null, "uploadpack", false);
- src.getConfig().save();
+ final FileBasedConfig cfg = src.getConfig();
+ cfg.setBoolean("http", null, "uploadpack", false);
+ cfg.save();
Repository dst = createBareRepository();
Transport t = Transport.open(dst, smartAuthNoneURI);