From 2c264ea390ed10e718ba0e9fc747bacc90ba3d69 Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Wed, 19 Jul 2023 13:23:04 +0200 Subject: [PATCH 1/1] JAL-4199 Add tests to the "Functional" group --- .../ws2/actions/alignment/AlignmentActionTest.java | 24 +++++--- .../ws2/client/slivka/SlivkaWSDiscovererTest.java | 62 +++++++++++++------- 2 files changed, 57 insertions(+), 29 deletions(-) diff --git a/test/jalview/ws2/actions/alignment/AlignmentActionTest.java b/test/jalview/ws2/actions/alignment/AlignmentActionTest.java index 5586108..300eb6d 100644 --- a/test/jalview/ws2/actions/alignment/AlignmentActionTest.java +++ b/test/jalview/ws2/actions/alignment/AlignmentActionTest.java @@ -98,7 +98,9 @@ public class AlignmentActionTest }; } - @Test(dataProvider = "multipleSequencesUnalignedAndAligned") + @Test( + groups = { "Functional" }, + dataProvider = "multipleSequencesUnalignedAndAligned") public void submitSequences_verifySequenceNamesUniquified( Alignment unaligned, Alignment aligned) throws IOException @@ -116,7 +118,9 @@ public class AlignmentActionTest hasProperty("name", is("Sequence2")))); } - @Test(dataProvider = "multipleSequencesUnalignedAndAligned") + @Test( + groups = { "Functional" }, + dataProvider = "multipleSequencesUnalignedAndAligned") public void submitSequences_submitGapsOff_verifySequencesSubmittedWithoutGaps(Alignment unaligned, Alignment aligned) throws IOException { @@ -134,7 +138,9 @@ public class AlignmentActionTest matchesSequence("ASTVLOPDTMMQEL"))); } - @Test(dataProvider = "multipleSequencesUnalignedAndAligned") + @Test( + groups = { "Functional" }, + dataProvider = "multipleSequencesUnalignedAndAligned") public void submitSequences_submitGapsOn_verifySequencesSubmittedWithGaps( Alignment unaligned, Alignment aligned) throws IOException @@ -153,7 +159,9 @@ public class AlignmentActionTest matchesSequence("AS--TVL--OPDTMMQEL------"))); } - @Test(dataProvider = "multipleSequencesUnalignedAndAligned") + @Test( + groups = { "Functional" }, + dataProvider = "multipleSequencesUnalignedAndAligned") public void retrieveResult_verifySequencesAligned( Alignment unaligned, Alignment aligned) throws IOException @@ -251,7 +259,7 @@ class AlignmentActionListenerNotifiedTest extends AlignmentActionTest }; } - @Test + @Test(groups = { "Functional" }) public void allJobsStarted_taskStartedCalled() throws IOException { @@ -260,7 +268,7 @@ class AlignmentActionListenerNotifiedTest extends AlignmentActionTest verify(mockListener).taskStarted(any(), anyList()); } - @Test + @Test(groups = { "Functional" }) public void allJobsStarted_taskStatusChangedCalledWithReadyThenSubmitted() throws IOException { @@ -271,7 +279,7 @@ class AlignmentActionListenerNotifiedTest extends AlignmentActionTest inOrder.verify(mockListener).taskStatusChanged(any(), eq(JobStatus.SUBMITTED)); } - @Test(dataProvider = "jobStatuses") + @Test(groups = { "Functional" }, dataProvider = "jobStatuses") public void jobStatusChanged_taskStatusChangedCalledWithJobStatus(JobStatus status) throws IOException { @@ -282,7 +290,7 @@ class AlignmentActionListenerNotifiedTest extends AlignmentActionTest verify(mockListener).taskStatusChanged(any(), eq(status)); } - @Test(dataProvider = "jobStatuses") + @Test(groups = { "Functional" }, dataProvider = "jobStatuses") public void jobStatusChanged_subJobStatusChangedCalledWithJobStatus(JobStatus status) throws IOException { diff --git a/test/jalview/ws2/client/slivka/SlivkaWSDiscovererTest.java b/test/jalview/ws2/client/slivka/SlivkaWSDiscovererTest.java index 870acb1..6824a10 100644 --- a/test/jalview/ws2/client/slivka/SlivkaWSDiscovererTest.java +++ b/test/jalview/ws2/client/slivka/SlivkaWSDiscovererTest.java @@ -24,6 +24,7 @@ import org.testng.annotations.Test; import jalview.bin.Cache; import jalview.bin.Console; import jalview.ws.params.ValueConstrainI.ValueType; +import jalview.ws.params.simple.BooleanOption; import jalview.ws.params.simple.DoubleParameter; import jalview.ws.params.simple.IntegerParameter; import jalview.ws.params.simple.StringParameter; @@ -55,7 +56,7 @@ public class SlivkaWSDiscovererTest clientMock = mock(SlivkaClient.class); } - @Test + @Test(groups = { "Functional" }) public void getStatusForUrl_servicesReturned_statusIsOK() throws Exception { when(clientMock.getServices()) @@ -67,7 +68,7 @@ public class SlivkaWSDiscovererTest is(WebServiceDiscovererI.STATUS_OK)); } - @Test + @Test(groups = { "Functional" }) public void getStatusForUrl_noServicesReturned_statusIsNoServices() throws Exception { @@ -79,7 +80,7 @@ public class SlivkaWSDiscovererTest is(WebServiceDiscovererI.STATUS_NO_SERVICES)); } - @Test + @Test(groups = { "Functional" }) public void getStatusForUrl_exceptionThrown_statusIsInvalid() throws Exception { @@ -91,7 +92,7 @@ public class SlivkaWSDiscovererTest is(WebServiceDiscovererI.STATUS_INVALID)); } - @Test + @Test(groups = { "Functional" }) public void testGetUrls_noPropEntry_defaultUrlReturned() throws MalformedURLException { @@ -119,7 +120,7 @@ public class SlivkaWSDiscovererTest List.of(new URL("http://example.org")) } }; } - @Test(dataProvider = "urlPropertyValues") + @Test(groups = { "Functional" }, dataProvider = "urlPropertyValues") public void testGetUrls_urlsProperlyParsed(String propValue, List expected) { @@ -128,7 +129,7 @@ public class SlivkaWSDiscovererTest assertThat(discoverer.getUrls(), equalTo(expected)); } - @Test + @Test(groups = { "Functional" }) public void testSetUrls_emptyList_propertyReset() { Cache.setProperty(URLS_PROPERTY_NAME, "http://www.example.org"); @@ -137,7 +138,7 @@ public class SlivkaWSDiscovererTest assertThat(Cache.getProperty(URLS_PROPERTY_NAME), is(nullValue())); } - @Test + @Test(groups = { "Functional" }) public void testSetUrls_null_propertyReset() { Cache.setProperty(URLS_PROPERTY_NAME, "http://www.example.org"); @@ -159,7 +160,7 @@ public class SlivkaWSDiscovererTest "https://www.compbio.dundee.ac.uk/slivka/,http://example.org" }, }; } - @Test(dataProvider = "urlsList") + @Test(groups = { "Functional" }, dataProvider = "urlsList") public void testSetUrls_urlsPropertySet(List urls, String expected) throws MalformedURLException { @@ -168,7 +169,7 @@ public class SlivkaWSDiscovererTest assertThat(Cache.getProperty(URLS_PROPERTY_NAME), equalTo(expected)); } - @Test + @Test(groups = { "Functional" }) public void testFetchServices_oneService_basicDataMatches() throws IOException { @@ -212,7 +213,9 @@ public class SlivkaWSDiscovererTest } - @Test(dataProvider = "validMultipleSequenceAlignmentClassifiers") + @Test( + groups = { "Functional" }, + dataProvider = "validMultipleSequenceAlignmentClassifiers") public void testFetchServices_multipleSequenceAlignmentClassifier_serviceTypeIsMSA( String classifier) throws IOException { @@ -257,7 +260,9 @@ public class SlivkaWSDiscovererTest List.of(), List.of(), null) }; } - @Test(dataProvider = "multipleSequenceAlignmentService") + @Test( + groups = { "Functional" }, + dataProvider = "multipleSequenceAlignmentService") public void testFetchServices_multipleSequenceAlignmentService_actionTypeIsAlignment( SlivkaService service) throws IOException { @@ -271,7 +276,9 @@ public class SlivkaWSDiscovererTest typeCompatibleWith(AlignmentAction.class)); } - @Test(dataProvider = "multipleSequenceAlignmentService") + @Test( + groups = { "Functional" }, + dataProvider = "multipleSequenceAlignmentService") public void testFetchServices_multipleSequenceAlignmentService_serviceIsNonInteractive( SlivkaService service) throws IOException { @@ -313,7 +320,7 @@ public class SlivkaWSDiscovererTest List.of(), List.of(), null), }; } - @Test(dataProvider = "clustalFamilyService") + @Test(groups = { "Functional" }, dataProvider = "clustalFamilyService") public void testFetchService_clustalFamilyService_containsTwoActions( SlivkaService service) throws IOException { @@ -362,7 +369,9 @@ public class SlivkaWSDiscovererTest return services.iterator(); } - @Test(dataProvider = "RNASecondaryStructurePredictionService") + @Test( + groups = { "Functional" }, + dataProvider = "RNASecondaryStructurePredictionService") public void testFetchServices_RNASecStrPredClassifier_serviceTypeIsRNASecStrPred( SlivkaService service) throws IOException { @@ -402,7 +411,9 @@ public class SlivkaWSDiscovererTest return services.iterator(); } - @Test(dataProvider = "validConservationAnalysisClassifiers") + @Test( + groups = { "Functional" }, + dataProvider = "validConservationAnalysisClassifiers") public void testFetchServices_conservationAnalysisClassifier_serviceTypeIsConservation( String classifier) throws IOException { @@ -427,7 +438,9 @@ public class SlivkaWSDiscovererTest "Operation :: Analysis :: Sequence analysis :: Protein sequence analysis", }; } - @Test(dataProvider = "validProteinSequenceAnalysisClassifiers") + @Test( + groups = { "Functional" }, + dataProvider = "validProteinSequenceAnalysisClassifiers") public void testFetchServices_proteinSequenceAnalysisClassifier_serviceTypeIsProtSeqAnalysis( String classifier) throws IOException { @@ -460,6 +473,7 @@ public class SlivkaWSDiscovererTest @Test( enabled = false, // sec. str. pred. not implemented for slivka + groups = { "Functional" }, dataProvider = "validProteinSecondaryStructurePredictionClassifiers") public void testFetchServices_proteinSecStrPredClassifier_serviceTypeIsProtSecStrPred( String classifier) throws IOException @@ -490,7 +504,7 @@ public class SlivkaWSDiscovererTest List.of(), null) }; } - @Test(dataProvider = "unrecognisedService") + @Test(groups = { "Functional" }, dataProvider = "unrecognisedService") public void testFetchServices_unrecognisedService_noServiceDiscovered( SlivkaService service) throws IOException { @@ -525,7 +539,7 @@ public class SlivkaWSDiscovererTest { new Parameter.FlagParameter("param", "Parameter", "Description", true, false, null, Map.of()), - StringParameter.class + BooleanOption.class }, { new Parameter.ChoiceParameter("param", "Parameter", "Description", @@ -535,7 +549,9 @@ public class SlivkaWSDiscovererTest }; } - @Test(dataProvider = "serviceParameterAndMappedClass") + @Test( + groups = { "Functional" }, + dataProvider = "serviceParameterAndMappedClass") public void testServiceParameter_slivkaParameterMappedToJalviewParameter( Parameter slivkaParameter, Class expectedClass) throws IOException @@ -593,7 +609,9 @@ public class SlivkaWSDiscovererTest }; } - @Test(dataProvider = "serviceParametersAndInfoMatcher") + @Test( + groups = { "Functional" }, + dataProvider = "serviceParametersAndPropertyMatcher") public void testServiceParameters_testBasicParameterProperties( Parameter parameter, Matcher matcher) throws IOException { @@ -638,7 +656,9 @@ public class SlivkaWSDiscovererTest }; } - @Test(dataProvider = "integerParametersAndPropertyMatcher") + @Test( + groups = { "Functional" }, + dataProvider = "integerParametersAndPropertyMatcher") public void testServiceParameters_testIntegerProperties( Parameter parameter, Matcher matcher) throws IOException { -- 1.7.10.2