22
22
import java .io .StringWriter ;
23
23
import java .io .Writer ;
24
24
25
+ import static junit .framework .Assert .assertNotNull ;
25
26
import static junit .framework .TestCase .assertEquals ;
26
27
import static org .bytedeco .javacpp .opencv_core .*;
27
28
@@ -142,7 +143,7 @@ public void testPerformSerializedStep() throws Exception {
142
143
serializeAndDeserialize ();
143
144
144
145
145
- final Step fromPipeline = pipeline .getSteps ().get (0 );
146
+ final Step fromPipeline = pipeline .getSteps ().get (0 );
146
147
InputSocket <Number > a = (InputSocket <Number >) fromPipeline .getInputSockets ()[0 ];
147
148
InputSocket <Number > b = (InputSocket <Number >) fromPipeline .getInputSockets ()[1 ];
148
149
OutputSocket <Number > sum = (OutputSocket <Number >) fromPipeline .getOutputSockets ()[0 ];
@@ -161,7 +162,7 @@ public void testPerformSerializedPythonStepFromURL() throws Exception {
161
162
pipeline .addStep (stepFactory .create (pythonAdditionOperationFromURL ));
162
163
serializeAndDeserialize ();
163
164
164
- final Step fromPipeline = pipeline .getSteps ().get (0 );
165
+ final Step fromPipeline = pipeline .getSteps ().get (0 );
165
166
InputSocket <Number > a = (InputSocket <Number >) fromPipeline .getInputSockets ()[0 ];
166
167
InputSocket <Number > b = (InputSocket <Number >) fromPipeline .getInputSockets ()[1 ];
167
168
OutputSocket <Number > sum = (OutputSocket <Number >) fromPipeline .getOutputSockets ()[0 ];
@@ -181,7 +182,7 @@ public void testPerformSerializedPythonStepFromSource() throws Exception {
181
182
pipeline .addStep (stepFactory .create (pythonAdditionOperationFromSource ));
182
183
serializeAndDeserialize ();
183
184
184
- final Step fromPipeline = pipeline .getSteps ().get (0 );
185
+ final Step fromPipeline = pipeline .getSteps ().get (0 );
185
186
InputSocket <Number > a = (InputSocket <Number >) fromPipeline .getInputSockets ()[0 ];
186
187
InputSocket <Number > b = (InputSocket <Number >) fromPipeline .getInputSockets ()[1 ];
187
188
OutputSocket <Number > sum = (OutputSocket <Number >) fromPipeline .getOutputSockets ()[0 ];
@@ -218,7 +219,6 @@ public void testPerformSerializedPipeline() throws Exception {
218
219
OutputSocket <Number > sum2 = (OutputSocket <Number >) step2Out .getOutputSockets ()[0 ];
219
220
220
221
221
-
222
222
a1 .setValue (123 );
223
223
b1 .setValue (456 );
224
224
b2 .setValue (789 );
@@ -240,7 +240,6 @@ public void testPerformSerializedPipelineWithMats() throws Exception {
240
240
OutputSocket <Mat > sum = (OutputSocket <Mat >) step1 .getOutputSockets ()[0 ];
241
241
242
242
243
-
244
243
a .setValue (new Mat (1 , 1 , CV_32F , new Scalar (1234.5 )));
245
244
b .setValue (new Mat (1 , 1 , CV_32F , new Scalar (6789.0 )));
246
245
@@ -280,4 +279,18 @@ public void testSerializedProjectSettings() {
280
279
assertEquals ("Deploy address was not serialized/deserialized" ,
281
280
"roborio-191-frc.local" , pipeline .getProjectSettings ().getDeployAddress ());
282
281
}
282
+
283
+ @ Test
284
+ public void testUnspecifiedProjectSettings () {
285
+ Reader reader = new StringReader ("<grip:Pipeline>" +
286
+ " <sources/>" +
287
+ " <steps/>" +
288
+ " <connections/>" +
289
+ " <settings/>" +
290
+ "</grip:Pipeline>" );
291
+
292
+ project .open (reader );
293
+
294
+ assertNotNull ("Project setting was null" , pipeline .getProjectSettings ().getDeployJvmOptions ());
295
+ }
283
296
}
0 commit comments