-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into Production
- Loading branch information
Showing
9 changed files
with
111 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,10 +51,10 @@ development=true | |
|
||
# This url is the url which returns callback after authorization of users on social sites. | ||
# This url is same like app.domain if there isnt any problem with callback and proxies. | ||
# If callback have to come back to app via another url or port change it. | ||
app.appUrlForSocialSites=http://147.228.64.172:8080 | ||
|
||
app.domain=http://147.228.64.172:8080 | ||
# If callback have to come back to app via another url or port change it. End it with slash. | ||
app.appUrlForSocialSites=http://147.228.64.172:8080/ | ||
# end url with slash for right generating url from app domain for email, etc. | ||
app.domain=http://147.228.64.172:8080/ | ||
email.smtp=smtp.zcu.cz | ||
email.from=[email protected] | ||
email.subject=EEG/ERP portal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,6 +115,54 @@ public void testCreateExperiment() { | |
assertNotNull(experimentDao.read(experiment.getExperimentId())); | ||
assertEquals(1, experimentDao.getCountRecords()); | ||
|
||
} | ||
|
||
@Test | ||
@Transactional | ||
public void testGetCountExperimentsWhereOwner() { | ||
int count = experimentDao.getCountForExperimentsWhereOwner(person); | ||
experimentDao.create(experiment); | ||
Person person1 = TestUtils.createPersonForTesting("[email protected]", Util.ROLE_READER); | ||
personDao.create(person1); | ||
Experiment exp = setUpExperiment(); | ||
exp.setPersonByOwnerId(person1); | ||
experimentDao.create(exp); | ||
assertEquals(count + 1, experimentDao.getCountForExperimentsWhereOwner(person)); | ||
|
||
} | ||
|
||
@Test | ||
@Transactional | ||
public void testGetCountExperimentsWhereSubject() { | ||
int countForOwner = experimentDao.getCountForExperimentsWhereOwner(person); | ||
int countForSubject = experimentDao.getCountForExperimentsWhereSubject(person); | ||
experimentDao.create(experiment); | ||
Person person1 = TestUtils.createPersonForTesting("[email protected]", Util.ROLE_READER); | ||
personDao.create(person1); | ||
Experiment exp = setUpExperiment(); | ||
exp.setPersonBySubjectPersonId(person1); | ||
experimentDao.create(exp); | ||
assertEquals(countForOwner + 2, experimentDao.getCountForExperimentsWhereOwner(person)); | ||
assertEquals(countForSubject + 1, experimentDao.getCountForExperimentsWhereSubject(person)); | ||
|
||
} | ||
|
||
@Test | ||
@Transactional | ||
public void testGetExperimentForDetail() { | ||
|
||
experimentDao.create(experiment); | ||
Experiment exp = experimentDao.getExperimentForDetail(experiment.getExperimentId()); | ||
assertEquals("testTitle", exp.getResearchGroup().getTitle()); | ||
assertEquals("[email protected]", exp.getPersonBySubjectPersonId().getUsername()); | ||
assertEquals("testTitleWeather", exp.getWeather().getTitle()); | ||
for (Software sw: exp.getSoftwares()) { | ||
assertEquals("testTitleSW", sw.getTitle()); | ||
} | ||
|
||
|
||
|
||
|
||
} | ||
|
||
@After | ||
|
@@ -151,14 +199,14 @@ private Hardware createHardware() { | |
private Software createSoftware() { | ||
Software software = new Software(); | ||
software.setDescription("testDesc"); | ||
software.setTitle("testTitle"); | ||
software.setTitle("testTitleSW"); | ||
softwareDao.create(software); | ||
return software; | ||
} | ||
|
||
private Weather createWeather() { | ||
Weather weather = new Weather(); | ||
weather.setTitle("testTitle"); | ||
weather.setTitle("testTitleWeather"); | ||
weather.setDescription("testDesc"); | ||
weatherDao.create(weather); | ||
return weather; | ||
|