@Test
public void testStageGroupProperties() throws Exception {
MongoConnector mdc = mongoConnectorResource.getConnector();
Pipeline p = new Pipeline();
StageGroup singleGroup = new StageGroup("singleStage");
StageGroup multiGroup = new StageGroup("multi");
Stage single = new Stage("singleStage", new DatabaseFile());
Stage multi1 = new Stage("multi1", new DatabaseFile());
Stage multi2 = new Stage("multi2", new DatabaseFile());
multiGroup.addStage(multi1);
multiGroup.addStage(multi2);
singleGroup.addStage(single);
p.addGroup(multiGroup);
p.addGroup(singleGroup);
multiGroup.setJvmParameters("jvm");
multiGroup.setRetries(3);
multiGroup.setLogging(false);
multiGroup.setCmdlineArgs("cmd");
mongoConnectorResource.reset();
mdc = mongoConnectorResource.getConnector();
MongoPipelineReader reader = new MongoPipelineReader(mdc.getDB());
MongoPipelineWriter writer = new MongoPipelineWriter(reader, WriteConcern.SAFE);
writer.write(p);
StageGroup g2 = reader.getPipeline().getGroup("multi");
assertEquals(multiGroup.getJvmParameters(), g2.getJvmParameters());
assertEquals(multiGroup.getRetries(), g2.getRetries());
assertEquals(multiGroup.isLogging(), g2.isLogging());
assertEquals(multiGroup.getCmdlineArgs(), g2.getCmdlineArgs());
}