Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into added-complete-task-a…
Browse files Browse the repository at this point in the history
…nd-fixed-ui-issues

# Conflicts:
#	src/main/java/Main.java
#	src/main/java/d_frameworks_and_drivers/database_management/DBAdapters/DBMapper.java
#	src/main/java/d_frameworks_and_drivers/database_management/DBAdapters/DBSearcher.java
#	src/main/java/d_frameworks_and_drivers/database_management/DBControllers/DBManagerInsertController.java
#	src/main/java/d_frameworks_and_drivers/database_management/DBControllers/DBManagerRemoveController.java
#	src/main/java/d_frameworks_and_drivers/database_management/DBControllers/DBManagerSearchController.java
#	src/main/java/d_frameworks_and_drivers/database_management/DBControllers/EntityIDstoModelController.java
#	src/main/java/d_frameworks_and_drivers/database_management/DBControllers/IDListsToModelList.java
#	src/main/java/d_frameworks_and_drivers/database_management/DatabaseInitializer/DBInitializer.java
#	src/main/java/d_frameworks_and_drivers/database_management/DatabaseInitializer/ProjectDBInitializer.java
#	src/main/java/d_frameworks_and_drivers/database_management/DatabaseInitializer/TaskDBInitializer.java
#	src/main/java/d_frameworks_and_drivers/database_management/DatabaseInitializer/UniqueIDsInitializer.java
  • Loading branch information
