24
24
import java .io .StringWriter ;
25
25
import java .io .Writer ;
26
26
27
+ import static junit .framework .Assert .assertNotNull ;
27
28
import static junit .framework .TestCase .assertEquals ;
28
29
import static org .bytedeco .javacpp .opencv_core .*;
29
30
@@ -152,7 +153,7 @@ public void testPerformSerializedStep() throws Exception {
152
153
serializeAndDeserialize ();
153
154
154
155
155
- final Step fromPipeline = pipeline .getSteps ().get (0 );
156
+ final Step fromPipeline = pipeline .getSteps ().get (0 );
156
157
InputSocket <Number > a = (InputSocket <Number >) fromPipeline .getInputSockets ()[0 ];
157
158
InputSocket <Number > b = (InputSocket <Number >) fromPipeline .getInputSockets ()[1 ];
158
159
OutputSocket <Number > sum = (OutputSocket <Number >) fromPipeline .getOutputSockets ()[0 ];
@@ -171,7 +172,7 @@ public void testPerformSerializedPythonStepFromURL() throws Exception {
171
172
pipeline .addStep (stepFactory .create (pythonAdditionOperationFromURL ));
172
173
serializeAndDeserialize ();
173
174
174
- final Step fromPipeline = pipeline .getSteps ().get (0 );
175
+ final Step fromPipeline = pipeline .getSteps ().get (0 );
175
176
InputSocket <Number > a = (InputSocket <Number >) fromPipeline .getInputSockets ()[0 ];
176
177
InputSocket <Number > b = (InputSocket <Number >) fromPipeline .getInputSockets ()[1 ];
177
178
OutputSocket <Number > sum = (OutputSocket <Number >) fromPipeline .getOutputSockets ()[0 ];
@@ -191,7 +192,7 @@ public void testPerformSerializedPythonStepFromSource() throws Exception {
191
192
pipeline .addStep (stepFactory .create (pythonAdditionOperationFromSource ));
192
193
serializeAndDeserialize ();
193
194
194
- final Step fromPipeline = pipeline .getSteps ().get (0 );
195
+ final Step fromPipeline = pipeline .getSteps ().get (0 );
195
196
InputSocket <Number > a = (InputSocket <Number >) fromPipeline .getInputSockets ()[0 ];
196
197
InputSocket <Number > b = (InputSocket <Number >) fromPipeline .getInputSockets ()[1 ];
197
198
OutputSocket <Number > sum = (OutputSocket <Number >) fromPipeline .getOutputSockets ()[0 ];
@@ -228,7 +229,6 @@ public void testPerformSerializedPipeline() throws Exception {
228
229
OutputSocket <Number > sum2 = (OutputSocket <Number >) step2Out .getOutputSockets ()[0 ];
229
230
230
231
231
-
232
232
a1 .setValue (123 );
233
233
b1 .setValue (456 );
234
234
b2 .setValue (789 );
@@ -250,7 +250,6 @@ public void testPerformSerializedPipelineWithMats() throws Exception {
250
250
OutputSocket <Mat > sum = (OutputSocket <Mat >) step1 .getOutputSockets ()[0 ];
251
251
252
252
253
-
254
253
a .setValue (new Mat (1 , 1 , CV_32F , new Scalar (1234.5 )));
255
254
b .setValue (new Mat (1 , 1 , CV_32F , new Scalar (6789.0 )));
256
255
@@ -290,4 +289,18 @@ public void testSerializedProjectSettings() {
290
289
assertEquals ("Deploy address was not serialized/deserialized" ,
291
290
"roborio-191-frc.local" , pipeline .getProjectSettings ().getDeployAddress ());
292
291
}
292
+
293
+ @ Test
294
+ public void testUnspecifiedProjectSettings () {
295
+ Reader reader = new StringReader ("<grip:Pipeline>" +
296
+ " <sources/>" +
297
+ " <steps/>" +
298
+ " <connections/>" +
299
+ " <settings/>" +
300
+ "</grip:Pipeline>" );
301
+
302
+ project .open (reader );
303
+
304
+ assertNotNull ("Project setting was null" , pipeline .getProjectSettings ().getDeployJvmOptions ());
305
+ }
293
306
}
0 commit comments