Skip to content
Browse files

Made FitNesseContext.authenticator final

Now the FitNesseContext object only has final fields.
  • Loading branch information...
1 parent ea53024 commit 4d9b0e33302df1697503f4f83866514e9dd9a9fc @amolenaar amolenaar committed
View
22 src/fitnesse/FitNesseContext.java
@@ -47,15 +47,17 @@ public Builder(WikiPage root) {
public Builder(FitNesseContext context) {
super();
- root = context.root;
- port = context.port;
- rootPath = context.rootPath;
- rootDirectoryName = context.rootDirectoryName;
- socketDealer = context.socketDealer;
- logger = context.logger;
- authenticator = context.authenticator;
- defaultNewPageContent = context.defaultNewPageContent;
- pageTheme = context.pageTheme;
+ if (context != null) {
+ root = context.root;
+ port = context.port;
+ rootPath = context.rootPath;
+ rootDirectoryName = context.rootDirectoryName;
+ socketDealer = context.socketDealer;
+ logger = context.logger;
+ authenticator = context.authenticator;
+ defaultNewPageContent = context.defaultNewPageContent;
+ pageTheme = context.pageTheme;
+ }
}
public final FitNesseContext createFitNesseContext() {
@@ -84,7 +86,7 @@ public final FitNesseContext createFitNesseContext() {
public final String defaultNewPageContent;
public final Logger logger;
- public Authenticator authenticator = new PromiscuousAuthenticator();
+ public final Authenticator authenticator;
public final String pageTheme;
View
1 src/fitnesse/FitNesseExpediterTest.java
@@ -40,7 +40,6 @@ public void tearDown() throws Exception {
public void testAuthenticationGetsCalled() throws Exception {
context = FitNesseUtil.makeTestContext(context, new StoneWallAuthenticator());
expediter = new FitNesseExpediter(socket, context);
- context.authenticator = new StoneWallAuthenticator();
MockRequest request = new MockRequest();
Response response = expediter.createGoodResponse(request);
assertEquals(401, response.getStatus());
View
6 src/fitnesse/fixtures/AuthenticatorSetup.java
@@ -2,7 +2,7 @@
// Released under the terms of the CPL Common Public License version 1.0.
package fitnesse.fixtures;
-import fitnesse.FitNesseContext.Builder;
+import static fitnesse.fixtures.FitnesseFixtureContext.authenticator;
import fitnesse.authentication.OneUserAuthenticator;
public class AuthenticatorSetup
@@ -11,9 +11,7 @@
private String password;
public String status() {
- Builder builder = new Builder(FitnesseFixtureContext.context);
- builder.authenticator = new OneUserAuthenticator(username, password);
- FitnesseFixtureContext.context.authenticator = new OneUserAuthenticator(username, password);
+ authenticator = new OneUserAuthenticator(username, password);
return "ok";
}
View
6 src/fitnesse/fixtures/FitnesseFixtureContext.java
@@ -4,9 +4,10 @@
import fitnesse.FitNesse;
import fitnesse.FitNesseContext;
+import fitnesse.authentication.Authenticator;
import fitnesse.http.MockResponseSender;
import fitnesse.http.Response;
-import fitnesse.testutil.SampleFileUtility;
+import fitnesse.testutil.FitNesseUtil;
import fitnesse.wiki.WikiPage;
public class FitnesseFixtureContext {
@@ -14,7 +15,8 @@
public static WikiPage page;
public static Response response;
public static MockResponseSender sender;
- public static String baseDir = SampleFileUtility.base;
+ public static String baseDir = FitNesseUtil.base;
+ public static Authenticator authenticator;
public static FitNesseContext context;
public static FitNesse fitnesse;
}
View
5 src/fitnesse/fixtures/PageDriver.java
@@ -18,6 +18,7 @@
import org.htmlparser.util.NodeList;
import org.json.JSONObject;
+import fitnesse.FitNesseContext.Builder;
import fitnesse.FitNesseExpediter;
import fitnesse.authentication.OneUserAuthenticator;
import fitnesse.http.MockRequest;
@@ -276,7 +277,9 @@ public boolean pageHasAttribute(String fullPathOfPage, String attribute) throws
}
public void givenUserWithPassword(String user, String password) {
- FitnesseFixtureContext.context.authenticator = new OneUserAuthenticator(user, password);
+ Builder builder = new Builder(FitnesseFixtureContext.context);
+ builder.authenticator = new OneUserAuthenticator(user, password);
+ FitnesseFixtureContext.context = builder.createFitNesseContext();
}
public void sendAsHash(Map<String, String> hash) {
View
10 src/fitnesse/fixtures/SetUp.java
@@ -11,6 +11,7 @@
import util.FileUtil;
import fit.Fixture;
import fitnesse.FitNesse;
+import fitnesse.authentication.Authenticator;
import fitnesse.components.SaveRecorder;
import fitnesse.responders.WikiImportTestEventListener;
import fitnesse.testutil.FitNesseUtil;
@@ -22,7 +23,14 @@ public SetUp() throws Exception {
WikiImportTestEventListener.register();
root = InMemoryPage.makeRoot("RooT");
- context = FitNesseUtil.makeTestContext(root, 9123);
+ context = FitNesseUtil.makeTestContext(root, 9123, new Authenticator() {
+ @Override public boolean isAuthenticated(String username, String password) {
+ if (FitnesseFixtureContext.authenticator != null) {
+ return FitnesseFixtureContext.authenticator.isAuthenticated(username, password);
+ }
+ return true;
+ }
+ });
fitnesse = new FitNesse(context, false);
File historyDirectory = context.getTestHistoryDirectory();
if (historyDirectory.exists())
View
120 src/fitnesse/responders/WikiImportingResponderAuthenticationTest.java
@@ -0,0 +1,120 @@
+package fitnesse.responders;
+
+import fitnesse.FitNesseContext;
+import fitnesse.authentication.OneUserAuthenticator;
+import fitnesse.http.ChunkedResponse;
+import fitnesse.http.MockChunkedDataProvider;
+import fitnesse.http.MockRequest;
+import fitnesse.http.MockResponseSender;
+import fitnesse.http.Response;
+import fitnesse.testutil.FitNesseUtil;
+import fitnesse.wiki.PageData;
+import fitnesse.wiki.WikiPage;
+import fitnesse.wiki.WikiPagePath;
+import util.RegexTestCase;
+
+public class WikiImportingResponderAuthenticationTest extends RegexTestCase {
+ private WikiImportingResponder responder;
+ private String baseUrl;
+ private WikiImporterTest testData;
+
+ public void setUp() throws Exception {
+ testData = new WikiImporterTest();
+ testData.createRemoteRoot();
+ testData.createLocalRoot();
+
+ FitNesseContext context = FitNesseUtil.makeTestContext(testData.remoteRoot, new OneUserAuthenticator("joe", "blow"));
+
+ FitNesseUtil.startFitnesseWithContext(context);
+ baseUrl = FitNesseUtil.URL;
+
+ createResponder();
+ }
+
+ private void createResponder() throws Exception {
+ responder = new WikiImportingResponder();
+ responder.path = new WikiPagePath();
+ ChunkedResponse response = new ChunkedResponse("html", new MockChunkedDataProvider());
+ response.sendTo(new MockResponseSender());
+ responder.setResponse(response);
+ responder.getImporter().setDeleteOrphanOption(false);
+ }
+
+ public void tearDown() throws Exception {
+ FitNesseUtil.stopFitnesse();
+ }
+
+ private void makeSecurePage(WikiPage page) throws Exception {
+ PageData data = page.getData();
+ data.setAttribute(PageData.PropertySECURE_READ);
+ page.commit(data);
+ }
+
+ private void checkRemoteLoginForm(String content) {
+ assertHasRegexp("The wiki at .* requires authentication.", content);
+ assertSubString("<form", content);
+ assertHasRegexp("<input[^>]*name=\"remoteUsername\"", content);
+ assertHasRegexp("<input[^>]*name=\"remotePassword\"", content);
+ }
+
+ private MockRequest makeRequest(String remoteUrl) {
+ MockRequest request = new MockRequest();
+ request.setResource("PageTwo");
+ request.addInput("responder", "import");
+ request.addInput("remoteUrl", remoteUrl);
+ return request;
+ }
+
+ private ChunkedResponse makeSampleResponse(String remoteUrl) {
+ MockRequest request = makeRequest(remoteUrl);
+
+ return getResponse(request);
+ }
+
+ private ChunkedResponse getResponse(MockRequest request) {
+ ChunkedResponse response = (ChunkedResponse) responder.makeResponse(FitNesseUtil.makeTestContext(testData.localRoot), request);
+ response.turnOffChunking();
+ return response;
+ }
+
+ public void testUnauthorizedResponse() throws Exception {
+ makeSecurePage(testData.remoteRoot);
+
+ Response response = makeSampleResponse(baseUrl);
+ MockResponseSender sender = new MockResponseSender();
+ sender.doSending(response);
+ String content = sender.sentData();
+ checkRemoteLoginForm(content);
+ }
+
+ public void testUnauthorizedResponseFromNonRoot() throws Exception {
+ WikiPage childPage = testData.remoteRoot.getChildPage("PageOne");
+ makeSecurePage(childPage);
+
+ Response response = makeSampleResponse(baseUrl);
+ MockResponseSender sender = new MockResponseSender();
+ sender.doSending(response);
+ String content = sender.sentData();
+ assertSubString("The wiki at " + baseUrl + "PageOne requires authentication.", content);
+ assertSubString("<form", content);
+ }
+
+ public void testImportingFromSecurePageWithCredentials() throws Exception {
+ makeSecurePage(testData.remoteRoot);
+
+ MockRequest request = makeRequest(baseUrl);
+ request.addInput("remoteUsername", "joe");
+ request.addInput("remotePassword", "blow");
+ Response response = getResponse(request);
+ MockResponseSender sender = new MockResponseSender();
+ sender.doSending(response);
+ String content = sender.sentData();
+
+ assertNotSubString("requires authentication", content);
+ assertSubString("3 pages were imported.", content);
+
+ assertEquals("joe", WikiImporter.remoteUsername);
+ assertEquals("blow", WikiImporter.remotePassword);
+ }
+
+}
View
60 src/fitnesse/responders/WikiImportingResponderTest.java
@@ -5,9 +5,6 @@
import java.io.IOException;
import util.RegexTestCase;
-import fitnesse.FitNesseContext;
-import fitnesse.FitNesseContext.Builder;
-import fitnesse.authentication.OneUserAuthenticator;
import fitnesse.http.ChunkedResponse;
import fitnesse.http.MockChunkedDataProvider;
import fitnesse.http.MockRequest;
@@ -25,14 +22,13 @@
private WikiImportingResponder responder;
private String baseUrl;
private WikiImporterTest testData;
- private FitNesseContext context;
public void setUp() throws Exception {
testData = new WikiImporterTest();
testData.createRemoteRoot();
testData.createLocalRoot();
- context = FitNesseUtil.startFitnesse(testData.remoteRoot);
+ FitNesseUtil.startFitnesse(testData.remoteRoot);
baseUrl = "http://localhost:" + FitNesseUtil.PORT + "/";
createResponder();
@@ -226,60 +222,6 @@ public void testErrorMessageForBadUrlProvided() throws Exception {
assertSubString("The URL's resource path, blah, is not a valid WikiWord.", content);
}
- public void testUnauthorizedResponse() throws Exception {
- makeSecurePage(testData.remoteRoot);
-
- Response response = makeSampleResponse(baseUrl);
- MockResponseSender sender = new MockResponseSender();
- sender.doSending(response);
- String content = sender.sentData();
- checkRemoteLoginForm(content);
- }
-
- private void makeSecurePage(WikiPage page) throws Exception {
- PageData data = page.getData();
- data.setAttribute(PageData.PropertySECURE_READ);
- page.commit(data);
- Builder builder = new Builder(context);
- context.authenticator = new OneUserAuthenticator("joe", "blow");
- }
-
- private void checkRemoteLoginForm(String content) {
- assertHasRegexp("The wiki at .* requires authentication.", content);
- assertSubString("<form", content);
- assertHasRegexp("<input[^>]*name=\"remoteUsername\"", content);
- assertHasRegexp("<input[^>]*name=\"remotePassword\"", content);
- }
-
- public void testUnauthorizedResponseFromNonRoot() throws Exception {
- WikiPage childPage = testData.remoteRoot.getChildPage("PageOne");
- makeSecurePage(childPage);
-
- Response response = makeSampleResponse(baseUrl);
- MockResponseSender sender = new MockResponseSender();
- sender.doSending(response);
- String content = sender.sentData();
- assertSubString("The wiki at " + baseUrl + "PageOne requires authentication.", content);
- assertSubString("<form", content);
- }
-
- public void testImportingFromSecurePageWithCredentials() throws Exception {
- makeSecurePage(testData.remoteRoot);
-
- MockRequest request = makeRequest(baseUrl);
- request.addInput("remoteUsername", "joe");
- request.addInput("remotePassword", "blow");
- Response response = getResponse(request);
- MockResponseSender sender = new MockResponseSender();
- sender.doSending(response);
- String content = sender.sentData();
-
- assertNotSubString("requires authentication", content);
- assertSubString("3 pages were imported.", content);
-
- assertEquals("joe", WikiImporter.remoteUsername);
- assertEquals("blow", WikiImporter.remotePassword);
- }
public void testListOfOrphanedPages() throws Exception {
WikiImporter importer = new WikiImporter();
View
8 src/fitnesse/responders/files/DirectoryResponderTest.java
@@ -28,7 +28,7 @@ public void tearDown() throws Exception {
public void testDirectotyListing() throws Exception {
request.setResource("files/testDir/");
- Responder responder = FileResponder.makeResponder(request, SampleFileUtility.base);
+ Responder responder = FileResponder.makeResponder(request, FitNesseUtil.base);
response = (SimpleResponse) responder.makeResponse(context, request);
assertHasRegexp("testDir", response.getContent());
assertHasRegexp("testFile2", response.getContent());
@@ -38,7 +38,7 @@ public void testDirectotyListing() throws Exception {
public void testButtons() throws Exception {
request.setResource("files/testDir/");
- Responder responder = FileResponder.makeResponder(request, SampleFileUtility.base);
+ Responder responder = FileResponder.makeResponder(request, FitNesseUtil.base);
response = (SimpleResponse) responder.makeResponse(context, request);
assertHasRegexp("Upload", response.getContent());
@@ -47,14 +47,14 @@ public void testButtons() throws Exception {
public void testHtml() throws Exception {
request.setResource("files/testDir/");
- Responder responder = FileResponder.makeResponder(request, SampleFileUtility.base);
+ Responder responder = FileResponder.makeResponder(request, FitNesseUtil.base);
response = (SimpleResponse) responder.makeResponse(context, request);
assertHasRegexp("/files/", response.getContent());
}
public void testRedirectForDirectory() throws Exception {
request.setResource("files/testDir");
- Responder responder = FileResponder.makeResponder(request, SampleFileUtility.base);
+ Responder responder = FileResponder.makeResponder(request, FitNesseUtil.base);
Response response = responder.makeResponse(context, request);
assertEquals(303, response.getStatus());
assertEquals("/files/testDir/", response.getHeader("Location"));
View
22 src/fitnesse/responders/files/FileResponderTest.java
@@ -57,7 +57,7 @@ public void tearDown() throws Exception {
@Test
public void testFileContent() throws Exception {
request.setResource("files/testFile1");
- responder = (FileResponder) FileResponder.makeResponder(request, SampleFileUtility.base);
+ responder = (FileResponder) FileResponder.makeResponder(request, FitNesseUtil.base);
response = responder.makeResponse(context, request);
RegexTestCase.assertEquals(InputStreamResponse.class, response.getClass());
MockResponseSender sender = new MockResponseSender();
@@ -68,7 +68,7 @@ public void testFileContent() throws Exception {
@Test
public void testClasspathResourceContent() throws Exception {
request.setResource("files/fitnesse/testresource.txt");
- responder = (FileResponder) FileResponder.makeResponder(request, SampleFileUtility.base);
+ responder = (FileResponder) FileResponder.makeResponder(request, FitNesseUtil.base);
response = responder.makeResponse(context, request);
MockResponseSender sender = new MockResponseSender();
sender.doSending(response);
@@ -78,10 +78,10 @@ public void testClasspathResourceContent() throws Exception {
@Test
public void testSpacesInFileName() throws Exception {
request.setResource("files/test%20File%20With%20Spaces%20In%20Name");
- responder = (FileResponder) FileResponder.makeResponder(request, SampleFileUtility.base);
+ responder = (FileResponder) FileResponder.makeResponder(request, FitNesseUtil.base);
assertEquals(context.rootDirectoryName + File.separator + "files" + File.separator + "test File With Spaces In Name", responder.requestedFile.getPath());
request.setResource("files/file4%20with%20spaces%32.txt");
- responder = (FileResponder) FileResponder.makeResponder(request, SampleFileUtility.base);
+ responder = (FileResponder) FileResponder.makeResponder(request, FitNesseUtil.base);
assertEquals("files/file4 with spaces2.txt", responder.resource);
}
@@ -89,7 +89,7 @@ public void testSpacesInFileName() throws Exception {
public void testLastModifiedHeader() throws Exception {
Locale.setDefault(Locale.US);
request.setResource("files/testFile1");
- responder = (FileResponder) FileResponder.makeResponder(request, SampleFileUtility.base);
+ responder = (FileResponder) FileResponder.makeResponder(request, FitNesseUtil.base);
response = responder.makeResponse(context, request);
String lastModifiedHeader = response.getHeader("Last-Modified");
assertMatches(HTTP_DATE_REGEXP, lastModifiedHeader);
@@ -106,13 +106,13 @@ public void test304IfNotModified() throws Exception {
request.setResource("files/testFile1");
request.addHeader("If-Modified-Since", yesterday);
- responder = (FileResponder) FileResponder.makeResponder(request, SampleFileUtility.base);
+ responder = (FileResponder) FileResponder.makeResponder(request, FitNesseUtil.base);
response = responder.makeResponse(context, request);
assertEquals(200, response.getStatus());
request.setResource("files/testFile1");
request.addHeader("If-Modified-Since", tomorrow);
- responder = (FileResponder) FileResponder.makeResponder(request, SampleFileUtility.base);
+ responder = (FileResponder) FileResponder.makeResponder(request, FitNesseUtil.base);
SimpleResponse notModifiedResponse = (SimpleResponse) responder.makeResponse(context, request);
assertEquals(304, notModifiedResponse.getStatus());
assertEquals("", notModifiedResponse.getContent());
@@ -124,7 +124,7 @@ public void test304IfNotModified() throws Exception {
public void testRecoverFromUnparseableDateInIfNotModifiedHeader() throws Exception {
request.setResource("files/testFile1");
request.addHeader("If-Modified-Since", "Unparseable Date");
- responder = (FileResponder) FileResponder.makeResponder(request, SampleFileUtility.base);
+ responder = (FileResponder) FileResponder.makeResponder(request, FitNesseUtil.base);
response = responder.makeResponse(context, request);
assertEquals(200, response.getStatus());
}
@@ -132,7 +132,7 @@ public void testRecoverFromUnparseableDateInIfNotModifiedHeader() throws Excepti
@Test
public void testNotFoundFile() throws Exception {
request.setResource("files/something/that/aint/there");
- Responder notFoundResponder = FileResponder.makeResponder(request, SampleFileUtility.base);
+ Responder notFoundResponder = FileResponder.makeResponder(request, FitNesseUtil.base);
SimpleResponse response = (SimpleResponse) notFoundResponder.makeResponse(context, request);
assertEquals(404, response.getStatus());
assertHasRegexp("files/something/that/aint/there", response.getContent());
@@ -142,7 +142,7 @@ public void testNotFoundFile() throws Exception {
public void testCssMimeType() throws Exception {
SampleFileUtility.addFile("/files/fitnesse.css", "body{color: red;}");
request.setResource("files/fitnesse.css");
- responder = (FileResponder) FileResponder.makeResponder(request, SampleFileUtility.base);
+ responder = (FileResponder) FileResponder.makeResponder(request, FitNesseUtil.base);
response = responder.makeResponse(context, request);
assertEquals("text/css", response.getContentType());
}
@@ -150,7 +150,7 @@ public void testCssMimeType() throws Exception {
@Test
public void testNavigationBackToFrontPage() throws Exception {
request.setResource("files/");
- DirectoryResponder responder = (DirectoryResponder) FileResponder.makeResponder(request, SampleFileUtility.base);
+ DirectoryResponder responder = (DirectoryResponder) FileResponder.makeResponder(request, FitNesseUtil.base);
response = responder.makeResponse(context, request);
response = responder.makeResponse(context, request);
MockResponseSender sender = new MockResponseSender();
View
24 src/fitnesse/testutil/FitNesseUtil.java
@@ -15,10 +15,12 @@
import fitnesse.wiki.WikiPage;
public class FitNesseUtil {
- private static FitNesse instance = null;
+ public static final String base = "TestDir";
public static final int PORT = 1999;
public static final String URL = "http://localhost:" + PORT + "/";
+ private static FitNesse instance = null;
+
public static FitNesseContext startFitnesse(WikiPage root) {
FitNesseContext context = makeTestContext(root);
startFitnesseWithContext(context);
@@ -53,16 +55,34 @@ public static FitNesseContext makeTestContext(int port) {
}
public static FitNesseContext makeTestContext(WikiPage root, int port) {
- return makeTestContext(root, null, SampleFileUtility.base, port);
+ return makeTestContext(root, null, FitNesseUtil.base, port, null);
+ }
+
+ public static FitNesseContext makeTestContext(WikiPage root,
+ Authenticator authenticator) {
+ return makeTestContext(root, null, FitNesseUtil.base, PORT, authenticator);
}
+ public static FitNesseContext makeTestContext(WikiPage root, int port,
+ Authenticator authenticator) {
+ return makeTestContext(root, null, FitNesseUtil.base, port, authenticator);
+ }
+
+
+
public static FitNesseContext makeTestContext(WikiPage root, String rootPath,
String rootDirectoryName, int port) {
+ return makeTestContext(root, rootPath, rootDirectoryName, port, null);
+ }
+
+ public static FitNesseContext makeTestContext(WikiPage root, String rootPath,
+ String rootDirectoryName, int port, Authenticator authenticator) {
Builder builder = new Builder();
builder.root = root;
builder.rootPath = rootPath;
builder.rootDirectoryName = rootDirectoryName;
builder.port = port;
+ builder.authenticator = authenticator;
FitNesseContext context = builder.createFitNesseContext();
// Ensure Velocity is configured with the default root directory name (FitNesseRoot)
View
16 src/fitnesse/testutil/SampleFileUtility.java
@@ -7,7 +7,7 @@
import util.FileUtil;
public class SampleFileUtility {
- public static String base = "TestDir";
+ public static final String base = FitNesseUtil.base;
public static File filesDir;
public static File testDir;
public static File testFile1;
@@ -16,24 +16,24 @@
public static File testFile4;
public static void makeSampleFiles() {
- File dir = new File(base);
+ File dir = new File(FitNesseUtil.base);
dir.mkdir();
filesDir = new File(dir, "files");
filesDir.mkdir();
testDir = new File(filesDir, "testDir");
testDir.mkdir();
- testFile1 = FileUtil.createFile(base + "/files/testFile1", "file1 content");
- testFile2 = FileUtil.createFile(base + "/files/testDir/testFile2", "file2 content");
- testFile3 = FileUtil.createFile(base + "/files/testDir/testFile3", "file3 content");
- testFile4 = FileUtil.createFile(base + "/files/file4 with spaces.txt", "file4 content");
+ testFile1 = FileUtil.createFile(FitNesseUtil.base + "/files/testFile1", "file1 content");
+ testFile2 = FileUtil.createFile(FitNesseUtil.base + "/files/testDir/testFile2", "file2 content");
+ testFile3 = FileUtil.createFile(FitNesseUtil.base + "/files/testDir/testFile3", "file3 content");
+ testFile4 = FileUtil.createFile(FitNesseUtil.base + "/files/file4 with spaces.txt", "file4 content");
}
public static void deleteSampleFiles() {
- FileUtil.deleteFileSystemDirectory(base);
+ FileUtil.deleteFileSystemDirectory(FitNesseUtil.base);
}
public static void addFile(String name, String content) {
- FileUtil.createFile(base + name, content);
+ FileUtil.createFile(FitNesseUtil.base + name, content);
}
}
View
4 src/fitnesse/updates/ReplacingFileUpdateTest.java
@@ -4,7 +4,7 @@
import org.junit.Test;
-import fitnesse.testutil.SampleFileUtility;
+import fitnesse.testutil.FitNesseUtil;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertEquals;
@@ -18,7 +18,7 @@
public final File sourceFile = new File(sourceFilename);
public final String destDirName = "subDir";
- public final String destPath = SampleFileUtility.base + "/" + destDirName + "/testFile";
+ public final String destPath = FitNesseUtil.base + "/" + destDirName + "/testFile";
public final File destFile = new File(destPath);
public void setUp() throws Exception {
View
7 src/fitnesse/updates/UpdateTestCase.java
@@ -4,7 +4,6 @@
import fitnesse.FitNesseContext;
import fitnesse.testutil.FitNesseUtil;
-import fitnesse.testutil.SampleFileUtility;
import fitnesse.wiki.FileSystemPage;
import fitnesse.wiki.PageCrawler;
import fitnesse.wiki.PathParser;
@@ -26,10 +25,10 @@
@Before
public void setUp() throws Exception {
- root = new FileSystemPage(SampleFileUtility.base, rootName);
+ root = new FileSystemPage(FitNesseUtil.base, rootName);
context = FitNesseUtil.makeTestContext(root);
- FileUtil.makeDir(SampleFileUtility.base);
+ FileUtil.makeDir(FitNesseUtil.base);
crawler = root.getPageCrawler();
pageOne = crawler.addPage(root, PathParser.parse("PageOne"), "some content");
@@ -42,7 +41,7 @@ public void setUp() throws Exception {
@After
public void tearDown() throws Exception {
- FileUtil.deleteFileSystemDirectory(SampleFileUtility.base);
+ FileUtil.deleteFileSystemDirectory(FitNesseUtil.base);
}
protected Update makeUpdate() throws Exception {

0 comments on commit 4d9b0e3

Please sign in to comment.
Something went wrong with that request. Please try again.