[Suiviobsmer-commits] r1186 - trunk/wao-business/src/test/java/fr/ifremer/wao/service
Author: bleny Date: 2011-04-12 10:07:44 +0000 (Tue, 12 Apr 2011) New Revision: 1186 Log: obsdeb test code style Modified: trunk/wao-business/src/test/java/fr/ifremer/wao/service/ObsDebTest.java Modified: trunk/wao-business/src/test/java/fr/ifremer/wao/service/ObsDebTest.java =================================================================== --- trunk/wao-business/src/test/java/fr/ifremer/wao/service/ObsDebTest.java 2011-04-12 09:21:21 UTC (rev 1185) +++ trunk/wao-business/src/test/java/fr/ifremer/wao/service/ObsDebTest.java 2011-04-12 10:07:44 UTC (rev 1186) @@ -158,6 +158,7 @@ /** * As an admin, i must be able to import a sampling plan + * @throws WaoBusinessException if import fail */ @Test public void adminCanImportSamplingPlan() throws WaoBusinessException { @@ -180,6 +181,7 @@ /** * As an admin, i should be able to read sampling plan + * @throws WaoBusinessException if a call to service fail */ @Test public void adminCanReadSamplingPlan() throws WaoBusinessException { @@ -233,13 +235,17 @@ // i can filter the sampling plan by getting a filter SamplingFilter samplingFilter = serviceSampling.newSamplingFilter(joshAsAdministrator()); - // and the possible values (here we only check that this - // doesn't raise any error + // and the possible values i can use to fill the filter SamplingFilterValues samplingFilterValues = serviceSampling.getPossibleValuesForFilter(samplingFilter); + + // according to the given sampling plan, there may be as many different values + // as different values used in the sampling plan, for example : two + // companies are used in the sampling plan so, 2 companies must be in + // the possible values + Assert.assertEquals(2, samplingFilterValues.getCompanies().size()); Assert.assertEquals(4, samplingFilterValues.getSampleRows().size()); Assert.assertEquals(2, samplingFilterValues.getObservationUnits().size()); Assert.assertEquals(0, samplingFilterValues.getObservers().size()); - Assert.assertEquals(2, samplingFilterValues.getCompanies().size()); samplingFilter = serviceSampling.newSamplingFilter(joshAsAdministrator()); samplingFilter.setPeriod(new PeriodDates(DateUtil.createDate(20, 2, 2010), @@ -257,6 +263,7 @@ /** * As an admin, i should be able to read sampling plan + * @throws WaoBusinessException if call to service fail */ @Test public void coordinatorCanReadSamplingPlan() throws WaoBusinessException { @@ -307,7 +314,6 @@ serviceSampling.importSamplingPlanCsv(IOUtils.toInputStream(CSV_WITH_OBSERVERS_CONTENT), joshAsCoordinator()); // now getting the sampling plan and checking that observers are linked to sample rows - samplingFilter = serviceSampling.newSamplingFilter(joshAsCoordinator()); SampleRow row2011_890 = serviceSampling.getSampleRowByCode(joshAsCoordinator(), "2011_890"); Assert.assertEquals(1, row2011_890.sizeObservers()); @@ -327,6 +333,8 @@ /** * We want to check that the coordinator is not able to create a bad sampling * plan by sending a same observer on two different place the same day + * @throws WaoBusinessException if call to service fail + * @throws java.io.IOException if failure while reading CSV */ @Test public void coordinatorCannotBreakSamplingPlan() throws IOException, WaoBusinessException {
participants (1)
-
bleny@users.labs.libre-entreprise.org