@Test
public void testSyncErroneousTrainingDate(){


  
Test sync create
 patient1 = new StandardizedPatient();
tient1.setPreName("perName1");
tient1.setName("name1");
tient1.persist();
tient1.merge();
tient2 = new StandardizedPatient();
tient2.setPreName("perName2");
tient2.setName("name2");
tient2.persist();
tient2.merge();
tientInSemester pSemester = PatientInSemester.findPatientInSemesterByStandardizedPatient(patient1);
sertEquals(null,pSemester);
turnData = "{\"message\" : [{\"key\":\"osce for date 2012-6-18 12:00 already in DMZ doing nothing\"},{\"key\":\"osce for date 12-6-20 12:00 already in DMZ doing nothing\"},{\"key\":\"osce for date 12-6-20 12:00 already in DMZ doing nothing\"},{\"key\":\"warning patient Daniel Kohler was not found in the DMZ. Please manually push\"},{\"key\":\"warning patient Marianne Lamarie was not found in the DMZ. Please manually push\"},{\"key\":\"warning patient Ferdinand Preussler was not found in the DMZ. Please manually push\"},{\"key\":\"warning patient Karl Meyer was not found in the DMZ. Please manually push\"},{\"key\":\"warning patient Bettina Buser was not found in the DMZ. Please manually push\"},{\"key\":\"warning patient Carla Joanna Velazquez was not found in the DMZ. Please manually push\"},{\"key\":\"warning patient Max Peter was not found in the DMZ. Please manually push\"},{\"key\":\"warning patient Ruth Musyl was not found in the DMZ. Please manually push\"},{\"key\":\"warning patient Ljiljana Ivanovicwas not found in the DMZ. Please manually push\"},{\"key\":\"warning patient Delphine Landwerlin was not found in the DMZ. Please manually push\"}],\"osceDay\" :[{\"osceDate\":\"2012-06-10T00:00:00Z\"},{\"osceDate\":\"2012-06-20T00:00:00Z\"},{\"osceDate\":\"2012-06-18T00:00:00Z\"},{\"osceDate\":\"2012-06-21T00:00:00Z\"}],\"trainings\" : [{\"name\":\"training1\",\"trainingDate\":\"2012-16-\",\"timeStart\":\"2012-07-17T11:00:02Z\",\"timeEnd\":\"2012-07-17T17:15:55Z\"},{\"name\":\"training2\",\"trainingDate\":\"2012-07-25T00:00:00Z\",\"timeStart\":\"2012-07-25T08:30:00Z\",\"timeEnd\":\"2012-07-25T15:30:00Z\"},{\"name\":\"training1\",\"trainingDate\":\"2012-07-17T00:00:00Z\",\"timeStart\":\"2012-07-17T07:00:02Z\",\"timeEnd\":\"2012-07-17T14:15:55Z\"},{\"name\":\"training1\",\"trainingDate\":\"2012-07-17T00:00:00Z\",\"timeStart\":\"2012-07-17T10:00:02Z\",\"timeEnd\":\"2012-07-17T14:15:55Z\"},{\"name\":\"tttttt\",\"trainingDate\":\"2012-07-17T00:00:00Z\",\"timeStart\":\"2012-07-17T09:00:02Z\",\"timeEnd\":\"2012-07-17T19:00:00Z\"}],\"patientInSemester\" : [{\"standarizedPatientId\":"+patient2.getId()+",\"acceptedTrainings\":[{\"name\":\"training2\",\"trainingDate\":\"2012-07-25T00:00:00Z\",\"timeStart\":\"2012-07-25T08:30:00Z\",\"timeEnd\":\"2012-07-25T15:30:00Z\"}],\"acceptedOsce\":[{\"osceDate\":\"2012-06-21T00:00:00Z\"}],\"accepted\":false},{\"standarizedPatientId\":"+patient1.getId()+",\"acceptedTrainings\":[{\"name\":\"training1\",\"trainingDate\":\"2012-07-17T00:00:00Z\",\"timeStart\":\"2012-07-17T07:00:02Z\",\"timeEnd\":\"2012-07-17T14:15:55Z\"},{\"name\":\"training2\",\"trainingDate\":\"2012-07-25T00:00:00Z\",\"timeStart\":\"2012-07-25T08:30:00Z\",\"timeEnd\":\"2012-25-07\"},{\"name\":\"training1\",\"trainingDate\":\"2012-07-17T00:00:00Z\",\"timeStart\":\"2012-07-17T11:00:02Z\",\"timeEnd\":\"2012-07-17T17:15:55Z\"}],\"acceptedOsce\":[{\"osceDate\":\"2012-06-10T00:00:00Z\"},{\"osceDate\":\"2012-06-20T00:00:00Z\"}],\"accepted\":true}]}";
y {
ocale = "en";

nstance.sendSync(locale);
catch (Exception e) {
/e.printStackTrace();
/e.getCause().printStackTrace();
ssert.fail("Expected Error never occured " );
st<Training> trainings = Training.findAllTrainings();
sertEquals(4,trainings.size());
Wrong trainingDate, original trainingDate is 2012-07-17T00:00:00Z
Training training1 = Training.findTrainingByTrainingDateAndTimeStart(convertToDate("2012-07-17T00:00:00Z"),convertToDate("2012-07-17T11:00:02Z"));
sertNull(training1);
aining training2 = Training.findTrainingByTrainingDateAndTimeStart(convertToDate("2012-07-25T00:00:00Z"),convertToDate("2012-07-25T08:30:00Z"));
sertNotNull(training2);
sertEquals("training2",training2.getName());
sertEquals(convertToDate("2012-07-25T15:30:00Z"),training2.getTimeEnd());
aining training3 = Training.findTrainingByTrainingDateAndTimeStart(convertToDate("2012-07-17T00:00:00Z"),convertToDate("2012-07-17T07:00:02Z"));
sertNotNull(training3);
sertEquals("training1",training3.getName());
sertEquals(convertToDate("2012-07-17T14:15:55Z"),training3.getTimeEnd());
aining training4 = Training.findTrainingByTrainingDateAndTimeStart(convertToDate("2012-07-17T00:00:00Z"),convertToDate("2012-07-17T10:00:02Z"));
sertNotNull(training4);
sertEquals("training1",training4.getName());
sertEquals(convertToDate("2012-07-17T14:15:55Z"),training4.getTimeEnd());
aining training5 = Training.findTrainingByTrainingDateAndTimeStart(convertToDate("2012-07-17T00:00:00Z"),convertToDate("2012-07-17T09:00:02Z"));
sertNotNull(training5);
sertEquals("tttttt",training5.getName());
sertEquals(convertToDate("2012-07-17T19:00:00Z"),training5.getTimeEnd());	
*/
}