From 6b4dcebf2559b4b1156139bdc352d1b101a09814 Mon Sep 17 00:00:00 2001 From: Ruslan Forostianov Date: Thu, 14 Mar 2024 11:26:22 +0100 Subject: [PATCH 01/14] Make import clinical data tests to run --- .../portal/scripts/TestImportClinicalData.java | 2 -- src/test/resources/applicationContext-dao.xml | 15 --------------- 2 files changed, 17 deletions(-) diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportClinicalData.java b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportClinicalData.java index df3e1fbd..14c2931f 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportClinicalData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportClinicalData.java @@ -61,8 +61,6 @@ * @author Pieter Lukasse */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/resources/applicationContext-dao.xml b/src/test/resources/applicationContext-dao.xml index e0fbe55b..58335dea 100644 --- a/src/test/resources/applicationContext-dao.xml +++ b/src/test/resources/applicationContext-dao.xml @@ -9,17 +9,6 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> - - - - - - - - - - - @@ -105,10 +94,6 @@ - - - - From 3e6f92aaf44d83ad87758b5d09f8c038be2b3dd7 Mon Sep 17 00:00:00 2001 From: Ruslan Forostianov Date: Thu, 14 Mar 2024 12:01:58 +0100 Subject: [PATCH 02/14] Fix testImportClinicalData_WithDuplInMixedAttrFormat Warning was not shown because process mistakenly thought it's running from a web server --- .../java/org/mskcc/cbio/portal/util/ProgressMonitor.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/mskcc/cbio/portal/util/ProgressMonitor.java b/src/main/java/org/mskcc/cbio/portal/util/ProgressMonitor.java index cd95a9ae..948d25d9 100644 --- a/src/main/java/org/mskcc/cbio/portal/util/ProgressMonitor.java +++ b/src/main/java/org/mskcc/cbio/portal/util/ProgressMonitor.java @@ -68,7 +68,10 @@ private ProgressMonitor() { } private static boolean isRunningOnServer() { - return ServerDetector.getServerId() != null; + // FXIME because we bring core as dependency into cbioportal-core, we have web server classes in classpath + // But we run loader as standalone java process atm, not from the web server. + // return ServerDetector.getServerId() != null; + return false; } /** * Sets Console Flag. From 3632d2bd5c9aa718f8e0d4465c539dbd06107010 Mon Sep 17 00:00:00 2001 From: Ruslan Forostianov Date: Thu, 14 Mar 2024 12:25:14 +0100 Subject: [PATCH 03/14] Enable TestImportProfileData --- .../org/mskcc/cbio/portal/scripts/TestImportProfileData.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportProfileData.java b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportProfileData.java index 79054c65..b8089f7f 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportProfileData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportProfileData.java @@ -71,8 +71,6 @@ * @author Pieter Lukasse pieter@thehyve.nl */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional From 0ce532123ca7edd17dc47c928b16f3e225fadf43 Mon Sep 17 00:00:00 2001 From: Ruslan Forostianov Date: Thu, 14 Mar 2024 12:40:37 +0100 Subject: [PATCH 04/14] Enable the rest of passing script tests They passing when run one by one. But fail when you run them in batch due dirty database state (created by other tests?). --- .../org/mskcc/cbio/portal/scripts/TestGenerateMutationData.java | 1 - .../cbio/portal/scripts/TestImportCnaDiscreteLongData.java | 2 -- .../cbio/portal/scripts/TestImportCopyNumberSegmentData.java | 2 -- .../cbio/portal/scripts/TestImportExtendedMutationData.java | 2 -- .../java/org/mskcc/cbio/portal/scripts/TestImportGeneData.java | 2 -- .../mskcc/cbio/portal/scripts/TestImportGenericAssayData.java | 2 -- .../portal/scripts/TestImportGenericAssayPatientLevelData.java | 2 -- .../org/mskcc/cbio/portal/scripts/TestImportGenesetData.java | 2 -- .../cbio/portal/scripts/TestImportGenesetHierarchyData.java | 2 -- .../mskcc/cbio/portal/scripts/TestImportReferenceGenome.java | 2 -- .../org/mskcc/cbio/portal/scripts/TestImportTabDelimData.java | 2 -- .../java/org/mskcc/cbio/portal/scripts/TestImportUsers.java | 2 -- .../java/org/mskcc/cbio/portal/scripts/TestIntegrationTest.java | 2 -- .../java/org/mskcc/cbio/portal/scripts/TestMutationFilter.java | 2 -- .../cbio/portal/scripts/TestNormalizeExpressionLevels.java | 2 -- 15 files changed, 29 deletions(-) diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestGenerateMutationData.java b/src/test/java/org/mskcc/cbio/portal/scripts/TestGenerateMutationData.java index 9217f91e..938c51b1 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestGenerateMutationData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/TestGenerateMutationData.java @@ -49,7 +49,6 @@ * JUnit test for GenerateMutationData class. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportCnaDiscreteLongData.java b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportCnaDiscreteLongData.java index 0f3703af..a9053f78 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportCnaDiscreteLongData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportCnaDiscreteLongData.java @@ -57,8 +57,6 @@ import static org.junit.Assert.assertTrue; @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = {"classpath:/applicationContext-dao.xml"}) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportCopyNumberSegmentData.java b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportCopyNumberSegmentData.java index a68270ce..d77a1883 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportCopyNumberSegmentData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportCopyNumberSegmentData.java @@ -58,8 +58,6 @@ * @author pieterlukasse */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportExtendedMutationData.java b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportExtendedMutationData.java index 9f3ad075..616b144d 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportExtendedMutationData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportExtendedMutationData.java @@ -60,8 +60,6 @@ * @author Arthur Goldberg goldberg@cbio.mskcc.org */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/integrationTestScript.xml", "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGeneData.java b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGeneData.java index c192a46e..d3315f34 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGeneData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGeneData.java @@ -55,8 +55,6 @@ * JUnit tests for ImportGeneData class. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenericAssayData.java b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenericAssayData.java index 38b099e1..eff1560c 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenericAssayData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenericAssayData.java @@ -56,8 +56,6 @@ */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenericAssayPatientLevelData.java b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenericAssayPatientLevelData.java index 4599dc7f..b22c23bf 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenericAssayPatientLevelData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenericAssayPatientLevelData.java @@ -63,8 +63,6 @@ * JUnit tests for ImportGenericAssayPatientLevelData class. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenesetData.java b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenesetData.java index 74825b3d..f04f191e 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenesetData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenesetData.java @@ -48,8 +48,6 @@ */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenesetHierarchyData.java b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenesetHierarchyData.java index 5befd914..74440e25 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenesetHierarchyData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenesetHierarchyData.java @@ -59,8 +59,6 @@ */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportReferenceGenome.java b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportReferenceGenome.java index 8749febb..89d714d1 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportReferenceGenome.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportReferenceGenome.java @@ -20,8 +20,6 @@ * JUnit tests for ImportGeneData class. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportTabDelimData.java b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportTabDelimData.java index 03522f6f..ef78f4f6 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportTabDelimData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportTabDelimData.java @@ -62,8 +62,6 @@ * JUnit tests for ImportTabDelimData class. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportUsers.java b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportUsers.java index 63dce370..8fef7d87 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportUsers.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/TestImportUsers.java @@ -51,8 +51,6 @@ * JUnit test for ImportUsers class. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestIntegrationTest.java b/src/test/java/org/mskcc/cbio/portal/scripts/TestIntegrationTest.java index e5e1c41b..df70b972 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestIntegrationTest.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/TestIntegrationTest.java @@ -103,8 +103,6 @@ */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/integrationTestScript.xml", "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestMutationFilter.java b/src/test/java/org/mskcc/cbio/portal/scripts/TestMutationFilter.java index 6e4abce3..ef7c6867 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestMutationFilter.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/TestMutationFilter.java @@ -52,8 +52,6 @@ * JUnit tests for MutationFilter class. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestNormalizeExpressionLevels.java b/src/test/java/org/mskcc/cbio/portal/scripts/TestNormalizeExpressionLevels.java index bb857d32..984abc60 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestNormalizeExpressionLevels.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/TestNormalizeExpressionLevels.java @@ -52,8 +52,6 @@ import java.util.ArrayList; @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional From 8b4f29cdedaf34e7146c0fc3725744cf4fc2dd66 Mon Sep 17 00:00:00 2001 From: Ruslan Forostianov Date: Fri, 15 Mar 2024 16:46:09 +0100 Subject: [PATCH 05/14] Upgrade surefire version to insulate test executions better With the old version, db integration tests did not roll back inserted data properly --- pom.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 802d5ce8..768c53df 100644 --- a/pom.xml +++ b/pom.xml @@ -247,7 +247,11 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12.4 + 2.21.0 + + 1 + false + org.apache.maven.plugins From 29ab2da174ac25a82ea59460f7be15acd65afb3f Mon Sep 17 00:00:00 2001 From: Ruslan Forostianov Date: Tue, 19 Mar 2024 16:16:56 +0100 Subject: [PATCH 06/14] Run db tests at integration-test step --- pom.xml | 32 ++++++++++++++++--- ...CancerStudy.java => ITDaoCancerStudy.java} | 5 +-- ...ibute.java => ITDaoClinicalAttribute.java} | 2 +- .../dao/{TestDaoGene.java => ITDaoGene.java} | 2 +- ...tDaoGenePanel.java => ITDaoGenePanel.java} | 5 +-- ...ation.java => ITDaoGeneticAlteration.java} | 2 +- ...cProfile.java => ITDaoGeneticProfile.java} | 2 +- ...s.java => ITDaoGeneticProfileSamples.java} | 2 +- .../{TestDaoGistic.java => ITDaoGistic.java} | 5 +-- .../{TestDaoMutSig.java => ITDaoMutSig.java} | 2 +- ...estDaoMutation.java => ITDaoMutation.java} | 2 +- ...aoSampleList.java => ITDaoSampleList.java} | 2 +- ...leProfile.java => ITDaoSampleProfile.java} | 2 +- .../dao/{TestDaoUser.java => ITDaoUser.java} | 4 +-- ...orities.java => ITDaoUserAuthorities.java} | 2 +- ...ava => ITPanCancerStudySummaryImport.java} | 14 +++----- .../pancancer/LargeTestSetGenerator.java | 12 ++----- ...nData.java => ITGenerateMutationData.java} | 3 +- ...ML.java => ITImportCaisesClinicalXML.java} | 2 +- ...calData.java => ITImportClinicalData.java} | 4 +-- ....java => ITImportCnaDiscreteLongData.java} | 2 +- ...ava => ITImportCopyNumberSegmentData.java} | 3 +- ...java => ITImportExtendedMutationData.java} | 3 +- ...ortGeneData.java => ITImportGeneData.java} | 6 +--- ...ata.java => ITImportGenericAssayData.java} | 4 +-- ...ITImportGenericAssayPatientLevelData.java} | 9 +----- ...esetData.java => ITImportGenesetData.java} | 3 +- ...java => ITImportGenesetHierarchyData.java} | 3 +- ...fileData.java => ITImportProfileData.java} | 3 +- ...nome.java => ITImportReferenceGenome.java} | 3 +- ...ava => ITImportStructuralVariantData.java} | 4 +-- ...limData.java => ITImportTabDelimData.java} | 3 +- ...estImportUsers.java => ITImportUsers.java} | 3 +- ...rationTest.java => ITIntegrationTest.java} | 2 +- ...ationFilter.java => ITMutationFilter.java} | 3 +- ....java => ITNormalizeExpressionLevels.java} | 9 +++--- ...{TestWebService.java => ITWebService.java} | 21 +++++++----- .../cbio/portal/stats/TestOddsRatio.java | 2 +- ...dyReader.java => ITCancerStudyReader.java} | 2 +- ...enePanelUtil.java => ITGenePanelUtil.java} | 2 +- ...eader.java => ITGeneticProfileReader.java} | 2 +- ...tMutSigReader.java => ITMutSigReader.java} | 2 +- ...ripts.java => ITTransactionalScripts.java} | 2 +- ...rofiles.java => ITGetGeneticProfiles.java} | 2 +- .../{TestGetMutSig.java => ITGetMutSig.java} | 3 +- ...ProfileData.java => ITGetProfileData.java} | 4 +-- ...etSampleList.java => ITGetSampleList.java} | 2 +- ...sOfCancer.java => ITGetTypesOfCancer.java} | 2 +- 48 files changed, 97 insertions(+), 118 deletions(-) rename src/test/java/org/mskcc/cbio/portal/dao/{TestDaoCancerStudy.java => ITDaoCancerStudy.java} (97%) rename src/test/java/org/mskcc/cbio/portal/dao/{TestDaoClinicalAttribute.java => ITDaoClinicalAttribute.java} (98%) rename src/test/java/org/mskcc/cbio/portal/dao/{TestDaoGene.java => ITDaoGene.java} (99%) rename src/test/java/org/mskcc/cbio/portal/dao/{TestDaoGenePanel.java => ITDaoGenePanel.java} (96%) rename src/test/java/org/mskcc/cbio/portal/dao/{TestDaoGeneticAlteration.java => ITDaoGeneticAlteration.java} (99%) rename src/test/java/org/mskcc/cbio/portal/dao/{TestDaoGeneticProfile.java => ITDaoGeneticProfile.java} (99%) rename src/test/java/org/mskcc/cbio/portal/dao/{TestDaoGeneticProfileSamples.java => ITDaoGeneticProfileSamples.java} (98%) rename src/test/java/org/mskcc/cbio/portal/dao/{TestDaoGistic.java => ITDaoGistic.java} (95%) rename src/test/java/org/mskcc/cbio/portal/dao/{TestDaoMutSig.java => ITDaoMutSig.java} (99%) rename src/test/java/org/mskcc/cbio/portal/dao/{TestDaoMutation.java => ITDaoMutation.java} (99%) rename src/test/java/org/mskcc/cbio/portal/dao/{TestDaoSampleList.java => ITDaoSampleList.java} (99%) rename src/test/java/org/mskcc/cbio/portal/dao/{TestDaoSampleProfile.java => ITDaoSampleProfile.java} (99%) rename src/test/java/org/mskcc/cbio/portal/dao/{TestDaoUser.java => ITDaoUser.java} (97%) rename src/test/java/org/mskcc/cbio/portal/dao/{TestDaoUserAuthorities.java => ITDaoUserAuthorities.java} (99%) rename src/test/java/org/mskcc/cbio/portal/pancancer/{TestPanCancerStudySummaryImport.java => ITPanCancerStudySummaryImport.java} (94%) rename src/test/java/org/mskcc/cbio/portal/scripts/{TestGenerateMutationData.java => ITGenerateMutationData.java} (98%) rename src/test/java/org/mskcc/cbio/portal/scripts/{TestImportCaisesClinicalXML.java => ITImportCaisesClinicalXML.java} (99%) rename src/test/java/org/mskcc/cbio/portal/scripts/{TestImportClinicalData.java => ITImportClinicalData.java} (99%) rename src/test/java/org/mskcc/cbio/portal/scripts/{TestImportCnaDiscreteLongData.java => ITImportCnaDiscreteLongData.java} (99%) rename src/test/java/org/mskcc/cbio/portal/scripts/{TestImportCopyNumberSegmentData.java => ITImportCopyNumberSegmentData.java} (98%) rename src/test/java/org/mskcc/cbio/portal/scripts/{TestImportExtendedMutationData.java => ITImportExtendedMutationData.java} (99%) rename src/test/java/org/mskcc/cbio/portal/scripts/{TestImportGeneData.java => ITImportGeneData.java} (93%) rename src/test/java/org/mskcc/cbio/portal/scripts/{TestImportGenericAssayData.java => ITImportGenericAssayData.java} (98%) rename src/test/java/org/mskcc/cbio/portal/scripts/{TestImportGenericAssayPatientLevelData.java => ITImportGenericAssayPatientLevelData.java} (97%) rename src/test/java/org/mskcc/cbio/portal/scripts/{TestImportGenesetData.java => ITImportGenesetData.java} (98%) rename src/test/java/org/mskcc/cbio/portal/scripts/{TestImportGenesetHierarchyData.java => ITImportGenesetHierarchyData.java} (98%) rename src/test/java/org/mskcc/cbio/portal/scripts/{TestImportProfileData.java => ITImportProfileData.java} (99%) rename src/test/java/org/mskcc/cbio/portal/scripts/{TestImportReferenceGenome.java => ITImportReferenceGenome.java} (95%) rename src/test/java/org/mskcc/cbio/portal/scripts/{TestImportStructuralVariantData.java => ITImportStructuralVariantData.java} (97%) rename src/test/java/org/mskcc/cbio/portal/scripts/{TestImportTabDelimData.java => ITImportTabDelimData.java} (99%) rename src/test/java/org/mskcc/cbio/portal/scripts/{TestImportUsers.java => ITImportUsers.java} (98%) rename src/test/java/org/mskcc/cbio/portal/scripts/{TestIntegrationTest.java => ITIntegrationTest.java} (99%) rename src/test/java/org/mskcc/cbio/portal/scripts/{TestMutationFilter.java => ITMutationFilter.java} (99%) rename src/test/java/org/mskcc/cbio/portal/scripts/{TestNormalizeExpressionLevels.java => ITNormalizeExpressionLevels.java} (91%) rename src/test/java/org/mskcc/cbio/portal/servlet/{TestWebService.java => ITWebService.java} (97%) rename src/test/java/org/mskcc/cbio/portal/util/{TestCancerStudyReader.java => ITCancerStudyReader.java} (98%) rename src/test/java/org/mskcc/cbio/portal/util/{TestGenePanelUtil.java => ITGenePanelUtil.java} (99%) rename src/test/java/org/mskcc/cbio/portal/util/{TestGeneticProfileReader.java => ITGeneticProfileReader.java} (99%) rename src/test/java/org/mskcc/cbio/portal/util/{TestMutSigReader.java => ITMutSigReader.java} (99%) rename src/test/java/org/mskcc/cbio/portal/util/{TestTransactionalScripts.java => ITTransactionalScripts.java} (96%) rename src/test/java/org/mskcc/cbio/portal/web_api/{TestGetGeneticProfiles.java => ITGetGeneticProfiles.java} (98%) rename src/test/java/org/mskcc/cbio/portal/web_api/{TestGetMutSig.java => ITGetMutSig.java} (97%) rename src/test/java/org/mskcc/cbio/portal/web_api/{TestGetProfileData.java => ITGetProfileData.java} (98%) rename src/test/java/org/mskcc/cbio/portal/web_api/{TestGetSampleList.java => ITGetSampleList.java} (98%) rename src/test/java/org/mskcc/cbio/portal/web_api/{TestGetTypesOfCancer.java => ITGetTypesOfCancer.java} (99%) diff --git a/pom.xml b/pom.xml index 768c53df..066522cc 100644 --- a/pom.xml +++ b/pom.xml @@ -248,10 +248,34 @@ org.apache.maven.plugins maven-surefire-plugin 2.21.0 - - 1 - false - + + + default-test + test + + test + + + + **/IT* + + + + + integration-test + integration-test + + test + + + + **/IT* + + 1 + false + + + org.apache.maven.plugins diff --git a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoCancerStudy.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoCancerStudy.java similarity index 97% rename from src/test/java/org/mskcc/cbio/portal/dao/TestDaoCancerStudy.java rename to src/test/java/org/mskcc/cbio/portal/dao/ITDaoCancerStudy.java index 5fa9ac4f..7bbe9d24 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoCancerStudy.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoCancerStudy.java @@ -32,6 +32,7 @@ package org.mskcc.cbio.portal.dao; +import org.junit.Assert; import org.junit.Test; import org.junit.Ignore; import org.junit.runner.RunWith; @@ -58,7 +59,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestDaoCancerStudy { +public class ITDaoCancerStudy { /** * Tests DaoCancer Study #1. @@ -68,7 +69,7 @@ public class TestDaoCancerStudy { @Test public void testDaoCancerStudy() throws DaoException, IOException { - assertEquals("Breast Invasive Carcinoma", DaoTypeOfCancer.getTypeOfCancerById("BRCA").getName()); + Assert.assertEquals("Breast Invasive Carcinoma", DaoTypeOfCancer.getTypeOfCancerById("BRCA").getName()); CancerStudy cancerStudy = new CancerStudy("GBM", "GBM Description", "gbm", "brca", false); cancerStudy.setReferenceGenome("hg19"); diff --git a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoClinicalAttribute.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoClinicalAttribute.java similarity index 98% rename from src/test/java/org/mskcc/cbio/portal/dao/TestDaoClinicalAttribute.java rename to src/test/java/org/mskcc/cbio/portal/dao/ITDaoClinicalAttribute.java index ecc83385..a675ddfc 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoClinicalAttribute.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoClinicalAttribute.java @@ -48,7 +48,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestDaoClinicalAttribute { +public class ITDaoClinicalAttribute { @Test public void testDaoClinicalAttribute() throws DaoException { diff --git a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoGene.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGene.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/dao/TestDaoGene.java rename to src/test/java/org/mskcc/cbio/portal/dao/ITDaoGene.java index 2d1180b8..938636df 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoGene.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGene.java @@ -54,7 +54,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestDaoGene { +public class ITDaoGene { /** * Tests DaoGene and DaoGeneOptimized. diff --git a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoGenePanel.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGenePanel.java similarity index 96% rename from src/test/java/org/mskcc/cbio/portal/dao/TestDaoGenePanel.java rename to src/test/java/org/mskcc/cbio/portal/dao/ITDaoGenePanel.java index dc6f3bef..78b7d785 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoGenePanel.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGenePanel.java @@ -35,7 +35,6 @@ import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; -import org.mskcc.cbio.portal.dao.*; import org.mskcc.cbio.portal.model.*; import org.springframework.test.annotation.Rollback; @@ -43,8 +42,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import org.junit.Test; -import org.junit.runner.RunWith; import static org.junit.Assert.*; import java.util.*; @@ -57,7 +54,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestDaoGenePanel { +public class ITDaoGenePanel { /** * Tests DaoGenePanel.addGenePanel(). diff --git a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoGeneticAlteration.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticAlteration.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/dao/TestDaoGeneticAlteration.java rename to src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticAlteration.java index f18f5cf8..d2e7d0b8 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoGeneticAlteration.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticAlteration.java @@ -54,7 +54,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestDaoGeneticAlteration { +public class ITDaoGeneticAlteration { CancerStudy study; ArrayList internalSampleIds; diff --git a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoGeneticProfile.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfile.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/dao/TestDaoGeneticProfile.java rename to src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfile.java index 20552257..60b1ae41 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoGeneticProfile.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfile.java @@ -52,7 +52,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestDaoGeneticProfile { +public class ITDaoGeneticProfile { int studyId; diff --git a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoGeneticProfileSamples.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfileSamples.java similarity index 98% rename from src/test/java/org/mskcc/cbio/portal/dao/TestDaoGeneticProfileSamples.java rename to src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfileSamples.java index 0812aeb8..0c13faba 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoGeneticProfileSamples.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfileSamples.java @@ -52,7 +52,7 @@ @RunWith(SpringJUnit4ClassRunner.class) @Ignore @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) -public class TestDaoGeneticProfileSamples { +public class ITDaoGeneticProfileSamples { CancerStudy study; ArrayList internalSampleIds; diff --git a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoGistic.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGistic.java similarity index 95% rename from src/test/java/org/mskcc/cbio/portal/dao/TestDaoGistic.java rename to src/test/java/org/mskcc/cbio/portal/dao/ITDaoGistic.java index b430e585..8551e746 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoGistic.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGistic.java @@ -37,9 +37,6 @@ import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; -import org.mskcc.cbio.portal.dao.DaoGeneOptimized; -import org.mskcc.cbio.portal.dao.DaoException; -import org.mskcc.cbio.portal.dao.DaoGistic; import org.mskcc.cbio.portal.model.CanonicalGene; import org.mskcc.cbio.portal.model.Gistic; import org.mskcc.cbio.portal.validate.validationException; @@ -58,7 +55,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestDaoGistic { +public class ITDaoGistic { @Test public void testDaoGistic() throws SQLException, DaoException, validationException { diff --git a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoMutSig.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutSig.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/dao/TestDaoMutSig.java rename to src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutSig.java index 1616f2e5..28c93e4f 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoMutSig.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutSig.java @@ -56,7 +56,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestDaoMutSig { +public class ITDaoMutSig { /** * Tests DaoGene and DaoGeneOptimized. diff --git a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoMutation.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutation.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/dao/TestDaoMutation.java rename to src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutation.java index e31dc8c7..6a462c2d 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoMutation.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutation.java @@ -59,7 +59,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestDaoMutation { +public class ITDaoMutation { int geneticProfileId; int sampleId; diff --git a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoSampleList.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleList.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/dao/TestDaoSampleList.java rename to src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleList.java index 1b73db9e..4d7ccb6e 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoSampleList.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleList.java @@ -54,7 +54,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestDaoSampleList { +public class ITDaoSampleList { CancerStudy study; diff --git a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoSampleProfile.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleProfile.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/dao/TestDaoSampleProfile.java rename to src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleProfile.java index f327facc..daa8b205 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoSampleProfile.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleProfile.java @@ -55,7 +55,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestDaoSampleProfile { +public class ITDaoSampleProfile { CancerStudy study; GenePanel genePanel; diff --git a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoUser.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoUser.java similarity index 97% rename from src/test/java/org/mskcc/cbio/portal/dao/TestDaoUser.java rename to src/test/java/org/mskcc/cbio/portal/dao/ITDaoUser.java index b6c2890e..ed2afeb1 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoUser.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoUser.java @@ -39,14 +39,12 @@ import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; -import org.mskcc.cbio.portal.dao.DaoUser; import org.mskcc.cbio.portal.model.User; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; import static org.hamcrest.CoreMatchers.*; /** @@ -58,7 +56,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestDaoUser { +public class ITDaoUser { @Test public void testDaoSeededUsers() throws Exception { diff --git a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoUserAuthorities.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoUserAuthorities.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/dao/TestDaoUserAuthorities.java rename to src/test/java/org/mskcc/cbio/portal/dao/ITDaoUserAuthorities.java index c90a8b3a..f8254269 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/TestDaoUserAuthorities.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoUserAuthorities.java @@ -58,7 +58,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestDaoUserAuthorities { +public class ITDaoUserAuthorities { @Test public void testDaoUserAuthorities() throws Exception { diff --git a/src/test/java/org/mskcc/cbio/portal/pancancer/TestPanCancerStudySummaryImport.java b/src/test/java/org/mskcc/cbio/portal/pancancer/ITPanCancerStudySummaryImport.java similarity index 94% rename from src/test/java/org/mskcc/cbio/portal/pancancer/TestPanCancerStudySummaryImport.java rename to src/test/java/org/mskcc/cbio/portal/pancancer/ITPanCancerStudySummaryImport.java index 248ee686..be990473 100755 --- a/src/test/java/org/mskcc/cbio/portal/pancancer/TestPanCancerStudySummaryImport.java +++ b/src/test/java/org/mskcc/cbio/portal/pancancer/ITPanCancerStudySummaryImport.java @@ -6,17 +6,13 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.*; -import org.mskcc.cbio.portal.model.CancerStudy; -import org.mskcc.cbio.portal.model.CanonicalGene; -import org.mskcc.cbio.portal.model.ClinicalAttribute; -import org.mskcc.cbio.portal.model.Sample; -import org.mskcc.cbio.portal.model.TypeOfCancer; +import org.mskcc.cbio.portal.model.*; import org.mskcc.cbio.portal.scripts.ImportCancerStudy; import org.mskcc.cbio.portal.scripts.ImportClinicalData; -import org.mskcc.cbio.portal.scripts.ImportSampleList; import org.mskcc.cbio.portal.scripts.ImportProfileData; -import org.mskcc.cbio.portal.util.*; -import org.mskcc.cbio.portal.web_api.GetSampleLists; +import org.mskcc.cbio.portal.scripts.ImportSampleList; +import org.mskcc.cbio.portal.util.ConsoleUtil; +import org.mskcc.cbio.portal.util.ProgressMonitor; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -34,7 +30,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestPanCancerStudySummaryImport { +public class ITPanCancerStudySummaryImport { @Before public void setUp() throws DaoException { diff --git a/src/test/java/org/mskcc/cbio/portal/pancancer/LargeTestSetGenerator.java b/src/test/java/org/mskcc/cbio/portal/pancancer/LargeTestSetGenerator.java index 9ab181cd..03b8990e 100644 --- a/src/test/java/org/mskcc/cbio/portal/pancancer/LargeTestSetGenerator.java +++ b/src/test/java/org/mskcc/cbio/portal/pancancer/LargeTestSetGenerator.java @@ -1,15 +1,7 @@ package org.mskcc.cbio.portal.pancancer; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.io.*; +import java.util.*; /** diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestGenerateMutationData.java b/src/test/java/org/mskcc/cbio/portal/scripts/ITGenerateMutationData.java similarity index 98% rename from src/test/java/org/mskcc/cbio/portal/scripts/TestGenerateMutationData.java rename to src/test/java/org/mskcc/cbio/portal/scripts/ITGenerateMutationData.java index 938c51b1..1bbca2d7 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestGenerateMutationData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/ITGenerateMutationData.java @@ -32,7 +32,6 @@ package org.mskcc.cbio.portal.scripts; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.util.ProgressMonitor; @@ -52,7 +51,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestGenerateMutationData { +public class ITGenerateMutationData { @Test public void testGenerateMutationData() throws Exception { diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportCaisesClinicalXML.java b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportCaisesClinicalXML.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/scripts/TestImportCaisesClinicalXML.java rename to src/test/java/org/mskcc/cbio/portal/scripts/ITImportCaisesClinicalXML.java index d139a87f..974a5674 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportCaisesClinicalXML.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportCaisesClinicalXML.java @@ -61,7 +61,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestImportCaisesClinicalXML { +public class ITImportCaisesClinicalXML { @Before public void setUp() throws Exception { diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportClinicalData.java b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportClinicalData.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/scripts/TestImportClinicalData.java rename to src/test/java/org/mskcc/cbio/portal/scripts/ITImportClinicalData.java index 14c2931f..b80c2a8f 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportClinicalData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportClinicalData.java @@ -33,7 +33,6 @@ package org.mskcc.cbio.portal.scripts; import org.junit.Before; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -42,7 +41,6 @@ import org.mskcc.cbio.portal.model.*; import org.mskcc.cbio.portal.util.ConsoleUtil; import org.mskcc.cbio.portal.util.ProgressMonitor; -import org.mskcc.cbio.portal.scripts.ImportClinicalData; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -64,7 +62,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestImportClinicalData { +public class ITImportClinicalData { //To use in test cases where we expect an exception: @Rule diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportCnaDiscreteLongData.java b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportCnaDiscreteLongData.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/scripts/TestImportCnaDiscreteLongData.java rename to src/test/java/org/mskcc/cbio/portal/scripts/ITImportCnaDiscreteLongData.java index a9053f78..f374250e 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportCnaDiscreteLongData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportCnaDiscreteLongData.java @@ -60,7 +60,7 @@ @ContextConfiguration(locations = {"classpath:/applicationContext-dao.xml"}) @Rollback @Transactional -public class TestImportCnaDiscreteLongData { +public class ITImportCnaDiscreteLongData { int studyId; GeneticProfile geneticProfile; String genePanel = "TESTPANEL_CNA_DISCRETE_LONG_FORMAT"; diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportCopyNumberSegmentData.java b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportCopyNumberSegmentData.java similarity index 98% rename from src/test/java/org/mskcc/cbio/portal/scripts/TestImportCopyNumberSegmentData.java rename to src/test/java/org/mskcc/cbio/portal/scripts/ITImportCopyNumberSegmentData.java index d77a1883..e533b9bc 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportCopyNumberSegmentData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportCopyNumberSegmentData.java @@ -32,7 +32,6 @@ import java.util.List; import org.junit.Before; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -61,7 +60,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestImportCopyNumberSegmentData { +public class ITImportCopyNumberSegmentData { @Autowired ApplicationContext applicationContext; diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportExtendedMutationData.java b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportExtendedMutationData.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/scripts/TestImportExtendedMutationData.java rename to src/test/java/org/mskcc/cbio/portal/scripts/ITImportExtendedMutationData.java index 616b144d..89543f00 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportExtendedMutationData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportExtendedMutationData.java @@ -33,7 +33,6 @@ package org.mskcc.cbio.portal.scripts; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.*; @@ -63,7 +62,7 @@ @ContextConfiguration(locations = { "classpath:/integrationTestScript.xml", "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestImportExtendedMutationData { +public class ITImportExtendedMutationData { @Autowired private ApplicationContext applicationContext; diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGeneData.java b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGeneData.java similarity index 93% rename from src/test/java/org/mskcc/cbio/portal/scripts/TestImportGeneData.java rename to src/test/java/org/mskcc/cbio/portal/scripts/ITImportGeneData.java index d3315f34..c8893e0a 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGeneData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGeneData.java @@ -32,7 +32,6 @@ package org.mskcc.cbio.portal.scripts; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -41,10 +40,7 @@ import java.io.File; import org.mskcc.cbio.portal.dao.DaoGeneOptimized; -import org.mskcc.cbio.portal.dao.DaoReferenceGenomeGene; import org.mskcc.cbio.portal.model.CanonicalGene; -import org.mskcc.cbio.portal.model.ReferenceGenome; -import org.mskcc.cbio.portal.model.ReferenceGenomeGene; import org.mskcc.cbio.portal.util.ProgressMonitor; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; @@ -58,7 +54,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestImportGeneData { +public class ITImportGeneData { @Test /* diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenericAssayData.java b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenericAssayData.java similarity index 98% rename from src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenericAssayData.java rename to src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenericAssayData.java index eff1560c..c6af45a9 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenericAssayData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenericAssayData.java @@ -36,9 +36,7 @@ import java.sql.ResultSet; import java.sql.SQLException; -import org.cbioportal.model.EntityType; import org.cbioportal.model.meta.GenericAssayMeta; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.DaoGenericAssay; @@ -59,7 +57,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestImportGenericAssayData { +public class ITImportGenericAssayData { @Test public void testImportTreatmentData() throws Exception { diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenericAssayPatientLevelData.java b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenericAssayPatientLevelData.java similarity index 97% rename from src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenericAssayPatientLevelData.java rename to src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenericAssayPatientLevelData.java index b22c23bf..be23a12a 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenericAssayPatientLevelData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenericAssayPatientLevelData.java @@ -32,9 +32,7 @@ package org.mskcc.cbio.portal.scripts; -import java.io.BufferedReader; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.*; @@ -49,15 +47,10 @@ import static org.junit.Assert.*; import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Set; /** * JUnit tests for ImportGenericAssayPatientLevelData class. @@ -66,7 +59,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestImportGenericAssayPatientLevelData { +public class ITImportGenericAssayPatientLevelData { private int studyId; private int geneticProfileId; diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenesetData.java b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenesetData.java similarity index 98% rename from src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenesetData.java rename to src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenesetData.java index f04f191e..ed026013 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenesetData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenesetData.java @@ -27,7 +27,6 @@ package org.mskcc.cbio.portal.scripts; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -51,7 +50,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestImportGenesetData { +public class ITImportGenesetData { @Test public void testImportGenesetData() throws Exception { diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenesetHierarchyData.java b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenesetHierarchyData.java similarity index 98% rename from src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenesetHierarchyData.java rename to src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenesetHierarchyData.java index 74440e25..35e9c025 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGenesetHierarchyData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenesetHierarchyData.java @@ -27,7 +27,6 @@ package org.mskcc.cbio.portal.scripts; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -62,7 +61,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestImportGenesetHierarchyData { +public class ITImportGenesetHierarchyData { @Test public void testImportGenesetHierarchyData() throws Exception { diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportProfileData.java b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportProfileData.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/scripts/TestImportProfileData.java rename to src/test/java/org/mskcc/cbio/portal/scripts/ITImportProfileData.java index b8089f7f..f7d78118 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportProfileData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportProfileData.java @@ -55,7 +55,6 @@ import org.mskcc.cbio.portal.model.CnaEvent; import org.mskcc.cbio.portal.model.ExtendedMutation; import org.mskcc.cbio.portal.model.GeneticProfile; -import org.mskcc.cbio.portal.model.GeneticAlterationType; import org.mskcc.cbio.portal.model.Patient; import org.mskcc.cbio.portal.model.Sample; import org.mskcc.cbio.portal.model.StructuralVariant; @@ -74,7 +73,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestImportProfileData { +public class ITImportProfileData { int studyId; int geneticProfileId; diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportReferenceGenome.java b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportReferenceGenome.java similarity index 95% rename from src/test/java/org/mskcc/cbio/portal/scripts/TestImportReferenceGenome.java rename to src/test/java/org/mskcc/cbio/portal/scripts/ITImportReferenceGenome.java index 89d714d1..405422e4 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportReferenceGenome.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportReferenceGenome.java @@ -1,6 +1,5 @@ package org.mskcc.cbio.portal.scripts; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -23,7 +22,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestImportReferenceGenome { +public class ITImportReferenceGenome { @Test /* diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportStructuralVariantData.java b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportStructuralVariantData.java similarity index 97% rename from src/test/java/org/mskcc/cbio/portal/scripts/TestImportStructuralVariantData.java rename to src/test/java/org/mskcc/cbio/portal/scripts/ITImportStructuralVariantData.java index 25442ea0..c9970ff4 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportStructuralVariantData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportStructuralVariantData.java @@ -29,7 +29,6 @@ import junitparams.JUnitParamsRunner; import junitparams.Parameters; -import org.apache.commons.lang3.StringEscapeUtils; import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.*; import org.junit.runner.RunWith; @@ -38,7 +37,6 @@ import org.mskcc.cbio.portal.util.*; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.rules.SpringClassRule; import org.springframework.test.context.junit4.rules.SpringMethodRule; import org.springframework.transaction.annotation.Transactional; @@ -57,7 +55,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestImportStructuralVariantData{ +public class ITImportStructuralVariantData { int studyId; int geneticProfileId; Set noNamespaces = null; diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportTabDelimData.java b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportTabDelimData.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/scripts/TestImportTabDelimData.java rename to src/test/java/org/mskcc/cbio/portal/scripts/ITImportTabDelimData.java index ef78f4f6..22f83ef7 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportTabDelimData.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportTabDelimData.java @@ -34,7 +34,6 @@ import java.io.BufferedReader; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.*; @@ -65,7 +64,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestImportTabDelimData { +public class ITImportTabDelimData { private final Set NON_CASE_ID_COLS = new HashSet<>(Arrays.asList( "Gene Symbol", diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportUsers.java b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportUsers.java similarity index 98% rename from src/test/java/org/mskcc/cbio/portal/scripts/TestImportUsers.java rename to src/test/java/org/mskcc/cbio/portal/scripts/ITImportUsers.java index 8fef7d87..39d0c855 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestImportUsers.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportUsers.java @@ -33,7 +33,6 @@ package org.mskcc.cbio.portal.scripts; // imports -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.model.User; @@ -54,7 +53,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestImportUsers { +public class ITImportUsers { @Test public void testImportUsers() throws Exception{ diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestIntegrationTest.java b/src/test/java/org/mskcc/cbio/portal/scripts/ITIntegrationTest.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/scripts/TestIntegrationTest.java rename to src/test/java/org/mskcc/cbio/portal/scripts/ITIntegrationTest.java index df70b972..36fc257a 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestIntegrationTest.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/ITIntegrationTest.java @@ -106,7 +106,7 @@ @ContextConfiguration(locations = { "classpath:/integrationTestScript.xml", "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestIntegrationTest { +public class ITIntegrationTest { @Autowired private ApplicationContext applicationContext; diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestMutationFilter.java b/src/test/java/org/mskcc/cbio/portal/scripts/ITMutationFilter.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/scripts/TestMutationFilter.java rename to src/test/java/org/mskcc/cbio/portal/scripts/ITMutationFilter.java index ef7c6867..64523387 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestMutationFilter.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/ITMutationFilter.java @@ -36,7 +36,6 @@ import static org.junit.Assert.assertTrue; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.DaoException; @@ -55,7 +54,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestMutationFilter { +public class ITMutationFilter { @Before public void setUp() throws DaoException { diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestNormalizeExpressionLevels.java b/src/test/java/org/mskcc/cbio/portal/scripts/ITNormalizeExpressionLevels.java similarity index 91% rename from src/test/java/org/mskcc/cbio/portal/scripts/TestNormalizeExpressionLevels.java rename to src/test/java/org/mskcc/cbio/portal/scripts/ITNormalizeExpressionLevels.java index 984abc60..f07c89b9 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestNormalizeExpressionLevels.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/ITNormalizeExpressionLevels.java @@ -33,7 +33,6 @@ package org.mskcc.cbio.portal.scripts; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -55,7 +54,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestNormalizeExpressionLevels { +public class ITNormalizeExpressionLevels { private String validationFile; private String[] args; @@ -65,9 +64,9 @@ public void initialize() { URL url = this.getClass().getResource("/correct_data_mRNA_ZbyNorm.txt"); validationFile = url.getFile().toString(); - URL url1 = TestNormalizeExpressionLevels.class.getResource("/test_all_thresholded.by_genes.txt"); - URL url2 = TestNormalizeExpressionLevels.class.getResource("/test_PR_GDAC_CANCER.medianexp.txt"); - URL url3 = TestNormalizeExpressionLevels.class.getResource("/data_mRNA_ZbyNorm.txt"); + URL url1 = ITNormalizeExpressionLevels.class.getResource("/test_all_thresholded.by_genes.txt"); + URL url2 = ITNormalizeExpressionLevels.class.getResource("/test_PR_GDAC_CANCER.medianexp.txt"); + URL url3 = ITNormalizeExpressionLevels.class.getResource("/data_mRNA_ZbyNorm.txt"); args = new String[] { url1.getFile().toString(), diff --git a/src/test/java/org/mskcc/cbio/portal/servlet/TestWebService.java b/src/test/java/org/mskcc/cbio/portal/servlet/ITWebService.java similarity index 97% rename from src/test/java/org/mskcc/cbio/portal/servlet/TestWebService.java rename to src/test/java/org/mskcc/cbio/portal/servlet/ITWebService.java index fb2d968d..fb064ce7 100644 --- a/src/test/java/org/mskcc/cbio/portal/servlet/TestWebService.java +++ b/src/test/java/org/mskcc/cbio/portal/servlet/ITWebService.java @@ -32,27 +32,32 @@ package org.mskcc.cbio.portal.servlet; -import java.io.*; -import java.util.*; - import jakarta.servlet.ServletException; - import org.junit.After; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; -import org.mskcc.cbio.portal.dao.*; +import org.mskcc.cbio.portal.dao.DaoCancerStudy; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.dao.DaoSampleList; import org.mskcc.cbio.portal.model.*; -import org.mskcc.cbio.portal.util.*; +import org.mskcc.cbio.portal.util.AccessControl; +import org.mskcc.cbio.portal.util.SpringUtil; +import org.mskcc.cbio.portal.util.WebserviceParserUtils; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; + import static org.easymock.EasyMock.*; +import static org.junit.Assert.*; /** * JUnit test for WebService class. @@ -63,7 +68,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestWebService { +public class ITWebService { private CancerStudy publicCancerStudy; private CancerStudy privateCancerStudy1; diff --git a/src/test/java/org/mskcc/cbio/portal/stats/TestOddsRatio.java b/src/test/java/org/mskcc/cbio/portal/stats/TestOddsRatio.java index 108fdb57..adad5c30 100644 --- a/src/test/java/org/mskcc/cbio/portal/stats/TestOddsRatio.java +++ b/src/test/java/org/mskcc/cbio/portal/stats/TestOddsRatio.java @@ -56,7 +56,7 @@ public void testFisherExact() throws IOException { GeneticAlterationType.COPY_NUMBER_ALTERATION, "DISCRETE", "CNA", "CNA", true); // TBD: change this to use getResourceAsStream() - String matrix0[][] = WebFileConnect.retrieveMatrix(new File("target/test-classes/cna_sample2.txt")); + String matrix0[][] = WebFileConnect.retrieveMatrix(new File("src/test/resources/cna_sample2.txt")); ProfileData data0 = new ProfileData(profile0, matrix0); profileList.add(data0); diff --git a/src/test/java/org/mskcc/cbio/portal/util/TestCancerStudyReader.java b/src/test/java/org/mskcc/cbio/portal/util/ITCancerStudyReader.java similarity index 98% rename from src/test/java/org/mskcc/cbio/portal/util/TestCancerStudyReader.java rename to src/test/java/org/mskcc/cbio/portal/util/ITCancerStudyReader.java index d6c13b02..0f39b948 100644 --- a/src/test/java/org/mskcc/cbio/portal/util/TestCancerStudyReader.java +++ b/src/test/java/org/mskcc/cbio/portal/util/ITCancerStudyReader.java @@ -55,7 +55,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestCancerStudyReader { +public class ITCancerStudyReader { @Test public void testCancerStudyReaderCancerType() throws Exception { diff --git a/src/test/java/org/mskcc/cbio/portal/util/TestGenePanelUtil.java b/src/test/java/org/mskcc/cbio/portal/util/ITGenePanelUtil.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/util/TestGenePanelUtil.java rename to src/test/java/org/mskcc/cbio/portal/util/ITGenePanelUtil.java index c4b05600..cee8ab29 100644 --- a/src/test/java/org/mskcc/cbio/portal/util/TestGenePanelUtil.java +++ b/src/test/java/org/mskcc/cbio/portal/util/ITGenePanelUtil.java @@ -25,7 +25,7 @@ @ContextConfiguration(locations = {"classpath:/applicationContext-dao.xml"}) @Rollback @Transactional -public class TestGenePanelUtil { +public class ITGenePanelUtil { CanonicalGene otor = makeGene(13321, 56914, "OTOR", makeAliases("FDP", "MIAL1")); CanonicalGene cadm2 = makeGene(20001, 253559, "CADM2", makeAliases("IGSF4D", "Necl-3", "NECL3", "SynCAM 2", "synCAM2")); diff --git a/src/test/java/org/mskcc/cbio/portal/util/TestGeneticProfileReader.java b/src/test/java/org/mskcc/cbio/portal/util/ITGeneticProfileReader.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/util/TestGeneticProfileReader.java rename to src/test/java/org/mskcc/cbio/portal/util/ITGeneticProfileReader.java index b8caceef..130b22db 100644 --- a/src/test/java/org/mskcc/cbio/portal/util/TestGeneticProfileReader.java +++ b/src/test/java/org/mskcc/cbio/portal/util/ITGeneticProfileReader.java @@ -61,7 +61,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestGeneticProfileReader { +public class ITGeneticProfileReader { @Test public void testGeneticProfileReader() throws Exception { diff --git a/src/test/java/org/mskcc/cbio/portal/util/TestMutSigReader.java b/src/test/java/org/mskcc/cbio/portal/util/ITMutSigReader.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/util/TestMutSigReader.java rename to src/test/java/org/mskcc/cbio/portal/util/ITMutSigReader.java index bf46ab71..102da98f 100644 --- a/src/test/java/org/mskcc/cbio/portal/util/TestMutSigReader.java +++ b/src/test/java/org/mskcc/cbio/portal/util/ITMutSigReader.java @@ -53,7 +53,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestMutSigReader { +public class ITMutSigReader { // TBD: change these to use getResourceAsStream() File properties = new File("target/test-classes/testCancerStudy.txt"); diff --git a/src/test/java/org/mskcc/cbio/portal/util/TestTransactionalScripts.java b/src/test/java/org/mskcc/cbio/portal/util/ITTransactionalScripts.java similarity index 96% rename from src/test/java/org/mskcc/cbio/portal/util/TestTransactionalScripts.java rename to src/test/java/org/mskcc/cbio/portal/util/ITTransactionalScripts.java index 25b691ea..b75ff58f 100644 --- a/src/test/java/org/mskcc/cbio/portal/util/TestTransactionalScripts.java +++ b/src/test/java/org/mskcc/cbio/portal/util/ITTransactionalScripts.java @@ -18,7 +18,7 @@ @ContextConfiguration(locations = { "classpath:/demoScript.xml", "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestTransactionalScripts { +public class ITTransactionalScripts { @Autowired private ApplicationContext applicationContext; diff --git a/src/test/java/org/mskcc/cbio/portal/web_api/TestGetGeneticProfiles.java b/src/test/java/org/mskcc/cbio/portal/web_api/ITGetGeneticProfiles.java similarity index 98% rename from src/test/java/org/mskcc/cbio/portal/web_api/TestGetGeneticProfiles.java rename to src/test/java/org/mskcc/cbio/portal/web_api/ITGetGeneticProfiles.java index cd226089..2111d966 100644 --- a/src/test/java/org/mskcc/cbio/portal/web_api/TestGetGeneticProfiles.java +++ b/src/test/java/org/mskcc/cbio/portal/web_api/ITGetGeneticProfiles.java @@ -52,7 +52,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestGetGeneticProfiles { +public class ITGetGeneticProfiles { @Test public void testDaoGeneticProfile() throws DaoException { diff --git a/src/test/java/org/mskcc/cbio/portal/web_api/TestGetMutSig.java b/src/test/java/org/mskcc/cbio/portal/web_api/ITGetMutSig.java similarity index 97% rename from src/test/java/org/mskcc/cbio/portal/web_api/TestGetMutSig.java rename to src/test/java/org/mskcc/cbio/portal/web_api/ITGetMutSig.java index 6b074c3f..bf2da29e 100644 --- a/src/test/java/org/mskcc/cbio/portal/web_api/TestGetMutSig.java +++ b/src/test/java/org/mskcc/cbio/portal/web_api/ITGetMutSig.java @@ -41,7 +41,6 @@ import org.mskcc.cbio.portal.dao.DaoGeneOptimized; import org.mskcc.cbio.portal.dao.DaoGeneticProfile; import org.mskcc.cbio.portal.dao.DaoMutSig; -import org.mskcc.cbio.portal.model.CancerStudy; import org.mskcc.cbio.portal.model.CanonicalGene; import org.mskcc.cbio.portal.model.MutSig; import org.mskcc.cbio.portal.dao.DaoException; @@ -64,7 +63,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestGetMutSig { +public class ITGetMutSig { int studyId; diff --git a/src/test/java/org/mskcc/cbio/portal/web_api/TestGetProfileData.java b/src/test/java/org/mskcc/cbio/portal/web_api/ITGetProfileData.java similarity index 98% rename from src/test/java/org/mskcc/cbio/portal/web_api/TestGetProfileData.java rename to src/test/java/org/mskcc/cbio/portal/web_api/ITGetProfileData.java index 37439531..724b27e5 100644 --- a/src/test/java/org/mskcc/cbio/portal/web_api/TestGetProfileData.java +++ b/src/test/java/org/mskcc/cbio/portal/web_api/ITGetProfileData.java @@ -38,7 +38,6 @@ import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.*; import org.mskcc.cbio.portal.model.*; -import org.mskcc.cbio.portal.util.*; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -46,7 +45,6 @@ import static org.junit.Assert.*; -import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -59,7 +57,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestGetProfileData { +public class ITGetProfileData { int geneticProfileId; diff --git a/src/test/java/org/mskcc/cbio/portal/web_api/TestGetSampleList.java b/src/test/java/org/mskcc/cbio/portal/web_api/ITGetSampleList.java similarity index 98% rename from src/test/java/org/mskcc/cbio/portal/web_api/TestGetSampleList.java rename to src/test/java/org/mskcc/cbio/portal/web_api/ITGetSampleList.java index dc91d80e..fee96d59 100644 --- a/src/test/java/org/mskcc/cbio/portal/web_api/TestGetSampleList.java +++ b/src/test/java/org/mskcc/cbio/portal/web_api/ITGetSampleList.java @@ -51,7 +51,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestGetSampleList { +public class ITGetSampleList { @Test public void testGetSampleList() throws Exception { diff --git a/src/test/java/org/mskcc/cbio/portal/web_api/TestGetTypesOfCancer.java b/src/test/java/org/mskcc/cbio/portal/web_api/ITGetTypesOfCancer.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/web_api/TestGetTypesOfCancer.java rename to src/test/java/org/mskcc/cbio/portal/web_api/ITGetTypesOfCancer.java index a28a89f6..831b2b36 100644 --- a/src/test/java/org/mskcc/cbio/portal/web_api/TestGetTypesOfCancer.java +++ b/src/test/java/org/mskcc/cbio/portal/web_api/ITGetTypesOfCancer.java @@ -63,7 +63,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class TestGetTypesOfCancer { +public class ITGetTypesOfCancer { public static final String DESCRIPTION = "The Cancer Genome Atlas (TCGA)" + " Breast Invasive Carcinoma project. 825 cases.
Nature 2012. " + From 0de4217f0de09b864396c62ee37604af39ad52ab Mon Sep 17 00:00:00 2001 From: Ruslan Forostianov Date: Tue, 19 Mar 2024 16:42:17 +0100 Subject: [PATCH 07/14] Un-ignore the rest of passing integration tests --- src/test/java/org/mskcc/cbio/portal/dao/ITDaoCancerStudy.java | 1 - .../java/org/mskcc/cbio/portal/dao/ITDaoClinicalAttribute.java | 1 - src/test/java/org/mskcc/cbio/portal/dao/ITDaoGene.java | 1 - src/test/java/org/mskcc/cbio/portal/dao/ITDaoGenePanel.java | 1 - .../java/org/mskcc/cbio/portal/dao/ITDaoGeneticAlteration.java | 1 - .../java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfile.java | 1 - .../org/mskcc/cbio/portal/dao/ITDaoGeneticProfileSamples.java | 1 - src/test/java/org/mskcc/cbio/portal/dao/ITDaoGistic.java | 1 - src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutSig.java | 1 - src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutation.java | 1 - src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleList.java | 1 - src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleProfile.java | 1 - src/test/java/org/mskcc/cbio/portal/dao/ITDaoUser.java | 1 - .../java/org/mskcc/cbio/portal/dao/ITDaoUserAuthorities.java | 1 - src/test/java/org/mskcc/cbio/portal/servlet/ITWebService.java | 2 -- .../java/org/mskcc/cbio/portal/util/ITCancerStudyReader.java | 2 -- src/test/java/org/mskcc/cbio/portal/util/ITGenePanelUtil.java | 2 -- .../java/org/mskcc/cbio/portal/util/ITGeneticProfileReader.java | 2 -- src/test/java/org/mskcc/cbio/portal/util/ITMutSigReader.java | 2 -- .../java/org/mskcc/cbio/portal/util/ITTransactionalScripts.java | 2 -- .../org/mskcc/cbio/portal/web_api/ITGetGeneticProfiles.java | 2 -- src/test/java/org/mskcc/cbio/portal/web_api/ITGetMutSig.java | 2 -- .../java/org/mskcc/cbio/portal/web_api/ITGetProfileData.java | 2 -- .../java/org/mskcc/cbio/portal/web_api/ITGetSampleList.java | 2 -- .../java/org/mskcc/cbio/portal/web_api/ITGetTypesOfCancer.java | 2 -- 25 files changed, 36 deletions(-) diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoCancerStudy.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoCancerStudy.java index 7bbe9d24..845fdacf 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoCancerStudy.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoCancerStudy.java @@ -55,7 +55,6 @@ * @author Arman Aksoy, Ethan Cerami, Arthur Goldberg, Ersin Ciftci. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoClinicalAttribute.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoClinicalAttribute.java index a675ddfc..ef847e38 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoClinicalAttribute.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoClinicalAttribute.java @@ -44,7 +44,6 @@ import static org.junit.Assert.*; @RunWith(SpringJUnit4ClassRunner.class) -@Ignore @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGene.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGene.java index 938636df..3afdbd27 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGene.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGene.java @@ -50,7 +50,6 @@ * JUnit Tests for DaoGene and DaoGeneOptimized. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGenePanel.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGenePanel.java index 78b7d785..bdbec20c 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGenePanel.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGenePanel.java @@ -50,7 +50,6 @@ * JUnit Tests for DaoGenePanel. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticAlteration.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticAlteration.java index d2e7d0b8..80e9f154 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticAlteration.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticAlteration.java @@ -50,7 +50,6 @@ * JUnit tests for DaoGeneticAlteration class. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfile.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfile.java index 60b1ae41..8257406c 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfile.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfile.java @@ -48,7 +48,6 @@ * JUnit tests for DaoGeneticProfile class. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfileSamples.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfileSamples.java index 0c13faba..76ac14ba 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfileSamples.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfileSamples.java @@ -50,7 +50,6 @@ * @author Ethan Cerami. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) public class ITDaoGeneticProfileSamples { diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGistic.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGistic.java index 8551e746..18e9744a 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGistic.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGistic.java @@ -51,7 +51,6 @@ import java.util.ArrayList; @RunWith(SpringJUnit4ClassRunner.class) -@Ignore @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutSig.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutSig.java index 28c93e4f..788b119c 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutSig.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutSig.java @@ -52,7 +52,6 @@ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutation.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutation.java index 6a462c2d..f4bd26c5 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutation.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutation.java @@ -55,7 +55,6 @@ * JUnit tests for DaoMutation class. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleList.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleList.java index 4d7ccb6e..303a65d0 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleList.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleList.java @@ -50,7 +50,6 @@ * JUnit test for DaoCase List. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleProfile.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleProfile.java index daa8b205..36147dd0 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleProfile.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleProfile.java @@ -51,7 +51,6 @@ * JUnit test for DaoSample class */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoUser.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoUser.java index ed2afeb1..29bed794 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoUser.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoUser.java @@ -52,7 +52,6 @@ */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoUserAuthorities.java b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoUserAuthorities.java index f8254269..b09331a8 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoUserAuthorities.java +++ b/src/test/java/org/mskcc/cbio/portal/dao/ITDaoUserAuthorities.java @@ -54,7 +54,6 @@ * JUnit test for DaoUserAuthorities class. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/servlet/ITWebService.java b/src/test/java/org/mskcc/cbio/portal/servlet/ITWebService.java index fb064ce7..6efb2518 100644 --- a/src/test/java/org/mskcc/cbio/portal/servlet/ITWebService.java +++ b/src/test/java/org/mskcc/cbio/portal/servlet/ITWebService.java @@ -63,8 +63,6 @@ * JUnit test for WebService class. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/util/ITCancerStudyReader.java b/src/test/java/org/mskcc/cbio/portal/util/ITCancerStudyReader.java index 0f39b948..abe793f5 100644 --- a/src/test/java/org/mskcc/cbio/portal/util/ITCancerStudyReader.java +++ b/src/test/java/org/mskcc/cbio/portal/util/ITCancerStudyReader.java @@ -50,8 +50,6 @@ * JUnit test for CancerStudyReader class. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/util/ITGenePanelUtil.java b/src/test/java/org/mskcc/cbio/portal/util/ITGenePanelUtil.java index cee8ab29..b5853d18 100644 --- a/src/test/java/org/mskcc/cbio/portal/util/ITGenePanelUtil.java +++ b/src/test/java/org/mskcc/cbio/portal/util/ITGenePanelUtil.java @@ -20,8 +20,6 @@ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = {"classpath:/applicationContext-dao.xml"}) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/util/ITGeneticProfileReader.java b/src/test/java/org/mskcc/cbio/portal/util/ITGeneticProfileReader.java index 130b22db..8d4046f8 100644 --- a/src/test/java/org/mskcc/cbio/portal/util/ITGeneticProfileReader.java +++ b/src/test/java/org/mskcc/cbio/portal/util/ITGeneticProfileReader.java @@ -56,8 +56,6 @@ * JUnit test for GeneticProfileReader class. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/util/ITMutSigReader.java b/src/test/java/org/mskcc/cbio/portal/util/ITMutSigReader.java index 102da98f..a2830b7c 100644 --- a/src/test/java/org/mskcc/cbio/portal/util/ITMutSigReader.java +++ b/src/test/java/org/mskcc/cbio/portal/util/ITMutSigReader.java @@ -48,8 +48,6 @@ import java.io.File; @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/util/ITTransactionalScripts.java b/src/test/java/org/mskcc/cbio/portal/util/ITTransactionalScripts.java index b75ff58f..eb821998 100644 --- a/src/test/java/org/mskcc/cbio/portal/util/ITTransactionalScripts.java +++ b/src/test/java/org/mskcc/cbio/portal/util/ITTransactionalScripts.java @@ -13,8 +13,6 @@ import org.springframework.transaction.annotation.Transactional; @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/demoScript.xml", "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/web_api/ITGetGeneticProfiles.java b/src/test/java/org/mskcc/cbio/portal/web_api/ITGetGeneticProfiles.java index 2111d966..f605b3a9 100644 --- a/src/test/java/org/mskcc/cbio/portal/web_api/ITGetGeneticProfiles.java +++ b/src/test/java/org/mskcc/cbio/portal/web_api/ITGetGeneticProfiles.java @@ -47,8 +47,6 @@ * JUnit test for GeneticProfile class. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/web_api/ITGetMutSig.java b/src/test/java/org/mskcc/cbio/portal/web_api/ITGetMutSig.java index bf2da29e..4739c1da 100644 --- a/src/test/java/org/mskcc/cbio/portal/web_api/ITGetMutSig.java +++ b/src/test/java/org/mskcc/cbio/portal/web_api/ITGetMutSig.java @@ -58,8 +58,6 @@ */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/web_api/ITGetProfileData.java b/src/test/java/org/mskcc/cbio/portal/web_api/ITGetProfileData.java index 724b27e5..df39299b 100644 --- a/src/test/java/org/mskcc/cbio/portal/web_api/ITGetProfileData.java +++ b/src/test/java/org/mskcc/cbio/portal/web_api/ITGetProfileData.java @@ -52,8 +52,6 @@ * JUnit test for GetProfileData class. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/web_api/ITGetSampleList.java b/src/test/java/org/mskcc/cbio/portal/web_api/ITGetSampleList.java index fee96d59..e02763ba 100644 --- a/src/test/java/org/mskcc/cbio/portal/web_api/ITGetSampleList.java +++ b/src/test/java/org/mskcc/cbio/portal/web_api/ITGetSampleList.java @@ -46,8 +46,6 @@ * JUnit test for GetSampleLists class. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional diff --git a/src/test/java/org/mskcc/cbio/portal/web_api/ITGetTypesOfCancer.java b/src/test/java/org/mskcc/cbio/portal/web_api/ITGetTypesOfCancer.java index 831b2b36..d9a720dc 100644 --- a/src/test/java/org/mskcc/cbio/portal/web_api/ITGetTypesOfCancer.java +++ b/src/test/java/org/mskcc/cbio/portal/web_api/ITGetTypesOfCancer.java @@ -58,8 +58,6 @@ * @author Ethan Cerami, Arthur Goldberg, Ersin Ciftci. */ @RunWith(SpringJUnit4ClassRunner.class) -@Ignore - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional From 9816ecf431dc7db9403af4a169b7ea3b69d80632 Mon Sep 17 00:00:00 2001 From: Ruslan Forostianov Date: Tue, 19 Mar 2024 17:11:17 +0100 Subject: [PATCH 08/14] Document how to run integration tests --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/README.md b/README.md index 34634d1f..1a04e860 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,39 @@ This repo contains: ## Inclusion in main codebase The `cbioportal-core` code is currently included in the final Docker image during the Docker build process: https://github.com/cBioPortal/cbioportal/blob/master/docker/web-and-data/Dockerfile#L48 + +## How to run integration tests + +This section guides you through the process of running integration tests by setting up a cBioPortal MySQL database environment using Docker. Please follow these steps carefully to ensure your testing environment is configured correctly. + +### Preparing the cbioportal test database + +1. **Download the cBioPortal Database Schema**: To begin, you need to download the database schema for the version of cBioPortal you are interested in testing. +Locate the pom.xml file in your project directory and check the values of `` and `` to determine the correct version. +Replace `v6.0.3` in the command below with your desired cBioPortal version: +``` +curl -o cgds.sql https://raw.githubusercontent.com/cBioPortal/cbioportal/v6.0.3/src/main/resources/db-scripts/cgds.sql +``` + +2. **Launch the MySQL Server Container**: Use Docker to start a MySQL server pre-loaded with the cBioPortal schema. Execute the following command from the root of your project directory. +It is recommended to open a separate terminal tab or window for this operation as it will occupy the console until stopped: + +``` +docker run -p 3306:3306 \ +-v $(pwd)/src/test/resources/seed_mini.sql:/docker-entrypoint-initdb.d/seed.sql:ro \ +-v $(pwd)/cgds.sql:/docker-entrypoint-initdb.d/cgds.sql:ro \ +-e MYSQL_ROOT_PASSWORD=root \ +-e MYSQL_USER=cbio_user \ +-e MYSQL_PASSWORD=somepassword \ +-e MYSQL_DATABASE=cgds_test \ +mysql:5.7 +``` + +### Run integration tests + +With the database up and running, you are now ready to execute the integration tests. + +Use Maven to run the integration tests. Ensure you are in the root directory of your project and run the following command: +``` +mvn integration-test +``` From 49b5f4b87428ed8e28aca490e6d4007861f32dd9 Mon Sep 17 00:00:00 2001 From: Ruslan Forostianov Date: Mon, 1 Apr 2024 17:21:28 +0200 Subject: [PATCH 09/14] Rename and move int.tests to integerationTest package Integrationt test class name does not have to follow any naming convention anymore as soon as it placed under integrationTest package. We renamed all integration tests from IT* to Test* for readability purpose. --- pom.xml | 4 +- .../portal/scripts/ImportGenesetData.java | 2 +- .../dao/TestDaoCancerStudy.java} | 8 +- .../dao/TestDaoClinicalAttribute.java} | 7 +- .../dao/TestDaoGene.java} | 8 +- .../dao/TestDaoGenePanel.java} | 8 +- .../dao/TestDaoGeneticAlteration.java} | 6 +- .../dao/TestDaoGeneticProfile.java} | 8 +- .../dao/TestDaoGeneticProfileSamples.java} | 6 +- .../dao/TestDaoGistic.java} | 8 +- .../dao/TestDaoMutSig.java} | 8 +- .../dao/TestDaoMutation.java} | 6 +- .../dao/TestDaoSampleList.java} | 6 +- .../dao/TestDaoSampleProfile.java} | 6 +- .../dao/TestDaoUser.java} | 6 +- .../dao/TestDaoUserAuthorities.java} | 6 +- .../pancancer/LargeTestSetGenerator.java | 2 +- .../TestPanCancerStudySummaryImport.java} | 4 +- .../scripts/TestGenerateMutationData.java} | 5 +- .../scripts/TestImportCaisesClinicalXML.java} | 5 +- .../scripts/TestImportClinicalData.java} | 5 +- .../TestImportCnaDiscreteLongData.java} | 5 +- .../TestImportCopyNumberSegmentData.java} | 5 +- .../TestImportExtendedMutationData.java} | 5 +- .../scripts/TestImportGeneData.java} | 5 +- .../scripts/TestImportGenericAssayData.java} | 5 +- ...stImportGenericAssayPatientLevelData.java} | 5 +- .../TestImportGenesetHierarchyData.java} | 6 +- .../scripts/TestImportProfileData.java} | 5 +- .../scripts/TestImportReferenceGenome.java} | 5 +- .../TestImportStructuralVariantData.java} | 5 +- .../scripts/TestImportTabDelimData.java} | 63 ++++++++++- .../scripts/TestImportUsers.java} | 5 +- .../scripts/TestIntegrationTest.java} | 5 +- .../scripts/TestMutationFilter.java} | 5 +- .../TestNormalizeExpressionLevels.java} | 11 +- .../servlet/TestWebService.java} | 8 +- .../util/TestCancerStudyReader.java} | 6 +- .../util/TestGenePanelUtil.java} | 5 +- .../util/TestGeneticProfileReader.java} | 6 +- .../util/TestMutSigReader.java} | 7 +- .../util/TestTransactionalScripts.java} | 6 +- .../web_api/TestGetGeneticProfiles.java} | 6 +- .../web_api/TestGetMutSig.java} | 6 +- .../web_api/TestGetProfileData.java} | 6 +- .../web_api/TestGetSampleList.java} | 6 +- .../web_api/TestGetTypesOfCancer.java} | 7 +- .../portal/scripts/ITImportGenesetData.java | 103 ------------------ .../portal/scripts/TestCutInvalidCases.java | 1 + 49 files changed, 213 insertions(+), 224 deletions(-) rename src/test/java/org/mskcc/cbio/portal/{dao/ITDaoCancerStudy.java => integrationTest/dao/TestDaoCancerStudy.java} (97%) rename src/test/java/org/mskcc/cbio/portal/{dao/ITDaoClinicalAttribute.java => integrationTest/dao/TestDaoClinicalAttribute.java} (92%) rename src/test/java/org/mskcc/cbio/portal/{dao/ITDaoGene.java => integrationTest/dao/TestDaoGene.java} (95%) rename src/test/java/org/mskcc/cbio/portal/{dao/ITDaoGenePanel.java => integrationTest/dao/TestDaoGenePanel.java} (93%) rename src/test/java/org/mskcc/cbio/portal/{dao/ITDaoGeneticAlteration.java => integrationTest/dao/TestDaoGeneticAlteration.java} (97%) rename src/test/java/org/mskcc/cbio/portal/{dao/ITDaoGeneticProfile.java => integrationTest/dao/TestDaoGeneticProfile.java} (96%) rename src/test/java/org/mskcc/cbio/portal/{dao/ITDaoGeneticProfileSamples.java => integrationTest/dao/TestDaoGeneticProfileSamples.java} (96%) rename src/test/java/org/mskcc/cbio/portal/{dao/ITDaoGistic.java => integrationTest/dao/TestDaoGistic.java} (94%) rename src/test/java/org/mskcc/cbio/portal/{dao/ITDaoMutSig.java => integrationTest/dao/TestDaoMutSig.java} (94%) rename src/test/java/org/mskcc/cbio/portal/{dao/ITDaoMutation.java => integrationTest/dao/TestDaoMutation.java} (99%) rename src/test/java/org/mskcc/cbio/portal/{dao/ITDaoSampleList.java => integrationTest/dao/TestDaoSampleList.java} (96%) rename src/test/java/org/mskcc/cbio/portal/{dao/ITDaoSampleProfile.java => integrationTest/dao/TestDaoSampleProfile.java} (97%) rename src/test/java/org/mskcc/cbio/portal/{dao/ITDaoUser.java => integrationTest/dao/TestDaoUser.java} (96%) rename src/test/java/org/mskcc/cbio/portal/{dao/ITDaoUserAuthorities.java => integrationTest/dao/TestDaoUserAuthorities.java} (96%) rename src/test/java/org/mskcc/cbio/portal/{ => integrationTest}/pancancer/LargeTestSetGenerator.java (99%) rename src/test/java/org/mskcc/cbio/portal/{pancancer/ITPanCancerStudySummaryImport.java => integrationTest/pancancer/TestPanCancerStudySummaryImport.java} (98%) rename src/test/java/org/mskcc/cbio/portal/{scripts/ITGenerateMutationData.java => integrationTest/scripts/TestGenerateMutationData.java} (95%) rename src/test/java/org/mskcc/cbio/portal/{scripts/ITImportCaisesClinicalXML.java => integrationTest/scripts/TestImportCaisesClinicalXML.java} (96%) rename src/test/java/org/mskcc/cbio/portal/{scripts/ITImportClinicalData.java => integrationTest/scripts/TestImportClinicalData.java} (99%) rename src/test/java/org/mskcc/cbio/portal/{scripts/ITImportCnaDiscreteLongData.java => integrationTest/scripts/TestImportCnaDiscreteLongData.java} (99%) rename src/test/java/org/mskcc/cbio/portal/{scripts/ITImportCopyNumberSegmentData.java => integrationTest/scripts/TestImportCopyNumberSegmentData.java} (96%) rename src/test/java/org/mskcc/cbio/portal/{scripts/ITImportExtendedMutationData.java => integrationTest/scripts/TestImportExtendedMutationData.java} (99%) rename src/test/java/org/mskcc/cbio/portal/{scripts/ITImportGeneData.java => integrationTest/scripts/TestImportGeneData.java} (95%) rename src/test/java/org/mskcc/cbio/portal/{scripts/ITImportGenericAssayData.java => integrationTest/scripts/TestImportGenericAssayData.java} (97%) rename src/test/java/org/mskcc/cbio/portal/{scripts/ITImportGenericAssayPatientLevelData.java => integrationTest/scripts/TestImportGenericAssayPatientLevelData.java} (97%) rename src/test/java/org/mskcc/cbio/portal/{scripts/ITImportGenesetHierarchyData.java => integrationTest/scripts/TestImportGenesetHierarchyData.java} (95%) rename src/test/java/org/mskcc/cbio/portal/{scripts/ITImportProfileData.java => integrationTest/scripts/TestImportProfileData.java} (99%) rename src/test/java/org/mskcc/cbio/portal/{scripts/ITImportReferenceGenome.java => integrationTest/scripts/TestImportReferenceGenome.java} (89%) rename src/test/java/org/mskcc/cbio/portal/{scripts/ITImportStructuralVariantData.java => integrationTest/scripts/TestImportStructuralVariantData.java} (97%) rename src/test/java/org/mskcc/cbio/portal/{scripts/ITImportTabDelimData.java => integrationTest/scripts/TestImportTabDelimData.java} (88%) rename src/test/java/org/mskcc/cbio/portal/{scripts/ITImportUsers.java => integrationTest/scripts/TestImportUsers.java} (95%) rename src/test/java/org/mskcc/cbio/portal/{scripts/ITIntegrationTest.java => integrationTest/scripts/TestIntegrationTest.java} (99%) rename src/test/java/org/mskcc/cbio/portal/{scripts/ITMutationFilter.java => integrationTest/scripts/TestMutationFilter.java} (97%) rename src/test/java/org/mskcc/cbio/portal/{scripts/ITNormalizeExpressionLevels.java => integrationTest/scripts/TestNormalizeExpressionLevels.java} (89%) rename src/test/java/org/mskcc/cbio/portal/{servlet/ITWebService.java => integrationTest/servlet/TestWebService.java} (98%) rename src/test/java/org/mskcc/cbio/portal/{util/ITCancerStudyReader.java => integrationTest/util/TestCancerStudyReader.java} (95%) rename src/test/java/org/mskcc/cbio/portal/{util/ITGenePanelUtil.java => integrationTest/util/TestGenePanelUtil.java} (99%) rename src/test/java/org/mskcc/cbio/portal/{util/ITGeneticProfileReader.java => integrationTest/util/TestGeneticProfileReader.java} (96%) rename src/test/java/org/mskcc/cbio/portal/{util/ITMutSigReader.java => integrationTest/util/TestMutSigReader.java} (94%) rename src/test/java/org/mskcc/cbio/portal/{util/ITTransactionalScripts.java => integrationTest/util/TestTransactionalScripts.java} (87%) rename src/test/java/org/mskcc/cbio/portal/{web_api/ITGetGeneticProfiles.java => integrationTest/web_api/TestGetGeneticProfiles.java} (94%) rename src/test/java/org/mskcc/cbio/portal/{web_api/ITGetMutSig.java => integrationTest/web_api/TestGetMutSig.java} (96%) rename src/test/java/org/mskcc/cbio/portal/{web_api/ITGetProfileData.java => integrationTest/web_api/TestGetProfileData.java} (97%) rename src/test/java/org/mskcc/cbio/portal/{web_api/ITGetSampleList.java => integrationTest/web_api/TestGetSampleList.java} (94%) rename src/test/java/org/mskcc/cbio/portal/{web_api/ITGetTypesOfCancer.java => integrationTest/web_api/TestGetTypesOfCancer.java} (97%) delete mode 100644 src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenesetData.java diff --git a/pom.xml b/pom.xml index 066522cc..99339126 100644 --- a/pom.xml +++ b/pom.xml @@ -257,7 +257,7 @@ - **/IT* + **/integrationTest/**/* @@ -269,7 +269,7 @@ - **/IT* + **/integrationTest/**/* 1 false diff --git a/src/main/java/org/mskcc/cbio/portal/scripts/ImportGenesetData.java b/src/main/java/org/mskcc/cbio/portal/scripts/ImportGenesetData.java index f912fa77..7c6ed3b7 100644 --- a/src/main/java/org/mskcc/cbio/portal/scripts/ImportGenesetData.java +++ b/src/main/java/org/mskcc/cbio/portal/scripts/ImportGenesetData.java @@ -278,7 +278,7 @@ public static int importData(File genesetFile, boolean updateInfo, boolean newV * @param suppFile * @throws Exception */ - static void importSuppGenesetData(File suppFile) throws Exception { + public static void importSuppGenesetData(File suppFile) throws Exception { ProgressMonitor.setCurrentMessage("Reading data from: " + suppFile.getCanonicalPath()); diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoCancerStudy.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoCancerStudy.java similarity index 97% rename from src/test/java/org/mskcc/cbio/portal/dao/ITDaoCancerStudy.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoCancerStudy.java index 845fdacf..84d08321 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoCancerStudy.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoCancerStudy.java @@ -30,12 +30,14 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.dao; +package org.mskcc.cbio.portal.integrationTest.dao; import org.junit.Assert; import org.junit.Test; -import org.junit.Ignore; import org.junit.runner.RunWith; +import org.mskcc.cbio.portal.dao.DaoCancerStudy; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.dao.DaoTypeOfCancer; import org.mskcc.cbio.portal.model.CancerStudy; import java.io.IOException; @@ -58,7 +60,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITDaoCancerStudy { +public class TestDaoCancerStudy { /** * Tests DaoCancer Study #1. diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoClinicalAttribute.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoClinicalAttribute.java similarity index 92% rename from src/test/java/org/mskcc/cbio/portal/dao/ITDaoClinicalAttribute.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoClinicalAttribute.java index ef847e38..12dee513 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoClinicalAttribute.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoClinicalAttribute.java @@ -30,11 +30,12 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.dao; +package org.mskcc.cbio.portal.integrationTest.dao; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.mskcc.cbio.portal.dao.DaoClinicalAttributeMeta; +import org.mskcc.cbio.portal.dao.DaoException; import org.mskcc.cbio.portal.model.ClinicalAttribute; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; @@ -47,7 +48,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITDaoClinicalAttribute { +public class TestDaoClinicalAttribute { @Test public void testDaoClinicalAttribute() throws DaoException { diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGene.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGene.java similarity index 95% rename from src/test/java/org/mskcc/cbio/portal/dao/ITDaoGene.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGene.java index 3afdbd27..9ba437c9 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGene.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGene.java @@ -30,11 +30,13 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.dao; +package org.mskcc.cbio.portal.integrationTest.dao; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.dao.DaoGeneOptimized; +import org.mskcc.cbio.portal.dao.MySQLbulkLoader; import org.mskcc.cbio.portal.model.CanonicalGene; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; @@ -53,7 +55,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITDaoGene { +public class TestDaoGene { /** * Tests DaoGene and DaoGeneOptimized. diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGenePanel.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGenePanel.java similarity index 93% rename from src/test/java/org/mskcc/cbio/portal/dao/ITDaoGenePanel.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGenePanel.java index bdbec20c..1cb31ba2 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGenePanel.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGenePanel.java @@ -30,11 +30,13 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.dao; +package org.mskcc.cbio.portal.integrationTest.dao; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.dao.DaoGeneOptimized; +import org.mskcc.cbio.portal.dao.DaoGenePanel; import org.mskcc.cbio.portal.model.*; import org.springframework.test.annotation.Rollback; @@ -53,7 +55,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITDaoGenePanel { +public class TestDaoGenePanel { /** * Tests DaoGenePanel.addGenePanel(). diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticAlteration.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticAlteration.java similarity index 97% rename from src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticAlteration.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticAlteration.java index 80e9f154..3e9d6fd1 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticAlteration.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticAlteration.java @@ -30,12 +30,12 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.dao; +package org.mskcc.cbio.portal.integrationTest.dao; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.mskcc.cbio.portal.dao.*; import org.mskcc.cbio.portal.model.*; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; @@ -53,7 +53,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITDaoGeneticAlteration { +public class TestDaoGeneticAlteration { CancerStudy study; ArrayList internalSampleIds; diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfile.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticProfile.java similarity index 96% rename from src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfile.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticProfile.java index 8257406c..f2378832 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfile.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticProfile.java @@ -30,13 +30,15 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.dao; +package org.mskcc.cbio.portal.integrationTest.dao; import java.util.ArrayList; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.mskcc.cbio.portal.dao.DaoCancerStudy; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.dao.DaoGeneticProfile; import org.mskcc.cbio.portal.model.*; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; @@ -51,7 +53,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITDaoGeneticProfile { +public class TestDaoGeneticProfile { int studyId; diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfileSamples.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticProfileSamples.java similarity index 96% rename from src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfileSamples.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticProfileSamples.java index 76ac14ba..e8cfd241 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGeneticProfileSamples.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticProfileSamples.java @@ -30,12 +30,12 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.dao; +package org.mskcc.cbio.portal.integrationTest.dao; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.mskcc.cbio.portal.dao.*; import org.mskcc.cbio.portal.model.*; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -51,7 +51,7 @@ */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) -public class ITDaoGeneticProfileSamples { +public class TestDaoGeneticProfileSamples { CancerStudy study; ArrayList internalSampleIds; diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGistic.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGistic.java similarity index 94% rename from src/test/java/org/mskcc/cbio/portal/dao/ITDaoGistic.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGistic.java index 18e9744a..9f3af0fd 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoGistic.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGistic.java @@ -30,13 +30,15 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.dao; +package org.mskcc.cbio.portal.integrationTest.dao; import java.util.Arrays; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.dao.DaoGeneOptimized; +import org.mskcc.cbio.portal.dao.DaoGistic; import org.mskcc.cbio.portal.model.CanonicalGene; import org.mskcc.cbio.portal.model.Gistic; import org.mskcc.cbio.portal.validate.validationException; @@ -54,7 +56,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITDaoGistic { +public class TestDaoGistic { @Test public void testDaoGistic() throws SQLException, DaoException, validationException { diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutSig.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutSig.java similarity index 94% rename from src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutSig.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutSig.java index 788b119c..0395c953 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutSig.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutSig.java @@ -30,11 +30,13 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.dao; +package org.mskcc.cbio.portal.integrationTest.dao; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.dao.DaoGeneOptimized; +import org.mskcc.cbio.portal.dao.DaoMutSig; import org.mskcc.cbio.portal.model.CanonicalGene; import org.mskcc.cbio.portal.model.MutSig; import org.springframework.test.annotation.Rollback; @@ -55,7 +57,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITDaoMutSig { +public class TestDaoMutSig { /** * Tests DaoGene and DaoGeneOptimized. diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutation.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutation.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutation.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutation.java index f4bd26c5..e4020bf7 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoMutation.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutation.java @@ -30,13 +30,13 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.dao; +package org.mskcc.cbio.portal.integrationTest.dao; import java.io.IOException; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.mskcc.cbio.portal.dao.*; import org.mskcc.cbio.portal.model.*; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; @@ -58,7 +58,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITDaoMutation { +public class TestDaoMutation { int geneticProfileId; int sampleId; diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleList.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoSampleList.java similarity index 96% rename from src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleList.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoSampleList.java index 303a65d0..3d55193f 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleList.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoSampleList.java @@ -30,14 +30,14 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.dao; +package org.mskcc.cbio.portal.integrationTest.dao; import java.util.ArrayList; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.mskcc.cbio.portal.dao.*; import org.mskcc.cbio.portal.model.*; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; @@ -53,7 +53,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITDaoSampleList { +public class TestDaoSampleList { CancerStudy study; diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleProfile.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoSampleProfile.java similarity index 97% rename from src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleProfile.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoSampleProfile.java index 36147dd0..514fcd4d 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoSampleProfile.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoSampleProfile.java @@ -30,9 +30,9 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.dao; +package org.mskcc.cbio.portal.integrationTest.dao; -import org.junit.Ignore; +import org.mskcc.cbio.portal.dao.*; import org.mskcc.cbio.portal.model.*; import org.springframework.test.annotation.Rollback; @@ -54,7 +54,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITDaoSampleProfile { +public class TestDaoSampleProfile { CancerStudy study; GenePanel genePanel; diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoUser.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoUser.java similarity index 96% rename from src/test/java/org/mskcc/cbio/portal/dao/ITDaoUser.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoUser.java index 29bed794..049ee874 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoUser.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoUser.java @@ -30,15 +30,15 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.dao; +package org.mskcc.cbio.portal.integrationTest.dao; import static org.junit.Assert.*; import java.util.ArrayList; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.mskcc.cbio.portal.dao.DaoUser; import org.mskcc.cbio.portal.model.User; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; @@ -55,7 +55,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITDaoUser { +public class TestDaoUser { @Test public void testDaoSeededUsers() throws Exception { diff --git a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoUserAuthorities.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoUserAuthorities.java similarity index 96% rename from src/test/java/org/mskcc/cbio/portal/dao/ITDaoUserAuthorities.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoUserAuthorities.java index b09331a8..1ccc7883 100644 --- a/src/test/java/org/mskcc/cbio/portal/dao/ITDaoUserAuthorities.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoUserAuthorities.java @@ -30,7 +30,7 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.dao; +package org.mskcc.cbio.portal.integrationTest.dao; // imports import static org.junit.Assert.assertEquals; @@ -40,9 +40,9 @@ import java.util.Arrays; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.mskcc.cbio.portal.dao.DaoUserAuthorities; import org.mskcc.cbio.portal.model.User; import org.mskcc.cbio.portal.model.UserAuthorities; import org.springframework.test.annotation.Rollback; @@ -57,7 +57,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITDaoUserAuthorities { +public class TestDaoUserAuthorities { @Test public void testDaoUserAuthorities() throws Exception { diff --git a/src/test/java/org/mskcc/cbio/portal/pancancer/LargeTestSetGenerator.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/pancancer/LargeTestSetGenerator.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/pancancer/LargeTestSetGenerator.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/pancancer/LargeTestSetGenerator.java index 03b8990e..1dac5a88 100644 --- a/src/test/java/org/mskcc/cbio/portal/pancancer/LargeTestSetGenerator.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/pancancer/LargeTestSetGenerator.java @@ -1,4 +1,4 @@ -package org.mskcc.cbio.portal.pancancer; +package org.mskcc.cbio.portal.integrationTest.pancancer; import java.io.*; import java.util.*; diff --git a/src/test/java/org/mskcc/cbio/portal/pancancer/ITPanCancerStudySummaryImport.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/pancancer/TestPanCancerStudySummaryImport.java similarity index 98% rename from src/test/java/org/mskcc/cbio/portal/pancancer/ITPanCancerStudySummaryImport.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/pancancer/TestPanCancerStudySummaryImport.java index be990473..96e5ec6f 100755 --- a/src/test/java/org/mskcc/cbio/portal/pancancer/ITPanCancerStudySummaryImport.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/pancancer/TestPanCancerStudySummaryImport.java @@ -1,4 +1,4 @@ -package org.mskcc.cbio.portal.pancancer; +package org.mskcc.cbio.portal.integrationTest.pancancer; import org.junit.After; import org.junit.Before; @@ -30,7 +30,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITPanCancerStudySummaryImport { +public class TestPanCancerStudySummaryImport { @Before public void setUp() throws DaoException { diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/ITGenerateMutationData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestGenerateMutationData.java similarity index 95% rename from src/test/java/org/mskcc/cbio/portal/scripts/ITGenerateMutationData.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestGenerateMutationData.java index 1bbca2d7..b5a785f7 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/ITGenerateMutationData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestGenerateMutationData.java @@ -30,10 +30,11 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.scripts; +package org.mskcc.cbio.portal.integrationTest.scripts; import org.junit.Test; import org.junit.runner.RunWith; +import org.mskcc.cbio.portal.scripts.GenerateMutationData; import org.mskcc.cbio.portal.util.ProgressMonitor; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; @@ -51,7 +52,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITGenerateMutationData { +public class TestGenerateMutationData { @Test public void testGenerateMutationData() throws Exception { diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportCaisesClinicalXML.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCaisesClinicalXML.java similarity index 96% rename from src/test/java/org/mskcc/cbio/portal/scripts/ITImportCaisesClinicalXML.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCaisesClinicalXML.java index 974a5674..9c2b8d4a 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportCaisesClinicalXML.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCaisesClinicalXML.java @@ -30,7 +30,7 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.scripts; +package org.mskcc.cbio.portal.integrationTest.scripts; import java.io.File; @@ -46,6 +46,7 @@ import org.mskcc.cbio.portal.model.Patient; import org.mskcc.cbio.portal.model.Sample; import org.mskcc.cbio.portal.model.TypeOfCancer; +import org.mskcc.cbio.portal.scripts.ImportCaisesClinicalXML; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -61,7 +62,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITImportCaisesClinicalXML { +public class TestImportCaisesClinicalXML { @Before public void setUp() throws Exception { diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportClinicalData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportClinicalData.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/scripts/ITImportClinicalData.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportClinicalData.java index b80c2a8f..8cb7b923 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportClinicalData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportClinicalData.java @@ -30,7 +30,7 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.scripts; +package org.mskcc.cbio.portal.integrationTest.scripts; import org.junit.Before; import org.junit.Rule; @@ -39,6 +39,7 @@ import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.*; import org.mskcc.cbio.portal.model.*; +import org.mskcc.cbio.portal.scripts.ImportClinicalData; import org.mskcc.cbio.portal.util.ConsoleUtil; import org.mskcc.cbio.portal.util.ProgressMonitor; import org.springframework.test.annotation.Rollback; @@ -62,7 +63,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITImportClinicalData { +public class TestImportClinicalData { //To use in test cases where we expect an exception: @Rule diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportCnaDiscreteLongData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCnaDiscreteLongData.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/scripts/ITImportCnaDiscreteLongData.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCnaDiscreteLongData.java index f374250e..9dafb819 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportCnaDiscreteLongData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCnaDiscreteLongData.java @@ -25,7 +25,7 @@ * @author Sander Tan */ -package org.mskcc.cbio.portal.scripts; +package org.mskcc.cbio.portal.integrationTest.scripts; import com.fasterxml.jackson.databind.*; import org.junit.*; @@ -34,6 +34,7 @@ import org.mskcc.cbio.portal.model.CnaEvent; import org.mskcc.cbio.portal.model.GeneticProfile; import org.mskcc.cbio.portal.model.Sample; +import org.mskcc.cbio.portal.scripts.ImportCnaDiscreteLongData; import org.mskcc.cbio.portal.util.StableIdUtil; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; @@ -60,7 +61,7 @@ @ContextConfiguration(locations = {"classpath:/applicationContext-dao.xml"}) @Rollback @Transactional -public class ITImportCnaDiscreteLongData { +public class TestImportCnaDiscreteLongData { int studyId; GeneticProfile geneticProfile; String genePanel = "TESTPANEL_CNA_DISCRETE_LONG_FORMAT"; diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportCopyNumberSegmentData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCopyNumberSegmentData.java similarity index 96% rename from src/test/java/org/mskcc/cbio/portal/scripts/ITImportCopyNumberSegmentData.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCopyNumberSegmentData.java index e533b9bc..e9d6e174 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportCopyNumberSegmentData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCopyNumberSegmentData.java @@ -21,7 +21,7 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.scripts; +package org.mskcc.cbio.portal.integrationTest.scripts; import java.io.BufferedReader; import java.io.File; @@ -44,6 +44,7 @@ import org.mskcc.cbio.portal.model.CancerStudy; import org.mskcc.cbio.portal.model.Patient; import org.mskcc.cbio.portal.model.Sample; +import org.mskcc.cbio.portal.scripts.ImportCopyNumberSegmentData; import org.mskcc.cbio.portal.util.SpringUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; @@ -60,7 +61,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITImportCopyNumberSegmentData { +public class TestImportCopyNumberSegmentData { @Autowired ApplicationContext applicationContext; diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportExtendedMutationData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportExtendedMutationData.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/scripts/ITImportExtendedMutationData.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportExtendedMutationData.java index 89543f00..ebf27848 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportExtendedMutationData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportExtendedMutationData.java @@ -30,13 +30,14 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.scripts; +package org.mskcc.cbio.portal.integrationTest.scripts; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.*; import org.mskcc.cbio.portal.model.*; +import org.mskcc.cbio.portal.scripts.ImportExtendedMutationData; import org.mskcc.cbio.portal.util.*; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; @@ -62,7 +63,7 @@ @ContextConfiguration(locations = { "classpath:/integrationTestScript.xml", "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITImportExtendedMutationData { +public class TestImportExtendedMutationData { @Autowired private ApplicationContext applicationContext; diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGeneData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGeneData.java similarity index 95% rename from src/test/java/org/mskcc/cbio/portal/scripts/ITImportGeneData.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGeneData.java index c8893e0a..a8e89000 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGeneData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGeneData.java @@ -30,7 +30,7 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.scripts; +package org.mskcc.cbio.portal.integrationTest.scripts; import org.junit.Test; import org.junit.runner.RunWith; @@ -41,6 +41,7 @@ import org.mskcc.cbio.portal.dao.DaoGeneOptimized; import org.mskcc.cbio.portal.model.CanonicalGene; +import org.mskcc.cbio.portal.scripts.ImportGeneData; import org.mskcc.cbio.portal.util.ProgressMonitor; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; @@ -54,7 +55,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITImportGeneData { +public class TestImportGeneData { @Test /* diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenericAssayData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenericAssayData.java similarity index 97% rename from src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenericAssayData.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenericAssayData.java index c6af45a9..029c4ed0 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenericAssayData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenericAssayData.java @@ -25,7 +25,7 @@ * @author Pim van Nierop, pim@thehyve.nl */ -package org.mskcc.cbio.portal.scripts; +package org.mskcc.cbio.portal.integrationTest.scripts; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -43,6 +43,7 @@ import org.mskcc.cbio.portal.dao.DaoGeneticEntity; import org.mskcc.cbio.portal.dao.JdbcUtil; import org.mskcc.cbio.portal.model.GeneticAlterationType; +import org.mskcc.cbio.portal.scripts.ImportGenericAssayEntity; import org.mskcc.cbio.portal.util.ProgressMonitor; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; @@ -57,7 +58,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITImportGenericAssayData { +public class TestImportGenericAssayData { @Test public void testImportTreatmentData() throws Exception { diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenericAssayPatientLevelData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenericAssayPatientLevelData.java similarity index 97% rename from src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenericAssayPatientLevelData.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenericAssayPatientLevelData.java index be23a12a..f7c20bea 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenericAssayPatientLevelData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenericAssayPatientLevelData.java @@ -30,7 +30,7 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.scripts; +package org.mskcc.cbio.portal.integrationTest.scripts; import org.junit.Before; import org.junit.Test; @@ -38,6 +38,7 @@ import org.mskcc.cbio.portal.dao.*; import org.mskcc.cbio.portal.model.*; import org.cbioportal.model.GeneticEntity; +import org.mskcc.cbio.portal.scripts.ImportGenericAssayPatientLevelData; import org.mskcc.cbio.portal.util.*; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; @@ -59,7 +60,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITImportGenericAssayPatientLevelData { +public class TestImportGenericAssayPatientLevelData { private int studyId; private int geneticProfileId; diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenesetHierarchyData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenesetHierarchyData.java similarity index 95% rename from src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenesetHierarchyData.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenesetHierarchyData.java index 35e9c025..fd064189 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenesetHierarchyData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenesetHierarchyData.java @@ -25,7 +25,7 @@ * @author Sander Tan */ -package org.mskcc.cbio.portal.scripts; +package org.mskcc.cbio.portal.integrationTest.scripts; import org.junit.Test; import org.junit.runner.RunWith; @@ -47,6 +47,8 @@ import org.mskcc.cbio.portal.model.Geneset; import org.mskcc.cbio.portal.model.GenesetHierarchy; import org.mskcc.cbio.portal.model.GenesetHierarchyLeaf; +import org.mskcc.cbio.portal.scripts.ImportGenesetData; +import org.mskcc.cbio.portal.scripts.ImportGenesetHierarchy; import org.mskcc.cbio.portal.util.ProgressMonitor; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; @@ -61,7 +63,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITImportGenesetHierarchyData { +public class TestImportGenesetHierarchyData { @Test public void testImportGenesetHierarchyData() throws Exception { diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportProfileData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportProfileData.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/scripts/ITImportProfileData.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportProfileData.java index f7d78118..97505f20 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportProfileData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportProfileData.java @@ -21,7 +21,7 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.scripts; +package org.mskcc.cbio.portal.integrationTest.scripts; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; @@ -59,6 +59,7 @@ import org.mskcc.cbio.portal.model.Sample; import org.mskcc.cbio.portal.model.StructuralVariant; +import org.mskcc.cbio.portal.scripts.ImportProfileData; import org.mskcc.cbio.portal.util.ConsoleUtil; import org.mskcc.cbio.portal.util.ProgressMonitor; import org.springframework.test.annotation.Rollback; @@ -73,7 +74,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITImportProfileData { +public class TestImportProfileData { int studyId; int geneticProfileId; diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportReferenceGenome.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportReferenceGenome.java similarity index 89% rename from src/test/java/org/mskcc/cbio/portal/scripts/ITImportReferenceGenome.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportReferenceGenome.java index 405422e4..0be3131c 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportReferenceGenome.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportReferenceGenome.java @@ -1,4 +1,4 @@ -package org.mskcc.cbio.portal.scripts; +package org.mskcc.cbio.portal.integrationTest.scripts; import org.junit.Test; import org.junit.runner.RunWith; @@ -9,6 +9,7 @@ import org.mskcc.cbio.portal.dao.DaoReferenceGenome; import org.mskcc.cbio.portal.model.ReferenceGenome; +import org.mskcc.cbio.portal.scripts.ImportReferenceGenome; import org.mskcc.cbio.portal.util.ProgressMonitor; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; @@ -22,7 +23,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITImportReferenceGenome { +public class TestImportReferenceGenome { @Test /* diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportStructuralVariantData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportStructuralVariantData.java similarity index 97% rename from src/test/java/org/mskcc/cbio/portal/scripts/ITImportStructuralVariantData.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportStructuralVariantData.java index c9970ff4..31d2c8fa 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportStructuralVariantData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportStructuralVariantData.java @@ -25,7 +25,7 @@ * @author Sander Tan */ -package org.mskcc.cbio.portal.scripts; +package org.mskcc.cbio.portal.integrationTest.scripts; import junitparams.JUnitParamsRunner; import junitparams.Parameters; @@ -34,6 +34,7 @@ import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.*; import org.mskcc.cbio.portal.model.*; +import org.mskcc.cbio.portal.scripts.ImportStructuralVariantData; import org.mskcc.cbio.portal.util.*; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; @@ -55,7 +56,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITImportStructuralVariantData { +public class TestImportStructuralVariantData { int studyId; int geneticProfileId; Set noNamespaces = null; diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportTabDelimData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportTabDelimData.java similarity index 88% rename from src/test/java/org/mskcc/cbio/portal/scripts/ITImportTabDelimData.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportTabDelimData.java index 22f83ef7..9eef51de 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportTabDelimData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportTabDelimData.java @@ -30,7 +30,7 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.scripts; +package org.mskcc.cbio.portal.integrationTest.scripts; import java.io.BufferedReader; import org.junit.Before; @@ -38,6 +38,8 @@ import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.*; import org.mskcc.cbio.portal.model.*; +import org.mskcc.cbio.portal.scripts.ImportGenesetData; +import org.mskcc.cbio.portal.scripts.ImportTabDelimData; import org.mskcc.cbio.portal.util.*; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; @@ -64,7 +66,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITImportTabDelimData { +public class TestImportTabDelimData { private final Set NON_CASE_ID_COLS = new HashSet<>(Arrays.asList( "Gene Symbol", @@ -506,5 +508,60 @@ private void addTestPatientAndSampleRecords(File file) throws FileNotFoundExcept } MySQLbulkLoader.flushAll(); } - + + @RunWith(SpringJUnit4ClassRunner.class) + @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) + @Rollback + @Transactional + public static class TestImportGenesetData { + + @Test + public void testImportGenesetData() throws Exception { + ProgressMonitor.setConsoleMode(false); + + // Open genesets test data file + File file = new File("src/test/resources/genesets/unit-test1_genesets.gmt"); + boolean updateInfo = false; + boolean newVersion = true; + int skippedGenes = ImportGenesetData.importData(file, updateInfo, newVersion); + + // Open supplementary file + file = new File("src/test/resources/genesets/unit-test1_supp-genesets.txt"); + ImportGenesetData.importSuppGenesetData(file); + + // Test database entries + Geneset geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET5"); + assertEquals("UNITTEST_GENESET5", geneset.getExternalId()); + geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET10"); + assertEquals("http://www.broadinstitute.org/gsea/msigdb/cards/GCNP_SHH_UP_EARLY.V1_UP", geneset.getRefLink()); + + // Test warning message + assertEquals(5, skippedGenes); + + // Test database entries supplementary file + geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET2"); + assertEquals("Genes up-regulated in RK3E cells (kidney epithelium) over-expressing GLI1 [GeneID=2735].", geneset.getDescription()); + geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET8"); + assertEquals("UNITTEST_GENESET8", geneset.getName()); + + // Test update of genes + // Open genesets test data file + file = new File("src/test/resources/genesets/unit-test2_genesets.gmt"); + newVersion = false; + updateInfo = true; + skippedGenes = ImportGenesetData.importData(file, updateInfo, newVersion); + + // Open supplementary file + file = new File("src/test/resources/genesets/unit-test2_supp-genesets.txt"); + ImportGenesetData.importSuppGenesetData(file); + + geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET2"); + assertEquals("A made up description is suited for this a fake gene.", geneset.getDescription()); + geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET1"); + assertEquals("Thought of new nice name for this geneset", geneset.getName()); + geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET1"); + assertEquals("http://www.thehyve.nl/", geneset.getRefLink()); + + } + } } diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportUsers.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportUsers.java similarity index 95% rename from src/test/java/org/mskcc/cbio/portal/scripts/ITImportUsers.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportUsers.java index 39d0c855..ad44d948 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportUsers.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportUsers.java @@ -30,7 +30,7 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.scripts; +package org.mskcc.cbio.portal.integrationTest.scripts; // imports import org.junit.Test; @@ -39,6 +39,7 @@ import org.mskcc.cbio.portal.dao.DaoUser; import org.mskcc.cbio.portal.model.UserAuthorities; import org.mskcc.cbio.portal.dao.DaoUserAuthorities; +import org.mskcc.cbio.portal.scripts.ImportUsers; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -53,7 +54,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITImportUsers { +public class TestImportUsers { @Test public void testImportUsers() throws Exception{ diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/ITIntegrationTest.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestIntegrationTest.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/scripts/ITIntegrationTest.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestIntegrationTest.java index 36fc257a..3f6a51e0 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/ITIntegrationTest.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestIntegrationTest.java @@ -21,7 +21,7 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.scripts; +package org.mskcc.cbio.portal.integrationTest.scripts; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -81,6 +81,7 @@ import org.mskcc.cbio.portal.model.CanonicalGene; import org.mskcc.cbio.portal.model.ExtendedMutation; import org.mskcc.cbio.portal.model.Gistic; +import org.mskcc.cbio.portal.scripts.ImportGenePanel; import org.mskcc.cbio.portal.util.ConsoleUtil; import org.mskcc.cbio.portal.util.ProgressMonitor; import org.mskcc.cbio.portal.util.SpringUtil; @@ -106,7 +107,7 @@ @ContextConfiguration(locations = { "classpath:/integrationTestScript.xml", "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITIntegrationTest { +public class TestIntegrationTest { @Autowired private ApplicationContext applicationContext; diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/ITMutationFilter.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestMutationFilter.java similarity index 97% rename from src/test/java/org/mskcc/cbio/portal/scripts/ITMutationFilter.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestMutationFilter.java index 64523387..75640e4d 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/ITMutationFilter.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestMutationFilter.java @@ -30,7 +30,7 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.scripts; +package org.mskcc.cbio.portal.integrationTest.scripts; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -42,6 +42,7 @@ import org.mskcc.cbio.portal.dao.DaoGeneOptimized; import org.mskcc.cbio.portal.model.CanonicalGene; import org.mskcc.cbio.portal.model.ExtendedMutation; +import org.mskcc.cbio.portal.scripts.MutationFilter; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -54,7 +55,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITMutationFilter { +public class TestMutationFilter { @Before public void setUp() throws DaoException { diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/ITNormalizeExpressionLevels.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestNormalizeExpressionLevels.java similarity index 89% rename from src/test/java/org/mskcc/cbio/portal/scripts/ITNormalizeExpressionLevels.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestNormalizeExpressionLevels.java index f07c89b9..6c0ca7b8 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/ITNormalizeExpressionLevels.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestNormalizeExpressionLevels.java @@ -30,7 +30,7 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.scripts; +package org.mskcc.cbio.portal.integrationTest.scripts; import org.junit.Before; import org.junit.Test; @@ -40,6 +40,7 @@ import org.mskcc.cbio.portal.model.CanonicalGene; import org.mskcc.cbio.portal.dao.DaoGeneOptimized; +import org.mskcc.cbio.portal.scripts.NormalizeExpressionLevels; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -54,7 +55,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITNormalizeExpressionLevels { +public class TestNormalizeExpressionLevels { private String validationFile; private String[] args; @@ -64,9 +65,9 @@ public void initialize() { URL url = this.getClass().getResource("/correct_data_mRNA_ZbyNorm.txt"); validationFile = url.getFile().toString(); - URL url1 = ITNormalizeExpressionLevels.class.getResource("/test_all_thresholded.by_genes.txt"); - URL url2 = ITNormalizeExpressionLevels.class.getResource("/test_PR_GDAC_CANCER.medianexp.txt"); - URL url3 = ITNormalizeExpressionLevels.class.getResource("/data_mRNA_ZbyNorm.txt"); + URL url1 = TestNormalizeExpressionLevels.class.getResource("/test_all_thresholded.by_genes.txt"); + URL url2 = TestNormalizeExpressionLevels.class.getResource("/test_PR_GDAC_CANCER.medianexp.txt"); + URL url3 = TestNormalizeExpressionLevels.class.getResource("/data_mRNA_ZbyNorm.txt"); args = new String[] { url1.getFile().toString(), diff --git a/src/test/java/org/mskcc/cbio/portal/servlet/ITWebService.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/servlet/TestWebService.java similarity index 98% rename from src/test/java/org/mskcc/cbio/portal/servlet/ITWebService.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/servlet/TestWebService.java index 6efb2518..55cd3654 100644 --- a/src/test/java/org/mskcc/cbio/portal/servlet/ITWebService.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/servlet/TestWebService.java @@ -30,18 +30,20 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.servlet; +package org.mskcc.cbio.portal.integrationTest.servlet; import jakarta.servlet.ServletException; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.DaoCancerStudy; import org.mskcc.cbio.portal.dao.DaoException; import org.mskcc.cbio.portal.dao.DaoSampleList; import org.mskcc.cbio.portal.model.*; +import org.mskcc.cbio.portal.servlet.NullHttpServletRequest; +import org.mskcc.cbio.portal.servlet.NullHttpServletResponse; +import org.mskcc.cbio.portal.servlet.WebService; import org.mskcc.cbio.portal.util.AccessControl; import org.mskcc.cbio.portal.util.SpringUtil; import org.mskcc.cbio.portal.util.WebserviceParserUtils; @@ -66,7 +68,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITWebService { +public class TestWebService { private CancerStudy publicCancerStudy; private CancerStudy privateCancerStudy1; diff --git a/src/test/java/org/mskcc/cbio/portal/util/ITCancerStudyReader.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestCancerStudyReader.java similarity index 95% rename from src/test/java/org/mskcc/cbio/portal/util/ITCancerStudyReader.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestCancerStudyReader.java index abe793f5..ce659f22 100644 --- a/src/test/java/org/mskcc/cbio/portal/util/ITCancerStudyReader.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestCancerStudyReader.java @@ -30,15 +30,15 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.util; +package org.mskcc.cbio.portal.integrationTest.util; import java.io.File; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.DaoCancerStudy; import org.mskcc.cbio.portal.model.CancerStudy; +import org.mskcc.cbio.portal.util.CancerStudyReader; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -53,7 +53,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITCancerStudyReader { +public class TestCancerStudyReader { @Test public void testCancerStudyReaderCancerType() throws Exception { diff --git a/src/test/java/org/mskcc/cbio/portal/util/ITGenePanelUtil.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestGenePanelUtil.java similarity index 99% rename from src/test/java/org/mskcc/cbio/portal/util/ITGenePanelUtil.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestGenePanelUtil.java index b5853d18..0c289e1c 100644 --- a/src/test/java/org/mskcc/cbio/portal/util/ITGenePanelUtil.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestGenePanelUtil.java @@ -1,6 +1,5 @@ -package org.mskcc.cbio.portal.util; +package org.mskcc.cbio.portal.integrationTest.util; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.model.CanonicalGene; @@ -23,7 +22,7 @@ @ContextConfiguration(locations = {"classpath:/applicationContext-dao.xml"}) @Rollback @Transactional -public class ITGenePanelUtil { +public class TestGenePanelUtil { CanonicalGene otor = makeGene(13321, 56914, "OTOR", makeAliases("FDP", "MIAL1")); CanonicalGene cadm2 = makeGene(20001, 253559, "CADM2", makeAliases("IGSF4D", "Necl-3", "NECL3", "SynCAM 2", "synCAM2")); diff --git a/src/test/java/org/mskcc/cbio/portal/util/ITGeneticProfileReader.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestGeneticProfileReader.java similarity index 96% rename from src/test/java/org/mskcc/cbio/portal/util/ITGeneticProfileReader.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestGeneticProfileReader.java index 8d4046f8..7d8d2f74 100644 --- a/src/test/java/org/mskcc/cbio/portal/util/ITGeneticProfileReader.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestGeneticProfileReader.java @@ -30,9 +30,8 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.util; +package org.mskcc.cbio.portal.integrationTest.util; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.DaoCancerStudy; @@ -41,6 +40,7 @@ import org.mskcc.cbio.portal.model.CancerStudy; import org.mskcc.cbio.portal.model.GeneticAlterationType; import org.mskcc.cbio.portal.model.GeneticProfile; +import org.mskcc.cbio.portal.util.GeneticProfileReader; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -59,7 +59,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITGeneticProfileReader { +public class TestGeneticProfileReader { @Test public void testGeneticProfileReader() throws Exception { diff --git a/src/test/java/org/mskcc/cbio/portal/util/ITMutSigReader.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestMutSigReader.java similarity index 94% rename from src/test/java/org/mskcc/cbio/portal/util/ITMutSigReader.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestMutSigReader.java index a2830b7c..4a60f9ac 100644 --- a/src/test/java/org/mskcc/cbio/portal/util/ITMutSigReader.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestMutSigReader.java @@ -30,14 +30,15 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.util; +package org.mskcc.cbio.portal.integrationTest.util; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.*; import org.mskcc.cbio.portal.model.*; +import org.mskcc.cbio.portal.util.MutSigReader; +import org.mskcc.cbio.portal.util.ProgressMonitor; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -51,7 +52,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITMutSigReader { +public class TestMutSigReader { // TBD: change these to use getResourceAsStream() File properties = new File("target/test-classes/testCancerStudy.txt"); diff --git a/src/test/java/org/mskcc/cbio/portal/util/ITTransactionalScripts.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestTransactionalScripts.java similarity index 87% rename from src/test/java/org/mskcc/cbio/portal/util/ITTransactionalScripts.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestTransactionalScripts.java index eb821998..0bb03e57 100644 --- a/src/test/java/org/mskcc/cbio/portal/util/ITTransactionalScripts.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestTransactionalScripts.java @@ -1,10 +1,10 @@ -package org.mskcc.cbio.portal.util; +package org.mskcc.cbio.portal.integrationTest.util; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.DaoCancerStudy; +import org.mskcc.cbio.portal.util.TransactionalScripts; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.test.annotation.Rollback; @@ -16,7 +16,7 @@ @ContextConfiguration(locations = { "classpath:/demoScript.xml", "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITTransactionalScripts { +public class TestTransactionalScripts { @Autowired private ApplicationContext applicationContext; diff --git a/src/test/java/org/mskcc/cbio/portal/web_api/ITGetGeneticProfiles.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetGeneticProfiles.java similarity index 94% rename from src/test/java/org/mskcc/cbio/portal/web_api/ITGetGeneticProfiles.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetGeneticProfiles.java index f605b3a9..414d90b1 100644 --- a/src/test/java/org/mskcc/cbio/portal/web_api/ITGetGeneticProfiles.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetGeneticProfiles.java @@ -30,12 +30,12 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.web_api; +package org.mskcc.cbio.portal.integrationTest.web_api; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.web_api.GetGeneticProfiles; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -50,7 +50,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITGetGeneticProfiles { +public class TestGetGeneticProfiles { @Test public void testDaoGeneticProfile() throws DaoException { diff --git a/src/test/java/org/mskcc/cbio/portal/web_api/ITGetMutSig.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetMutSig.java similarity index 96% rename from src/test/java/org/mskcc/cbio/portal/web_api/ITGetMutSig.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetMutSig.java index 4739c1da..5a9870c4 100644 --- a/src/test/java/org/mskcc/cbio/portal/web_api/ITGetMutSig.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetMutSig.java @@ -30,11 +30,10 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.web_api; +package org.mskcc.cbio.portal.integrationTest.web_api; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.DaoCancerStudy; @@ -44,6 +43,7 @@ import org.mskcc.cbio.portal.model.CanonicalGene; import org.mskcc.cbio.portal.model.MutSig; import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.web_api.GetMutSig; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -61,7 +61,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITGetMutSig { +public class TestGetMutSig { int studyId; diff --git a/src/test/java/org/mskcc/cbio/portal/web_api/ITGetProfileData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetProfileData.java similarity index 97% rename from src/test/java/org/mskcc/cbio/portal/web_api/ITGetProfileData.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetProfileData.java index df39299b..2cd1bf8e 100644 --- a/src/test/java/org/mskcc/cbio/portal/web_api/ITGetProfileData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetProfileData.java @@ -30,14 +30,14 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.web_api; +package org.mskcc.cbio.portal.integrationTest.web_api; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.*; import org.mskcc.cbio.portal.model.*; +import org.mskcc.cbio.portal.web_api.GetProfileData; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -55,7 +55,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITGetProfileData { +public class TestGetProfileData { int geneticProfileId; diff --git a/src/test/java/org/mskcc/cbio/portal/web_api/ITGetSampleList.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetSampleList.java similarity index 94% rename from src/test/java/org/mskcc/cbio/portal/web_api/ITGetSampleList.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetSampleList.java index e02763ba..6ee09bd3 100644 --- a/src/test/java/org/mskcc/cbio/portal/web_api/ITGetSampleList.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetSampleList.java @@ -30,11 +30,11 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.web_api; +package org.mskcc.cbio.portal.integrationTest.web_api; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.mskcc.cbio.portal.web_api.GetSampleLists; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -49,7 +49,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITGetSampleList { +public class TestGetSampleList { @Test public void testGetSampleList() throws Exception { diff --git a/src/test/java/org/mskcc/cbio/portal/web_api/ITGetTypesOfCancer.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetTypesOfCancer.java similarity index 97% rename from src/test/java/org/mskcc/cbio/portal/web_api/ITGetTypesOfCancer.java rename to src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetTypesOfCancer.java index d9a720dc..7502d93d 100644 --- a/src/test/java/org/mskcc/cbio/portal/web_api/ITGetTypesOfCancer.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetTypesOfCancer.java @@ -30,12 +30,11 @@ * along with this program. If not, see . */ -package org.mskcc.cbio.portal.web_api; +package org.mskcc.cbio.portal.integrationTest.web_api; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.DaoCancerStudy; @@ -43,6 +42,8 @@ import org.mskcc.cbio.portal.dao.DaoTypeOfCancer; import org.mskcc.cbio.portal.model.CancerStudy; import org.mskcc.cbio.portal.model.TypeOfCancer; +import org.mskcc.cbio.portal.web_api.GetTypesOfCancer; +import org.mskcc.cbio.portal.web_api.ProtocolException; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -61,7 +62,7 @@ @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback @Transactional -public class ITGetTypesOfCancer { +public class TestGetTypesOfCancer { public static final String DESCRIPTION = "The Cancer Genome Atlas (TCGA)" + " Breast Invasive Carcinoma project. 825 cases.
Nature 2012. " + diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenesetData.java b/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenesetData.java deleted file mode 100644 index ed026013..00000000 --- a/src/test/java/org/mskcc/cbio/portal/scripts/ITImportGenesetData.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2017 The Hyve B.V. - * This code is licensed under the GNU Affero General Public License (AGPL), - * version 3, or (at your option) any later version. - */ - -/* - * This file is part of cBioPortal. - * - * cBioPortal is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -*/ - -/* - * @author Sander Tan -*/ - -package org.mskcc.cbio.portal.scripts; - -import org.junit.Test; -import org.junit.runner.RunWith; - -import static org.junit.Assert.assertEquals; - -import java.io.File; - -import org.mskcc.cbio.portal.dao.DaoGeneset; -import org.mskcc.cbio.portal.model.Geneset; -import org.mskcc.cbio.portal.util.ProgressMonitor; -import org.springframework.test.annotation.Rollback; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.transaction.annotation.Transactional; - -/* - * JUnit tests for ImportGenesetData class. -*/ - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) -@Rollback -@Transactional -public class ITImportGenesetData { - - @Test - public void testImportGenesetData() throws Exception { - ProgressMonitor.setConsoleMode(false); - - // Open genesets test data file - File file = new File("src/test/resources/genesets/unit-test1_genesets.gmt"); - boolean updateInfo = false; - boolean newVersion = true; - int skippedGenes = ImportGenesetData.importData(file, updateInfo, newVersion); - - // Open supplementary file - file = new File("src/test/resources/genesets/unit-test1_supp-genesets.txt"); - ImportGenesetData.importSuppGenesetData(file); - - // Test database entries - Geneset geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET5"); - assertEquals("UNITTEST_GENESET5", geneset.getExternalId()); - geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET10"); - assertEquals("http://www.broadinstitute.org/gsea/msigdb/cards/GCNP_SHH_UP_EARLY.V1_UP", geneset.getRefLink()); - - // Test warning message - assertEquals(5, skippedGenes); - - // Test database entries supplementary file - geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET2"); - assertEquals("Genes up-regulated in RK3E cells (kidney epithelium) over-expressing GLI1 [GeneID=2735].", geneset.getDescription()); - geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET8"); - assertEquals("UNITTEST_GENESET8", geneset.getName()); - - // Test update of genes - // Open genesets test data file - file = new File("src/test/resources/genesets/unit-test2_genesets.gmt"); - newVersion = false; - updateInfo = true; - skippedGenes = ImportGenesetData.importData(file, updateInfo, newVersion); - - // Open supplementary file - file = new File("src/test/resources/genesets/unit-test2_supp-genesets.txt"); - ImportGenesetData.importSuppGenesetData(file); - - geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET2"); - assertEquals("A made up description is suited for this a fake gene.", geneset.getDescription()); - geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET1"); - assertEquals("Thought of new nice name for this geneset", geneset.getName()); - geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET1"); - assertEquals("http://www.thehyve.nl/", geneset.getRefLink()); - - } -} diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestCutInvalidCases.java b/src/test/java/org/mskcc/cbio/portal/scripts/TestCutInvalidCases.java index fbb6fa6a..8953f0be 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestCutInvalidCases.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/TestCutInvalidCases.java @@ -33,6 +33,7 @@ package org.mskcc.cbio.portal.scripts; import org.junit.Test; +import org.mskcc.cbio.portal.scripts.CutInvalidCases; import static org.junit.Assert.*; From 0b48914cc2769bfc12f0b72a765102cc4885d83c Mon Sep 17 00:00:00 2001 From: Ruslan Forostianov Date: Wed, 3 Apr 2024 17:21:23 +0200 Subject: [PATCH 10/14] Replace wildcard imports in integrationTest folder --- .../dao/TestDaoCancerStudy.java | 11 ++-- .../dao/TestDaoClinicalAttribute.java | 3 +- .../integrationTest/dao/TestDaoGenePanel.java | 9 +-- .../dao/TestDaoGeneticAlteration.java | 20 +++++-- .../dao/TestDaoGeneticProfile.java | 10 +++- .../dao/TestDaoGeneticProfileSamples.java | 15 +++-- .../integrationTest/dao/TestDaoGistic.java | 8 +-- .../integrationTest/dao/TestDaoMutSig.java | 5 +- .../integrationTest/dao/TestDaoMutation.java | 27 ++++++--- .../dao/TestDaoSampleList.java | 18 ++++-- .../dao/TestDaoSampleProfile.java | 28 ++++++--- .../integrationTest/dao/TestDaoUser.java | 13 +++-- .../dao/TestDaoUserAuthorities.java | 13 +++-- .../pancancer/LargeTestSetGenerator.java | 12 +++- .../TestPanCancerStudySummaryImport.java | 15 ++++- .../scripts/TestGenerateMutationData.java | 5 +- .../scripts/TestImportCaisesClinicalXML.java | 4 +- .../scripts/TestImportClinicalData.java | 21 +++++-- .../TestImportCnaDiscreteLongData.java | 23 ++++++-- .../TestImportCopyNumberSegmentData.java | 16 +++--- .../TestImportExtendedMutationData.java | 39 ++++++++++--- .../scripts/TestImportGeneData.java | 9 ++- .../scripts/TestImportGenericAssayData.java | 18 +++--- ...estImportGenericAssayPatientLevelData.java | 28 +++++++-- .../TestImportGenesetHierarchyData.java | 21 ++++--- .../scripts/TestImportProfileData.java | 25 ++++---- .../scripts/TestImportReferenceGenome.java | 9 ++- .../TestImportStructuralVariantData.java | 27 ++++++--- .../scripts/TestImportTabDelimData.java | 31 ++++++++-- .../scripts/TestImportUsers.java | 9 ++- .../scripts/TestIntegrationTest.java | 57 +++++++++---------- .../scripts/TestMutationFilter.java | 6 +- .../TestNormalizeExpressionLevels.java | 9 +-- .../servlet/TestWebService.java | 15 ++++- .../util/TestCancerStudyReader.java | 7 ++- .../util/TestGenePanelUtil.java | 5 +- .../util/TestGeneticProfileReader.java | 4 +- .../util/TestMutSigReader.java | 13 +++-- .../web_api/TestGetGeneticProfiles.java | 2 +- .../web_api/TestGetMutSig.java | 7 ++- .../web_api/TestGetProfileData.java | 16 ++++-- .../web_api/TestGetSampleList.java | 2 +- .../web_api/TestGetTypesOfCancer.java | 6 +- 43 files changed, 423 insertions(+), 218 deletions(-) diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoCancerStudy.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoCancerStudy.java index 84d08321..bae3a7be 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoCancerStudy.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoCancerStudy.java @@ -39,17 +39,18 @@ import org.mskcc.cbio.portal.dao.DaoException; import org.mskcc.cbio.portal.dao.DaoTypeOfCancer; import org.mskcc.cbio.portal.model.CancerStudy; - -import java.io.IOException; -import java.util.ArrayList; - import org.mskcc.cbio.portal.model.ReferenceGenome; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; +import java.io.IOException; +import java.util.ArrayList; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; /** * JUnit Tests for DaoCancer Study. diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoClinicalAttribute.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoClinicalAttribute.java index 12dee513..734a44db 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoClinicalAttribute.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoClinicalAttribute.java @@ -42,7 +42,8 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGenePanel.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGenePanel.java index 1cb31ba2..a0fbd5af 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGenePanel.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGenePanel.java @@ -37,16 +37,17 @@ import org.mskcc.cbio.portal.dao.DaoException; import org.mskcc.cbio.portal.dao.DaoGeneOptimized; import org.mskcc.cbio.portal.dao.DaoGenePanel; -import org.mskcc.cbio.portal.model.*; - +import org.mskcc.cbio.portal.model.CanonicalGene; +import org.mskcc.cbio.portal.model.GenePanel; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; +import java.util.HashSet; -import java.util.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; /** * JUnit Tests for DaoGenePanel. diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticAlteration.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticAlteration.java index 3e9d6fd1..000b90fa 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticAlteration.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticAlteration.java @@ -35,16 +35,28 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.mskcc.cbio.portal.dao.*; -import org.mskcc.cbio.portal.model.*; +import org.mskcc.cbio.portal.dao.DaoCancerStudy; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.dao.DaoGeneticAlteration; +import org.mskcc.cbio.portal.dao.DaoGeneticProfile; +import org.mskcc.cbio.portal.dao.DaoGeneticProfileSamples; +import org.mskcc.cbio.portal.dao.DaoPatient; +import org.mskcc.cbio.portal.dao.DaoSample; +import org.mskcc.cbio.portal.dao.MySQLbulkLoader; +import org.mskcc.cbio.portal.model.CancerStudy; +import org.mskcc.cbio.portal.model.CanonicalGene; +import org.mskcc.cbio.portal.model.Patient; +import org.mskcc.cbio.portal.model.Sample; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Set; -import java.util.*; +import static org.junit.Assert.assertEquals; /** * JUnit tests for DaoGeneticAlteration class. diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticProfile.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticProfile.java index f2378832..8c1afdcc 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticProfile.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticProfile.java @@ -32,19 +32,23 @@ package org.mskcc.cbio.portal.integrationTest.dao; -import java.util.ArrayList; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.DaoCancerStudy; import org.mskcc.cbio.portal.dao.DaoException; import org.mskcc.cbio.portal.dao.DaoGeneticProfile; -import org.mskcc.cbio.portal.model.*; +import org.mskcc.cbio.portal.model.GeneticAlterationType; +import org.mskcc.cbio.portal.model.GeneticProfile; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; + +import java.util.ArrayList; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; /** * JUnit tests for DaoGeneticProfile class. diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticProfileSamples.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticProfileSamples.java index e8cfd241..01d65388 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticProfileSamples.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGeneticProfileSamples.java @@ -35,15 +35,22 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.mskcc.cbio.portal.dao.*; -import org.mskcc.cbio.portal.model.*; +import org.mskcc.cbio.portal.dao.DaoCancerStudy; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.dao.DaoGeneticProfile; +import org.mskcc.cbio.portal.dao.DaoGeneticProfileSamples; +import org.mskcc.cbio.portal.dao.DaoPatient; +import org.mskcc.cbio.portal.dao.DaoSample; +import org.mskcc.cbio.portal.model.CancerStudy; +import org.mskcc.cbio.portal.model.Patient; +import org.mskcc.cbio.portal.model.Sample; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import static org.junit.Assert.*; - import java.util.ArrayList; +import static org.junit.Assert.assertEquals; + /** * JUnit Tests for the Dao Genetic Profile Cases Class. * diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGistic.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGistic.java index 9f3af0fd..df152f7b 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGistic.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoGistic.java @@ -32,8 +32,6 @@ package org.mskcc.cbio.portal.integrationTest.dao; -import java.util.Arrays; - import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.DaoException; @@ -47,10 +45,12 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; - import java.sql.SQLException; import java.util.ArrayList; +import java.util.Arrays; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutSig.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutSig.java index 0395c953..67714b6e 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutSig.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutSig.java @@ -44,10 +44,11 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; - import java.io.IOException; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + /** * @author Lennart Bastian */ diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutation.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutation.java index e4020bf7..a1331b2c 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutation.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutation.java @@ -32,24 +32,33 @@ package org.mskcc.cbio.portal.integrationTest.dao; -import java.io.IOException; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.mskcc.cbio.portal.dao.*; -import org.mskcc.cbio.portal.model.*; +import org.mskcc.cbio.portal.dao.DaoCancerStudy; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.dao.DaoGeneOptimized; +import org.mskcc.cbio.portal.dao.DaoGeneticProfile; +import org.mskcc.cbio.portal.dao.DaoMutation; +import org.mskcc.cbio.portal.dao.DaoSample; +import org.mskcc.cbio.portal.dao.MySQLbulkLoader; +import org.mskcc.cbio.portal.model.CanonicalGene; +import org.mskcc.cbio.portal.model.ExtendedMutation; +import org.mskcc.cbio.portal.model.GeneticProfile; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; - -import java.util.*; - -import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; -import org.junit.Assert; +import static org.junit.Assert.assertEquals; /** * JUnit tests for DaoMutation class. diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoSampleList.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoSampleList.java index 3d55193f..83b807b3 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoSampleList.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoSampleList.java @@ -32,19 +32,27 @@ package org.mskcc.cbio.portal.integrationTest.dao; -import java.util.ArrayList; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.mskcc.cbio.portal.dao.*; -import org.mskcc.cbio.portal.model.*; +import org.mskcc.cbio.portal.dao.DaoCancerStudy; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.dao.DaoPatient; +import org.mskcc.cbio.portal.dao.DaoSample; +import org.mskcc.cbio.portal.dao.DaoSampleList; +import org.mskcc.cbio.portal.model.CancerStudy; +import org.mskcc.cbio.portal.model.Patient; +import org.mskcc.cbio.portal.model.Sample; +import org.mskcc.cbio.portal.model.SampleList; +import org.mskcc.cbio.portal.model.SampleListCategory; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; +import java.util.ArrayList; + +import static org.junit.Assert.assertEquals; /** * JUnit test for DaoCase List. diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoSampleProfile.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoSampleProfile.java index 514fcd4d..705f46b6 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoSampleProfile.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoSampleProfile.java @@ -32,20 +32,32 @@ package org.mskcc.cbio.portal.integrationTest.dao; -import org.mskcc.cbio.portal.dao.*; -import org.mskcc.cbio.portal.model.*; - +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mskcc.cbio.portal.dao.DaoCancerStudy; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.dao.DaoGeneOptimized; +import org.mskcc.cbio.portal.dao.DaoGenePanel; +import org.mskcc.cbio.portal.dao.DaoGeneticProfile; +import org.mskcc.cbio.portal.dao.DaoPatient; +import org.mskcc.cbio.portal.dao.DaoSample; +import org.mskcc.cbio.portal.dao.DaoSampleProfile; +import org.mskcc.cbio.portal.model.CancerStudy; +import org.mskcc.cbio.portal.model.CanonicalGene; +import org.mskcc.cbio.portal.model.GenePanel; +import org.mskcc.cbio.portal.model.Patient; +import org.mskcc.cbio.portal.model.Sample; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import org.junit.Test; -import org.junit.Before; -import org.junit.runner.RunWith; -import static org.junit.Assert.*; +import java.util.ArrayList; +import java.util.HashSet; -import java.util.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; /** * JUnit test for DaoSample class diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoUser.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoUser.java index 049ee874..2c6b78a0 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoUser.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoUser.java @@ -32,10 +32,6 @@ package org.mskcc.cbio.portal.integrationTest.dao; -import static org.junit.Assert.*; - -import java.util.ArrayList; - import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.DaoUser; @@ -45,7 +41,14 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.hamcrest.CoreMatchers.*; +import java.util.ArrayList; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertThat; /** * JUnit test for DaoUser class. diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoUserAuthorities.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoUserAuthorities.java index 1ccc7883..556a11dd 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoUserAuthorities.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoUserAuthorities.java @@ -33,12 +33,6 @@ package org.mskcc.cbio.portal.integrationTest.dao; // imports -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.util.Arrays; import org.junit.Test; import org.junit.runner.RunWith; @@ -50,6 +44,13 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; +import java.util.Arrays; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + /** * JUnit test for DaoUserAuthorities class. */ diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/pancancer/LargeTestSetGenerator.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/pancancer/LargeTestSetGenerator.java index 1dac5a88..f85d7f2b 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/pancancer/LargeTestSetGenerator.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/pancancer/LargeTestSetGenerator.java @@ -1,7 +1,15 @@ package org.mskcc.cbio.portal.integrationTest.pancancer; -import java.io.*; -import java.util.*; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/pancancer/TestPanCancerStudySummaryImport.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/pancancer/TestPanCancerStudySummaryImport.java index 96e5ec6f..81cf6a2e 100755 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/pancancer/TestPanCancerStudySummaryImport.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/pancancer/TestPanCancerStudySummaryImport.java @@ -5,8 +5,19 @@ import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; -import org.mskcc.cbio.portal.dao.*; -import org.mskcc.cbio.portal.model.*; +import org.mskcc.cbio.portal.dao.DaoCancerStudy; +import org.mskcc.cbio.portal.dao.DaoClinicalData; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.dao.DaoGeneOptimized; +import org.mskcc.cbio.portal.dao.DaoGeneticProfile; +import org.mskcc.cbio.portal.dao.DaoPatient; +import org.mskcc.cbio.portal.dao.DaoSample; +import org.mskcc.cbio.portal.dao.DaoTypeOfCancer; +import org.mskcc.cbio.portal.model.CancerStudy; +import org.mskcc.cbio.portal.model.CanonicalGene; +import org.mskcc.cbio.portal.model.ClinicalAttribute; +import org.mskcc.cbio.portal.model.Sample; +import org.mskcc.cbio.portal.model.TypeOfCancer; import org.mskcc.cbio.portal.scripts.ImportCancerStudy; import org.mskcc.cbio.portal.scripts.ImportClinicalData; import org.mskcc.cbio.portal.scripts.ImportProfileData; diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestGenerateMutationData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestGenerateMutationData.java index b5a785f7..66926984 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestGenerateMutationData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestGenerateMutationData.java @@ -41,10 +41,11 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; - import java.io.File; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + /** * JUnit test for GenerateMutationData class. */ diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCaisesClinicalXML.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCaisesClinicalXML.java index 9c2b8d4a..e0532c90 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCaisesClinicalXML.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCaisesClinicalXML.java @@ -32,8 +32,6 @@ package org.mskcc.cbio.portal.integrationTest.scripts; -import java.io.File; - import org.junit.Before; import org.junit.Ignore; import org.junit.Test; @@ -52,6 +50,8 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; +import java.io.File; + /** * * @author jgao diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportClinicalData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportClinicalData.java index 8cb7b923..6d1475f2 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportClinicalData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportClinicalData.java @@ -37,8 +37,12 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; -import org.mskcc.cbio.portal.dao.*; -import org.mskcc.cbio.portal.model.*; +import org.mskcc.cbio.portal.dao.DaoCancerStudy; +import org.mskcc.cbio.portal.dao.DaoClinicalData; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.model.CancerStudy; +import org.mskcc.cbio.portal.model.ClinicalParameterMap; +import org.mskcc.cbio.portal.model.Patient; import org.mskcc.cbio.portal.scripts.ImportClinicalData; import org.mskcc.cbio.portal.util.ConsoleUtil; import org.mskcc.cbio.portal.util.ProgressMonitor; @@ -47,10 +51,17 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; -import java.io.*; -import java.util.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; /** * Tests Import of Clinical Data. diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCnaDiscreteLongData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCnaDiscreteLongData.java index 9dafb819..74ca7874 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCnaDiscreteLongData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCnaDiscreteLongData.java @@ -27,10 +27,22 @@ package org.mskcc.cbio.portal.integrationTest.scripts; -import com.fasterxml.jackson.databind.*; -import org.junit.*; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; import org.junit.runner.RunWith; -import org.mskcc.cbio.portal.dao.*; +import org.mskcc.cbio.portal.dao.DaoCancerStudy; +import org.mskcc.cbio.portal.dao.DaoCnaEvent; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.dao.DaoGeneOptimized; +import org.mskcc.cbio.portal.dao.DaoGeneticAlteration; +import org.mskcc.cbio.portal.dao.DaoGeneticProfile; +import org.mskcc.cbio.portal.dao.DaoSample; +import org.mskcc.cbio.portal.dao.DaoSampleProfile; +import org.mskcc.cbio.portal.dao.JdbcUtil; +import org.mskcc.cbio.portal.dao.MySQLbulkLoader; import org.mskcc.cbio.portal.model.CnaEvent; import org.mskcc.cbio.portal.model.GeneticProfile; import org.mskcc.cbio.portal.model.Sample; @@ -46,7 +58,10 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -import java.util.*; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Sets.newHashSet; diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCopyNumberSegmentData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCopyNumberSegmentData.java index e9d6e174..7cc50cff 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCopyNumberSegmentData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCopyNumberSegmentData.java @@ -23,14 +23,6 @@ package org.mskcc.cbio.portal.integrationTest.scripts; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -53,6 +45,14 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + /** * Test the import of Segment data into database. * @author pieterlukasse diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportExtendedMutationData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportExtendedMutationData.java index ebf27848..b76c33d8 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportExtendedMutationData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportExtendedMutationData.java @@ -35,26 +35,47 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.mskcc.cbio.portal.dao.*; -import org.mskcc.cbio.portal.model.*; +import org.mskcc.cbio.portal.dao.DaoCancerStudy; +import org.mskcc.cbio.portal.dao.DaoClinicalAttributeMeta; +import org.mskcc.cbio.portal.dao.DaoClinicalData; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.dao.DaoGeneOptimized; +import org.mskcc.cbio.portal.dao.DaoGeneticProfile; +import org.mskcc.cbio.portal.dao.DaoMutation; +import org.mskcc.cbio.portal.dao.DaoPatient; +import org.mskcc.cbio.portal.dao.DaoSample; +import org.mskcc.cbio.portal.dao.MySQLbulkLoader; +import org.mskcc.cbio.portal.model.CancerStudy; +import org.mskcc.cbio.portal.model.CanonicalGene; +import org.mskcc.cbio.portal.model.ClinicalAttribute; +import org.mskcc.cbio.portal.model.ClinicalData; +import org.mskcc.cbio.portal.model.ExtendedMutation; +import org.mskcc.cbio.portal.model.GeneticAlterationType; +import org.mskcc.cbio.portal.model.GeneticProfile; +import org.mskcc.cbio.portal.model.Patient; +import org.mskcc.cbio.portal.model.Sample; import org.mskcc.cbio.portal.scripts.ImportExtendedMutationData; -import org.mskcc.cbio.portal.util.*; +import org.mskcc.cbio.portal.util.ConsoleUtil; +import org.mskcc.cbio.portal.util.ProgressMonitor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static com.google.common.collect.Sets.newHashSet; -import static org.junit.Assert.*; - -import java.io.*; +import java.io.File; +import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; + +import static com.google.common.collect.Sets.newHashSet; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; /** * @author Arthur Goldberg goldberg@cbio.mskcc.org diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGeneData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGeneData.java index a8e89000..aa182c36 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGeneData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGeneData.java @@ -34,11 +34,6 @@ import org.junit.Test; import org.junit.runner.RunWith; - -import static org.junit.Assert.assertEquals; - -import java.io.File; - import org.mskcc.cbio.portal.dao.DaoGeneOptimized; import org.mskcc.cbio.portal.model.CanonicalGene; import org.mskcc.cbio.portal.scripts.ImportGeneData; @@ -48,6 +43,10 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; +import java.io.File; + +import static org.junit.Assert.assertEquals; + /** * JUnit tests for ImportGeneData class. */ diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenericAssayData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenericAssayData.java index 029c4ed0..a0a33c6d 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenericAssayData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenericAssayData.java @@ -27,15 +27,6 @@ package org.mskcc.cbio.portal.integrationTest.scripts; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.io.File; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; - import org.cbioportal.model.meta.GenericAssayMeta; import org.junit.Test; import org.junit.runner.RunWith; @@ -50,6 +41,15 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; +import java.io.File; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + /* * JUnit tests for ImportTreatmentData class. */ diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenericAssayPatientLevelData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenericAssayPatientLevelData.java index f7c20bea..123715f8 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenericAssayPatientLevelData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenericAssayPatientLevelData.java @@ -32,27 +32,43 @@ package org.mskcc.cbio.portal.integrationTest.scripts; +import org.cbioportal.model.GeneticEntity; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.mskcc.cbio.portal.dao.*; -import org.mskcc.cbio.portal.model.*; -import org.cbioportal.model.GeneticEntity; +import org.mskcc.cbio.portal.dao.DaoCancerStudy; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.dao.DaoGeneOptimized; +import org.mskcc.cbio.portal.dao.DaoGenericAssay; +import org.mskcc.cbio.portal.dao.DaoGeneticAlteration; +import org.mskcc.cbio.portal.dao.DaoGeneticEntity; +import org.mskcc.cbio.portal.dao.DaoGeneticProfile; +import org.mskcc.cbio.portal.dao.DaoPatient; +import org.mskcc.cbio.portal.dao.DaoSample; +import org.mskcc.cbio.portal.dao.DaoSampleProfile; +import org.mskcc.cbio.portal.dao.MySQLbulkLoader; +import org.mskcc.cbio.portal.model.CancerStudy; +import org.mskcc.cbio.portal.model.GeneticAlterationType; +import org.mskcc.cbio.portal.model.GeneticProfile; +import org.mskcc.cbio.portal.model.Patient; +import org.mskcc.cbio.portal.model.Sample; import org.mskcc.cbio.portal.scripts.ImportGenericAssayPatientLevelData; -import org.mskcc.cbio.portal.util.*; +import org.mskcc.cbio.portal.util.FileUtil; +import org.mskcc.cbio.portal.util.ProgressMonitor; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; - import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + /** * JUnit tests for ImportGenericAssayPatientLevelData class. */ diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenesetHierarchyData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenesetHierarchyData.java index fd064189..8e63b1ed 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenesetHierarchyData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenesetHierarchyData.java @@ -29,20 +29,10 @@ import org.junit.Test; import org.junit.runner.RunWith; - -import static org.junit.Assert.assertEquals; - -import java.io.File; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.List; - import org.mskcc.cbio.portal.dao.DaoException; import org.mskcc.cbio.portal.dao.DaoGeneset; -import org.mskcc.cbio.portal.dao.DaoGenesetHierarchyNode; import org.mskcc.cbio.portal.dao.DaoGenesetHierarchyLeaf; +import org.mskcc.cbio.portal.dao.DaoGenesetHierarchyNode; import org.mskcc.cbio.portal.dao.JdbcUtil; import org.mskcc.cbio.portal.model.Geneset; import org.mskcc.cbio.portal.model.GenesetHierarchy; @@ -55,6 +45,15 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; +import java.io.File; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.List; + +import static org.junit.Assert.assertEquals; + /* * JUnit tests for ImportGenesetData class. */ diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportProfileData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportProfileData.java index 97505f20..f1cc61fe 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportProfileData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportProfileData.java @@ -23,16 +23,10 @@ package org.mskcc.cbio.portal.integrationTest.scripts; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; - -import org.junit.*; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.DaoCancerStudy; @@ -58,7 +52,6 @@ import org.mskcc.cbio.portal.model.Patient; import org.mskcc.cbio.portal.model.Sample; import org.mskcc.cbio.portal.model.StructuralVariant; - import org.mskcc.cbio.portal.scripts.ImportProfileData; import org.mskcc.cbio.portal.util.ConsoleUtil; import org.mskcc.cbio.portal.util.ProgressMonitor; @@ -67,6 +60,16 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + /** * @author Pieter Lukasse pieter@thehyve.nl */ diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportReferenceGenome.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportReferenceGenome.java index 0be3131c..a59ba407 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportReferenceGenome.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportReferenceGenome.java @@ -2,11 +2,6 @@ import org.junit.Test; import org.junit.runner.RunWith; - -import static org.junit.Assert.assertEquals; - -import java.io.File; - import org.mskcc.cbio.portal.dao.DaoReferenceGenome; import org.mskcc.cbio.portal.model.ReferenceGenome; import org.mskcc.cbio.portal.scripts.ImportReferenceGenome; @@ -16,6 +11,10 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; +import java.io.File; + +import static org.junit.Assert.assertEquals; + /** * JUnit tests for ImportGeneData class. */ diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportStructuralVariantData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportStructuralVariantData.java index 31d2c8fa..76a58f85 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportStructuralVariantData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportStructuralVariantData.java @@ -27,25 +27,36 @@ package org.mskcc.cbio.portal.integrationTest.scripts; +import com.fasterxml.jackson.databind.ObjectMapper; import junitparams.JUnitParamsRunner; import junitparams.Parameters; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.*; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; import org.junit.runner.RunWith; -import org.mskcc.cbio.portal.dao.*; -import org.mskcc.cbio.portal.model.*; +import org.mskcc.cbio.portal.dao.DaoCancerStudy; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.dao.DaoGeneticProfile; +import org.mskcc.cbio.portal.dao.DaoStructuralVariant; +import org.mskcc.cbio.portal.dao.MySQLbulkLoader; +import org.mskcc.cbio.portal.model.StructuralVariant; import org.mskcc.cbio.portal.scripts.ImportStructuralVariantData; -import org.mskcc.cbio.portal.util.*; +import org.mskcc.cbio.portal.util.ProgressMonitor; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.rules.SpringClassRule; import org.springframework.test.context.junit4.rules.SpringMethodRule; import org.springframework.transaction.annotation.Transactional; +import java.io.File; +import java.io.IOException; +import java.util.List; +import java.util.Set; + import static com.google.common.collect.Sets.newHashSet; -import static org.junit.Assert.*; -import java.io.*; -import java.util.*; +import static org.junit.Assert.assertEquals; /** * Test class to test functionality of ImportStructralVariantData diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportTabDelimData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportTabDelimData.java index 9eef51de..faf5d6ad 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportTabDelimData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportTabDelimData.java @@ -32,22 +32,38 @@ package org.mskcc.cbio.portal.integrationTest.scripts; -import java.io.BufferedReader; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.mskcc.cbio.portal.dao.*; -import org.mskcc.cbio.portal.model.*; +import org.mskcc.cbio.portal.dao.DaoCancerStudy; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.dao.DaoGeneOptimized; +import org.mskcc.cbio.portal.dao.DaoGeneset; +import org.mskcc.cbio.portal.dao.DaoGeneticAlteration; +import org.mskcc.cbio.portal.dao.DaoGeneticProfile; +import org.mskcc.cbio.portal.dao.DaoPatient; +import org.mskcc.cbio.portal.dao.DaoSample; +import org.mskcc.cbio.portal.dao.DaoSampleProfile; +import org.mskcc.cbio.portal.dao.MySQLbulkLoader; +import org.mskcc.cbio.portal.model.CancerStudy; +import org.mskcc.cbio.portal.model.CanonicalGene; +import org.mskcc.cbio.portal.model.CopyNumberStatus; +import org.mskcc.cbio.portal.model.Geneset; +import org.mskcc.cbio.portal.model.GeneticAlterationType; +import org.mskcc.cbio.portal.model.GeneticProfile; +import org.mskcc.cbio.portal.model.Patient; +import org.mskcc.cbio.portal.model.Sample; import org.mskcc.cbio.portal.scripts.ImportGenesetData; import org.mskcc.cbio.portal.scripts.ImportTabDelimData; -import org.mskcc.cbio.portal.util.*; +import org.mskcc.cbio.portal.util.ConsoleUtil; +import org.mskcc.cbio.portal.util.FileUtil; +import org.mskcc.cbio.portal.util.ProgressMonitor; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; - +import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; @@ -59,6 +75,9 @@ import java.util.List; import java.util.Set; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + /** * JUnit tests for ImportTabDelimData class. */ diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportUsers.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportUsers.java index ad44d948..d70ea0b0 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportUsers.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportUsers.java @@ -33,19 +33,22 @@ package org.mskcc.cbio.portal.integrationTest.scripts; // imports + import org.junit.Test; import org.junit.runner.RunWith; -import org.mskcc.cbio.portal.model.User; import org.mskcc.cbio.portal.dao.DaoUser; -import org.mskcc.cbio.portal.model.UserAuthorities; import org.mskcc.cbio.portal.dao.DaoUserAuthorities; +import org.mskcc.cbio.portal.model.User; +import org.mskcc.cbio.portal.model.UserAuthorities; import org.mskcc.cbio.portal.scripts.ImportUsers; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; /** * JUnit test for ImportUsers class. diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestIntegrationTest.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestIntegrationTest.java index 3f6a51e0..bc3bbac1 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestIntegrationTest.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestIntegrationTest.java @@ -23,29 +23,11 @@ package org.mskcc.cbio.portal.integrationTest.scripts; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; - import org.cbioportal.model.GenericAssayData; import org.cbioportal.model.GenesetMolecularData; import org.cbioportal.model.StructuralVariant; @@ -59,28 +41,28 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.DaoCancerStudy; +import org.mskcc.cbio.portal.dao.DaoClinicalAttributeMeta; +import org.mskcc.cbio.portal.dao.DaoClinicalData; import org.mskcc.cbio.portal.dao.DaoException; import org.mskcc.cbio.portal.dao.DaoGeneOptimized; import org.mskcc.cbio.portal.dao.DaoGeneset; +import org.mskcc.cbio.portal.dao.DaoGeneticAlteration; import org.mskcc.cbio.portal.dao.DaoGeneticEntity; +import org.mskcc.cbio.portal.dao.DaoGeneticProfile; import org.mskcc.cbio.portal.dao.DaoGistic; -import org.mskcc.cbio.portal.dao.DaoSampleList; -import org.mskcc.cbio.portal.dao.MySQLbulkLoader; import org.mskcc.cbio.portal.dao.DaoMutation; +import org.mskcc.cbio.portal.dao.DaoSampleList; import org.mskcc.cbio.portal.dao.DaoTypeOfCancer; -import org.mskcc.cbio.portal.dao.DaoClinicalData; -import org.mskcc.cbio.portal.dao.DaoGeneticProfile; -import org.mskcc.cbio.portal.dao.DaoGeneticAlteration; -import org.mskcc.cbio.portal.dao.DaoClinicalAttributeMeta; -import org.mskcc.cbio.portal.model.ClinicalData; -import org.mskcc.cbio.portal.model.ClinicalAttribute; -import org.mskcc.cbio.portal.model.GeneticProfile; -import org.mskcc.cbio.portal.model.SampleList; +import org.mskcc.cbio.portal.dao.MySQLbulkLoader; import org.mskcc.cbio.portal.model.CancerStudy; -import org.mskcc.cbio.portal.model.TypeOfCancer; import org.mskcc.cbio.portal.model.CanonicalGene; +import org.mskcc.cbio.portal.model.ClinicalAttribute; +import org.mskcc.cbio.portal.model.ClinicalData; import org.mskcc.cbio.portal.model.ExtendedMutation; +import org.mskcc.cbio.portal.model.GeneticProfile; import org.mskcc.cbio.portal.model.Gistic; +import org.mskcc.cbio.portal.model.SampleList; +import org.mskcc.cbio.portal.model.TypeOfCancer; import org.mskcc.cbio.portal.scripts.ImportGenePanel; import org.mskcc.cbio.portal.util.ConsoleUtil; import org.mskcc.cbio.portal.util.ProgressMonitor; @@ -93,6 +75,23 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * Integration test using the same data that is used by validation system test * "study_es_0". In the validation system test for "study_es_0" it is checked if diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestMutationFilter.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestMutationFilter.java index 75640e4d..2c193723 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestMutationFilter.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestMutationFilter.java @@ -32,9 +32,6 @@ package org.mskcc.cbio.portal.integrationTest.scripts; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -48,6 +45,9 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + /** * JUnit tests for MutationFilter class. */ diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestNormalizeExpressionLevels.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestNormalizeExpressionLevels.java index 6c0ca7b8..964ccee3 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestNormalizeExpressionLevels.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestNormalizeExpressionLevels.java @@ -35,11 +35,8 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; - -import static org.junit.Assert.*; - -import org.mskcc.cbio.portal.model.CanonicalGene; import org.mskcc.cbio.portal.dao.DaoGeneOptimized; +import org.mskcc.cbio.portal.model.CanonicalGene; import org.mskcc.cbio.portal.scripts.NormalizeExpressionLevels; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; @@ -51,6 +48,10 @@ import java.net.URL; import java.util.ArrayList; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/servlet/TestWebService.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/servlet/TestWebService.java index 55cd3654..9b4917be 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/servlet/TestWebService.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/servlet/TestWebService.java @@ -40,7 +40,11 @@ import org.mskcc.cbio.portal.dao.DaoCancerStudy; import org.mskcc.cbio.portal.dao.DaoException; import org.mskcc.cbio.portal.dao.DaoSampleList; -import org.mskcc.cbio.portal.model.*; +import org.mskcc.cbio.portal.model.CancerStudy; +import org.mskcc.cbio.portal.model.GeneticProfile; +import org.mskcc.cbio.portal.model.SampleList; +import org.mskcc.cbio.portal.model.SampleListCategory; +import org.mskcc.cbio.portal.model.User; import org.mskcc.cbio.portal.servlet.NullHttpServletRequest; import org.mskcc.cbio.portal.servlet.NullHttpServletResponse; import org.mskcc.cbio.portal.servlet.WebService; @@ -58,8 +62,13 @@ import java.util.HashSet; import java.util.List; -import static org.easymock.EasyMock.*; -import static org.junit.Assert.*; +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.isA; +import static org.easymock.EasyMock.replay; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; /** * JUnit test for WebService class. diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestCancerStudyReader.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestCancerStudyReader.java index ce659f22..733cbc79 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestCancerStudyReader.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestCancerStudyReader.java @@ -32,8 +32,6 @@ package org.mskcc.cbio.portal.integrationTest.util; -import java.io.File; - import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.DaoCancerStudy; @@ -44,7 +42,10 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; +import java.io.File; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; /** * JUnit test for CancerStudyReader class. diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestGenePanelUtil.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestGenePanelUtil.java index 0c289e1c..e86341d0 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestGenePanelUtil.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestGenePanelUtil.java @@ -15,7 +15,10 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; -import static org.mskcc.cbio.portal.util.GenePanelUtil.*; +import static org.mskcc.cbio.portal.util.GenePanelUtil.Pair; +import static org.mskcc.cbio.portal.util.GenePanelUtil.extractGenes; +import static org.mskcc.cbio.portal.util.GenePanelUtil.extractPropertyValue; +import static org.mskcc.cbio.portal.util.GenePanelUtil.getAddRemove; @RunWith(SpringJUnit4ClassRunner.class) diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestGeneticProfileReader.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestGeneticProfileReader.java index 7d8d2f74..af6eaf95 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestGeneticProfileReader.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestGeneticProfileReader.java @@ -46,12 +46,12 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; - import java.io.File; import java.io.IOException; import java.util.ArrayList; +import static org.junit.Assert.assertEquals; + /** * JUnit test for GeneticProfileReader class. */ diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestMutSigReader.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestMutSigReader.java index 4a60f9ac..85c01d28 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestMutSigReader.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/util/TestMutSigReader.java @@ -35,8 +35,12 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.mskcc.cbio.portal.dao.*; -import org.mskcc.cbio.portal.model.*; +import org.mskcc.cbio.portal.dao.DaoCancerStudy; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.dao.DaoGeneticProfile; +import org.mskcc.cbio.portal.dao.DaoMutSig; +import org.mskcc.cbio.portal.model.CanonicalGene; +import org.mskcc.cbio.portal.model.MutSig; import org.mskcc.cbio.portal.util.MutSigReader; import org.mskcc.cbio.portal.util.ProgressMonitor; import org.springframework.test.annotation.Rollback; @@ -44,10 +48,11 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; - import java.io.File; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) @Rollback diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetGeneticProfiles.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetGeneticProfiles.java index 414d90b1..ede6b433 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetGeneticProfiles.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetGeneticProfiles.java @@ -41,7 +41,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; +import static org.junit.Assert.assertTrue; /** * JUnit test for GeneticProfile class. diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetMutSig.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetMutSig.java index 5a9870c4..e7d33db7 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetMutSig.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetMutSig.java @@ -37,21 +37,22 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.DaoCancerStudy; +import org.mskcc.cbio.portal.dao.DaoException; import org.mskcc.cbio.portal.dao.DaoGeneOptimized; import org.mskcc.cbio.portal.dao.DaoGeneticProfile; import org.mskcc.cbio.portal.dao.DaoMutSig; import org.mskcc.cbio.portal.model.CanonicalGene; import org.mskcc.cbio.portal.model.MutSig; -import org.mskcc.cbio.portal.dao.DaoException; import org.mskcc.cbio.portal.web_api.GetMutSig; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; +import java.io.IOException; -import java.io.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; /** * @author Lennart Bastian diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetProfileData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetProfileData.java index 2cd1bf8e..8fdff896 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetProfileData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetProfileData.java @@ -35,19 +35,27 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.mskcc.cbio.portal.dao.*; -import org.mskcc.cbio.portal.model.*; +import org.mskcc.cbio.portal.dao.DaoCancerStudy; +import org.mskcc.cbio.portal.dao.DaoException; +import org.mskcc.cbio.portal.dao.DaoGeneOptimized; +import org.mskcc.cbio.portal.dao.DaoGeneticProfile; +import org.mskcc.cbio.portal.dao.DaoPatient; +import org.mskcc.cbio.portal.dao.DaoSample; +import org.mskcc.cbio.portal.model.CanonicalGene; +import org.mskcc.cbio.portal.model.GeneticAlterationType; +import org.mskcc.cbio.portal.model.GeneticProfile; import org.mskcc.cbio.portal.web_api.GetProfileData; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; - import java.io.IOException; import java.util.ArrayList; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + /** * JUnit test for GetProfileData class. */ diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetSampleList.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetSampleList.java index 6ee09bd3..598269ce 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetSampleList.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetSampleList.java @@ -40,7 +40,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; +import static org.junit.Assert.assertTrue; /** * JUnit test for GetSampleLists class. diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetTypesOfCancer.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetTypesOfCancer.java index 7502d93d..51b1d78d 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetTypesOfCancer.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/web_api/TestGetTypesOfCancer.java @@ -49,10 +49,12 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; -import static org.junit.Assert.*; - import java.io.IOException; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + /** * JUnit Tests for GetTypes of Cancer. * From 8e49ff58ef114b3bf90b9fb1cfa1693fe8eb711f Mon Sep 17 00:00:00 2001 From: Ruslan Forostianov Date: Thu, 4 Apr 2024 20:56:42 +0200 Subject: [PATCH 11/14] Move TestImportGenesetData back to own class --- .../scripts/TestImportGenesetData.java | 99 +++++++++++++++++++ .../scripts/TestImportTabDelimData.java | 56 ----------- 2 files changed, 99 insertions(+), 56 deletions(-) create mode 100644 src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenesetData.java diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenesetData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenesetData.java new file mode 100644 index 00000000..a345f722 --- /dev/null +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportGenesetData.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2017 The Hyve B.V. + * This code is licensed under the GNU Affero General Public License (AGPL), + * version 3, or (at your option) any later version. + */ + +/* + * This file is part of cBioPortal. + * + * cBioPortal is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* + * @author Sander Tan + */ + +package org.mskcc.cbio.portal.integrationTest.scripts; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mskcc.cbio.portal.dao.DaoGeneset; +import org.mskcc.cbio.portal.model.Geneset; +import org.mskcc.cbio.portal.scripts.ImportGenesetData; +import org.mskcc.cbio.portal.util.ProgressMonitor; +import org.springframework.test.annotation.Rollback; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.transaction.annotation.Transactional; + +import java.io.File; + +import static org.junit.Assert.assertEquals; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) +@Rollback +@Transactional +public class TestImportGenesetData { + + @Test + public void testImportGenesetData() throws Exception { + ProgressMonitor.setConsoleMode(false); + + // Open genesets test data file + File file = new File("src/test/resources/genesets/unit-test1_genesets.gmt"); + boolean updateInfo = false; + boolean newVersion = true; + int skippedGenes = ImportGenesetData.importData(file, updateInfo, newVersion); + + // Open supplementary file + file = new File("src/test/resources/genesets/unit-test1_supp-genesets.txt"); + ImportGenesetData.importSuppGenesetData(file); + + // Test database entries + Geneset geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET5"); + assertEquals("UNITTEST_GENESET5", geneset.getExternalId()); + geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET10"); + assertEquals("http://www.broadinstitute.org/gsea/msigdb/cards/GCNP_SHH_UP_EARLY.V1_UP", geneset.getRefLink()); + + // Test warning message + assertEquals(5, skippedGenes); + + // Test database entries supplementary file + geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET2"); + assertEquals("Genes up-regulated in RK3E cells (kidney epithelium) over-expressing GLI1 [GeneID=2735].", geneset.getDescription()); + geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET8"); + assertEquals("UNITTEST_GENESET8", geneset.getName()); + + // Test update of genes + // Open genesets test data file + file = new File("src/test/resources/genesets/unit-test2_genesets.gmt"); + newVersion = false; + updateInfo = true; + skippedGenes = ImportGenesetData.importData(file, updateInfo, newVersion); + + // Open supplementary file + file = new File("src/test/resources/genesets/unit-test2_supp-genesets.txt"); + ImportGenesetData.importSuppGenesetData(file); + + geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET2"); + assertEquals("A made up description is suited for this a fake gene.", geneset.getDescription()); + geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET1"); + assertEquals("Thought of new nice name for this geneset", geneset.getName()); + geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET1"); + assertEquals("http://www.thehyve.nl/", geneset.getRefLink()); + + } +} diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportTabDelimData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportTabDelimData.java index faf5d6ad..33779cd3 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportTabDelimData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportTabDelimData.java @@ -527,60 +527,4 @@ private void addTestPatientAndSampleRecords(File file) throws FileNotFoundExcept } MySQLbulkLoader.flushAll(); } - - @RunWith(SpringJUnit4ClassRunner.class) - @ContextConfiguration(locations = { "classpath:/applicationContext-dao.xml" }) - @Rollback - @Transactional - public static class TestImportGenesetData { - - @Test - public void testImportGenesetData() throws Exception { - ProgressMonitor.setConsoleMode(false); - - // Open genesets test data file - File file = new File("src/test/resources/genesets/unit-test1_genesets.gmt"); - boolean updateInfo = false; - boolean newVersion = true; - int skippedGenes = ImportGenesetData.importData(file, updateInfo, newVersion); - - // Open supplementary file - file = new File("src/test/resources/genesets/unit-test1_supp-genesets.txt"); - ImportGenesetData.importSuppGenesetData(file); - - // Test database entries - Geneset geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET5"); - assertEquals("UNITTEST_GENESET5", geneset.getExternalId()); - geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET10"); - assertEquals("http://www.broadinstitute.org/gsea/msigdb/cards/GCNP_SHH_UP_EARLY.V1_UP", geneset.getRefLink()); - - // Test warning message - assertEquals(5, skippedGenes); - - // Test database entries supplementary file - geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET2"); - assertEquals("Genes up-regulated in RK3E cells (kidney epithelium) over-expressing GLI1 [GeneID=2735].", geneset.getDescription()); - geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET8"); - assertEquals("UNITTEST_GENESET8", geneset.getName()); - - // Test update of genes - // Open genesets test data file - file = new File("src/test/resources/genesets/unit-test2_genesets.gmt"); - newVersion = false; - updateInfo = true; - skippedGenes = ImportGenesetData.importData(file, updateInfo, newVersion); - - // Open supplementary file - file = new File("src/test/resources/genesets/unit-test2_supp-genesets.txt"); - ImportGenesetData.importSuppGenesetData(file); - - geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET2"); - assertEquals("A made up description is suited for this a fake gene.", geneset.getDescription()); - geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET1"); - assertEquals("Thought of new nice name for this geneset", geneset.getName()); - geneset = DaoGeneset.getGenesetByExternalId("UNITTEST_GENESET1"); - assertEquals("http://www.thehyve.nl/", geneset.getRefLink()); - - } - } } From 257d2a562d0f6cb44cb5f2c9fa3f975a24fdeb7d Mon Sep 17 00:00:00 2001 From: Ruslan Forostianov Date: Fri, 5 Apr 2024 09:21:33 +0200 Subject: [PATCH 12/14] Use static imports for asserts --- .../dao/TestDaoCancerStudy.java | 3 +-- .../integrationTest/dao/TestDaoMutation.java | 23 ++++++++++--------- .../TestImportCnaDiscreteLongData.java | 5 ++-- .../portal/scripts/TestCutInvalidCases.java | 6 ++--- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoCancerStudy.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoCancerStudy.java index bae3a7be..aec208b9 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoCancerStudy.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoCancerStudy.java @@ -32,7 +32,6 @@ package org.mskcc.cbio.portal.integrationTest.dao; -import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.mskcc.cbio.portal.dao.DaoCancerStudy; @@ -71,7 +70,7 @@ public class TestDaoCancerStudy { @Test public void testDaoCancerStudy() throws DaoException, IOException { - Assert.assertEquals("Breast Invasive Carcinoma", DaoTypeOfCancer.getTypeOfCancerById("BRCA").getName()); + assertEquals("Breast Invasive Carcinoma", DaoTypeOfCancer.getTypeOfCancerById("BRCA").getName()); CancerStudy cancerStudy = new CancerStudy("GBM", "GBM Description", "gbm", "brca", false); cancerStudy.setReferenceGenome("hg19"); diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutation.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutation.java index a1331b2c..104291ae 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutation.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutation.java @@ -33,7 +33,6 @@ package org.mskcc.cbio.portal.integrationTest.dao; import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -58,7 +57,9 @@ import java.util.Map; import java.util.Set; -import static org.junit.Assert.assertEquals; +import static org.junit.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * JUnit tests for DaoMutation class. @@ -223,23 +224,23 @@ private void validateMockAnnotationJson(ExtendedMutation mutation) { Map> expectedAnnotationJsonMap = makeMockExpectedAnnotationJsonMap(); // confirm expected sizes - Assert.assertTrue(annotationJsonMap.containsKey("namespace1")); - Assert.assertEquals(expectedAnnotationJsonMap.get("namespace1").size(), annotationJsonMap.get("namespace1").size()); - Assert.assertEquals(2, annotationJsonMap.get("namespace1").size()); - Assert.assertTrue(annotationJsonMap.containsKey("namespace2")); - Assert.assertEquals(1, annotationJsonMap.get("namespace2").size()); - Assert.assertEquals(expectedAnnotationJsonMap.get("namespace2").size(), annotationJsonMap.get("namespace2").size()); + assertTrue(annotationJsonMap.containsKey("namespace1")); + assertEquals(expectedAnnotationJsonMap.get("namespace1").size(), annotationJsonMap.get("namespace1").size()); + assertEquals(2, annotationJsonMap.get("namespace1").size()); + assertTrue(annotationJsonMap.containsKey("namespace2")); + assertEquals(1, annotationJsonMap.get("namespace2").size()); + assertEquals(expectedAnnotationJsonMap.get("namespace2").size(), annotationJsonMap.get("namespace2").size()); // compare namespace 1 annotation map values Map namespace1Map = annotationJsonMap.get("namespace1"); Map expectedNamespace1Map = expectedAnnotationJsonMap.get("namespace1"); - Assert.assertEquals(expectedNamespace1Map.get("header1"), namespace1Map.get("header1")); - Assert.assertEquals(expectedNamespace1Map.get("header2"), namespace1Map.get("header2")); + assertEquals(expectedNamespace1Map.get("header1"), namespace1Map.get("header1")); + assertEquals(expectedNamespace1Map.get("header2"), namespace1Map.get("header2")); // compare namespace 2 annotation map values Map namespace2Map = annotationJsonMap.get("namespace2"); Map expectedNamespace2Map = expectedAnnotationJsonMap.get("namespace2"); - Assert.assertEquals(expectedNamespace2Map.get("header1"), namespace2Map.get("header1")); + assertEquals(expectedNamespace2Map.get("header1"), namespace2Map.get("header1")); } private String makeMockAnnotationJsonString() { diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCnaDiscreteLongData.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCnaDiscreteLongData.java index 74ca7874..d317aa03 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCnaDiscreteLongData.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/scripts/TestImportCnaDiscreteLongData.java @@ -70,6 +70,7 @@ import static org.cbioportal.model.MolecularProfile.DataType.DISCRETE; import static org.cbioportal.model.MolecularProfile.ImportType.DISCRETE_LONG; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @RunWith(SpringJUnit4ClassRunner.class) @@ -579,8 +580,8 @@ private void assertSampleExistsInGeneticProfile(String sampleId) throws DaoExcep geneticProfile.getCancerStudyId(), sampleStableId ); - Assert.assertNotNull(sample); - Assert.assertTrue(DaoSampleProfile.sampleExistsInGeneticProfile( + assertNotNull(sample); + assertTrue(DaoSampleProfile.sampleExistsInGeneticProfile( sample.getInternalId(), geneticProfile.getGeneticProfileId() )); diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestCutInvalidCases.java b/src/test/java/org/mskcc/cbio/portal/scripts/TestCutInvalidCases.java index 8953f0be..6985626e 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestCutInvalidCases.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/TestCutInvalidCases.java @@ -33,12 +33,12 @@ package org.mskcc.cbio.portal.scripts; import org.junit.Test; -import org.mskcc.cbio.portal.scripts.CutInvalidCases; - -import static org.junit.Assert.*; import java.io.File; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; + /** * JUnit test for CutInvalidCases class. */ From b6ca35d6de8d6bd1c64a4d6941a1523045b360dd Mon Sep 17 00:00:00 2001 From: Ruslan Forostianov Date: Sat, 6 Apr 2024 08:00:51 +0200 Subject: [PATCH 13/14] Use asserts from org.junit.Assert class everywhere --- .../cbio/portal/integrationTest/dao/TestDaoMutation.java | 5 ++--- .../org/mskcc/cbio/portal/scripts/TestCutInvalidCases.java | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutation.java b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutation.java index 104291ae..cd22ac6c 100644 --- a/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutation.java +++ b/src/test/java/org/mskcc/cbio/portal/integrationTest/dao/TestDaoMutation.java @@ -57,9 +57,8 @@ import java.util.Map; import java.util.Set; -import static org.junit.assertEquals; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; /** * JUnit tests for DaoMutation class. diff --git a/src/test/java/org/mskcc/cbio/portal/scripts/TestCutInvalidCases.java b/src/test/java/org/mskcc/cbio/portal/scripts/TestCutInvalidCases.java index 6985626e..1b576c74 100644 --- a/src/test/java/org/mskcc/cbio/portal/scripts/TestCutInvalidCases.java +++ b/src/test/java/org/mskcc/cbio/portal/scripts/TestCutInvalidCases.java @@ -36,8 +36,8 @@ import java.io.File; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.fail; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; /** * JUnit test for CutInvalidCases class. From 63d58d60e79cbd9f50675bf8f10dce85dea3182d Mon Sep 17 00:00:00 2001 From: Ruslan Forostianov Date: Sat, 6 Apr 2024 08:01:21 +0200 Subject: [PATCH 14/14] Comment application context configuration that caused tests to fail --- src/test/resources/applicationContext-dao.xml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/test/resources/applicationContext-dao.xml b/src/test/resources/applicationContext-dao.xml index 58335dea..7992c0f9 100644 --- a/src/test/resources/applicationContext-dao.xml +++ b/src/test/resources/applicationContext-dao.xml @@ -78,16 +78,16 @@ - - - - - - allowLoadLocalInfile - true - - - +