File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
main/java/fr/cnes/sonar/plugins/icode/check
test/java/fr/cnes/sonar/plugins/icode/check Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,6 @@ protected void executeICode(final SensorContext sensorContext) {
166
166
LOGGER .info ("Auto-launch successfully executed i-Code CNES." );
167
167
} catch (InterruptedException | IOException | ICodeException e ) {
168
168
LOGGER .error (e .getMessage (), e );
169
- sensorContext .newAnalysisError ().message (e .getMessage ()).save ();
170
169
}
171
170
}
172
171
Original file line number Diff line number Diff line change @@ -144,6 +144,34 @@ protected int runICode(final String command) {
144
144
assert (true );
145
145
}
146
146
147
+ @ Test
148
+ public void test_normal_work_with_icode_launch_other_exit () {
149
+ final ICodeSensor sensor = new ICodeSensor () {
150
+ @ Override
151
+ protected int runICode (final String command ) {
152
+ return 2 ;
153
+ }
154
+ };
155
+
156
+ final MapSettings settings = new MapSettings ();
157
+ settings .setProperty ("sonar.icode.launch" ,true );
158
+ context .setSettings (settings );
159
+
160
+ sensor .execute (context );
161
+ assert (true );
162
+ }
163
+
164
+
165
+
166
+ @ Test
167
+ public void test_run_a_command () throws IOException , InterruptedException {
168
+ final ICodeSensor sensor = new ICodeSensor ();
169
+
170
+ final int value = sensor .runICode ("java --version" );
171
+
172
+ Assert .assertEquals (1 , value );
173
+ }
174
+
147
175
@ Test
148
176
public void test_get_scanned_files () {
149
177
final ICodeSensor sensor = new ICodeSensor ();
You can’t perform that action at this time.
0 commit comments