@@ -0,0 +1,2763 @@
+//@@author A0147944U%0Apackage guitests;%0A%0Aimport org.junit.Test;%0A%0Aimport seedu.task.commons.core.Messages;%0Aimport seedu.task.logic.commands.BackupCommand;%0Aimport seedu.task.testutil.TypicalTestTasks;%0A%0Aimport static org.junit.Assert.assertTrue;%0A%0Apublic class BackupCommandTest extends TaskManagerGuiTest %7B%0A%0A    public static final String filepath_A = %22data/empty%22;%0A    public static final String filepath_B = %22data/notempty%22;%0A    public static final String filepath_C = %22c:/inaccessible%22;%0A    public static final String filepath_D = %22invalid:/drive%22;%0A    public static final String filepath_E = %22c:/invalid%3Echaracter%22;%0A%0A    @Test%0A    public void backup() %7B%0A%0A        //verify an empty TaskManager can be backed up in a valid directory%0A        commandBox.runCommand(%22clear%22);%0A        assertListSize(0);%0A        assertResultMessage(%22Task manager has been cleared!%22);%0A        commandBox.runCommand(%22backup %22 + filepath_A);%0A        assertResultMessage(String.format(BackupCommand.MESSAGE_BACKUP_SUCCESS, filepath_A + %22.xml%22));%0A        //assertBackupCommandSuccess();%0A        %0A        //verify a non-empty TaskManager can be backed up in a valid directory%0A        commandBox.runCommand(TypicalTestTasks.taskH.getAddCommand());%0A        assertTrue(taskListPanel.isListMatching(TypicalTestTasks.taskH));%0A        commandBox.runCommand(%22backup %22 + filepath_B);%0A        assertResultMessage(String.format(BackupCommand.MESSAGE_BACKUP_SUCCESS, filepath_B + %22.xml%22));%0A        //assertBackupCommandSuccess();%0A        %0A      //verify TaskManager can be backed up in a valid directory onto an existing backup%0A        commandBox.runCommand(%22backup %22 + filepath_A);%0A        assertResultMessage(String.format(BackupCommand.MESSAGE_BACKUP_SUCCESS, filepath_A + %22.xml%22));%0A        //assertBackupCommandSuccess();%0A%0A        //verify a TaskManager can't be backed up in an inaccessible directory%0A        commandBox.runCommand(%22backup %22 + filepath_C);%0A        assertResultMessage(String.format(BackupCommand.MESSAGE_BACKUP_FAILURE, filepath_C + %22.xml%22));%0A        //assertBackupCommandFailure();%0A        %0A        //verify a TaskManager can't be backed up in an invalid directory%0A        commandBox.runCommand(%22backup %22 + filepath_D);%0A        assertResultMessage(String.format(BackupCommand.MESSAGE_BACKUP_FAILURE, filepath_D + %22.xml%22));%0A        //assertBackupCommandFailure();%0A        commandBox.runCommand(%22backup %22 + filepath_E);%0A        assertResultMessage(String.format(Messages.MESSAGE_INVALID_COMMAND_FORMAT, BackupCommand.MESSAGE_USAGE));%0A        //assertBackupCommandFailure();%0A    %7D%0A%0A    /* Needs more in depth testing%0A     * 1) Check content of successful backup%0A     * private void assertBackupCommandSuccess() %7B%0A%0A    %7D%0A    %0A    private void assertBackupCommandFailure() %7B%0A%0A    %7D*/%0A%7D%0A

Add JUnit test for BackupCommand