rtutz committed Aug 16, 2023
2 parents 26bc208 + bf6acc8 commit cf3ee04
Show file tree
Hide file tree
Showing 39 changed files with 1,383 additions and 1,566 deletions.
9 changes: 6 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ javafx {

dependencies {

testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
testImplementation 'org.junit.platform:junit-platform-launcher:1.10.0-M1'
// https://mvnrepository.com/artifact/com.opencsv/opencsv
implementation group: 'com.opencsv', name: 'opencsv', version: '3.7'
implementation group: 'com.opencsv', name: 'opencsv', version: '5.7.1'
implementation 'org.apache.commons:commons-csv:1.10.0'
implementation 'commons-io:commons-io:2.13.0'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,17 @@ public void addTaskModelToPosition(TaskModel newTaskModel, int position) {
* remove is not in the column model.
*/
public void removeTaskModel(TaskModel taskModelToRemove) throws NoSuchElementException {
// the java.util.List.remove method returns a bool,
// indicating whether the object was removed or not.
// If it wasn't removed, we want to throw an exception,
// saying that the task model isn't in the column model, thus, it can't be
// removed.
// If it was removed, we don't have to do anything extra.
if (!this.taskModels.remove(taskModelToRemove)) {
// the java.util.List.remove method returns a bool,
// indicating whether the object was removed or not.
// If it wasn't removed, we want to throw an exception,
// saying that the task model isn't in the column model, thus, it can't be
// removed.
// If it was removed, we don't have to do anything extra.
throw new NoSuchElementException(
"The task model " + taskModelToRemove.toString() + " is not in this column model");
}

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
import java.io.File;
import java.io.FileWriter;


public class ColumnDBInitializer {
String[] ColumnHeaders = {"ColumnID", "Name", "Task ID's"};

/**
* Initializes column csv file for database with the above headers.
*/
public ColumnDBInitializer() {
// create CSVWriter object filewriter object as parameter
File file = new File("src/main/java/d_frameworks_and_drivers/database_management/DatabaseFiles/Columns/Columns.csv");
Expand Down
97 changes: 97 additions & 0 deletions src/test/java/TestRunner.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
//
//import a_enterprise_business_rules.entities.*;
//import b_application_business_rules.entity_models.*;
//import b_application_business_rules.use_cases.project_selection_use_cases.CreateProjectTest;
//import b_application_business_rules.use_cases.project_selection_use_cases.DeleteProjectTest;
//import b_application_business_rules.use_cases.project_selection_use_cases.EditProjectDetailsTest;
//import b_application_business_rules.use_cases.project_viewing_and_modification_use_cases.*;
//import c_interface_adapters.view_models.*;
//import d_frameworks_and_drivers.database_management.DatabaseInitializer.*;
//import d_frameworks_and_drivers.database_management.DBControllers.*;
//import d_frameworks_and_drivers.database_management.*;
//import d_frameworks_and_drivers.database_management.DBAdapters.*;
//
//
//
//import org.junit.platform.launcher.Launcher;
//import org.junit.platform.launcher.LauncherDiscoveryRequest;
//import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder;
//import org.junit.platform.launcher.core.LauncherFactory;
//import org.junit.platform.launcher.listeners.SummaryGeneratingListener;
//
//import org.junit.platform.launcher.listeners.TestExecutionSummary.Failure;
//
//import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass;
//
///**
// * Runs all tests at once.
// */
//public class TestRunner {
// public static void main(String[] args) {
// LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request()
// .selectors(
// // entities
// selectClass(ProjectTest.class),
// selectClass(ColumnTest.class),
// selectClass(TaskTest.class),
// // entity models
// selectClass(ProjectModelTest.class),
// selectClass(ColumnModelTest.class),
// selectClass(TaskModelTest.class),
// // entity view models
// selectClass(ProjectViewModelTest.class),
// selectClass(ColumnViewModelTest.class),
// selectClass(TaskViewModelTest.class),
// // project use cases
// selectClass(CreateProjectTest.class),
// selectClass(DeleteProjectTest.class),
// selectClass(EditProjectDetailsTest.class),
// // column use cases
// selectClass(AddColumnTest.class),
// selectClass(DeleteColumnTest.class),
// selectClass(EditColumnTest.class),
// // task use cases
// selectClass(AddTaskTest.class),
// selectClass(DeleteTaskTest.class),
// selectClass(EditTaskTest.class),
// // initializers
// selectClass(ProjectDBInitializerTest.class),
// selectClass(ColumnDBInitializerTest.class),
// selectClass(TaskDBInitializerTest.class),
// selectClass(UniqueIDsInitializerTest.class),
// // database adapters and controllers
// selectClass(DBMapperTest.class),
// selectClass(DBSearcherTest.class),
// selectClass(DbIDToModelTest.class),
// selectClass(DBManagerInsertControllerTest.class),
// selectClass(DBManagerSearchControllerTest.class),
// selectClass(DBManagerRemoveControllerTest.class),
// selectClass(EntityIDsToListControllerTest.class),
// selectClass(EntityIDstoModelControllerTest.class),
// selectClass(IDListsToModelListTest.class),
// selectClass(UniqueIDsReaderTest.class),
// selectClass(ProjectUUIDArrayTest.class)
// ).build();
//
// Launcher launcher = LauncherFactory.create();
// SummaryGeneratingListener listener = new SummaryGeneratingListener();
//
// launcher.registerTestExecutionListeners(listener);
// launcher.execute(request);
//
// // Print test results
// for (Failure failure : listener.getSummary().getFailures()) {
// System.out.println("FAILED: " + failure.getTestIdentifier().getDisplayName());
// System.out.println("Reason: " + failure.getException().getMessage());
// System.out.println();
// }
//
// System.out.println("Test execution finished.");
// }
//
//}
//
//
//
//
//
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* A class to test the Column entity.
*/
class ColumnTest {
public class ColumnTest {

@Test
/**
Expand Down Expand Up @@ -79,10 +79,11 @@ void setID() {
LocalDateTime.of(2023, 02, 18, 11, 10, 5, 2)));
sampleTasks1.add(new Task("t3 name", UUID.randomUUID(), "t3 desc", false,
LocalDateTime.of(1985, 10, 1, 19, 13, 9, 6)));
Column c = new Column("testing column name", sampleTasks1, UUID.randomUUID());

UUID currID = UUID.randomUUID();

Column c = new Column("testing column name", sampleTasks1, currID); // Set the UUID of the Column

Assertions.assertEquals(c.getID(), currID);
}

Expand Down
Loading

0 comments on commit cf3ee04

Please sign in to comment.