-
Notifications
You must be signed in to change notification settings - Fork 14
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
added new annotations
- Loading branch information
Showing
24 changed files
with
1,273 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
h1. EEGBase | ||
|
||
h2. An database portal specialized for EEG/ERP experiments | ||
|
||
h3. "http://eegdatabase.kiv.zcu.cz":http://eegdatabase.kiv.zcu.cz | ||
|
||
EEG Database enables community researchers to store, update, download and search data and metadata from EEG/ERP experiments. The system is developed as a standalone product; the database access is available through a web interface. | ||
|
||
h2. Technical Overview | ||
|
||
EEGBase as a web application uses modern web and database technologies: | ||
* SQL and NoSQL databases | ||
** PostgreSQL | ||
** Elasticsearch | ||
* Application | ||
** Spring MVC architecture | ||
** Hibernate JPA | ||
** Wicket framework | ||
* Web Server | ||
** Jetty | ||
|
||
h2. Getting Started | ||
* Prerequisites | ||
** Installed PostgreSQL v9.2 (http://www.postgresql.org/) | ||
** Installed Jetty web server and servlet container v7.5.0 (http://www.eclipse.org/jetty/) | ||
** Installed Java SE 6 JDK (http://www.oracle.com/technetwork/java/javase/downloads/index.html) | ||
** Installed and "configured":https://github.com/INCF/eeg-database/wiki/Elasticsearch Elasticsearch v1.3 (http://www.elasticsearch.org/); | ||
** Installed your favourite IDE (Eclipse, Netbeans, IntelliJ etc.) with configured GIT | ||
* EEG Database | ||
** Create new database in PostgreSQL (default name is "eeg"); tables will be created automatically by Hibernate framework | ||
** Clone eegdatabase GITHub repository to local destination | ||
** Open eegdatabase Maven project in your IDE and let the Maven to download dependencies | ||
** Edit database accesses in @eeb-database/src/main/webapp/WEB-INF/db.properties.sample@ and save the file as @db.properties@ | ||
** Set-up run and deployment configuration | ||
*** Select Jetty as a main deploying server | ||
*** Edit Jetty start up options; increase permanent generation memory size @-XX:MaxPermSize=256m@ | ||
*** Set-up deployment artefacts | ||
** Set-up Java SE 6 JDK as a default project SDK | ||
* Frequent problems | ||
** Ensure you have set JAVA_HOME variable in system environment variables | ||
** Elasticsearch requires JAVA 7. | ||
** Jetty port (8080 by default) is occupied by another service application (e.g. Apache Tomcat, Glassfish). | ||
** db.properties file is not set properly. | ||
** DB user has not enough privileges to the database schema. | ||
|
||
h1. License | ||
|
||
<pre> | ||
This software is licensed under the Apache 2 license, quoted below. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
use this file except in compliance with the License. You may obtain a copy of | ||
the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
License for the specific language governing permissions and limitations under | ||
the License. | ||
</pre> |
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 |
---|---|---|
|
@@ -55,6 +55,7 @@ | |
/** | ||
* Scenario generated by hbm2java | ||
*/ | ||
@Form | ||
@Entity | ||
@Table(name = "SCENARIO") | ||
@XmlRootElement | ||
|
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
97 changes: 97 additions & 0 deletions
97
src/test/java/cz/zcu/kiv/eegdatabase/services/ArtifactServiceTest.java
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 |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/******************************************************************************* | ||
* This file is part of the EEG-database project | ||
* | ||
* ========================================== | ||
* | ||
* Copyright (C) 2013 by University of West Bohemia (http://www.zcu.cz/en/) | ||
* | ||
* *********************************************************************************************************************** | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
* | ||
* *********************************************************************************************************************** | ||
* | ||
* ArtifactServiceTest.java, 2014/08/10 00:01 Jan Stebetak | ||
******************************************************************************/ | ||
package cz.zcu.kiv.eegdatabase.services; | ||
|
||
import cz.zcu.kiv.eegdatabase.data.TestUtils; | ||
import cz.zcu.kiv.eegdatabase.data.dao.PersonDao; | ||
import cz.zcu.kiv.eegdatabase.data.dao.ResearchGroupDao; | ||
import cz.zcu.kiv.eegdatabase.data.pojo.Artifact; | ||
import cz.zcu.kiv.eegdatabase.data.pojo.Person; | ||
import cz.zcu.kiv.eegdatabase.data.pojo.ResearchGroup; | ||
import cz.zcu.kiv.eegdatabase.logic.Util; | ||
import cz.zcu.kiv.eegdatabase.wui.core.common.ArtifactService; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import java.util.List; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
/** | ||
* Created by Honza on 10.8.14. | ||
*/ | ||
@Transactional | ||
public class ArtifactServiceTest extends AbstractServicesTest { | ||
|
||
@Autowired | ||
private ArtifactService artifactService; | ||
|
||
@Autowired | ||
private ResearchGroupDao researchGroupDao; | ||
@Autowired | ||
private PersonDao personDao; | ||
private Artifact artifact; | ||
private ResearchGroup researchGroup; | ||
|
||
@Before | ||
public void setUp() throws Exception { | ||
Person person = TestUtils.createPersonForTesting("test@test.com", Util.ROLE_ADMIN); | ||
|
||
personDao.create(person); | ||
|
||
researchGroup = new ResearchGroup(); | ||
researchGroup.setDescription("test-description"); | ||
researchGroup.setTitle("test-title"); | ||
researchGroup.setPerson(person); | ||
researchGroupDao.create(researchGroup); | ||
artifact = new Artifact(); | ||
artifact.setCompensation("test comp"); | ||
artifact.setRejectCondition("test condition"); | ||
} | ||
|
||
@Test | ||
public void testCreateArtifact() { | ||
int artifactCountBefore = artifactService.getAllRecords().size(); | ||
int id = artifactService.create(artifact); | ||
assertEquals(artifactCountBefore + 1, artifactService.getAllRecords().size()); | ||
assertEquals(id, artifact.getArtifactId()); | ||
} | ||
|
||
|
||
@Test | ||
public void testCreateArtifactGroupRel() { | ||
int artifactCountBefore = artifactService.getAllRecords().size(); | ||
int artifactGroupBefore = artifactService.getRecordsByGroup(researchGroup.getResearchGroupId()).size(); | ||
int id = artifactService.create(artifact); | ||
assertEquals(artifactCountBefore + 1, artifactService.getAllRecords().size()); | ||
|
||
List<Artifact> list = artifactService.getRecordsByGroup(researchGroup.getResearchGroupId()); | ||
assertEquals(artifactGroupBefore, list.size()); | ||
assertFalse(artifactService.hasGroupRel(id)); | ||
} | ||
|
||
} |
111 changes: 111 additions & 0 deletions
111
src/test/java/cz/zcu/kiv/eegdatabase/services/DiseaseServiceTest.java
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 |
---|---|---|
@@ -0,0 +1,111 @@ | ||
/******************************************************************************* | ||
* This file is part of the EEG-database project | ||
* | ||
* ========================================== | ||
* | ||
* Copyright (C) 2013 by University of West Bohemia (http://www.zcu.cz/en/) | ||
* | ||
* *********************************************************************************************************************** | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
* | ||
* *********************************************************************************************************************** | ||
* | ||
* DiseaseServiceTest.java, 2014/08/08 00:01 Jan Stebetak | ||
******************************************************************************/ | ||
package cz.zcu.kiv.eegdatabase.services; | ||
|
||
import cz.zcu.kiv.eegdatabase.data.TestUtils; | ||
import cz.zcu.kiv.eegdatabase.data.dao.PersonDao; | ||
import cz.zcu.kiv.eegdatabase.data.dao.ResearchGroupDao; | ||
import cz.zcu.kiv.eegdatabase.data.pojo.Disease; | ||
import cz.zcu.kiv.eegdatabase.data.pojo.Person; | ||
import cz.zcu.kiv.eegdatabase.data.pojo.ResearchGroup; | ||
import cz.zcu.kiv.eegdatabase.logic.Util; | ||
import cz.zcu.kiv.eegdatabase.wui.core.common.DiseaseService; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import java.util.List; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
/** | ||
* Created by Honza on 8.8.14. | ||
*/ | ||
@Transactional | ||
public class DiseaseServiceTest extends AbstractServicesTest { | ||
|
||
@Autowired | ||
private DiseaseService diseaseService; | ||
|
||
@Autowired | ||
private ResearchGroupDao researchGroupDao; | ||
@Autowired | ||
private PersonDao personDao; | ||
private Disease disease; | ||
private ResearchGroup researchGroup; | ||
|
||
@Before | ||
public void setUp() throws Exception { | ||
Person person = TestUtils.createPersonForTesting("test@test.com", Util.ROLE_ADMIN); | ||
|
||
personDao.create(person); | ||
|
||
researchGroup = new ResearchGroup(); | ||
researchGroup.setDescription("test-description"); | ||
researchGroup.setTitle("test-title"); | ||
researchGroup.setPerson(person); | ||
researchGroupDao.create(researchGroup); | ||
disease = createDisease("new Disease"); | ||
} | ||
|
||
@Test | ||
public void testCreateDisease() { | ||
int diseaseCountBefore = diseaseService.getAllRecords().size(); | ||
int diseaseID = diseaseService.create(disease); | ||
assertEquals(diseaseCountBefore + 1, diseaseService.getAllRecords().size()); | ||
assertEquals(diseaseID, disease.getDiseaseId()); | ||
} | ||
|
||
|
||
@Test | ||
public void testCreateDiseaseGroupRel() { | ||
int diseaseCountBefore = diseaseService.getAllRecords().size(); | ||
int diseaseGroupBefore = diseaseService.getRecordsByGroup(researchGroup.getResearchGroupId()).size(); | ||
diseaseService.createGroupRel(disease, researchGroup); | ||
int id = diseaseService.create(disease); | ||
assertEquals(diseaseCountBefore + 1, diseaseService.getAllRecords().size()); | ||
|
||
List<Disease> list = diseaseService.getRecordsByGroup(researchGroup.getResearchGroupId()); | ||
assertEquals(diseaseGroupBefore + 1, list.size()); | ||
assertTrue(diseaseService.hasGroupRel(id)); | ||
} | ||
|
||
|
||
@Test | ||
public void testCanSaveTitle() { | ||
diseaseService.createGroupRel(disease, researchGroup); | ||
int id = diseaseService.create(disease); | ||
assertTrue(diseaseService.canSaveTitle(disease.getTitle(), researchGroup.getResearchGroupId(), id)); | ||
assertFalse(diseaseService.canSaveTitle(disease.getTitle(), researchGroup.getResearchGroupId(), -1)); | ||
} | ||
|
||
private Disease createDisease(String title) { | ||
Disease newDisease = new Disease(); | ||
newDisease.setTitle(title); | ||
newDisease.setDescription("This is new testing Disease"); | ||
return newDisease; | ||
} | ||
} |
Oops, something went wrong.