Tony CHEMIT pushed to branch develop at ultreiaio / ird-t3

Commits:

4 changed files:

Changes:

  • t3-actions/src/main/java/fr/ird/t3/actions/io/input/it/AnalyzeInputSourceActionITSupport.java
    ... ... @@ -113,30 +113,26 @@ public abstract class AnalyzeInputSourceActionITSupport {
    113 113
             if (outputWriter != null) {
    
    114 114
                 outputWriter.flush();
    
    115 115
                 outputWriter.close();
    
    116
    +            log.info(new String(Files.readAllBytes(outputFile.toPath())));
    
    116 117
             }
    
    117 118
         }
    
    118 119
     
    
    119 120
         void testExecute(OceanFixtures fixture) throws Exception {
    
    120
    -        testExecute(
    
    121
    -                fixture.nbSafe(),
    
    122
    -                fixture.nbUnsafe(),
    
    123
    -                fixture.nbSafeWithoutWell(),
    
    124
    -                fixture.nbUnsafeWithoutWell(),
    
    125
    -                TripType.STANDARD,
    
    126
    -                false,
    
    127
    -                false
    
    128
    -        );
    
    121
    +        serviceContext.getMsConfig().setUseWells(false);
    
    122
    +        testExecute(fixture.nbSafe(), fixture.nbUnsafe(), fixture.nbSafeWithoutWell(), fixture.nbUnsafeWithoutWell(), TripType.STANDARD, false, false);
    
    123
    +//        serviceContext.getMsConfig().setUseWells(true);
    
    124
    +//        testExecute(fixture.nbSafe(), fixture.nbUnsafe(), fixture.nbSafeWithoutWell(), fixture.nbUnsafeWithoutWell(), TripType.STANDARD, false, false);
    
    129 125
         }
    
    130 126
     
    
    131 127
     
    
    132 128
         public void testExecute(int nbSafe,
    
    133 129
                                 int nbUnsafe,
    
    134
    -                            int nbSafeWithoutwell,
    
    130
    +                            int nbSafeWithoutWell,
    
    135 131
                                 int nbUnsafeWithoutWell) throws Exception {
    
    136 132
             testExecute(
    
    137 133
                     nbSafe,
    
    138 134
                     nbUnsafe,
    
    139
    -                nbSafeWithoutwell,
    
    135
    +                nbSafeWithoutWell,
    
    140 136
                     nbUnsafeWithoutWell,
    
    141 137
                     TripType.STANDARD,
    
    142 138
                     false,
    
    ... ... @@ -168,13 +164,15 @@ public abstract class AnalyzeInputSourceActionITSupport {
    168 164
                 Set<Trip> unsafeTrips = action.getResultAsSet(AnalyzeInputSourceAction.RESULT_UNSAFE_TRIPS, Trip.class);
    
    169 165
                 Assert.assertNotNull(unsafeTrips);
    
    170 166
                 outputWriter.write(String.format("found %d unsafe trip(s).\n", unsafeTrips.size()));
    
    167
    +
    
    168
    +            log.info(String.format("\n[%s](useWells?%b) safe : %d - unsafe : %d\n", msConfig.dbName, msConfig.isUseWells(), safeTrips.size(), unsafeTrips.size()));
    
    169
    +
    
    171 170
                 List<String> messages;
    
    172 171
                 if (log.isWarnEnabled()) {
    
    173 172
                     messages = action.getWarnMessages();
    
    174 173
                     if (CollectionUtils.isNotEmpty(messages)) {
    
    175 174
                         for (String message : messages) {
    
    176
    -                        log.warn(String.format("[WARNING] %s\n", message));
    
    177
    -//                        outputWriter.write(String.format("[WARNING] %s\n", message));
    
    175
    +                        outputWriter.write(String.format("[WARNING] %s\n", message));
    
    178 176
                         }
    
    179 177
                     }
    
    180 178
                 }
    
    ... ... @@ -187,9 +185,6 @@ public abstract class AnalyzeInputSourceActionITSupport {
    187 185
                     }
    
    188 186
                 }
    
    189 187
     
    
    190
    -            outputWriter.flush();
    
    191
    -            log.info(String.format("\n[%s] safe : %d - unsafe : %d\n", msConfig.dbName, safeTrips.size(), unsafeTrips.size()));
    
    192
    -            log.info(new String(Files.readAllBytes(outputFile.toPath())));
    
    193 188
                 if (msConfig.isUseWells()) {
    
    194 189
                     Assert.assertEquals(nbSafe, safeTrips.size());
    
    195 190
                     Assert.assertEquals(nbUnsafe, unsafeTrips.size());
    

  • t3-actions/src/main/java/fr/ird/t3/actions/io/input/test/MSAccessTestConfiguration.java
    ... ... @@ -188,4 +188,8 @@ public class MSAccessTestConfiguration {
    188 188
         public String getProviderId() {
    
    189 189
             return providerId;
    
    190 190
         }
    
    191
    +
    
    192
    +    public void setUseWells(boolean useWells) {
    
    193
    +        this.useWells = useWells;
    
    194
    +    }
    
    191 195
     }

  • t3-input-avdthv35/src/test/java/fr/ird/t3/actions/io/input/AtlanticOceanFixtures.java
    ... ... @@ -30,73 +30,73 @@ import fr.ird.t3.actions.io.input.test.OceanFixtures;
    30 30
      */
    
    31 31
     public enum AtlanticOceanFixtures implements OceanFixtures {
    
    32 32
     
    
    33
    -    OA_1960(318, 36, 352, 2),
    
    34
    -    OA_1961(298, 63, 361, 0),
    
    35
    -    OA_1962(184, 133, 317, 0),
    
    36
    -    OA_1963(218, 157, 375, 0),
    
    37
    -    OA_1964(121, 61, 182, 0),
    
    38
    -    OA_1965(93, 31, 124, 0),
    
    39
    -    OA_1966(70, 27, 97, 0),
    
    40
    -    OA_1967(53, 27, 80, 0),
    
    41
    -    OA_1968(46, 14, 60, 0),
    
    42
    -    OA_1969(64, 21, 86, 0),
    
    43
    -
    
    44
    -    OA_1970(318, 36, 352, 2),
    
    45
    -    OA_1971(298, 63, 361, 0),
    
    46
    -    OA_1972(184, 133, 317, 0),
    
    47
    -    OA_1973(218, 157, 375, 0),
    
    48
    -    OA_1974(121, 61, 182, 0),
    
    49
    -    OA_1975(93, 31, 124, 0),
    
    50
    -    OA_1976(70, 27, 97, 0),
    
    51
    -    OA_1977(53, 27, 80, 0),
    
    52
    -    OA_1978(46, 14, 60, 0),
    
    53
    -    OA_1979(64, 21, 86, 0),
    
    54
    -
    
    55
    -    OA_1980(318, 36, 352, 2),
    
    56
    -    OA_1981(298, 63, 361, 0),
    
    57
    -    OA_1982(184, 133, 317, 0),
    
    58
    -    OA_1983(218, 157, 375, 0),
    
    59
    -    OA_1984(121, 61, 182, 0),
    
    60
    -    OA_1985(93, 31, 124, 0),
    
    61
    -    OA_1986(70, 27, 97, 0),
    
    62
    -    OA_1987(53, 27, 80, 0),
    
    63
    -    OA_1988(46, 14, 60, 0),
    
    64
    -    OA_1989(64, 21, 86, 0),
    
    65
    -
    
    66
    -    OA_1990(318, 36, 352, 2),
    
    67
    -    OA_1991(298, 63, 361, 0),
    
    68
    -    OA_1992(184, 133, 317, 0),
    
    69
    -    OA_1993(218, 157, 375, 0),
    
    70
    -    OA_1994(121, 61, 182, 0),
    
    71
    -    OA_1995(93, 31, 124, 0),
    
    72
    -    OA_1996(70, 27, 97, 0),
    
    73
    -    OA_1997(53, 27, 80, 0),
    
    74
    -    OA_1998(46, 14, 60, 0),
    
    75
    -    OA_1999(64, 21, 86, 0),
    
    76 33
     
    
    34
    +    OA_1960(151, 0),
    
    35
    +    OA_1961(159, 0),
    
    36
    +    OA_1962(203, 0),
    
    37
    +    OA_1963(807, 0),
    
    38
    +    OA_1964(709, 0),
    
    39
    +    OA_1965(911, 0),
    
    40
    +    OA_1966(942, 0),
    
    41
    +    OA_1967(993, 0),
    
    42
    +    OA_1968(1339, 0),
    
    43
    +    OA_1969(453, 1179),
    
    44
    +    OA_1970(289, 970),
    
    45
    +    OA_1971(146, 1047),
    
    46
    +    OA_1972(143, 1069),
    
    47
    +    OA_1973(235, 890),
    
    48
    +    OA_1974(254, 948),
    
    49
    +    OA_1975(248, 709),
    
    50
    +    OA_1976(149, 692),
    
    51
    +    OA_1977(40, 761),
    
    52
    +    OA_1978(56, 766),
    
    53
    +    OA_1979(76, 618),
    
    54
    +    OA_1980(324, 299),
    
    55
    +    OA_1981(365, 280),
    
    56
    +    OA_1982(416, 247),
    
    57
    +    OA_1983(343, 257),
    
    58
    +    OA_1984(297, 111),
    
    59
    +    OA_1985(325, 115),
    
    60
    +    OA_1986(214, 121),
    
    61
    +    OA_1987(186, 165),
    
    62
    +    OA_1988(212, 156),
    
    63
    +    OA_1989(192, 154),
    
    64
    +    OA_1990(141, 192),
    
    65
    +    OA_1991(268, 0),
    
    66
    +    OA_1992(250, 0),
    
    67
    +    OA_1993(281, 2),
    
    68
    +    OA_1994(278, 0),
    
    69
    +    OA_1995(243, 3),
    
    70
    +    OA_1996(90, 142),
    
    71
    +    OA_1997(36, 178),
    
    72
    +    OA_1998(205, 2),
    
    73
    +    OA_1999(323, 5),
    
    77 74
         OA_2000(318, 36, 352, 2),
    
    78
    -    OA_2001(298, 63, 361, 0),
    
    79
    -    OA_2002(184, 133, 317, 0),
    
    80
    -    OA_2003(218, 157, 375, 0),
    
    81
    -    OA_2004(121, 61, 182, 0),
    
    75
    +    OA_2001(298, 63, 358, 3),
    
    76
    +    OA_2002(184, 133, 316, 1),
    
    77
    +    OA_2003(218, 157, 369, 6),
    
    78
    +    OA_2004(121, 61, 181, 1),
    
    82 79
         OA_2005(93, 31, 124, 0),
    
    83 80
         OA_2006(70, 27, 97, 0),
    
    84
    -    OA_2007(53, 27, 80, 0),
    
    81
    +    OA_2007(53, 27, 77, 3),
    
    85 82
         OA_2008(46, 14, 60, 0),
    
    86 83
         OA_2009(64, 21, 86, 0),
    
    87
    -
    
    88 84
         OA_2010(75, 13, 87, 0),
    
    89 85
         OA_2011(75, 13, 91, 1),
    
    90 86
         OA_2012(75, 13, 97, 0),
    
    91 87
         OA_2013(75, 13, 103, 0),
    
    92
    -    OA_2014(75, 13, 91, 0),
    
    93
    -    OA_2015(75, 13, 80, 8);
    
    88
    +    OA_2014(75, 13, 90, 0),
    
    89
    +    OA_2015(75, 13, 103, 0);
    
    94 90
     
    
    95 91
         private final int nbSafe;
    
    96 92
         private final int nbUnsafe;
    
    97 93
         private final int nbSafeWithoutWell;
    
    98 94
         private final int nbUnsafeWithoutWell;
    
    99 95
     
    
    96
    +    AtlanticOceanFixtures(int nbSafeWithoutWell, int nbUnsafeWithoutWell) {
    
    97
    +        this(nbSafeWithoutWell, nbUnsafeWithoutWell, nbSafeWithoutWell, nbUnsafeWithoutWell);
    
    98
    +    }
    
    99
    +
    
    100 100
         AtlanticOceanFixtures(int nbSafe, int nbUnsafe, int nbSafeWithoutWell, int nbUnsafeWithoutWell) {
    
    101 101
             this.nbSafe = nbSafe;
    
    102 102
             this.nbUnsafe = nbUnsafe;
    

  • t3-input-avdthv35/src/test/java/fr/ird/t3/actions/io/input/it/AnalyzeInputSourceActionAtlanticOceanIT.java
    ... ... @@ -33,7 +33,6 @@ import org.junit.Test;
    33 33
      * @author Tony Chemit - dev@tchemit.fr
    
    34 34
      * @since 1.0
    
    35 35
      */
    
    36
    -@Ignore
    
    37 36
     public class AnalyzeInputSourceActionAtlanticOceanIT extends AnalyzeInputSourceActionITSupport implements T3AVDTHV35TestAtlanticOcean {
    
    38 37
     
    
    39 38
         @Test