Package services.gui

Class StudyServiceTest


  • public class StudyServiceTest
    extends java.lang.Object
    Unit tests for StudyService.
    • Constructor Detail

      • StudyServiceTest

        public StudyServiceTest()
    • Method Detail

      • setUp

        public void setUp()
      • changeComponentPosition_valid_reorders_andUpdates

        public void changeComponentPosition_valid_reorders_andUpdates()
                                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • changeComponentPosition_invalidNumber_throws

        public void changeComponentPosition_invalidNumber_throws()
                                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • changeComponentPosition_outOfBounds_throws

        public void changeComponentPosition_outOfBounds_throws()
                                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getStudyFromIdOrUuid_numericId_branch

        public void getStudyFromIdOrUuid_numericId_branch()
      • getStudyFromIdOrUuid_uuid_branch

        public void getStudyFromIdOrUuid_uuid_branch()
      • updateStudy_AndRenameAssets_setsLogHashWhenDescriptionChanged

        public void updateStudy_AndRenameAssets_setsLogHashWhenDescriptionChanged()
      • updateStudy_AndRenameAssets_noLogWhenDescriptionUnchanged

        public void updateStudy_AndRenameAssets_noLogWhenDescriptionUnchanged()
      • updateStudy_AndRenameAssets_withProperties_logsWhenChanged

        public void updateStudy_AndRenameAssets_withProperties_logsWhenChanged()
                                                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • clone_clonesProperties_components_andAssetsDir

        public void clone_clonesProperties_components_andAssetsDir()
                                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • cloneTitle_incrementsNumber_ifTitleAlreadyExists

        public void cloneTitle_incrementsNumber_ifTitleAlreadyExists()
                                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • changeUserMember_addsMember_andAddsWorkerToBatches_andPersists

        public void changeUserMember_addsMember_andAddsWorkerToBatches_andPersists()
                                                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • changeUserMember_addMember_noopIfAlreadyMember

        public void changeUserMember_addMember_noopIfAlreadyMember()
                                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • changeUserMember_removesMember_andRemovesWorkerFromBatches_andPersists

        public void changeUserMember_removesMember_andRemovesWorkerFromBatches_andPersists()
                                                                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • changeUserMember_removeLastMember_throwsForbidden

        public void changeUserMember_removeLastMember_throwsForbidden()
                                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addAllUserMembers_addsUsers_andWorkersToBatches_andPersists

        public void addAllUserMembers_addsUsers_andWorkersToBatches_andPersists()
      • removeAllUserMembers_keepsSignedInUser_removesOthers_andPersists

        public void removeAllUserMembers_keepsSignedInUser_removesOthers_andPersists()
      • createAndPersistStudyAndAssetsDir_setsDirNameToUuid_ifMissing_createsDir_andPersists

        public void createAndPersistStudyAndAssetsDir_setsDirNameToUuid_ifMissing_createsDir_andPersists()
                                                                                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createAndPersistStudy_createsDefaultBatch_whenNoBatches_addsUser_updatesAndLogs

        public void createAndPersistStudy_createsDefaultBatch_whenNoBatches_addsUser_updatesAndLogs()
      • createAndPersistStudy_usesProvidedBatches_whenAlreadyPresent

        public void createAndPersistStudy_usesProvidedBatches_whenAlreadyPresent()
      • updateStudyWithoutDirName_updatesFields_butKeepsDirName_andLogsWhenHashChanged

        public void updateStudyWithoutDirName_updatesFields_butKeepsDirName_andLogsWhenHashChanged()
      • updateDescription_logsOnlyIfChanged

        public void updateDescription_logsOnlyIfChanged()
      • bindToStudy_copiesAllFieldsFromProperties

        public void bindToStudy_copiesAllFieldsFromProperties()
      • renameStudyAssetsDir_renamesInFs_updatesStudy_andPersists

        public void renameStudyAssetsDir_renamesInFs_updatesStudy_andPersists()
                                                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • bindToProperties_copiesFieldsFromStudy

        public void bindToProperties_copiesFieldsFromStudy()
      • validate_validStudy_doesNotThrow

        public void validate_validStudy_doesNotThrow()
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • validate_invalidStudy_throws

        public void validate_invalidStudy_throws()
                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • removeStudyInclAssets_removesBatches_users_study_assets_andLogs

        public void removeStudyInclAssets_removesBatches_users_study_assets_andLogs()
                                                                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • removeStudyInclAssets_doesNotRemoveAssets_whenDirNameNull

        public void removeStudyInclAssets_doesNotRemoveAssets_whenDirNameNull()
                                                                       throws java.lang.Exception
        Throws:
        java.lang.Exception