Skip to content

Commit

Permalink
Merge pull request #75 from CSC207-2023Y-UofT/72-feature-20-adding-to…
Browse files Browse the repository at this point in the history
…-database-testing-documentation

72 feature 20 adding to database testing documentation
  • Loading branch information
igor-kan authored Aug 10, 2023
2 parents d806111 + a705d31 commit 230e7f5
Show file tree
Hide file tree
Showing 88 changed files with 3,419 additions and 1,355 deletions.
29 changes: 15 additions & 14 deletions src/main/java/a_enterprise_business_rules/entities/Column.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,17 +227,8 @@ public String toString() {
return columnStringRepresentation;
}

// TODO:turn this into its own class
// private UUID getValidColumnID(){
// this.ID = UUID.randomUUID();
// DBManagerInsertController dbManagerInsertController = new
// DBManagerInsertController();
// while(uuidMap.containsKey(this.ID.toString())){
// this.ID = UUID.randomUUID();
// }
// dbManagerInsertController.DBInsert(this.ID);
// return this.ID;
// }



/**
* Returns whether this Column and another object are equal.
Expand All @@ -258,11 +249,11 @@ public boolean equals(Object o) {
}

/**
* Searches an List of columns and returns one that has the same ID as the given
* Searches a List of columns and returns one that has the same ID as the given
* ID. Otherwise, returns null.
*
* @param columnID
* @param listOfColumns
* @param columnID UUID ID of column searched.
* @param listOfColumns List of column entities to do the search in.
*/
public static Column IDToColumn(UUID columnID, List<Column> listOfColumns) {
int i = 0;
Expand All @@ -287,5 +278,15 @@ public static Column IDToColumn(UUID columnID, List<Column> listOfColumns) {
// Column found = Column.IDToColumn(id2, listOfColumns);
// System.out.println(c2.equals(found));
// }
// private UUID getValidColumnID(){
// this.ID = UUID.randomUUID();
// DBManagerInsertController dbManagerInsertController = new
// DBManagerInsertController();
// while(uuidMap.containsKey(this.ID.toString())){
// this.ID = UUID.randomUUID();
// }
// dbManagerInsertController.DBInsert(this.ID);
// return this.ID;
// }

}
7 changes: 4 additions & 3 deletions src/main/java/a_enterprise_business_rules/entities/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,10 @@ public boolean equals(Object o) {
}

/**
*
* @param taskID
* @param listOfTasks
* Searches a List of tasks and returns one that has the same ID as the given
* * ID. Otherwise, returns null.
* @param taskID UUID ID of task searched.
* @param listOfTasks List of task entities to do the search in.
* @return
*/
public static Task IDToTask(UUID taskID, ArrayList<Task> listOfTasks) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public class AdapterConvertString {
* @return
*/
public static List<String> toStringIDsList(String inputString){
// Split the inputString using delimiter ", "
String[] stringArray = inputString.split(", ");
// Split the inputString using delimiter ","
String[] stringArray = inputString.split(",");

// Convert array to a list using
List<String> stringList = Arrays.asList(stringArray);
Expand All @@ -27,7 +27,7 @@ public static List<String> toStringIDsList(String inputString){
*/
public static List<UUID> toIDsList(String inputString){
// Split the inputString using delimiter ", "
String[] stringArray = inputString.split(", ");
String[] stringArray = inputString.split(",");
List<UUID> idList = new ArrayList<>();
for (String s : stringArray){
idList.add(UUID.fromString(s));
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ public interface IDBInsert {

void DBInsert(UUID uuid);

void DBInsert(TaskModel taskModel, UUID parent);
void DBInsert(TaskModel taskModel);
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
package b_application_business_rules.use_cases.project_selection_use_cases;

import b_application_business_rules.entity_models.ProjectModel;
import b_application_business_rules.use_cases.interfaces.ProjectRepository;
import b_application_business_rules.use_cases.project_selection_gateways.IDBRemove;
import d_frameworks_and_drivers.database_management.DBControllers.DBManagerRemoveController;

import java.util.UUID;

import a_enterprise_business_rules.entities.Project;

public class DeleteProject implements DeleteProjectUseCase {
private ProjectRepository projectRepository;
public class DeleteProject {
/**
* Empty constructor (would be autogenerated by Java if not included anyways)
*/
public DeleteProject() {
this.projectRepository = projectRepository;

}

/**
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void addTask(UUID idOfColumn) {
// Initializing the required controllers and calls method that adds task to the
// database
IDBInsert insertTask = new DBManagerInsertController();
insertTask.DBInsert(taskModel, idOfColumn);
insertTask.DBInsert(taskModel);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void updateTaskDetail(UUID taskID, TaskModel updatedTask, UUID parentColu
removeTask.DBRemove(oldTask, taskID);

// Inserting the new task
insertTask.DBInsert(updatedTask, parentColumn);
insertTask.DBInsert(updatedTask);

}

Expand Down
42 changes: 0 additions & 42 deletions src/main/java/c_interface_adapters/CSVColumnRepository.java

This file was deleted.

43 changes: 0 additions & 43 deletions src/main/java/c_interface_adapters/CSVProjectRepository.java

This file was deleted.

9 changes: 0 additions & 9 deletions src/main/java/c_interface_adapters/UniqueIDsReader.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* CSVSearcher frameworks and driver class.
*/
public class CSVMapper implements AutoCloseable {
public class DBMapper implements AutoCloseable {
private File csvFile;
private FileReader fileReader;
private CSVParser csvParser;
Expand All @@ -21,7 +21,7 @@ public class CSVMapper implements AutoCloseable {
* Creates a new CSVSearcher given the filePath to csv to read.
* @param filePath
*/
public CSVMapper(String filePath) throws FileNotFoundException, IOException {
public DBMapper(String filePath) throws FileNotFoundException, IOException {
this.csvFile = new File(filePath);
}

Expand Down
Loading

0 comments on commit 230e7f5

Please sign in to comment.