<commit_before>// @@author A0138909R
package guitests;

import java.io.IOException;

import org.junit.Test;

import seedu.doit.commons.exceptions.DataConversionException;
import seedu.doit.commons.exceptions.IllegalValueException;
import seedu.doit.logic.commands.LoadCommand;
import seedu.doit.logic.commands.SaveCommand;
import seedu.doit.testutil.TestTask;
import seedu.doit.testutil.TestUtil;
import seedu.doit.testutil.TypicalTestTasks;

public class LoadCommandTest extends TaskManagerGuiTest {
    private static final String GUI_ALTERNATE_XML_FILE = "guitest1.xml";
    private static final String ALTERNATE_XML = TestUtil.SANDBOX_FOLDER + GUI_ALTERNATE_XML_FILE;

    @Test
    public void load() throws DataConversionException, IOException, IllegalValueException {
        TestTask[] currentList = this.td.getTypicalTasks();
        TestTask taskToAdd = TypicalTestTasks.getFloatingTestTask();
        this.commandBox.runCommand(taskToAdd.getAddCommand());
        currentList = TestUtil.addTasksToList(currentList, taskToAdd);
        this.commandBox.runCommand(SaveCommand.COMMAND_WORD + " " + ALTERNATE_XML);
        this.commandBox.runCommand(LoadCommand.COMMAND_WORD + " " + getDataFileLocation());

        TestTask[] expectedList = currentList;
        assertAllPanelsMatch(currentList);

        // add another task
        taskToAdd = TypicalTestTasks.getDeadlineTestTask();
        currentList = TestUtil.addTasksToList(currentList, taskToAdd);
        this.commandBox.runCommand(taskToAdd.getAddCommand());
        this.commandBox.runCommand(LoadCommand.COMMAND_WORD + " " + ALTERNATE_XML);
        assertAllPanelsMatch(expectedList);

        // add another event
        taskToAdd = TypicalTestTasks.getEventTestTask();
        this.commandBox.runCommand(taskToAdd.getAddCommand());
        this.commandBox.runCommand(LoadCommand.COMMAND_WORD + " " + getDataFileLocation());
        assertAllPanelsMatch(currentList);<commit_msg>Fix bug by including the deletion of guitest1.xml file<commit_after>// @@author A0138909R
package guitests;

import java.io.File;
import java.io.IOException;

import org.junit.Test;

import seedu.doit.commons.exceptions.DataConversionException;
import seedu.doit.commons.exceptions.IllegalValueException;
import seedu.doit.logic.commands.LoadCommand;
import seedu.doit.logic.commands.SaveCommand;
import seedu.doit.testutil.TestTask;
import seedu.doit.testutil.TestUtil;
import seedu.doit.testutil.TypicalTestTasks;

public class LoadCommandTest extends TaskManagerGuiTest {
    private static final String GUI_ALTERNATE_XML_FILE = "guitest1.xml";
    private static final String ALTERNATE_XML = TestUtil.SANDBOX_FOLDER + GUI_ALTERNATE_XML_FILE;

    @Test
    public void load() throws DataConversionException, IOException, IllegalValueException {
        TestTask[] currentList = this.td.getTypicalTasks();
        TestTask taskToAdd = TypicalTestTasks.getFloatingTestTask();
        this.commandBox.runCommand(taskToAdd.getAddCommand());
        currentList = TestUtil.addTasksToList(currentList, taskToAdd);
        this.commandBox.runCommand(SaveCommand.COMMAND_WORD + " " + ALTERNATE_XML);
        this.commandBox.runCommand(LoadCommand.COMMAND_WORD + " " + getDataFileLocation());

        TestTask[] expectedList = currentList;
        assertAllPanelsMatch(currentList);

        // add another task
        taskToAdd = TypicalTestTasks.getDeadlineTestTask();
        currentList = TestUtil.addTasksToList(currentList, taskToAdd);
        this.commandBox.runCommand(taskToAdd.getAddCommand());
        this.commandBox.runCommand(LoadCommand.COMMAND_WORD + " " + ALTERNATE_XML);
        assertAllPanelsMatch(expectedList);

        // add another event
        taskToAdd = TypicalTestTasks.getEventTestTask();
        this.commandBox.runCommand(taskToAdd.getAddCommand());
        this.commandBox.runCommand(LoadCommand.COMMAND_WORD + " " + getDataFileLocation());
        assertAllPanelsMatch(currentList);
        File file = new File(ALTERNATE_XML);
        file.delete();
{'fraction_non_alphanumeric': 0.0932077342588002, 'fraction_numerical': 0.00421417947446703, 'mean_word_length': 4.3585657370517925, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 3}, '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': '6950056', 'n_tokens_mistral': 1203, 'n_tokens_neox': 1173, 'n_words': 190}