Commit 75c63f8f authored by Piotr Gawron's avatar Piotr Gawron
Browse files

all tests are run on the hsqldb by default

parent de42e33a
database.driver=org.hsqldb.jdbcDriver
database.dialect=org.hibernate.dialect.HSQLDialect
database.uri=jdbc:hsqldb:mem:dapi
database.username=sa
database.password=
database.connectionQuery=SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS
database.driver=org.hsqldb.jdbcDriver
database.dialect=org.hibernate.dialect.HSQLDialect
database.uri=jdbc:hsqldb:mem:dapi
database.username=sa
database.password=
database.connectionQuery=SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS
database.driver=org.hsqldb.jdbcDriver
database.dialect=org.hibernate.dialect.HSQLDialect
database.uri=jdbc:hsqldb:mem:dapi
database.username=sa
database.password=
database.connectionQuery=SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS
database.driver=org.hsqldb.jdbcDriver
database.dialect=org.hibernate.dialect.HSQLDialect
database.uri=jdbc:hsqldb:mem:dapi
database.username=sa
database.password=
database.connectionQuery=SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS
......@@ -20,7 +20,7 @@ import lcsb.mapviewer.model.Project;
import lcsb.mapviewer.model.map.model.ModelData;
import lcsb.mapviewer.model.security.PrivilegeType;
import lcsb.mapviewer.model.user.User;
import lcsb.mapviewer.services.interfaces.IModelService;
import lcsb.mapviewer.persist.dao.ProjectDao;
import lcsb.mapviewer.services.interfaces.IUserService;
@RunWith(SpringJUnit4ClassRunner.class)
......@@ -28,15 +28,13 @@ import lcsb.mapviewer.services.interfaces.IUserService;
@Rollback
public class PublicationsControllerIntegrationTest extends ControllerIntegrationTest {
private static final String TEST_PROJECT = "test_project";
Logger logger = LogManager.getLogger();
@Autowired
private IUserService userService;
@Autowired
private IModelService modelService;
private ProjectDao projectDao;
private User anonymous;
......@@ -45,21 +43,20 @@ public class PublicationsControllerIntegrationTest extends ControllerIntegration
@Before
public void setup() {
project = createProject(TEST_PROJECT);
project = projectDao.getProjectByProjectId(BUILT_IN_PROJECT);
map = project.getModels().iterator().next();
anonymous = userService.getUserByLogin(Configuration.ANONYMOUS_LOGIN);
}
@After
public void tearDown() {
modelService.removeModelFromCache(map);
}
@Test
public void testGetPublicationsForMap() throws Exception {
userService.grantUserPrivilege(anonymous, PrivilegeType.READ_PROJECT, project.getProjectId());
userService.grantUserPrivilege(anonymous, PrivilegeType.READ_PROJECT, BUILT_IN_PROJECT);
RequestBuilder request = get("/projects/" + TEST_PROJECT + "/models/" + map.getId() + "/publications/")
RequestBuilder request = get("/projects/" + BUILT_IN_PROJECT + "/models/" + map.getId() + "/publications/")
.contentType(MediaType.APPLICATION_FORM_URLENCODED);
mockMvc.perform(request)
......
database.driver=org.hsqldb.jdbcDriver
database.dialect=org.hibernate.dialect.HSQLDialect
database.uri=jdbc:hsqldb:mem:dapi
database.username=sa
database.password=
database.connectionQuery=SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment