2018-06-13 15:48:28 +00:00
|
|
|
package test;
|
|
|
|
|
2018-10-04 20:58:04 +00:00
|
|
|
import org.junit.jupiter.api.BeforeAll;
|
2018-12-12 12:13:06 +00:00
|
|
|
|
|
|
|
import controller.Controller;
|
|
|
|
|
2018-10-04 20:58:04 +00:00
|
|
|
import org.junit.jupiter.api.AfterAll;
|
2018-06-13 15:48:28 +00:00
|
|
|
|
|
|
|
import repository.DataException;
|
|
|
|
import repository.RepositoryFactory;
|
|
|
|
import repository.RepositoryManager;
|
|
|
|
import repository.hsqldb.HSQLDBRepositoryFactory;
|
|
|
|
|
|
|
|
public class Common {
|
|
|
|
|
2018-10-04 20:58:04 +00:00
|
|
|
@BeforeAll
|
2018-06-13 15:48:28 +00:00
|
|
|
public static void setRepository() throws DataException {
|
2018-12-12 12:13:06 +00:00
|
|
|
RepositoryFactory repositoryFactory = new HSQLDBRepositoryFactory(Controller.connectionUrl);
|
2018-06-13 15:48:28 +00:00
|
|
|
RepositoryManager.setRepositoryFactory(repositoryFactory);
|
|
|
|
}
|
|
|
|
|
2018-10-04 20:58:04 +00:00
|
|
|
@AfterAll
|
2018-06-13 15:48:28 +00:00
|
|
|
public static void closeRepository() throws DataException {
|
2018-06-14 08:55:58 +00:00
|
|
|
RepositoryManager.closeRepositoryFactory();
|
2018-06-13 15:48:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|