From 518c6b0950558c9028a15f3aae0e79ecb0e31ca2 Mon Sep 17 00:00:00 2001 From: Rhys Evans <EvansRM17@cardiff.ac.uk> Date: Fri, 8 Dec 2023 12:56:36 +0000 Subject: [PATCH] Commiting to cehckout main --- build.gradle | 4 +- .../java/Team5/SmartTowns/DBUnitTestCase.java | 8 ++- src/test/java/Team5/SmartTowns/Test5.java | 72 +++++++++---------- 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/build.gradle b/build.gradle index bc24a66e..33328045 100644 --- a/build.gradle +++ b/build.gradle @@ -36,9 +36,7 @@ dependencies { testImplementation 'org.springframework.boot:spring-boot-starter-test' implementation 'org.springframework.boot:spring-boot-starter-validation' // https://mvnrepository.com/artifact/org.springframework/spring-dao -// https://mvnrepository.com/artifact/org.springframework/spring-dao - implementation group: 'org.springframework', name: 'spring-tx', version: '6.1.1' - implementation 'org.springframework:spring-dao:2.0.8' +// implementation group: 'org.springframework', name: 'spring-tx', version: '6.1.1' implementation 'org.springframework:spring-dao:2.0.8' // implementation 'org.springframework.dao.DataAccessException' // https://mvnrepository.com/artifact/org.springframework/spring-core diff --git a/src/test/java/Team5/SmartTowns/DBUnitTestCase.java b/src/test/java/Team5/SmartTowns/DBUnitTestCase.java index bb2352e2..7d64da18 100644 --- a/src/test/java/Team5/SmartTowns/DBUnitTestCase.java +++ b/src/test/java/Team5/SmartTowns/DBUnitTestCase.java @@ -1,9 +1,11 @@ package Team5.SmartTowns; -//import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; -import org.testng.annotations.Test; +import org.junit.jupiter.api.Test; +//import org.springframework.boot.test.context.SpringBootTest; +//import org.testng.annotations.Test; +//import org.testng.annotations.Test; //import org.apiguardian.api; +//import org.junit.platform.engine.TestDescriptor; //import static org.junit.jupiter.api.Assertions.assertEquals; import static org.testng.AssertJUnit.assertEquals; diff --git a/src/test/java/Team5/SmartTowns/Test5.java b/src/test/java/Team5/SmartTowns/Test5.java index c4275074..a5a518e5 100644 --- a/src/test/java/Team5/SmartTowns/Test5.java +++ b/src/test/java/Team5/SmartTowns/Test5.java @@ -1,36 +1,36 @@ -package Team5.SmartTowns; - -import Team5.SmartTowns.Data.locationRepositoryJDBC; -//import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.jdbc.JdbcTest; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.test.context.jdbc.Sql; -import org.testng.annotations.Test; - -//import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.testng.Assert.assertEquals; - -@SpringBootTest -@JdbcTest - -@Sql({"schema.sql", "data.sql"}) -public class Test5 { - - @Autowired - private JdbcTemplate ajdbc; - - - @Test -// test 1 - void whenInjectInMemoryDataSource_thenReturnCorrectEmployeeCount() { - locationRepositoryJDBC employeeDAO = new locationRepositoryJDBC(ajdbc); -// employeeDAO.setJdbc(ajdbc); - assertEquals(4, employeeDAO.getAllLocation().size()); - - } - - - -} +//package Team5.SmartTowns; +// +//import Team5.SmartTowns.Data.locationRepositoryJDBC; +////import org.junit.jupiter.api.Test; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.boot.test.autoconfigure.jdbc.JdbcTest; +//import org.springframework.boot.test.context.SpringBootTest; +//import org.springframework.jdbc.core.JdbcTemplate; +//import org.springframework.test.context.jdbc.Sql; +//import org.testng.annotations.Test; +// +////import static org.junit.jupiter.api.Assertions.assertEquals; +//import static org.testng.Assert.assertEquals; +// +//@SpringBootTest +//@JdbcTest +// +//@Sql({"schema.sql", "data.sql"}) +//public class Test5 { +// +// @Autowired +// private JdbcTemplate ajdbc; +// +// +// @Test +//// test 1 +// void whenInjectInMemoryDataSource_thenReturnCorrectEmployeeCount() { +// locationRepositoryJDBC employeeDAO = new locationRepositoryJDBC(ajdbc); +//// employeeDAO.setJdbc(ajdbc); +// assertEquals(4, employeeDAO.getAllLocation().size()); +// +// } +// +// +// +//} -- GitLab