}
public void testUpdateJob() throws Exception {
loadJobs();
MJob job = handler.findJob(1, getDerbyConnection());
List<MForm> forms;
forms = job.getConnectorPart().getForms();
((MStringInput)forms.get(0).getInputs().get(0)).setValue("Updated");
((MMapInput)forms.get(0).getInputs().get(1)).setValue(null);
((MStringInput)forms.get(1).getInputs().get(0)).setValue("Updated");
((MMapInput)forms.get(1).getInputs().get(1)).setValue(null);
forms = job.getFrameworkPart().getForms();
((MStringInput)forms.get(0).getInputs().get(0)).setValue("Updated");
((MMapInput)forms.get(0).getInputs().get(1)).setValue(new HashMap<String, String>()); // inject new map value
((MStringInput)forms.get(1).getInputs().get(0)).setValue("Updated");
((MMapInput)forms.get(1).getInputs().get(1)).setValue(new HashMap<String, String>()); // inject new map value
job.setName("name");
handler.updateJob(job, getDerbyConnection());
assertEquals(1, job.getPersistenceId());
assertCountForTable("SQOOP.SQ_JOB", 4);
assertCountForTable("SQOOP.SQ_JOB_INPUT", 18);
MJob retrieved = handler.findJob(1, getDerbyConnection());
assertEquals("name", retrieved.getName());
forms = retrieved.getConnectorPart().getForms();
assertEquals("Updated", forms.get(0).getInputs().get(0).getValue());
assertNull(forms.get(0).getInputs().get(1).getValue());
assertEquals("Updated", forms.get(1).getInputs().get(0).getValue());
assertNull(forms.get(1).getInputs().get(1).getValue());
forms = retrieved.getFrameworkPart().getForms();
assertEquals("Updated", forms.get(0).getInputs().get(0).getValue());
assertNotNull(forms.get(0).getInputs().get(1).getValue());
assertEquals(((Map)forms.get(0).getInputs().get(1).getValue()).size(), 0);
assertEquals("Updated", forms.get(1).getInputs().get(0).getValue());
assertNotNull(forms.get(1).getInputs().get(1).getValue());