Program: 179586
Project: 179586
Buggy source:
public void testValidateControlledSystemsWhenNodePatchLevelsAreOutOfSync() throws Exception {
  int currentPatchLevel=4;
  String systemName="String_Node_Str";
  JdbcMigrationLauncher launcher=new JdbcMigrationLauncher();
  MockControl node1ContextControl=MockControl.createControl(JdbcMigrationContext.class);
  JdbcMigrationContext node1Context=(JdbcMigrationContext)node1ContextControl.getMock();
  MockControl node1PatchInfoStoreControl=MockControl.createControl(PatchInfoStore.class);
  PatchInfoStore node1PatchInfoStore=(PatchInfoStore)node1PatchInfoStoreControl.getMock();
  node1PatchInfoStore.getPatchLevel();
  node1PatchInfoStoreControl.setReturnValue(currentPatchLevel);
  node1PatchInfoStoreControl.replay();
  MockControl node2ContextControl=MockControl.createControl(JdbcMigrationContext.class);
  JdbcMigrationContext node2Context=(JdbcMigrationContext)node2ContextControl.getMock();
  MockControl node2PatchInfoStoreControl=MockControl.createControl(PatchInfoStore.class);
  PatchInfoStore node2PatchInfoStore=(PatchInfoStore)node2PatchInfoStoreControl.getMock();
  node2PatchInfoStore.getPatchLevel();
  node2PatchInfoStoreControl.setReturnValue(0);
  node2PatchInfoStoreControl.replay();
  LinkedHashMap contexts=new LinkedHashMap();
  contexts.put(node1Context,node1PatchInfoStore);
  contexts.put(node2Context,node2PatchInfoStore);
  launcher.setContexts(contexts);
  HashMap controlledSystems=new HashMap();
  controlledSystems.put(systemName,launcher);
  migrationProcess.setControlledSystems(controlledSystems);
  try {
    migrationProcess.validateControlledSystems(currentPatchLevel);
    fail("String_Node_Str");
  }
 catch (  MigrationException me) {
  }
catch (  Exception e) {
    fail("String_Node_Str");
  }
}

Fixed version (ground truth):
public void testValidateControlledSystemsWhenNodePatchLevelsAreOutOfSync() throws Exception {
  int currentPatchLevel=4;
  String systemName="String_Node_Str";
  JdbcMigrationLauncher launcher=new JdbcMigrationLauncher();
  MockControl node1ContextControl=MockControl.createControl(JdbcMigrationContext.class);
  JdbcMigrationContext node1Context=(JdbcMigrationContext)node1ContextControl.getMock();
  MockControl node1PatchInfoStoreControl=MockControl.createControl(PatchInfoStore.class);
  PatchInfoStore node1PatchInfoStore=(PatchInfoStore)node1PatchInfoStoreControl.getMock();
  node1Context.getDatabaseName();
  node1ContextControl.setReturnValue("String_Node_Str",MockControl.ONE_OR_MORE);
  node1ContextControl.replay();
  node1PatchInfoStore.getPatchLevel();
  node1PatchInfoStoreControl.setReturnValue(currentPatchLevel);
  node1PatchInfoStoreControl.replay();
  MockControl node2ContextControl=MockControl.createControl(JdbcMigrationContext.class);
  JdbcMigrationContext node2Context=(JdbcMigrationContext)node2ContextControl.getMock();
  MockControl node2PatchInfoStoreControl=MockControl.createControl(PatchInfoStore.class);
  PatchInfoStore node2PatchInfoStore=(PatchInfoStore)node2PatchInfoStoreControl.getMock();
  node2Context.getDatabaseName();
  node2ContextControl.setReturnValue("String_Node_Str",MockControl.ONE_OR_MORE);
  node2ContextControl.replay();
  node2PatchInfoStore.getPatchLevel();
  node2PatchInfoStoreControl.setReturnValue(0);
  node2PatchInfoStoreControl.replay();
  LinkedHashMap contexts=new LinkedHashMap();
  contexts.put(node1Context,node1PatchInfoStore);
  contexts.put(node2Context,node2PatchInfoStore);
  launcher.setContexts(contexts);
  HashMap controlledSystems=new HashMap();
  controlledSystems.put(systemName,launcher);
  migrationProcess.setControlledSystems(controlledSystems);
  try {
    migrationProcess.validateControlledSystems(currentPatchLevel);
    fail("String_Node_Str");
  }
 catch (  MigrationException me) {
  }
catch (  Exception e) {
    fail("String_Node_Str");
  }
}