Package testutils
Class JatosTest
- java.lang.Object
-
- testutils.JatosTest
-
- Direct Known Subclasses:
ComponentServiceIntegrationTest,ImportExportServiceIntegrationTest,ResultRemoverIntegrationTest,StudyLoggerIntegrationTest,StudyServiceIntegrationTest,UserServiceIntegrationTest
public class JatosTest extends java.lang.ObjectParent class for all tests that need the JATOS application running.
-
-
Field Summary
Fields Modifier and Type Field Description protected Useradminprotected java.lang.StringapiTokenprotected play.Applicationapplicationprotected play.db.jpa.JPAApijpaApistatic java.lang.StringTEST_RESOURCES_POTATO_COMPASS_JZIP
-
Constructor Summary
Constructors Constructor Description JatosTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringcreateApiToken(User user)UsercreateUser(java.lang.String username)voiddropDatabase()UsergetAdmin()StudygetStudy(java.lang.Long id)StudyimportAndGetExampleStudy()java.lang.LongimportExampleStudy()voidremoveAllLogs()voidremoveAllResultUploads()voidremoveAllStudyAssets()voidremoveAllStudyLogs()voidremoveUser(java.lang.String username)voidstartApp()voidstopApp()
-
-
-
Field Detail
-
TEST_RESOURCES_POTATO_COMPASS_JZIP
public static final java.lang.String TEST_RESOURCES_POTATO_COMPASS_JZIP
- See Also:
- Constant Field Values
-
application
@Inject protected play.Application application
-
jpaApi
@Inject protected play.db.jpa.JPAApi jpaApi
-
admin
protected User admin
-
apiToken
protected java.lang.String apiToken
-
-
Method Detail
-
startApp
public void startApp()
-
stopApp
public void stopApp() throws java.lang.Exception- Throws:
java.lang.Exception
-
importExampleStudy
public java.lang.Long importExampleStudy()
-
getAdmin
public User getAdmin()
-
createUser
public User createUser(java.lang.String username)
-
createApiToken
public java.lang.String createApiToken(User user)
-
getStudy
public Study getStudy(java.lang.Long id)
-
importAndGetExampleStudy
public Study importAndGetExampleStudy()
-
dropDatabase
public void dropDatabase()
-
removeUser
public void removeUser(java.lang.String username)
-
removeAllStudyAssets
public void removeAllStudyAssets() throws java.io.IOException- Throws:
java.io.IOException
-
removeAllStudyLogs
public void removeAllStudyLogs() throws java.io.IOException- Throws:
java.io.IOException
-
removeAllResultUploads
public void removeAllResultUploads() throws java.io.IOException- Throws:
java.io.IOException
-
removeAllLogs
public void removeAllLogs() throws java.io.IOException- Throws:
java.io.IOException
-
-