<commit_before>// Copyright (C) 2003-2009 by Object Mentor, Inc. All rights reserved.
// Released under the terms of the CPL Common Public License version 1.0.
package fitnesse.responders.files;

import static util.RegexTestCase.assertSubString;

import fitnesse.FitNesseContext;
import fitnesse.Responder;
import fitnesse.http.MockRequest;
import fitnesse.http.SimpleResponse;
import fitnesse.testutil.FitNesseUtil;
import fitnesse.testutil.SampleFileUtility;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class RenameFileConfirmationResponderTest {
  MockRequest request;
  private FitNesseContext context;
  private String content;

  @Before
  public void setUp() throws Exception {
    request = new MockRequest();
    context = FitNesseUtil.makeTestContext(null);
    SampleFileUtility.makeSampleFiles();
  }

  @After
  public void tearDown() throws Exception {
    SampleFileUtility.deleteSampleFiles();
  }

  @Test
  public void testContentOfPage() throws Exception {
    getContentForSimpleRename();

    assertSubString("renameFile", content);
    assertSubString("Rename", content);
    assertSubString("Rename <b>MyFile.txt</b>", content);
  }

  @Test
  public void testExistingFilenameIsInTextField() throws Exception {
    getContentForSimpleRename();

    assertSubString("<input type=\"text\" name=\"newName\" value=\"MyFile.txt\"/>", content);
  }

  private void getContentForSimpleRename() throws Exception {
    request.setResource("files");
    request.addInput("filename", "MyFile.txt");
    Responder responder = new RenameFileConfirmationResponder();
    SimpleResponse response = (SimpleResponse) responder.makeResponse(context, request);
    content = response.getContent();
  }

  @Test
  public void testFitnesseLook() throws Exception {
    Responder responder = new RenameFileConfirmationResponder();
    SimpleResponse response = (SimpleResponse) responder.makeResponse(context, request);
    String content = response.getContent();
    assertSubString("<link rel=\"stylesheet\" type=\"text/css\" href=\"/files/fitnesse/css/fitnesse_wiki.css\"", content);
  }

}<commit_msg>Whoops. Need to keep the tests working...<commit_after>// Copyright (C) 2003-2009 by Object Mentor, Inc. All rights reserved.
// Released under the terms of the CPL Common Public License version 1.0.
package fitnesse.responders.files;

import static util.RegexTestCase.assertSubString;

import fitnesse.FitNesseContext;
import fitnesse.Responder;
import fitnesse.http.MockRequest;
import fitnesse.http.SimpleResponse;
import fitnesse.testutil.FitNesseUtil;
import fitnesse.testutil.SampleFileUtility;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class RenameFileConfirmationResponderTest {
  MockRequest request;
  private FitNesseContext context;
  private String content;

  @Before
  public void setUp() throws Exception {
    request = new MockRequest();
    context = FitNesseUtil.makeTestContext(null);
    SampleFileUtility.makeSampleFiles();
  }

  @After
  public void tearDown() throws Exception {
    SampleFileUtility.deleteSampleFiles();
  }

  @Test
  public void testContentOfPage() throws Exception {
    getContentForSimpleRename();

    assertSubString("renameFile", content);
    assertSubString("Rename", content);
    assertSubString("Rename <b>MyFile.txt</b>", content);
  }

  @Test
  public void testExistingFilenameIsInTextField() throws Exception {
    getContentForSimpleRename();

    assertSubString("<input id=\"rename-file\" type=\"text\" name=\"newName\" value=\"MyFile.txt\"/>", content);
  }

  private void getContentForSimpleRename() throws Exception {
    request.setResource("files");
    request.addInput("filename", "MyFile.txt");
    Responder responder = new RenameFileConfirmationResponder();
    SimpleResponse response = (SimpleResponse) responder.makeResponse(context, request);
    content = response.getContent();
  }

  @Test
  public void testFitnesseLook() throws Exception {
    Responder responder = new RenameFileConfirmationResponder();
    SimpleResponse response = (SimpleResponse) responder.makeResponse(context, request);
    String content = response.getContent();
    assertSubString("<link rel=\"stylesheet\" type=\"text/css\" href=\"/files/fitnesse/css/fitnesse_wiki.css\"", content);
  }

}
{'fraction_non_alphanumeric': 0.10851997229277303, 'fraction_numerical': 0.004617871161394597, 'mean_word_length': 4.9751724137931035, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3317580', 'n_tokens_mistral': 1266, 'n_tokens_neox': 1217, 'n_words': 295}