target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void nullNameShouldReturnNull() { openadk.library.common.Name sifName = null; Name sliName = converter.convert(sifName); Assert.assertNull(sliName); } | public Name convert(openadk.library.common.Name sifName) { if (sifName == null) { return null; } Name sliName = new Name(); mapSifNameIntoSliName(sifName, sliName); return sliName; } | NameConverter { public Name convert(openadk.library.common.Name sifName) { if (sifName == null) { return null; } Name sliName = new Name(); mapSifNameIntoSliName(sifName, sliName); return sliName; } } | NameConverter { public Name convert(openadk.library.common.Name sifName) { if (sifName == null) { return null; } Name sliName = new Name(); mapSifNameIntoSliName(sifName, sliName); return sliName; } } | NameConverter { public Name convert(openadk.library.common.Name sifName) { if (sifName == null) { return null; } Name sliName = new Name(); mapSifNameIntoSliName(sifName, sliName); return sliName; } Name convert(openadk.library.common.Name sifName); void mapSifNameIntoSliName(openadk.library.common.Name sifName, Name ... | NameConverter { public Name convert(openadk.library.common.Name sifName) { if (sifName == null) { return null; } Name sliName = new Name(); mapSifNameIntoSliName(sifName, sliName); return sliName; } Name convert(openadk.library.common.Name sifName); void mapSifNameIntoSliName(openadk.library.common.Name sifName, Name ... |
@Test public void emptySifNameShouldMapToNullAndDefaultValues() { openadk.library.common.Name sifName = new openadk.library.common.Name(); Name sliName = converter.convert(sifName); Assert.assertNotNull(sliName); Assert.assertEquals("Missing first name should map to Unknown", defaultName, sliName.getFirstName()); Asser... | public Name convert(openadk.library.common.Name sifName) { if (sifName == null) { return null; } Name sliName = new Name(); mapSifNameIntoSliName(sifName, sliName); return sliName; } | NameConverter { public Name convert(openadk.library.common.Name sifName) { if (sifName == null) { return null; } Name sliName = new Name(); mapSifNameIntoSliName(sifName, sliName); return sliName; } } | NameConverter { public Name convert(openadk.library.common.Name sifName) { if (sifName == null) { return null; } Name sliName = new Name(); mapSifNameIntoSliName(sifName, sliName); return sliName; } } | NameConverter { public Name convert(openadk.library.common.Name sifName) { if (sifName == null) { return null; } Name sliName = new Name(); mapSifNameIntoSliName(sifName, sliName); return sliName; } Name convert(openadk.library.common.Name sifName); void mapSifNameIntoSliName(openadk.library.common.Name sifName, Name ... | NameConverter { public Name convert(openadk.library.common.Name sifName) { if (sifName == null) { return null; } Name sliName = new Name(); mapSifNameIntoSliName(sifName, sliName); return sliName; } Name convert(openadk.library.common.Name sifName); void mapSifNameIntoSliName(openadk.library.common.Name sifName, Name ... |
@Test public void shouldMapSifNameToSliName() { Name sliName = converter.convert(createSifName(prefixes.get(0), suffixes.get(0))); Assert.assertNotNull(sliName); Assert.assertEquals("Incorrect prefix mapping", prefixes.get(0), sliName.getPersonalTitlePrefix()); Assert.assertEquals("Incorrect firstName mapping", firstNa... | public Name convert(openadk.library.common.Name sifName) { if (sifName == null) { return null; } Name sliName = new Name(); mapSifNameIntoSliName(sifName, sliName); return sliName; } | NameConverter { public Name convert(openadk.library.common.Name sifName) { if (sifName == null) { return null; } Name sliName = new Name(); mapSifNameIntoSliName(sifName, sliName); return sliName; } } | NameConverter { public Name convert(openadk.library.common.Name sifName) { if (sifName == null) { return null; } Name sliName = new Name(); mapSifNameIntoSliName(sifName, sliName); return sliName; } } | NameConverter { public Name convert(openadk.library.common.Name sifName) { if (sifName == null) { return null; } Name sliName = new Name(); mapSifNameIntoSliName(sifName, sliName); return sliName; } Name convert(openadk.library.common.Name sifName); void mapSifNameIntoSliName(openadk.library.common.Name sifName, Name ... | NameConverter { public Name convert(openadk.library.common.Name sifName) { if (sifName == null) { return null; } Name sliName = new Name(); mapSifNameIntoSliName(sifName, sliName); return sliName; } Name convert(openadk.library.common.Name sifName); void mapSifNameIntoSliName(openadk.library.common.Name sifName, Name ... |
@Test public void testshouldExtractSchoolYear() { Map<String, Object> gradeBody = new HashMap<String, Object>(); gradeBody.put(ParameterConstants.SCHOOL_YEAR, "2009-2010"); Entity grade = new MongoEntity(EntityNames.GRADE, gradeBody); Assert.assertTrue(simpleExtractVerifier.shouldExtract(grade, DateTime.parse("2011-05-... | @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { String entityDate = EntityDateHelper.retrieveDate(entity); return EntityDateHelper.isPastOrCurrentDate(entityDate, upToDate, entity.getType()); } | SimpleExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { String entityDate = EntityDateHelper.retrieveDate(entity); return EntityDateHelper.isPastOrCurrentDate(entityDate, upToDate, entity.getType()); } } | SimpleExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { String entityDate = EntityDateHelper.retrieveDate(entity); return EntityDateHelper.isPastOrCurrentDate(entityDate, upToDate, entity.getType()); } } | SimpleExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { String entityDate = EntityDateHelper.retrieveDate(entity); return EntityDateHelper.isPastOrCurrentDate(entityDate, upToDate, entity.getType()); } @Override boolean shouldExtract(Entity entity, ... | SimpleExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { String entityDate = EntityDateHelper.retrieveDate(entity); return EntityDateHelper.isPastOrCurrentDate(entityDate, upToDate, entity.getType()); } @Override boolean shouldExtract(Entity entity, ... |
@Test public void testNullObject() { String result = converter.convert(null); Assert.assertNull("Teaching Assignment list should be null", result); } | public String convert(HRProgramType hrProgramType) { if (hrProgramType == null) { return null; } return toSliProgramAssignment(ProgramTypeCode.wrap(hrProgramType.getCode())); } | HRProgramTypeConverter { public String convert(HRProgramType hrProgramType) { if (hrProgramType == null) { return null; } return toSliProgramAssignment(ProgramTypeCode.wrap(hrProgramType.getCode())); } } | HRProgramTypeConverter { public String convert(HRProgramType hrProgramType) { if (hrProgramType == null) { return null; } return toSliProgramAssignment(ProgramTypeCode.wrap(hrProgramType.getCode())); } } | HRProgramTypeConverter { public String convert(HRProgramType hrProgramType) { if (hrProgramType == null) { return null; } return toSliProgramAssignment(ProgramTypeCode.wrap(hrProgramType.getCode())); } String convert(HRProgramType hrProgramType); } | HRProgramTypeConverter { public String convert(HRProgramType hrProgramType) { if (hrProgramType == null) { return null; } return toSliProgramAssignment(ProgramTypeCode.wrap(hrProgramType.getCode())); } String convert(HRProgramType hrProgramType); } |
@Test public void testMappings() { map.clear(); map.put(ProgramTypeCode.ADULT_BASIC_EDUCATION, "Title I-Non-Academic"); map.put(ProgramTypeCode.ADULT_CONTINUING_EDUCATION, "Title I-Non-Academic"); map.put(ProgramTypeCode.ADULT_ENGLISH_AS_A_SECOND, "Bilingual/English as a Second Language"); map.put(ProgramTypeCode.ADVAN... | public String convert(HRProgramType hrProgramType) { if (hrProgramType == null) { return null; } return toSliProgramAssignment(ProgramTypeCode.wrap(hrProgramType.getCode())); } | HRProgramTypeConverter { public String convert(HRProgramType hrProgramType) { if (hrProgramType == null) { return null; } return toSliProgramAssignment(ProgramTypeCode.wrap(hrProgramType.getCode())); } } | HRProgramTypeConverter { public String convert(HRProgramType hrProgramType) { if (hrProgramType == null) { return null; } return toSliProgramAssignment(ProgramTypeCode.wrap(hrProgramType.getCode())); } } | HRProgramTypeConverter { public String convert(HRProgramType hrProgramType) { if (hrProgramType == null) { return null; } return toSliProgramAssignment(ProgramTypeCode.wrap(hrProgramType.getCode())); } String convert(HRProgramType hrProgramType); } | HRProgramTypeConverter { public String convert(HRProgramType hrProgramType) { if (hrProgramType == null) { return null; } return toSliProgramAssignment(ProgramTypeCode.wrap(hrProgramType.getCode())); } String convert(HRProgramType hrProgramType); } |
@Test public void testNullObject() { String result = converter.convert(null); Assert.assertNull("Race list should be null", result); } | public String convert(String gender) { return GENDER_TYPE_MAP.get(gender); } | GenderConverter { public String convert(String gender) { return GENDER_TYPE_MAP.get(gender); } } | GenderConverter { public String convert(String gender) { return GENDER_TYPE_MAP.get(gender); } } | GenderConverter { public String convert(String gender) { return GENDER_TYPE_MAP.get(gender); } String convert(String gender); } | GenderConverter { public String convert(String gender) { return GENDER_TYPE_MAP.get(gender); } String convert(String gender); } |
@Test public void testMale() { String result = converter.convert("M"); Assert.assertEquals("Male", result); } | public String convert(String gender) { return GENDER_TYPE_MAP.get(gender); } | GenderConverter { public String convert(String gender) { return GENDER_TYPE_MAP.get(gender); } } | GenderConverter { public String convert(String gender) { return GENDER_TYPE_MAP.get(gender); } } | GenderConverter { public String convert(String gender) { return GENDER_TYPE_MAP.get(gender); } String convert(String gender); } | GenderConverter { public String convert(String gender) { return GENDER_TYPE_MAP.get(gender); } String convert(String gender); } |
@Test public void testFemale() { String result = converter.convert("F"); Assert.assertEquals("Female", result); } | public String convert(String gender) { return GENDER_TYPE_MAP.get(gender); } | GenderConverter { public String convert(String gender) { return GENDER_TYPE_MAP.get(gender); } } | GenderConverter { public String convert(String gender) { return GENDER_TYPE_MAP.get(gender); } } | GenderConverter { public String convert(String gender) { return GENDER_TYPE_MAP.get(gender); } String convert(String gender); } | GenderConverter { public String convert(String gender) { return GENDER_TYPE_MAP.get(gender); } String convert(String gender); } |
@Test public void testUnknown() { String result = converter.convert("U"); Assert.assertNull(result); } | public String convert(String gender) { return GENDER_TYPE_MAP.get(gender); } | GenderConverter { public String convert(String gender) { return GENDER_TYPE_MAP.get(gender); } } | GenderConverter { public String convert(String gender) { return GENDER_TYPE_MAP.get(gender); } } | GenderConverter { public String convert(String gender) { return GENDER_TYPE_MAP.get(gender); } String convert(String gender); } | GenderConverter { public String convert(String gender) { return GENDER_TYPE_MAP.get(gender); } String convert(String gender); } |
@Test public void testNull() { String result = converter.convert(null); Assert.assertNull("Operational status should be null", result); } | public String convert(OperationalStatus operationalStatus) { if (operationalStatus == null || operationalStatus.getValue() == null || operationalStatus.getValue().isEmpty()) { return null; } return OPERATIONAL_STATUS_MAP.get(operationalStatus); } | OperationalStatusConverter { public String convert(OperationalStatus operationalStatus) { if (operationalStatus == null || operationalStatus.getValue() == null || operationalStatus.getValue().isEmpty()) { return null; } return OPERATIONAL_STATUS_MAP.get(operationalStatus); } } | OperationalStatusConverter { public String convert(OperationalStatus operationalStatus) { if (operationalStatus == null || operationalStatus.getValue() == null || operationalStatus.getValue().isEmpty()) { return null; } return OPERATIONAL_STATUS_MAP.get(operationalStatus); } } | OperationalStatusConverter { public String convert(OperationalStatus operationalStatus) { if (operationalStatus == null || operationalStatus.getValue() == null || operationalStatus.getValue().isEmpty()) { return null; } return OPERATIONAL_STATUS_MAP.get(operationalStatus); } String convert(OperationalStatus operationa... | OperationalStatusConverter { public String convert(OperationalStatus operationalStatus) { if (operationalStatus == null || operationalStatus.getValue() == null || operationalStatus.getValue().isEmpty()) { return null; } return OPERATIONAL_STATUS_MAP.get(operationalStatus); } String convert(OperationalStatus operationa... |
@Test public void testEmpty() { OperationalStatus status = OperationalStatus.wrap(""); String result = converter.convert(status); Assert.assertNull("Operational status should be null", result); } | public String convert(OperationalStatus operationalStatus) { if (operationalStatus == null || operationalStatus.getValue() == null || operationalStatus.getValue().isEmpty()) { return null; } return OPERATIONAL_STATUS_MAP.get(operationalStatus); } | OperationalStatusConverter { public String convert(OperationalStatus operationalStatus) { if (operationalStatus == null || operationalStatus.getValue() == null || operationalStatus.getValue().isEmpty()) { return null; } return OPERATIONAL_STATUS_MAP.get(operationalStatus); } } | OperationalStatusConverter { public String convert(OperationalStatus operationalStatus) { if (operationalStatus == null || operationalStatus.getValue() == null || operationalStatus.getValue().isEmpty()) { return null; } return OPERATIONAL_STATUS_MAP.get(operationalStatus); } } | OperationalStatusConverter { public String convert(OperationalStatus operationalStatus) { if (operationalStatus == null || operationalStatus.getValue() == null || operationalStatus.getValue().isEmpty()) { return null; } return OPERATIONAL_STATUS_MAP.get(operationalStatus); } String convert(OperationalStatus operationa... | OperationalStatusConverter { public String convert(OperationalStatus operationalStatus) { if (operationalStatus == null || operationalStatus.getValue() == null || operationalStatus.getValue().isEmpty()) { return null; } return OPERATIONAL_STATUS_MAP.get(operationalStatus); } String convert(OperationalStatus operationa... |
@Test public void testMappings() { map.clear(); map.put(OperationalStatus.AGENCY_CHANGED, "Changed Agency"); map.put(OperationalStatus.AGENCY_CLOSED, "Closed"); map.put(OperationalStatus.AGENCY_FUTURE, "Future"); map.put(OperationalStatus.AGENCY_INACTIVE, "Inactive"); map.put(OperationalStatus.AGENCY_NEW, "New"); map.p... | public String convert(OperationalStatus operationalStatus) { if (operationalStatus == null || operationalStatus.getValue() == null || operationalStatus.getValue().isEmpty()) { return null; } return OPERATIONAL_STATUS_MAP.get(operationalStatus); } | OperationalStatusConverter { public String convert(OperationalStatus operationalStatus) { if (operationalStatus == null || operationalStatus.getValue() == null || operationalStatus.getValue().isEmpty()) { return null; } return OPERATIONAL_STATUS_MAP.get(operationalStatus); } } | OperationalStatusConverter { public String convert(OperationalStatus operationalStatus) { if (operationalStatus == null || operationalStatus.getValue() == null || operationalStatus.getValue().isEmpty()) { return null; } return OPERATIONAL_STATUS_MAP.get(operationalStatus); } } | OperationalStatusConverter { public String convert(OperationalStatus operationalStatus) { if (operationalStatus == null || operationalStatus.getValue() == null || operationalStatus.getValue().isEmpty()) { return null; } return OPERATIONAL_STATUS_MAP.get(operationalStatus); } String convert(OperationalStatus operationa... | OperationalStatusConverter { public String convert(OperationalStatus operationalStatus) { if (operationalStatus == null || operationalStatus.getValue() == null || operationalStatus.getValue().isEmpty()) { return null; } return OPERATIONAL_STATUS_MAP.get(operationalStatus); } String convert(OperationalStatus operationa... |
@Test public void testNull() { String result = converter.convert(null); Assert.assertNull("School category should be null", result); } | public String convert(SchoolLevelType schoolLevelType) { if (schoolLevelType == null) { return null; } return SCHOOL_LEVEL_TYPE_MAP.get(schoolLevelType); } | SchoolLevelTypeConverter { public String convert(SchoolLevelType schoolLevelType) { if (schoolLevelType == null) { return null; } return SCHOOL_LEVEL_TYPE_MAP.get(schoolLevelType); } } | SchoolLevelTypeConverter { public String convert(SchoolLevelType schoolLevelType) { if (schoolLevelType == null) { return null; } return SCHOOL_LEVEL_TYPE_MAP.get(schoolLevelType); } } | SchoolLevelTypeConverter { public String convert(SchoolLevelType schoolLevelType) { if (schoolLevelType == null) { return null; } return SCHOOL_LEVEL_TYPE_MAP.get(schoolLevelType); } String convert(SchoolLevelType schoolLevelType); List<String> convertAsList(SchoolLevelType schoolLevelType); } | SchoolLevelTypeConverter { public String convert(SchoolLevelType schoolLevelType) { if (schoolLevelType == null) { return null; } return SCHOOL_LEVEL_TYPE_MAP.get(schoolLevelType); } String convert(SchoolLevelType schoolLevelType); List<String> convertAsList(SchoolLevelType schoolLevelType); } |
@Test public void testshouldExtractBeginDate() { Map<String, Object> body = new HashMap<String, Object>(); body.put(ParameterConstants.BEGIN_DATE, "2001-01-01"); Entity studentProgramAssociation = new MongoEntity(EntityNames.STUDENT_PROGRAM_ASSOCIATION, body); Assert.assertEquals(true, simpleExtractVerifier.shouldExtra... | @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { String entityDate = EntityDateHelper.retrieveDate(entity); return EntityDateHelper.isPastOrCurrentDate(entityDate, upToDate, entity.getType()); } | SimpleExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { String entityDate = EntityDateHelper.retrieveDate(entity); return EntityDateHelper.isPastOrCurrentDate(entityDate, upToDate, entity.getType()); } } | SimpleExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { String entityDate = EntityDateHelper.retrieveDate(entity); return EntityDateHelper.isPastOrCurrentDate(entityDate, upToDate, entity.getType()); } } | SimpleExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { String entityDate = EntityDateHelper.retrieveDate(entity); return EntityDateHelper.isPastOrCurrentDate(entityDate, upToDate, entity.getType()); } @Override boolean shouldExtract(Entity entity, ... | SimpleExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { String entityDate = EntityDateHelper.retrieveDate(entity); return EntityDateHelper.isPastOrCurrentDate(entityDate, upToDate, entity.getType()); } @Override boolean shouldExtract(Entity entity, ... |
@Test public void testListNull() { List<String> result = converter.convertAsList(null); Assert.assertNull("School category should be null", result); } | public List<String> convertAsList(SchoolLevelType schoolLevelType) { if (schoolLevelType == null) { return null; } ArrayList<String> list = new ArrayList<String>(); String category = SCHOOL_LEVEL_TYPE_MAP.get(schoolLevelType); if (category != null) { list.add(category); } return list; } | SchoolLevelTypeConverter { public List<String> convertAsList(SchoolLevelType schoolLevelType) { if (schoolLevelType == null) { return null; } ArrayList<String> list = new ArrayList<String>(); String category = SCHOOL_LEVEL_TYPE_MAP.get(schoolLevelType); if (category != null) { list.add(category); } return list; } } | SchoolLevelTypeConverter { public List<String> convertAsList(SchoolLevelType schoolLevelType) { if (schoolLevelType == null) { return null; } ArrayList<String> list = new ArrayList<String>(); String category = SCHOOL_LEVEL_TYPE_MAP.get(schoolLevelType); if (category != null) { list.add(category); } return list; } } | SchoolLevelTypeConverter { public List<String> convertAsList(SchoolLevelType schoolLevelType) { if (schoolLevelType == null) { return null; } ArrayList<String> list = new ArrayList<String>(); String category = SCHOOL_LEVEL_TYPE_MAP.get(schoolLevelType); if (category != null) { list.add(category); } return list; } Stri... | SchoolLevelTypeConverter { public List<String> convertAsList(SchoolLevelType schoolLevelType) { if (schoolLevelType == null) { return null; } ArrayList<String> list = new ArrayList<String>(); String category = SCHOOL_LEVEL_TYPE_MAP.get(schoolLevelType); if (category != null) { list.add(category); } return list; } Stri... |
@Test public void testEmpty() { SchoolLevelType type = SchoolLevelType.wrap(""); String result = converter.convert(type); Assert.assertNull(result); } | public String convert(SchoolLevelType schoolLevelType) { if (schoolLevelType == null) { return null; } return SCHOOL_LEVEL_TYPE_MAP.get(schoolLevelType); } | SchoolLevelTypeConverter { public String convert(SchoolLevelType schoolLevelType) { if (schoolLevelType == null) { return null; } return SCHOOL_LEVEL_TYPE_MAP.get(schoolLevelType); } } | SchoolLevelTypeConverter { public String convert(SchoolLevelType schoolLevelType) { if (schoolLevelType == null) { return null; } return SCHOOL_LEVEL_TYPE_MAP.get(schoolLevelType); } } | SchoolLevelTypeConverter { public String convert(SchoolLevelType schoolLevelType) { if (schoolLevelType == null) { return null; } return SCHOOL_LEVEL_TYPE_MAP.get(schoolLevelType); } String convert(SchoolLevelType schoolLevelType); List<String> convertAsList(SchoolLevelType schoolLevelType); } | SchoolLevelTypeConverter { public String convert(SchoolLevelType schoolLevelType) { if (schoolLevelType == null) { return null; } return SCHOOL_LEVEL_TYPE_MAP.get(schoolLevelType); } String convert(SchoolLevelType schoolLevelType); List<String> convertAsList(SchoolLevelType schoolLevelType); } |
@Test public void testListEmpty() { SchoolLevelType type = SchoolLevelType.wrap(""); List<String> result = converter.convertAsList(type); Assert.assertEquals(0, result.size()); } | public List<String> convertAsList(SchoolLevelType schoolLevelType) { if (schoolLevelType == null) { return null; } ArrayList<String> list = new ArrayList<String>(); String category = SCHOOL_LEVEL_TYPE_MAP.get(schoolLevelType); if (category != null) { list.add(category); } return list; } | SchoolLevelTypeConverter { public List<String> convertAsList(SchoolLevelType schoolLevelType) { if (schoolLevelType == null) { return null; } ArrayList<String> list = new ArrayList<String>(); String category = SCHOOL_LEVEL_TYPE_MAP.get(schoolLevelType); if (category != null) { list.add(category); } return list; } } | SchoolLevelTypeConverter { public List<String> convertAsList(SchoolLevelType schoolLevelType) { if (schoolLevelType == null) { return null; } ArrayList<String> list = new ArrayList<String>(); String category = SCHOOL_LEVEL_TYPE_MAP.get(schoolLevelType); if (category != null) { list.add(category); } return list; } } | SchoolLevelTypeConverter { public List<String> convertAsList(SchoolLevelType schoolLevelType) { if (schoolLevelType == null) { return null; } ArrayList<String> list = new ArrayList<String>(); String category = SCHOOL_LEVEL_TYPE_MAP.get(schoolLevelType); if (category != null) { list.add(category); } return list; } Stri... | SchoolLevelTypeConverter { public List<String> convertAsList(SchoolLevelType schoolLevelType) { if (schoolLevelType == null) { return null; } ArrayList<String> list = new ArrayList<String>(); String category = SCHOOL_LEVEL_TYPE_MAP.get(schoolLevelType); if (category != null) { list.add(category); } return list; } Stri... |
@Test public void testNullObject() { List<StaffIdentificationCode> result = converter.convert((HrOtherIdList) null); Assert.assertNull("StaffIdentificationCode list should be null", result); result = converter.convert((OtherIdList) null); Assert.assertNull("StaffIdentificationCode list should be null", result); } | public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } } | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } } | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList); List<StaffIdentificationCode> conv... | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList); List<StaffIdentificationCode> conv... |
@Test public void testEmptyHrOtherIdList() { HrOtherIdList list = new HrOtherIdList(); list.setOtherIds(new OtherId[0]); List<StaffIdentificationCode> result = converter.convert(list); Assert.assertEquals(0, result.size()); } | public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } } | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } } | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList); List<StaffIdentificationCode> conv... | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList); List<StaffIdentificationCode> conv... |
@Test public void testEmptyOtherIdList() { OtherIdList list = new OtherIdList(); list.setOtherIds(new OtherId[0]); List<StaffIdentificationCode> result = converter.convert(list); Assert.assertEquals(0, result.size()); } | public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } } | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } } | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList); List<StaffIdentificationCode> conv... | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList); List<StaffIdentificationCode> conv... |
@Test public void testEmptyOtherId4HrOtherIdList() { HrOtherIdList list = new HrOtherIdList(); OtherId original = new OtherId(); list.add(original); List<StaffIdentificationCode> result = converter.convert(list); Assert.assertEquals(1, result.size()); StaffIdentificationCode it = result.get(0); Assert.assertEquals(orig... | public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } } | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } } | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList); List<StaffIdentificationCode> conv... | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList); List<StaffIdentificationCode> conv... |
@Test public void testEmptyOtherId4OtherIdList() { OtherIdList list = new OtherIdList(); OtherId original = new OtherId(); list.add(original); List<StaffIdentificationCode> result = converter.convert(list); Assert.assertEquals(1, result.size()); StaffIdentificationCode it = result.get(0); Assert.assertEquals(original.g... | public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } } | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } } | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList); List<StaffIdentificationCode> conv... | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList); List<StaffIdentificationCode> conv... |
@Test public void testMappings() { map.clear(); map.put(OtherIdType.ACT_INST, "Other"); map.put(OtherIdType.ACT_PROG, "Other"); map.put(OtherIdType.ATP, "Other"); map.put(OtherIdType.CA_SIN, "Canadian SIN"); map.put(OtherIdType.CERTIFICATE, "Professional Certificate"); map.put(OtherIdType.CONTRACTOR, "Other"); map.put(... | public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } } | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } } | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList); List<StaffIdentificationCode> conv... | HrOtherIdListConverter { public List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList) { if (hrOtherIdList == null) { return null; } return toSliStaffIdentificationCodeList(hrOtherIdList.getOtherIds()); } List<StaffIdentificationCode> convert(HrOtherIdList hrOtherIdList); List<StaffIdentificationCode> conv... |
@Test public void testNullObject() { List<String> result = converter.convert(null); Assert.assertNull("Address list should be null", result); } | public List<String> convert(LanguageList languageList) { if (languageList == null) { return null; } return toSliLanguageList(languageList.getLanguages()); } | LanguageListConverter { public List<String> convert(LanguageList languageList) { if (languageList == null) { return null; } return toSliLanguageList(languageList.getLanguages()); } } | LanguageListConverter { public List<String> convert(LanguageList languageList) { if (languageList == null) { return null; } return toSliLanguageList(languageList.getLanguages()); } } | LanguageListConverter { public List<String> convert(LanguageList languageList) { if (languageList == null) { return null; } return toSliLanguageList(languageList.getLanguages()); } List<String> convert(LanguageList languageList); } | LanguageListConverter { public List<String> convert(LanguageList languageList) { if (languageList == null) { return null; } return toSliLanguageList(languageList.getLanguages()); } List<String> convert(LanguageList languageList); } |
@Test public void testSholdExtractEntities() { List<Entity> seaos = new ArrayList<Entity>(); Map<String, Object> body = new HashMap<String, Object>(); body.put(ParameterConstants.BEGIN_DATE, "2001-05-24"); Entity entity1 = new MongoEntity(EntityNames.STUDENT_PROGRAM_ASSOCIATION, body); Map<String, Object> body2 = new H... | @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { Iterable<Entity> seaos = edOrgExtractHelper.retrieveSEOAS((String) entity.getBody().get(ParameterConstants.TEACHER_ID), (String) entity.getBody().get(ParameterConstants.SCHOOL_ID)); return shouldExtract(seaos, upToDate); } | TeacherSchoolAssociationExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { Iterable<Entity> seaos = edOrgExtractHelper.retrieveSEOAS((String) entity.getBody().get(ParameterConstants.TEACHER_ID), (String) entity.getBody().get(ParameterConstants.SCHOOL_... | TeacherSchoolAssociationExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { Iterable<Entity> seaos = edOrgExtractHelper.retrieveSEOAS((String) entity.getBody().get(ParameterConstants.TEACHER_ID), (String) entity.getBody().get(ParameterConstants.SCHOOL_... | TeacherSchoolAssociationExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { Iterable<Entity> seaos = edOrgExtractHelper.retrieveSEOAS((String) entity.getBody().get(ParameterConstants.TEACHER_ID), (String) entity.getBody().get(ParameterConstants.SCHOOL_... | TeacherSchoolAssociationExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { Iterable<Entity> seaos = edOrgExtractHelper.retrieveSEOAS((String) entity.getBody().get(ParameterConstants.TEACHER_ID), (String) entity.getBody().get(ParameterConstants.SCHOOL_... |
@Test public void testEmptyList() { List<String> result = converter.convert(new LanguageList()); Assert.assertEquals(0, result.size()); } | public List<String> convert(LanguageList languageList) { if (languageList == null) { return null; } return toSliLanguageList(languageList.getLanguages()); } | LanguageListConverter { public List<String> convert(LanguageList languageList) { if (languageList == null) { return null; } return toSliLanguageList(languageList.getLanguages()); } } | LanguageListConverter { public List<String> convert(LanguageList languageList) { if (languageList == null) { return null; } return toSliLanguageList(languageList.getLanguages()); } } | LanguageListConverter { public List<String> convert(LanguageList languageList) { if (languageList == null) { return null; } return toSliLanguageList(languageList.getLanguages()); } List<String> convert(LanguageList languageList); } | LanguageListConverter { public List<String> convert(LanguageList languageList) { if (languageList == null) { return null; } return toSliLanguageList(languageList.getLanguages()); } List<String> convert(LanguageList languageList); } |
@Test public void testEmptyLanguage() { LanguageList list = new LanguageList(); openadk.library.common.Language original = new openadk.library.common.Language(); list.add(original); List<String> result = converter.convert(list); Assert.assertEquals(1, result.size()); String language = result.get(0); Assert.assertEquals... | public List<String> convert(LanguageList languageList) { if (languageList == null) { return null; } return toSliLanguageList(languageList.getLanguages()); } | LanguageListConverter { public List<String> convert(LanguageList languageList) { if (languageList == null) { return null; } return toSliLanguageList(languageList.getLanguages()); } } | LanguageListConverter { public List<String> convert(LanguageList languageList) { if (languageList == null) { return null; } return toSliLanguageList(languageList.getLanguages()); } } | LanguageListConverter { public List<String> convert(LanguageList languageList) { if (languageList == null) { return null; } return toSliLanguageList(languageList.getLanguages()); } List<String> convert(LanguageList languageList); } | LanguageListConverter { public List<String> convert(LanguageList languageList) { if (languageList == null) { return null; } return toSliLanguageList(languageList.getLanguages()); } List<String> convert(LanguageList languageList); } |
@Test public void testConversion() { map.clear(); map.put(LanguageCode.CHECHEN, "Other languages"); map.put(LanguageCode.CHEROKEE, "Cherokee"); map.put(LanguageCode.CHINESE, "Mandarin (Chinese)"); map.put(LanguageCode.ENGLISH, "English"); map.put(LanguageCode.FRENCH, "French"); map.put(LanguageCode.GERMAN, "German"); m... | public List<String> convert(LanguageList languageList) { if (languageList == null) { return null; } return toSliLanguageList(languageList.getLanguages()); } | LanguageListConverter { public List<String> convert(LanguageList languageList) { if (languageList == null) { return null; } return toSliLanguageList(languageList.getLanguages()); } } | LanguageListConverter { public List<String> convert(LanguageList languageList) { if (languageList == null) { return null; } return toSliLanguageList(languageList.getLanguages()); } } | LanguageListConverter { public List<String> convert(LanguageList languageList) { if (languageList == null) { return null; } return toSliLanguageList(languageList.getLanguages()); } List<String> convert(LanguageList languageList); } | LanguageListConverter { public List<String> convert(LanguageList languageList) { if (languageList == null) { return null; } return toSliLanguageList(languageList.getLanguages()); } List<String> convert(LanguageList languageList); } |
@Test public void shouldCreateAckMessages() throws ADKException, IOException { String ackString = mockZis.createAckString(); SIFParser parser = SIFParser.newInstance(); SIFElement sifElem = parser.parse(ackString); Assert.assertTrue("Should create a SIF message", (sifElem instanceof SIF_Ack)); } | public String createAckString() { SIF_Message message = new SIF_Message(); SIF_Ack ack = message.ackStatus(0); return sifElementToString(ack); } | MockZis { public String createAckString() { SIF_Message message = new SIF_Message(); SIF_Ack ack = message.ackStatus(0); return sifElementToString(ack); } } | MockZis { public String createAckString() { SIF_Message message = new SIF_Message(); SIF_Ack ack = message.ackStatus(0); return sifElementToString(ack); } } | MockZis { public String createAckString() { SIF_Message message = new SIF_Message(); SIF_Ack ack = message.ackStatus(0); return sifElementToString(ack); } void parseSIFMessage(String sifString); void broadcastMessage(String xmlMessage); @PostConstruct void setup(); String createAckString(); void getAgentUrls(Set<Strin... | MockZis { public String createAckString() { SIF_Message message = new SIF_Message(); SIF_Ack ack = message.ackStatus(0); return sifElementToString(ack); } void parseSIFMessage(String sifString); void broadcastMessage(String xmlMessage); @PostConstruct void setup(); String createAckString(); void getAgentUrls(Set<Strin... |
@Test public void testGenerateStudentPersonalDefaultEvent() throws ADKException { String messageFile = getPathForFile("/element_xml/StudentPersonal.xml"); Event studentPersonalEvent = CustomEventGenerator.generateEvent(messageFile, EventAction.ADD); EventAction eventAction = studentPersonalEvent.getAction(); Assert.ass... | public static Event generateEvent(String messageFile, EventAction eventAction) { FileReader in = null; Event event = null; try { SIFParser p = SIFParser.newInstance(); in = new FileReader(messageFile); StringBuffer xml = new StringBuffer(); int bufSize = 4096; char[] buf = new char[bufSize]; while (in.ready()) { bufSiz... | CustomEventGenerator { public static Event generateEvent(String messageFile, EventAction eventAction) { FileReader in = null; Event event = null; try { SIFParser p = SIFParser.newInstance(); in = new FileReader(messageFile); StringBuffer xml = new StringBuffer(); int bufSize = 4096; char[] buf = new char[bufSize]; whil... | CustomEventGenerator { public static Event generateEvent(String messageFile, EventAction eventAction) { FileReader in = null; Event event = null; try { SIFParser p = SIFParser.newInstance(); in = new FileReader(messageFile); StringBuffer xml = new StringBuffer(); int bufSize = 4096; char[] buf = new char[bufSize]; whil... | CustomEventGenerator { public static Event generateEvent(String messageFile, EventAction eventAction) { FileReader in = null; Event event = null; try { SIFParser p = SIFParser.newInstance(); in = new FileReader(messageFile); StringBuffer xml = new StringBuffer(); int bufSize = 4096; char[] buf = new char[bufSize]; whil... | CustomEventGenerator { public static Event generateEvent(String messageFile, EventAction eventAction) { FileReader in = null; Event event = null; try { SIFParser p = SIFParser.newInstance(); in = new FileReader(messageFile); StringBuffer xml = new StringBuffer(); int bufSize = 4096; char[] buf = new char[bufSize]; whil... |
@Test public void testGenerateLeaInfoDefaultEvent() throws ADKException { String messageFile = getPathForFile("/element_xml/LEAInfo.xml"); Event leaInfoEvent = CustomEventGenerator.generateEvent(messageFile, EventAction.ADD); EventAction eventAction = leaInfoEvent.getAction(); Assert.assertEquals(EventAction.ADD, event... | public static Event generateEvent(String messageFile, EventAction eventAction) { FileReader in = null; Event event = null; try { SIFParser p = SIFParser.newInstance(); in = new FileReader(messageFile); StringBuffer xml = new StringBuffer(); int bufSize = 4096; char[] buf = new char[bufSize]; while (in.ready()) { bufSiz... | CustomEventGenerator { public static Event generateEvent(String messageFile, EventAction eventAction) { FileReader in = null; Event event = null; try { SIFParser p = SIFParser.newInstance(); in = new FileReader(messageFile); StringBuffer xml = new StringBuffer(); int bufSize = 4096; char[] buf = new char[bufSize]; whil... | CustomEventGenerator { public static Event generateEvent(String messageFile, EventAction eventAction) { FileReader in = null; Event event = null; try { SIFParser p = SIFParser.newInstance(); in = new FileReader(messageFile); StringBuffer xml = new StringBuffer(); int bufSize = 4096; char[] buf = new char[bufSize]; whil... | CustomEventGenerator { public static Event generateEvent(String messageFile, EventAction eventAction) { FileReader in = null; Event event = null; try { SIFParser p = SIFParser.newInstance(); in = new FileReader(messageFile); StringBuffer xml = new StringBuffer(); int bufSize = 4096; char[] buf = new char[bufSize]; whil... | CustomEventGenerator { public static Event generateEvent(String messageFile, EventAction eventAction) { FileReader in = null; Event event = null; try { SIFParser p = SIFParser.newInstance(); in = new FileReader(messageFile); StringBuffer xml = new StringBuffer(); int bufSize = 4096; char[] buf = new char[bufSize]; whil... |
@Test public void testGenerateTestSchoolInfo() { SchoolInfo schoolInfo = SifEntityGenerator.generateTestSchoolInfo(); Assert.assertEquals(SifEntityGenerator.TEST_SCHOOLINFO_REFID, schoolInfo.getRefId()); Assert.assertEquals("Daybreak West High", schoolInfo.getStateProvinceId()); Assert.assertEquals("421575003045", scho... | public static SchoolInfo generateTestSchoolInfo() { SchoolInfo info = new SchoolInfo(); info.setRefId(TEST_SCHOOLINFO_REFID); info.setStateProvinceId("Daybreak West High"); info.setNCESId("421575003045"); info.setSchoolName("Daybreak West High"); info.setLEAInfoRefId(TEST_LEAINFO_REFID); SchoolFocusList schoolFocusList... | SifEntityGenerator { public static SchoolInfo generateTestSchoolInfo() { SchoolInfo info = new SchoolInfo(); info.setRefId(TEST_SCHOOLINFO_REFID); info.setStateProvinceId("Daybreak West High"); info.setNCESId("421575003045"); info.setSchoolName("Daybreak West High"); info.setLEAInfoRefId(TEST_LEAINFO_REFID); SchoolFocu... | SifEntityGenerator { public static SchoolInfo generateTestSchoolInfo() { SchoolInfo info = new SchoolInfo(); info.setRefId(TEST_SCHOOLINFO_REFID); info.setStateProvinceId("Daybreak West High"); info.setNCESId("421575003045"); info.setSchoolName("Daybreak West High"); info.setLEAInfoRefId(TEST_LEAINFO_REFID); SchoolFocu... | SifEntityGenerator { public static SchoolInfo generateTestSchoolInfo() { SchoolInfo info = new SchoolInfo(); info.setRefId(TEST_SCHOOLINFO_REFID); info.setStateProvinceId("Daybreak West High"); info.setNCESId("421575003045"); info.setSchoolName("Daybreak West High"); info.setLEAInfoRefId(TEST_LEAINFO_REFID); SchoolFocu... | SifEntityGenerator { public static SchoolInfo generateTestSchoolInfo() { SchoolInfo info = new SchoolInfo(); info.setRefId(TEST_SCHOOLINFO_REFID); info.setStateProvinceId("Daybreak West High"); info.setNCESId("421575003045"); info.setSchoolName("Daybreak West High"); info.setLEAInfoRefId(TEST_LEAINFO_REFID); SchoolFocu... |
@Test public void testGenerateTestLeaInfo() { LEAInfo leaInfo = SifEntityGenerator.generateTestLEAInfo(); Assert.assertEquals(SifEntityGenerator.TEST_LEAINFO_REFID, leaInfo.getRefId()); Assert.assertEquals("IL-DAYBREAK", leaInfo.getStateProvinceId()); Assert.assertEquals("4215750", leaInfo.getNCESId()); Assert.assertEq... | public static LEAInfo generateTestLEAInfo() { LEAInfo info = new LEAInfo(); info.setRefId(TEST_LEAINFO_REFID); info.setStateProvinceId("IL-DAYBREAK"); info.setNCESId("4215750"); info.setLEAName("Daybreak School District 4530"); info.setLEAURL("http: info.setEducationAgencyType(EducationAgencyTypeCode.REG_DISTRICT); inf... | SifEntityGenerator { public static LEAInfo generateTestLEAInfo() { LEAInfo info = new LEAInfo(); info.setRefId(TEST_LEAINFO_REFID); info.setStateProvinceId("IL-DAYBREAK"); info.setNCESId("4215750"); info.setLEAName("Daybreak School District 4530"); info.setLEAURL("http: info.setEducationAgencyType(EducationAgencyTypeCo... | SifEntityGenerator { public static LEAInfo generateTestLEAInfo() { LEAInfo info = new LEAInfo(); info.setRefId(TEST_LEAINFO_REFID); info.setStateProvinceId("IL-DAYBREAK"); info.setNCESId("4215750"); info.setLEAName("Daybreak School District 4530"); info.setLEAURL("http: info.setEducationAgencyType(EducationAgencyTypeCo... | SifEntityGenerator { public static LEAInfo generateTestLEAInfo() { LEAInfo info = new LEAInfo(); info.setRefId(TEST_LEAINFO_REFID); info.setStateProvinceId("IL-DAYBREAK"); info.setNCESId("4215750"); info.setLEAName("Daybreak School District 4530"); info.setLEAURL("http: info.setEducationAgencyType(EducationAgencyTypeCo... | SifEntityGenerator { public static LEAInfo generateTestLEAInfo() { LEAInfo info = new LEAInfo(); info.setRefId(TEST_LEAINFO_REFID); info.setStateProvinceId("IL-DAYBREAK"); info.setNCESId("4215750"); info.setLEAName("Daybreak School District 4530"); info.setLEAURL("http: info.setEducationAgencyType(EducationAgencyTypeCo... |
@Test public void testGenerateTestSeaInfo() { SEAInfo seaInfo = SifEntityGenerator.generateTestSEAInfo(); Assert.assertEquals(SifEntityGenerator.TEST_SEAINFO_REFID, seaInfo.getRefId()); Assert.assertEquals("Illinois State Board of Education", seaInfo.getSEAName()); Assert.assertEquals("http: AddressList addressList = s... | public static SEAInfo generateTestSEAInfo() { SEAInfo info = new SEAInfo(); info.setRefId(TEST_SEAINFO_REFID); info.setSEAName("Illinois State Board of Education"); info.setSEAURL("http: Address address = new Address(); address.setCity("Salt Lake City"); address.setStateProvince(StatePrCode.IL); address.setCountry(Coun... | SifEntityGenerator { public static SEAInfo generateTestSEAInfo() { SEAInfo info = new SEAInfo(); info.setRefId(TEST_SEAINFO_REFID); info.setSEAName("Illinois State Board of Education"); info.setSEAURL("http: Address address = new Address(); address.setCity("Salt Lake City"); address.setStateProvince(StatePrCode.IL); ad... | SifEntityGenerator { public static SEAInfo generateTestSEAInfo() { SEAInfo info = new SEAInfo(); info.setRefId(TEST_SEAINFO_REFID); info.setSEAName("Illinois State Board of Education"); info.setSEAURL("http: Address address = new Address(); address.setCity("Salt Lake City"); address.setStateProvince(StatePrCode.IL); ad... | SifEntityGenerator { public static SEAInfo generateTestSEAInfo() { SEAInfo info = new SEAInfo(); info.setRefId(TEST_SEAINFO_REFID); info.setSEAName("Illinois State Board of Education"); info.setSEAURL("http: Address address = new Address(); address.setCity("Salt Lake City"); address.setStateProvince(StatePrCode.IL); ad... | SifEntityGenerator { public static SEAInfo generateTestSEAInfo() { SEAInfo info = new SEAInfo(); info.setRefId(TEST_SEAINFO_REFID); info.setSEAName("Illinois State Board of Education"); info.setSEAURL("http: Address address = new Address(); address.setCity("Salt Lake City"); address.setStateProvince(StatePrCode.IL); ad... |
@Test public void testGenerateTestStudentSchoolEnrollment() { StudentSchoolEnrollment studentSchoolEnrollment = SifEntityGenerator.generateTestStudentSchoolEnrollment(); Assert.assertEquals(SifEntityGenerator.TEST_STUDENTSCHOOLENROLLMENT_REFID, studentSchoolEnrollment.getRefId()); Assert.assertEquals(SifEntityGenerator... | public static StudentSchoolEnrollment generateTestStudentSchoolEnrollment() { StudentSchoolEnrollment retVal = new StudentSchoolEnrollment(); retVal.setRefId(TEST_STUDENTSCHOOLENROLLMENT_REFID); retVal.setSchoolInfoRefId(TEST_SCHOOLINFO_REFID); retVal.setStudentPersonalRefId(TEST_STUDENTPERSONAL_REFID); retVal.setMembe... | SifEntityGenerator { public static StudentSchoolEnrollment generateTestStudentSchoolEnrollment() { StudentSchoolEnrollment retVal = new StudentSchoolEnrollment(); retVal.setRefId(TEST_STUDENTSCHOOLENROLLMENT_REFID); retVal.setSchoolInfoRefId(TEST_SCHOOLINFO_REFID); retVal.setStudentPersonalRefId(TEST_STUDENTPERSONAL_RE... | SifEntityGenerator { public static StudentSchoolEnrollment generateTestStudentSchoolEnrollment() { StudentSchoolEnrollment retVal = new StudentSchoolEnrollment(); retVal.setRefId(TEST_STUDENTSCHOOLENROLLMENT_REFID); retVal.setSchoolInfoRefId(TEST_SCHOOLINFO_REFID); retVal.setStudentPersonalRefId(TEST_STUDENTPERSONAL_RE... | SifEntityGenerator { public static StudentSchoolEnrollment generateTestStudentSchoolEnrollment() { StudentSchoolEnrollment retVal = new StudentSchoolEnrollment(); retVal.setRefId(TEST_STUDENTSCHOOLENROLLMENT_REFID); retVal.setSchoolInfoRefId(TEST_SCHOOLINFO_REFID); retVal.setStudentPersonalRefId(TEST_STUDENTPERSONAL_RE... | SifEntityGenerator { public static StudentSchoolEnrollment generateTestStudentSchoolEnrollment() { StudentSchoolEnrollment retVal = new StudentSchoolEnrollment(); retVal.setRefId(TEST_STUDENTSCHOOLENROLLMENT_REFID); retVal.setSchoolInfoRefId(TEST_SCHOOLINFO_REFID); retVal.setStudentPersonalRefId(TEST_STUDENTPERSONAL_RE... |
@Test public void testshouldExtractTeacherSchoolAssociation() { Entity mSeoa = Mockito.mock(Entity.class); Map<String, Object> body = new HashMap<String, Object>(); body.put(ParameterConstants.BEGIN_DATE, "2009-09-02"); body.put(ParameterConstants.END_DATE, "2010-05-31"); Mockito.when(mSeoa.getBody()).thenReturn(body);... | @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { Iterable<Entity> seaos = edOrgExtractHelper.retrieveSEOAS((String) entity.getBody().get(ParameterConstants.TEACHER_ID), (String) entity.getBody().get(ParameterConstants.SCHOOL_ID)); return shouldExtract(seaos, upToDate); } | TeacherSchoolAssociationExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { Iterable<Entity> seaos = edOrgExtractHelper.retrieveSEOAS((String) entity.getBody().get(ParameterConstants.TEACHER_ID), (String) entity.getBody().get(ParameterConstants.SCHOOL_... | TeacherSchoolAssociationExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { Iterable<Entity> seaos = edOrgExtractHelper.retrieveSEOAS((String) entity.getBody().get(ParameterConstants.TEACHER_ID), (String) entity.getBody().get(ParameterConstants.SCHOOL_... | TeacherSchoolAssociationExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { Iterable<Entity> seaos = edOrgExtractHelper.retrieveSEOAS((String) entity.getBody().get(ParameterConstants.TEACHER_ID), (String) entity.getBody().get(ParameterConstants.SCHOOL_... | TeacherSchoolAssociationExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { Iterable<Entity> seaos = edOrgExtractHelper.retrieveSEOAS((String) entity.getBody().get(ParameterConstants.TEACHER_ID), (String) entity.getBody().get(ParameterConstants.SCHOOL_... |
@Test public void testGenerateTestStudentLeaRelationship() { StudentLEARelationship studentLeaRelationship = SifEntityGenerator.generateTestStudentLeaRelationship(); Assert.assertEquals(SifEntityGenerator.TEST_STUDENTLEARELATIONSHIP_REFID, studentLeaRelationship.getRefId()); Assert.assertEquals(SifEntityGenerator.TEST_... | public static StudentLEARelationship generateTestStudentLeaRelationship() { StudentLEARelationship retVal = new StudentLEARelationship(); retVal.setRefId(TEST_STUDENTLEARELATIONSHIP_REFID); retVal.setStudentPersonalRefId(TEST_STUDENTPERSONAL_REFID); retVal.setLEAInfoRefId(TEST_LEAINFO_REFID); retVal.setSchoolYear(2012)... | SifEntityGenerator { public static StudentLEARelationship generateTestStudentLeaRelationship() { StudentLEARelationship retVal = new StudentLEARelationship(); retVal.setRefId(TEST_STUDENTLEARELATIONSHIP_REFID); retVal.setStudentPersonalRefId(TEST_STUDENTPERSONAL_REFID); retVal.setLEAInfoRefId(TEST_LEAINFO_REFID); retVa... | SifEntityGenerator { public static StudentLEARelationship generateTestStudentLeaRelationship() { StudentLEARelationship retVal = new StudentLEARelationship(); retVal.setRefId(TEST_STUDENTLEARELATIONSHIP_REFID); retVal.setStudentPersonalRefId(TEST_STUDENTPERSONAL_REFID); retVal.setLEAInfoRefId(TEST_LEAINFO_REFID); retVa... | SifEntityGenerator { public static StudentLEARelationship generateTestStudentLeaRelationship() { StudentLEARelationship retVal = new StudentLEARelationship(); retVal.setRefId(TEST_STUDENTLEARELATIONSHIP_REFID); retVal.setStudentPersonalRefId(TEST_STUDENTPERSONAL_REFID); retVal.setLEAInfoRefId(TEST_LEAINFO_REFID); retVa... | SifEntityGenerator { public static StudentLEARelationship generateTestStudentLeaRelationship() { StudentLEARelationship retVal = new StudentLEARelationship(); retVal.setRefId(TEST_STUDENTLEARELATIONSHIP_REFID); retVal.setStudentPersonalRefId(TEST_STUDENTPERSONAL_REFID); retVal.setLEAInfoRefId(TEST_LEAINFO_REFID); retVa... |
@Test public void testGenerateTestStudentPersonal() { StudentPersonal studentPersonal = SifEntityGenerator.generateTestStudentPersonal(); Assert.assertEquals(SifEntityGenerator.TEST_STUDENTPERSONAL_REFID, studentPersonal.getRefId()); Assert.assertEquals("1982", studentPersonal.getGraduationDate().getValue()); Assert.as... | public static StudentPersonal generateTestStudentPersonal() { StudentPersonal studentPersonal = new StudentPersonal(); studentPersonal.setRefId(TEST_STUDENTPERSONAL_REFID); studentPersonal.setStateProvinceId("IL-DAYBREAK-54321"); Name name = new Name(NameType.NAME_OF_RECORD, "Smith", "Joe"); name.setMiddleName(""); nam... | SifEntityGenerator { public static StudentPersonal generateTestStudentPersonal() { StudentPersonal studentPersonal = new StudentPersonal(); studentPersonal.setRefId(TEST_STUDENTPERSONAL_REFID); studentPersonal.setStateProvinceId("IL-DAYBREAK-54321"); Name name = new Name(NameType.NAME_OF_RECORD, "Smith", "Joe"); name.s... | SifEntityGenerator { public static StudentPersonal generateTestStudentPersonal() { StudentPersonal studentPersonal = new StudentPersonal(); studentPersonal.setRefId(TEST_STUDENTPERSONAL_REFID); studentPersonal.setStateProvinceId("IL-DAYBREAK-54321"); Name name = new Name(NameType.NAME_OF_RECORD, "Smith", "Joe"); name.s... | SifEntityGenerator { public static StudentPersonal generateTestStudentPersonal() { StudentPersonal studentPersonal = new StudentPersonal(); studentPersonal.setRefId(TEST_STUDENTPERSONAL_REFID); studentPersonal.setStateProvinceId("IL-DAYBREAK-54321"); Name name = new Name(NameType.NAME_OF_RECORD, "Smith", "Joe"); name.s... | SifEntityGenerator { public static StudentPersonal generateTestStudentPersonal() { StudentPersonal studentPersonal = new StudentPersonal(); studentPersonal.setRefId(TEST_STUDENTPERSONAL_REFID); studentPersonal.setStateProvinceId("IL-DAYBREAK-54321"); Name name = new Name(NameType.NAME_OF_RECORD, "Smith", "Joe"); name.s... |
@Test public void testGenerateTestStaffPersonal() { StaffPersonal staffPersonal = SifEntityGenerator.generateTestStaffPersonal(); Assert.assertEquals(SifEntityGenerator.TEST_STAFFPERSONAL_REFID, staffPersonal.getRefId()); Assert.assertEquals(SifEntityGenerator.TEST_EMPLOYEEPERSONAL_REFID, staffPersonal.getEmployeePerso... | public static StaffPersonal generateTestStaffPersonal() { StaffPersonal staffPersonal = new StaffPersonal(); staffPersonal.setRefId(TEST_STAFFPERSONAL_REFID); staffPersonal.setEmployeePersonalRefId(TEST_EMPLOYEEPERSONAL_REFID); staffPersonal.setLocalId("946379881"); staffPersonal.setStateProvinceId("C2345681"); staffPe... | SifEntityGenerator { public static StaffPersonal generateTestStaffPersonal() { StaffPersonal staffPersonal = new StaffPersonal(); staffPersonal.setRefId(TEST_STAFFPERSONAL_REFID); staffPersonal.setEmployeePersonalRefId(TEST_EMPLOYEEPERSONAL_REFID); staffPersonal.setLocalId("946379881"); staffPersonal.setStateProvinceId... | SifEntityGenerator { public static StaffPersonal generateTestStaffPersonal() { StaffPersonal staffPersonal = new StaffPersonal(); staffPersonal.setRefId(TEST_STAFFPERSONAL_REFID); staffPersonal.setEmployeePersonalRefId(TEST_EMPLOYEEPERSONAL_REFID); staffPersonal.setLocalId("946379881"); staffPersonal.setStateProvinceId... | SifEntityGenerator { public static StaffPersonal generateTestStaffPersonal() { StaffPersonal staffPersonal = new StaffPersonal(); staffPersonal.setRefId(TEST_STAFFPERSONAL_REFID); staffPersonal.setEmployeePersonalRefId(TEST_EMPLOYEEPERSONAL_REFID); staffPersonal.setLocalId("946379881"); staffPersonal.setStateProvinceId... | SifEntityGenerator { public static StaffPersonal generateTestStaffPersonal() { StaffPersonal staffPersonal = new StaffPersonal(); staffPersonal.setRefId(TEST_STAFFPERSONAL_REFID); staffPersonal.setEmployeePersonalRefId(TEST_EMPLOYEEPERSONAL_REFID); staffPersonal.setLocalId("946379881"); staffPersonal.setStateProvinceId... |
@Test public void testGenerateTestEmployeePersonal() { EmployeePersonal employeePersonal = SifEntityGenerator.generateTestEmployeePersonal(); Assert.assertEquals(SifEntityGenerator.TEST_EMPLOYEEPERSONAL_REFID, employeePersonal.getRefId()); HrOtherIdList hrOtherIdList = employeePersonal.getOtherIdList(); Assert.assertEq... | public static EmployeePersonal generateTestEmployeePersonal() { EmployeePersonal employeePersonal = new EmployeePersonal(); employeePersonal.setRefId(TEST_EMPLOYEEPERSONAL_REFID); employeePersonal.setStateProvinceId("C2345681"); OtherId otherId1 = new OtherId(OtherIdType.SOCIALSECURITY, "333333333"); OtherId otherId2 =... | SifEntityGenerator { public static EmployeePersonal generateTestEmployeePersonal() { EmployeePersonal employeePersonal = new EmployeePersonal(); employeePersonal.setRefId(TEST_EMPLOYEEPERSONAL_REFID); employeePersonal.setStateProvinceId("C2345681"); OtherId otherId1 = new OtherId(OtherIdType.SOCIALSECURITY, "333333333"... | SifEntityGenerator { public static EmployeePersonal generateTestEmployeePersonal() { EmployeePersonal employeePersonal = new EmployeePersonal(); employeePersonal.setRefId(TEST_EMPLOYEEPERSONAL_REFID); employeePersonal.setStateProvinceId("C2345681"); OtherId otherId1 = new OtherId(OtherIdType.SOCIALSECURITY, "333333333"... | SifEntityGenerator { public static EmployeePersonal generateTestEmployeePersonal() { EmployeePersonal employeePersonal = new EmployeePersonal(); employeePersonal.setRefId(TEST_EMPLOYEEPERSONAL_REFID); employeePersonal.setStateProvinceId("C2345681"); OtherId otherId1 = new OtherId(OtherIdType.SOCIALSECURITY, "333333333"... | SifEntityGenerator { public static EmployeePersonal generateTestEmployeePersonal() { EmployeePersonal employeePersonal = new EmployeePersonal(); employeePersonal.setRefId(TEST_EMPLOYEEPERSONAL_REFID); employeePersonal.setStateProvinceId("C2345681"); OtherId otherId1 = new OtherId(OtherIdType.SOCIALSECURITY, "333333333"... |
@Test public void testGenerateTestStaffAssignment() { StaffAssignment staffAssignment = SifEntityGenerator.generateTestStaffAssignment(); Assert.assertEquals(SifEntityGenerator.TEST_STAFFASSIGNMENT_REFID, staffAssignment.getRefId()); Assert.assertEquals(SifEntityGenerator.TEST_SCHOOLINFO_REFID, staffAssignment.getSchoo... | public static StaffAssignment generateTestStaffAssignment() { StaffAssignment staffAssignment = new StaffAssignment(); staffAssignment.setRefId(TEST_STAFFASSIGNMENT_REFID); staffAssignment.setSchoolInfoRefId(TEST_SCHOOLINFO_REFID); staffAssignment.setStaffPersonalRefId(TEST_STAFFPERSONAL_REFID); staffAssignment.setEmpl... | SifEntityGenerator { public static StaffAssignment generateTestStaffAssignment() { StaffAssignment staffAssignment = new StaffAssignment(); staffAssignment.setRefId(TEST_STAFFASSIGNMENT_REFID); staffAssignment.setSchoolInfoRefId(TEST_SCHOOLINFO_REFID); staffAssignment.setStaffPersonalRefId(TEST_STAFFPERSONAL_REFID); st... | SifEntityGenerator { public static StaffAssignment generateTestStaffAssignment() { StaffAssignment staffAssignment = new StaffAssignment(); staffAssignment.setRefId(TEST_STAFFASSIGNMENT_REFID); staffAssignment.setSchoolInfoRefId(TEST_SCHOOLINFO_REFID); staffAssignment.setStaffPersonalRefId(TEST_STAFFPERSONAL_REFID); st... | SifEntityGenerator { public static StaffAssignment generateTestStaffAssignment() { StaffAssignment staffAssignment = new StaffAssignment(); staffAssignment.setRefId(TEST_STAFFASSIGNMENT_REFID); staffAssignment.setSchoolInfoRefId(TEST_SCHOOLINFO_REFID); staffAssignment.setStaffPersonalRefId(TEST_STAFFPERSONAL_REFID); st... | SifEntityGenerator { public static StaffAssignment generateTestStaffAssignment() { StaffAssignment staffAssignment = new StaffAssignment(); staffAssignment.setRefId(TEST_STAFFASSIGNMENT_REFID); staffAssignment.setSchoolInfoRefId(TEST_SCHOOLINFO_REFID); staffAssignment.setStaffPersonalRefId(TEST_STAFFPERSONAL_REFID); st... |
@Test public void testGenerateTestEmploymentRecord() { EmploymentRecord employmentRecord = SifEntityGenerator.generateTestEmploymentRecord(); Assert.assertEquals(SifEntityGenerator.TEST_EMPLOYMENTRECORD_REFID, employmentRecord.getRefId()); Assert.assertEquals(SifEntityGenerator.TEST_STAFFPERSONAL_REFID, employmentRecor... | public static EmploymentRecord generateTestEmploymentRecord() { EmploymentRecord employmentRecord = new EmploymentRecord(); employmentRecord.setRefId(TEST_EMPLOYMENTRECORD_REFID); employmentRecord.setSIF_RefId(TEST_STAFFPERSONAL_REFID); employmentRecord.setSIF_RefObject("StaffPersonal"); employmentRecord.setLEAInfoRefI... | SifEntityGenerator { public static EmploymentRecord generateTestEmploymentRecord() { EmploymentRecord employmentRecord = new EmploymentRecord(); employmentRecord.setRefId(TEST_EMPLOYMENTRECORD_REFID); employmentRecord.setSIF_RefId(TEST_STAFFPERSONAL_REFID); employmentRecord.setSIF_RefObject("StaffPersonal"); employment... | SifEntityGenerator { public static EmploymentRecord generateTestEmploymentRecord() { EmploymentRecord employmentRecord = new EmploymentRecord(); employmentRecord.setRefId(TEST_EMPLOYMENTRECORD_REFID); employmentRecord.setSIF_RefId(TEST_STAFFPERSONAL_REFID); employmentRecord.setSIF_RefObject("StaffPersonal"); employment... | SifEntityGenerator { public static EmploymentRecord generateTestEmploymentRecord() { EmploymentRecord employmentRecord = new EmploymentRecord(); employmentRecord.setRefId(TEST_EMPLOYMENTRECORD_REFID); employmentRecord.setSIF_RefId(TEST_STAFFPERSONAL_REFID); employmentRecord.setSIF_RefObject("StaffPersonal"); employment... | SifEntityGenerator { public static EmploymentRecord generateTestEmploymentRecord() { EmploymentRecord employmentRecord = new EmploymentRecord(); employmentRecord.setRefId(TEST_EMPLOYMENTRECORD_REFID); employmentRecord.setSIF_RefId(TEST_STAFFPERSONAL_REFID); employmentRecord.setSIF_RefObject("StaffPersonal"); employment... |
@Test public void testGenerateTestEmployeeAssignment() { EmployeeAssignment employeeAssignment = SifEntityGenerator.generateTestEmployeeAssignment(); Assert.assertEquals(SifEntityGenerator.TEST_EMPLOYEEASSIGNMENT_REFID, employeeAssignment.getRefId()); Assert.assertEquals(SifEntityGenerator.TEST_EMPLOYEEPERSONAL_REFID, ... | public static EmployeeAssignment generateTestEmployeeAssignment() { EmployeeAssignment employeeAssignment = new EmployeeAssignment(); employeeAssignment.setRefId(TEST_EMPLOYEEASSIGNMENT_REFID); employeeAssignment.setEmployeePersonalRefId(TEST_EMPLOYEEPERSONAL_REFID); employeeAssignment.setDescription("Twelfth grade com... | SifEntityGenerator { public static EmployeeAssignment generateTestEmployeeAssignment() { EmployeeAssignment employeeAssignment = new EmployeeAssignment(); employeeAssignment.setRefId(TEST_EMPLOYEEASSIGNMENT_REFID); employeeAssignment.setEmployeePersonalRefId(TEST_EMPLOYEEPERSONAL_REFID); employeeAssignment.setDescripti... | SifEntityGenerator { public static EmployeeAssignment generateTestEmployeeAssignment() { EmployeeAssignment employeeAssignment = new EmployeeAssignment(); employeeAssignment.setRefId(TEST_EMPLOYEEASSIGNMENT_REFID); employeeAssignment.setEmployeePersonalRefId(TEST_EMPLOYEEPERSONAL_REFID); employeeAssignment.setDescripti... | SifEntityGenerator { public static EmployeeAssignment generateTestEmployeeAssignment() { EmployeeAssignment employeeAssignment = new EmployeeAssignment(); employeeAssignment.setRefId(TEST_EMPLOYEEASSIGNMENT_REFID); employeeAssignment.setEmployeePersonalRefId(TEST_EMPLOYEEPERSONAL_REFID); employeeAssignment.setDescripti... | SifEntityGenerator { public static EmployeeAssignment generateTestEmployeeAssignment() { EmployeeAssignment employeeAssignment = new EmployeeAssignment(); employeeAssignment.setRefId(TEST_EMPLOYEEASSIGNMENT_REFID); employeeAssignment.setEmployeePersonalRefId(TEST_EMPLOYEEPERSONAL_REFID); employeeAssignment.setDescripti... |
@Test public void testGetPropertiesDefault() throws ParseException { String[] args = {}; Properties props = PropertyUtils.getProperties(args); Assert.assertEquals("test.publisher.agent", props.getProperty(PropertyUtils.KEY_AGENT_ID)); Assert.assertEquals("http: Assert.assertEquals("TestZone", props.getProperty(Property... | public static Properties getProperties(String[] args) throws ParseException { Properties props = new Properties(); CommandLineParser parser = new PosixParser(); CommandLine cmd = parser.parse(OPTIONS, args); String zoneUrl = cmd.getOptionValue(FLAG_ZONE_URL, DEFAULT_ZONE_URL); String zoneId = cmd.getOptionValue(FLAG_ZO... | PropertyUtils { public static Properties getProperties(String[] args) throws ParseException { Properties props = new Properties(); CommandLineParser parser = new PosixParser(); CommandLine cmd = parser.parse(OPTIONS, args); String zoneUrl = cmd.getOptionValue(FLAG_ZONE_URL, DEFAULT_ZONE_URL); String zoneId = cmd.getOpt... | PropertyUtils { public static Properties getProperties(String[] args) throws ParseException { Properties props = new Properties(); CommandLineParser parser = new PosixParser(); CommandLine cmd = parser.parse(OPTIONS, args); String zoneUrl = cmd.getOptionValue(FLAG_ZONE_URL, DEFAULT_ZONE_URL); String zoneId = cmd.getOpt... | PropertyUtils { public static Properties getProperties(String[] args) throws ParseException { Properties props = new Properties(); CommandLineParser parser = new PosixParser(); CommandLine cmd = parser.parse(OPTIONS, args); String zoneUrl = cmd.getOptionValue(FLAG_ZONE_URL, DEFAULT_ZONE_URL); String zoneId = cmd.getOpt... | PropertyUtils { public static Properties getProperties(String[] args) throws ParseException { Properties props = new Properties(); CommandLineParser parser = new PosixParser(); CommandLine cmd = parser.parse(OPTIONS, args); String zoneUrl = cmd.getOptionValue(FLAG_ZONE_URL, DEFAULT_ZONE_URL); String zoneId = cmd.getOpt... |
@Test public void testGetPropertiesNonDefault() throws ParseException { String agentId = "agentId"; String zoneUrl = "http: String zoneId = "MyZone"; String script = "step1,step2,step3"; long waitTime = 9999; String messageFile = "path/to/file"; String eventAction = "DELETE"; String[] args = {"-a", agentId, "-u", zoneU... | public static Properties getProperties(String[] args) throws ParseException { Properties props = new Properties(); CommandLineParser parser = new PosixParser(); CommandLine cmd = parser.parse(OPTIONS, args); String zoneUrl = cmd.getOptionValue(FLAG_ZONE_URL, DEFAULT_ZONE_URL); String zoneId = cmd.getOptionValue(FLAG_ZO... | PropertyUtils { public static Properties getProperties(String[] args) throws ParseException { Properties props = new Properties(); CommandLineParser parser = new PosixParser(); CommandLine cmd = parser.parse(OPTIONS, args); String zoneUrl = cmd.getOptionValue(FLAG_ZONE_URL, DEFAULT_ZONE_URL); String zoneId = cmd.getOpt... | PropertyUtils { public static Properties getProperties(String[] args) throws ParseException { Properties props = new Properties(); CommandLineParser parser = new PosixParser(); CommandLine cmd = parser.parse(OPTIONS, args); String zoneUrl = cmd.getOptionValue(FLAG_ZONE_URL, DEFAULT_ZONE_URL); String zoneId = cmd.getOpt... | PropertyUtils { public static Properties getProperties(String[] args) throws ParseException { Properties props = new Properties(); CommandLineParser parser = new PosixParser(); CommandLine cmd = parser.parse(OPTIONS, args); String zoneUrl = cmd.getOptionValue(FLAG_ZONE_URL, DEFAULT_ZONE_URL); String zoneId = cmd.getOpt... | PropertyUtils { public static Properties getProperties(String[] args) throws ParseException { Properties props = new Properties(); CommandLineParser parser = new PosixParser(); CommandLine cmd = parser.parse(OPTIONS, args); String zoneUrl = cmd.getOptionValue(FLAG_ZONE_URL, DEFAULT_ZONE_URL); String zoneId = cmd.getOpt... |
@Test public void shouldCreateAndConfigureAgent() throws Exception { ZoneConfigurator mockZoneConfigurator = Mockito.mock(ZoneConfigurator.class); EventReporterAgent agent = createEventReporterAgent(mockZoneConfigurator); agent.startAgent(); AgentProperties props = agent.getProperties(); Assert.assertEquals("Push", pro... | public void startAgent() throws Exception { super.initialize(); setProperties(); Zone[] allZones = getZoneFactory().getAllZones(); zoneConfigurator.configure(allZones); } | EventReporterAgent extends Agent { public void startAgent() throws Exception { super.initialize(); setProperties(); Zone[] allZones = getZoneFactory().getAllZones(); zoneConfigurator.configure(allZones); } } | EventReporterAgent extends Agent { public void startAgent() throws Exception { super.initialize(); setProperties(); Zone[] allZones = getZoneFactory().getAllZones(); zoneConfigurator.configure(allZones); } EventReporterAgent(); EventReporterAgent(String id); EventReporterAgent(String id, ZoneConfigurator zoneConfig, ... | EventReporterAgent extends Agent { public void startAgent() throws Exception { super.initialize(); setProperties(); Zone[] allZones = getZoneFactory().getAllZones(); zoneConfigurator.configure(allZones); } EventReporterAgent(); EventReporterAgent(String id); EventReporterAgent(String id, ZoneConfigurator zoneConfig, ... | EventReporterAgent extends Agent { public void startAgent() throws Exception { super.initialize(); setProperties(); Zone[] allZones = getZoneFactory().getAllZones(); zoneConfigurator.configure(allZones); } EventReporterAgent(); EventReporterAgent(String id); EventReporterAgent(String id, ZoneConfigurator zoneConfig, ... |
@Test public void testshouldExtract() { Entity student = Mockito.mock(Entity.class); Mockito.when(student.getType()).thenReturn(EntityNames.STUDENT); Assert.assertTrue(datelessExtractVerifier.shouldExtract(student, DateTime.parse("2011-05-23", DateHelper.getDateTimeFormat()))); Assert.assertTrue(datelessExtractVerifier... | @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { return true; } | DatelessExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { return true; } } | DatelessExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { return true; } } | DatelessExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { return true; } @Override boolean shouldExtract(Entity entity, DateTime upToDate); } | DatelessExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { return true; } @Override boolean shouldExtract(Entity entity, DateTime upToDate); } |
@Test public void testRunReportScript() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, ADKException { Map<Class<? extends SIFDataObject>, List<EventAction>> testMap; testMap = new LinkedHashMap<Class<? extends SIFDataObject>, List<EventAction>>(); List<EventAction> addChangeDeleteEv... | public List<Event> runReportScript(String script, long waitTime) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { List<Event> eventsSent = new ArrayList<Event>(); LOG.info("Wait time (ms): " + waitTime); String[] eventDescriptors = script.split(","); for (String descriptor : eventDes... | EventReporter implements Publisher { public List<Event> runReportScript(String script, long waitTime) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { List<Event> eventsSent = new ArrayList<Event>(); LOG.info("Wait time (ms): " + waitTime); String[] eventDescriptors = script.split(",... | EventReporter implements Publisher { public List<Event> runReportScript(String script, long waitTime) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { List<Event> eventsSent = new ArrayList<Event>(); LOG.info("Wait time (ms): " + waitTime); String[] eventDescriptors = script.split(",... | EventReporter implements Publisher { public List<Event> runReportScript(String script, long waitTime) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { List<Event> eventsSent = new ArrayList<Event>(); LOG.info("Wait time (ms): " + waitTime); String[] eventDescriptors = script.split(",... | EventReporter implements Publisher { public List<Event> runReportScript(String script, long waitTime) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { List<Event> eventsSent = new ArrayList<Event>(); LOG.info("Wait time (ms): " + waitTime); String[] eventDescriptors = script.split(",... |
@Test public void runReportLeaInfoEventTests() throws ADKException { Class<? extends SIFDataObject> expectedClass = LEAInfo.class; String expectedId = SifEntityGenerator.TEST_LEAINFO_REFID; EventAction eventAction = EventAction.ADD; Event sentEvent = eventReporter.reportLeaInfoEvent(eventAction); LEAInfo dataObject = (... | public Event reportLeaInfoEvent(EventAction action) throws ADKException { LOG.info("LeaInfo " + action.toString()); LEAInfo leaInfo = SifEntityGenerator.generateTestLEAInfo(); if (action == EventAction.CHANGE) { leaInfo.setChanged(); leaInfo.setLEAURL("http: } Event event = new Event(leaInfo, action); zone.reportEvent(... | EventReporter implements Publisher { public Event reportLeaInfoEvent(EventAction action) throws ADKException { LOG.info("LeaInfo " + action.toString()); LEAInfo leaInfo = SifEntityGenerator.generateTestLEAInfo(); if (action == EventAction.CHANGE) { leaInfo.setChanged(); leaInfo.setLEAURL("http: } Event event = new Even... | EventReporter implements Publisher { public Event reportLeaInfoEvent(EventAction action) throws ADKException { LOG.info("LeaInfo " + action.toString()); LEAInfo leaInfo = SifEntityGenerator.generateTestLEAInfo(); if (action == EventAction.CHANGE) { leaInfo.setChanged(); leaInfo.setLEAURL("http: } Event event = new Even... | EventReporter implements Publisher { public Event reportLeaInfoEvent(EventAction action) throws ADKException { LOG.info("LeaInfo " + action.toString()); LEAInfo leaInfo = SifEntityGenerator.generateTestLEAInfo(); if (action == EventAction.CHANGE) { leaInfo.setChanged(); leaInfo.setLEAURL("http: } Event event = new Even... | EventReporter implements Publisher { public Event reportLeaInfoEvent(EventAction action) throws ADKException { LOG.info("LeaInfo " + action.toString()); LEAInfo leaInfo = SifEntityGenerator.generateTestLEAInfo(); if (action == EventAction.CHANGE) { leaInfo.setChanged(); leaInfo.setLEAURL("http: } Event event = new Even... |
@Test public void runReportSchoolInfoEventTests() throws ADKException { Class<? extends SIFDataObject> expectedClass = SchoolInfo.class; String expectedId = SifEntityGenerator.TEST_SCHOOLINFO_REFID; EventAction eventAction = EventAction.ADD; Event sentEvent = eventReporter.reportSchoolInfoEvent(eventAction); SchoolInfo... | public Event reportSchoolInfoEvent(EventAction action) throws ADKException { LOG.info("SchoolInfo " + action.toString()); SchoolInfo schoolInfo = SifEntityGenerator.generateTestSchoolInfo(); if (action == EventAction.CHANGE) { schoolInfo.setChanged(); schoolInfo.setSchoolURL("http: } Event event = new Event(schoolInfo,... | EventReporter implements Publisher { public Event reportSchoolInfoEvent(EventAction action) throws ADKException { LOG.info("SchoolInfo " + action.toString()); SchoolInfo schoolInfo = SifEntityGenerator.generateTestSchoolInfo(); if (action == EventAction.CHANGE) { schoolInfo.setChanged(); schoolInfo.setSchoolURL("http: ... | EventReporter implements Publisher { public Event reportSchoolInfoEvent(EventAction action) throws ADKException { LOG.info("SchoolInfo " + action.toString()); SchoolInfo schoolInfo = SifEntityGenerator.generateTestSchoolInfo(); if (action == EventAction.CHANGE) { schoolInfo.setChanged(); schoolInfo.setSchoolURL("http: ... | EventReporter implements Publisher { public Event reportSchoolInfoEvent(EventAction action) throws ADKException { LOG.info("SchoolInfo " + action.toString()); SchoolInfo schoolInfo = SifEntityGenerator.generateTestSchoolInfo(); if (action == EventAction.CHANGE) { schoolInfo.setChanged(); schoolInfo.setSchoolURL("http: ... | EventReporter implements Publisher { public Event reportSchoolInfoEvent(EventAction action) throws ADKException { LOG.info("SchoolInfo " + action.toString()); SchoolInfo schoolInfo = SifEntityGenerator.generateTestSchoolInfo(); if (action == EventAction.CHANGE) { schoolInfo.setChanged(); schoolInfo.setSchoolURL("http: ... |
@Test public void runReportStudentPersonalEventTests() throws ADKException { Class<? extends SIFDataObject> expectedClass = StudentPersonal.class; String expectedId = SifEntityGenerator.TEST_STUDENTPERSONAL_REFID; EventAction eventAction = EventAction.ADD; Event sentEvent = eventReporter.reportStudentPersonalEvent(even... | public Event reportStudentPersonalEvent(EventAction action) throws ADKException { LOG.info("StudentPersonal " + action.toString()); StudentPersonal studentPersonal = SifEntityGenerator.generateTestStudentPersonal(); if (action == EventAction.CHANGE) { studentPersonal.setChanged(); studentPersonal.setMigrant(YesNoUnknow... | EventReporter implements Publisher { public Event reportStudentPersonalEvent(EventAction action) throws ADKException { LOG.info("StudentPersonal " + action.toString()); StudentPersonal studentPersonal = SifEntityGenerator.generateTestStudentPersonal(); if (action == EventAction.CHANGE) { studentPersonal.setChanged(); s... | EventReporter implements Publisher { public Event reportStudentPersonalEvent(EventAction action) throws ADKException { LOG.info("StudentPersonal " + action.toString()); StudentPersonal studentPersonal = SifEntityGenerator.generateTestStudentPersonal(); if (action == EventAction.CHANGE) { studentPersonal.setChanged(); s... | EventReporter implements Publisher { public Event reportStudentPersonalEvent(EventAction action) throws ADKException { LOG.info("StudentPersonal " + action.toString()); StudentPersonal studentPersonal = SifEntityGenerator.generateTestStudentPersonal(); if (action == EventAction.CHANGE) { studentPersonal.setChanged(); s... | EventReporter implements Publisher { public Event reportStudentPersonalEvent(EventAction action) throws ADKException { LOG.info("StudentPersonal " + action.toString()); StudentPersonal studentPersonal = SifEntityGenerator.generateTestStudentPersonal(); if (action == EventAction.CHANGE) { studentPersonal.setChanged(); s... |
@Test public void runReportStudentLeaRelationshipEventTests() throws ADKException { Class<? extends SIFDataObject> expectedClass = StudentLEARelationship.class; String expectedId = SifEntityGenerator.TEST_STUDENTLEARELATIONSHIP_REFID; EventAction eventAction = EventAction.ADD; Event sentEvent = eventReporter.reportStud... | public Event reportStudentLeaRelationshipEvent(EventAction action) throws ADKException { LOG.info("StudentLeaRelationship " + action.toString()); StudentLEARelationship studentLeaRelationship = SifEntityGenerator.generateTestStudentLeaRelationship(); if (action == EventAction.CHANGE) { studentLeaRelationship.setChanged... | EventReporter implements Publisher { public Event reportStudentLeaRelationshipEvent(EventAction action) throws ADKException { LOG.info("StudentLeaRelationship " + action.toString()); StudentLEARelationship studentLeaRelationship = SifEntityGenerator.generateTestStudentLeaRelationship(); if (action == EventAction.CHANGE... | EventReporter implements Publisher { public Event reportStudentLeaRelationshipEvent(EventAction action) throws ADKException { LOG.info("StudentLeaRelationship " + action.toString()); StudentLEARelationship studentLeaRelationship = SifEntityGenerator.generateTestStudentLeaRelationship(); if (action == EventAction.CHANGE... | EventReporter implements Publisher { public Event reportStudentLeaRelationshipEvent(EventAction action) throws ADKException { LOG.info("StudentLeaRelationship " + action.toString()); StudentLEARelationship studentLeaRelationship = SifEntityGenerator.generateTestStudentLeaRelationship(); if (action == EventAction.CHANGE... | EventReporter implements Publisher { public Event reportStudentLeaRelationshipEvent(EventAction action) throws ADKException { LOG.info("StudentLeaRelationship " + action.toString()); StudentLEARelationship studentLeaRelationship = SifEntityGenerator.generateTestStudentLeaRelationship(); if (action == EventAction.CHANGE... |
@Test public void runReportStudentSchoolEnrollmentEventTests() throws ADKException { Class<? extends SIFDataObject> expectedClass = StudentSchoolEnrollment.class; String expectedId = SifEntityGenerator.TEST_STUDENTSCHOOLENROLLMENT_REFID; EventAction eventAction = EventAction.ADD; Event sentEvent = eventReporter.reportS... | public Event reportStudentSchoolEnrollmentEvent(EventAction action) throws ADKException { LOG.info("StudentSchoolEnrollment " + action.toString()); StudentSchoolEnrollment studentSchoolEnrollment = SifEntityGenerator.generateTestStudentSchoolEnrollment(); if (action == EventAction.CHANGE) { studentSchoolEnrollment.setC... | EventReporter implements Publisher { public Event reportStudentSchoolEnrollmentEvent(EventAction action) throws ADKException { LOG.info("StudentSchoolEnrollment " + action.toString()); StudentSchoolEnrollment studentSchoolEnrollment = SifEntityGenerator.generateTestStudentSchoolEnrollment(); if (action == EventAction.C... | EventReporter implements Publisher { public Event reportStudentSchoolEnrollmentEvent(EventAction action) throws ADKException { LOG.info("StudentSchoolEnrollment " + action.toString()); StudentSchoolEnrollment studentSchoolEnrollment = SifEntityGenerator.generateTestStudentSchoolEnrollment(); if (action == EventAction.C... | EventReporter implements Publisher { public Event reportStudentSchoolEnrollmentEvent(EventAction action) throws ADKException { LOG.info("StudentSchoolEnrollment " + action.toString()); StudentSchoolEnrollment studentSchoolEnrollment = SifEntityGenerator.generateTestStudentSchoolEnrollment(); if (action == EventAction.C... | EventReporter implements Publisher { public Event reportStudentSchoolEnrollmentEvent(EventAction action) throws ADKException { LOG.info("StudentSchoolEnrollment " + action.toString()); StudentSchoolEnrollment studentSchoolEnrollment = SifEntityGenerator.generateTestStudentSchoolEnrollment(); if (action == EventAction.C... |
@Test public void runReportStaffPersonalEventTests() throws ADKException { Class<? extends SIFDataObject> expectedClass = StaffPersonal.class; String expectedId = SifEntityGenerator.TEST_STAFFPERSONAL_REFID; EventAction eventAction = EventAction.ADD; Event sentEvent = eventReporter.reportStaffPersonalEvent(eventAction)... | public Event reportStaffPersonalEvent(EventAction action) throws ADKException { LOG.info("StaffPersonal " + action.toString()); StaffPersonal staffPersonal = SifEntityGenerator.generateTestStaffPersonal(); if (action == EventAction.CHANGE) { staffPersonal.setChanged(); staffPersonal.setEmailList(new EmailList(new Email... | EventReporter implements Publisher { public Event reportStaffPersonalEvent(EventAction action) throws ADKException { LOG.info("StaffPersonal " + action.toString()); StaffPersonal staffPersonal = SifEntityGenerator.generateTestStaffPersonal(); if (action == EventAction.CHANGE) { staffPersonal.setChanged(); staffPersonal... | EventReporter implements Publisher { public Event reportStaffPersonalEvent(EventAction action) throws ADKException { LOG.info("StaffPersonal " + action.toString()); StaffPersonal staffPersonal = SifEntityGenerator.generateTestStaffPersonal(); if (action == EventAction.CHANGE) { staffPersonal.setChanged(); staffPersonal... | EventReporter implements Publisher { public Event reportStaffPersonalEvent(EventAction action) throws ADKException { LOG.info("StaffPersonal " + action.toString()); StaffPersonal staffPersonal = SifEntityGenerator.generateTestStaffPersonal(); if (action == EventAction.CHANGE) { staffPersonal.setChanged(); staffPersonal... | EventReporter implements Publisher { public Event reportStaffPersonalEvent(EventAction action) throws ADKException { LOG.info("StaffPersonal " + action.toString()); StaffPersonal staffPersonal = SifEntityGenerator.generateTestStaffPersonal(); if (action == EventAction.CHANGE) { staffPersonal.setChanged(); staffPersonal... |
@Test public void runReportEmployeePersonalEventTests() throws ADKException { Class<? extends SIFDataObject> expectedClass = EmployeePersonal.class; String expectedId = SifEntityGenerator.TEST_EMPLOYEEPERSONAL_REFID; EventAction eventAction = EventAction.ADD; Event sentEvent = eventReporter.reportEmployeePersonalEvent(... | public Event reportEmployeePersonalEvent(EventAction action) throws ADKException { LOG.info("EmployeePersonal " + action.toString()); EmployeePersonal employeePersonal = SifEntityGenerator.generateTestEmployeePersonal(); if (action == EventAction.CHANGE) { employeePersonal.setChanged(); employeePersonal.setOtherIdList(... | EventReporter implements Publisher { public Event reportEmployeePersonalEvent(EventAction action) throws ADKException { LOG.info("EmployeePersonal " + action.toString()); EmployeePersonal employeePersonal = SifEntityGenerator.generateTestEmployeePersonal(); if (action == EventAction.CHANGE) { employeePersonal.setChange... | EventReporter implements Publisher { public Event reportEmployeePersonalEvent(EventAction action) throws ADKException { LOG.info("EmployeePersonal " + action.toString()); EmployeePersonal employeePersonal = SifEntityGenerator.generateTestEmployeePersonal(); if (action == EventAction.CHANGE) { employeePersonal.setChange... | EventReporter implements Publisher { public Event reportEmployeePersonalEvent(EventAction action) throws ADKException { LOG.info("EmployeePersonal " + action.toString()); EmployeePersonal employeePersonal = SifEntityGenerator.generateTestEmployeePersonal(); if (action == EventAction.CHANGE) { employeePersonal.setChange... | EventReporter implements Publisher { public Event reportEmployeePersonalEvent(EventAction action) throws ADKException { LOG.info("EmployeePersonal " + action.toString()); EmployeePersonal employeePersonal = SifEntityGenerator.generateTestEmployeePersonal(); if (action == EventAction.CHANGE) { employeePersonal.setChange... |
@Test public void runReportStaffAssignmentEventTests() throws ADKException { Class<? extends SIFDataObject> expectedClass = StaffAssignment.class; String expectedId = SifEntityGenerator.TEST_STAFFASSIGNMENT_REFID; EventAction eventAction = EventAction.ADD; Event sentEvent = eventReporter.reportStaffAssignmentEvent(even... | public Event reportStaffAssignmentEvent(EventAction action) throws ADKException { LOG.info("StaffAssignment " + action.toString()); StaffAssignment staffAssignment = SifEntityGenerator.generateTestStaffAssignment(); if (action == EventAction.CHANGE) { staffAssignment.setChanged(); staffAssignment.setPrimaryAssignment(Y... | EventReporter implements Publisher { public Event reportStaffAssignmentEvent(EventAction action) throws ADKException { LOG.info("StaffAssignment " + action.toString()); StaffAssignment staffAssignment = SifEntityGenerator.generateTestStaffAssignment(); if (action == EventAction.CHANGE) { staffAssignment.setChanged(); s... | EventReporter implements Publisher { public Event reportStaffAssignmentEvent(EventAction action) throws ADKException { LOG.info("StaffAssignment " + action.toString()); StaffAssignment staffAssignment = SifEntityGenerator.generateTestStaffAssignment(); if (action == EventAction.CHANGE) { staffAssignment.setChanged(); s... | EventReporter implements Publisher { public Event reportStaffAssignmentEvent(EventAction action) throws ADKException { LOG.info("StaffAssignment " + action.toString()); StaffAssignment staffAssignment = SifEntityGenerator.generateTestStaffAssignment(); if (action == EventAction.CHANGE) { staffAssignment.setChanged(); s... | EventReporter implements Publisher { public Event reportStaffAssignmentEvent(EventAction action) throws ADKException { LOG.info("StaffAssignment " + action.toString()); StaffAssignment staffAssignment = SifEntityGenerator.generateTestStaffAssignment(); if (action == EventAction.CHANGE) { staffAssignment.setChanged(); s... |
@Test public void runReportEmploymentRecordEventTests() throws ADKException { Class<? extends SIFDataObject> expectedClass = EmploymentRecord.class; String expectedId = SifEntityGenerator.TEST_EMPLOYMENTRECORD_REFID; EventAction eventAction = EventAction.ADD; Event sentEvent = eventReporter.reportEmploymentRecordEvent(... | public Event reportEmploymentRecordEvent(EventAction action) throws ADKException { LOG.info("EmploymentRecord " + action.toString()); EmploymentRecord employmentRecord = SifEntityGenerator.generateTestEmploymentRecord(); if (action == EventAction.CHANGE) { employmentRecord.setChanged(); employmentRecord.setPositionNumb... | EventReporter implements Publisher { public Event reportEmploymentRecordEvent(EventAction action) throws ADKException { LOG.info("EmploymentRecord " + action.toString()); EmploymentRecord employmentRecord = SifEntityGenerator.generateTestEmploymentRecord(); if (action == EventAction.CHANGE) { employmentRecord.setChange... | EventReporter implements Publisher { public Event reportEmploymentRecordEvent(EventAction action) throws ADKException { LOG.info("EmploymentRecord " + action.toString()); EmploymentRecord employmentRecord = SifEntityGenerator.generateTestEmploymentRecord(); if (action == EventAction.CHANGE) { employmentRecord.setChange... | EventReporter implements Publisher { public Event reportEmploymentRecordEvent(EventAction action) throws ADKException { LOG.info("EmploymentRecord " + action.toString()); EmploymentRecord employmentRecord = SifEntityGenerator.generateTestEmploymentRecord(); if (action == EventAction.CHANGE) { employmentRecord.setChange... | EventReporter implements Publisher { public Event reportEmploymentRecordEvent(EventAction action) throws ADKException { LOG.info("EmploymentRecord " + action.toString()); EmploymentRecord employmentRecord = SifEntityGenerator.generateTestEmploymentRecord(); if (action == EventAction.CHANGE) { employmentRecord.setChange... |
@Test public void testshouldExtractEntityBeforeAndAfterTreatment() { Map<String, Object> entityBody = new HashMap<String, Object>(); entityBody.put(ParameterConstants.SCHOOL_YEAR, "2009-2010"); Entity attendance = Mockito.mock(Entity.class); Mockito.when(attendance.getType()).thenReturn(EntityNames.ATTENDANCE); Mockito... | @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { String schoolYear = null; if (entity.getBody().containsKey("schoolYearAttendance")) { schoolYear = (String) ((List<Map<String, Object>>) entity.getBody().get("schoolYearAttendance")).get(0).get("schoolYear"); } else { schoolYear = EntityDateHelp... | AttendanceExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { String schoolYear = null; if (entity.getBody().containsKey("schoolYearAttendance")) { schoolYear = (String) ((List<Map<String, Object>>) entity.getBody().get("schoolYearAttendance")).get(0).... | AttendanceExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { String schoolYear = null; if (entity.getBody().containsKey("schoolYearAttendance")) { schoolYear = (String) ((List<Map<String, Object>>) entity.getBody().get("schoolYearAttendance")).get(0).... | AttendanceExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { String schoolYear = null; if (entity.getBody().containsKey("schoolYearAttendance")) { schoolYear = (String) ((List<Map<String, Object>>) entity.getBody().get("schoolYearAttendance")).get(0).... | AttendanceExtractVerifier implements ExtractVerifier { @Override public boolean shouldExtract(Entity entity, DateTime upToDate) { String schoolYear = null; if (entity.getBody().containsKey("schoolYearAttendance")) { schoolYear = (String) ((List<Map<String, Object>>) entity.getBody().get("schoolYearAttendance")).get(0).... |
@Test public void runReportEmployeeAssignmentEventTests() throws ADKException { Class<? extends SIFDataObject> expectedClass = EmployeeAssignment.class; String expectedId = SifEntityGenerator.TEST_EMPLOYEEASSIGNMENT_REFID; EventAction eventAction = EventAction.ADD; Event sentEvent = eventReporter.reportEmployeeAssignme... | public Event reportEmployeeAssignmentEvent(EventAction action) throws ADKException { LOG.info("EmployeeAssignment " + action.toString()); EmployeeAssignment employeeAssignment = SifEntityGenerator.generateTestEmployeeAssignment(); if (action == EventAction.CHANGE) { employeeAssignment.setChanged(); employeeAssignment.s... | EventReporter implements Publisher { public Event reportEmployeeAssignmentEvent(EventAction action) throws ADKException { LOG.info("EmployeeAssignment " + action.toString()); EmployeeAssignment employeeAssignment = SifEntityGenerator.generateTestEmployeeAssignment(); if (action == EventAction.CHANGE) { employeeAssignme... | EventReporter implements Publisher { public Event reportEmployeeAssignmentEvent(EventAction action) throws ADKException { LOG.info("EmployeeAssignment " + action.toString()); EmployeeAssignment employeeAssignment = SifEntityGenerator.generateTestEmployeeAssignment(); if (action == EventAction.CHANGE) { employeeAssignme... | EventReporter implements Publisher { public Event reportEmployeeAssignmentEvent(EventAction action) throws ADKException { LOG.info("EmployeeAssignment " + action.toString()); EmployeeAssignment employeeAssignment = SifEntityGenerator.generateTestEmployeeAssignment(); if (action == EventAction.CHANGE) { employeeAssignme... | EventReporter implements Publisher { public Event reportEmployeeAssignmentEvent(EventAction action) throws ADKException { LOG.info("EmployeeAssignment " + action.toString()); EmployeeAssignment employeeAssignment = SifEntityGenerator.generateTestEmployeeAssignment(); if (action == EventAction.CHANGE) { employeeAssignme... |
@Test public void testReportEventValidFile() throws ADKException { URL url = getClass().getResource("/element_xml/StudentPersonal.xml"); String validFilename = url.getPath(); String eventActionStr = EventAction.ADD.toString(); Event event = eventReporter.reportEvent(validFilename, eventActionStr); Assert.assertNotNull(... | public Event reportEvent(String messageFile, String eventAction) throws ADKException { Event event = CustomEventGenerator.generateEvent(messageFile, EventAction.valueOf(eventAction)); if (event == null) { LOG.error("Null event can not be reported"); return null; } if (zone.isConnected()) { zone.reportEvent(event); } el... | EventReporter implements Publisher { public Event reportEvent(String messageFile, String eventAction) throws ADKException { Event event = CustomEventGenerator.generateEvent(messageFile, EventAction.valueOf(eventAction)); if (event == null) { LOG.error("Null event can not be reported"); return null; } if (zone.isConnect... | EventReporter implements Publisher { public Event reportEvent(String messageFile, String eventAction) throws ADKException { Event event = CustomEventGenerator.generateEvent(messageFile, EventAction.valueOf(eventAction)); if (event == null) { LOG.error("Null event can not be reported"); return null; } if (zone.isConnect... | EventReporter implements Publisher { public Event reportEvent(String messageFile, String eventAction) throws ADKException { Event event = CustomEventGenerator.generateEvent(messageFile, EventAction.valueOf(eventAction)); if (event == null) { LOG.error("Null event can not be reported"); return null; } if (zone.isConnect... | EventReporter implements Publisher { public Event reportEvent(String messageFile, String eventAction) throws ADKException { Event event = CustomEventGenerator.generateEvent(messageFile, EventAction.valueOf(eventAction)); if (event == null) { LOG.error("Null event can not be reported"); return null; } if (zone.isConnect... |
@Test public void testReportEventInvalidFile() throws ADKException { String invalidFilename = "doesntexist.xml"; Event event = eventReporter.reportEvent(invalidFilename, EventAction.ADD.toString()); Assert.assertNull(event); Mockito.verify(zone, Mockito.times(0)).reportEvent(Mockito.eq(event)); } | public Event reportEvent(String messageFile, String eventAction) throws ADKException { Event event = CustomEventGenerator.generateEvent(messageFile, EventAction.valueOf(eventAction)); if (event == null) { LOG.error("Null event can not be reported"); return null; } if (zone.isConnected()) { zone.reportEvent(event); } el... | EventReporter implements Publisher { public Event reportEvent(String messageFile, String eventAction) throws ADKException { Event event = CustomEventGenerator.generateEvent(messageFile, EventAction.valueOf(eventAction)); if (event == null) { LOG.error("Null event can not be reported"); return null; } if (zone.isConnect... | EventReporter implements Publisher { public Event reportEvent(String messageFile, String eventAction) throws ADKException { Event event = CustomEventGenerator.generateEvent(messageFile, EventAction.valueOf(eventAction)); if (event == null) { LOG.error("Null event can not be reported"); return null; } if (zone.isConnect... | EventReporter implements Publisher { public Event reportEvent(String messageFile, String eventAction) throws ADKException { Event event = CustomEventGenerator.generateEvent(messageFile, EventAction.valueOf(eventAction)); if (event == null) { LOG.error("Null event can not be reported"); return null; } if (zone.isConnect... | EventReporter implements Publisher { public Event reportEvent(String messageFile, String eventAction) throws ADKException { Event event = CustomEventGenerator.generateEvent(messageFile, EventAction.valueOf(eventAction)); if (event == null) { LOG.error("Null event can not be reported"); return null; } if (zone.isConnect... |
@Test public void testIsValid() { AbstractBlacklistStrategy strategy = new CharacterBlacklistStrategy(); List<String> badStringList = createBadStringList(); List<Character> badCharList = createCharacterListFromStringList(badStringList); strategy.setInputCollection(badStringList); strategy.init(); runTestLoop(badCharLis... | @Override public boolean isValid(String context, String input) { if (input == null) { return false; } for (char c : input.toCharArray()) { if (characterSet.contains(c)) { return false; } } return true; } | CharacterBlacklistStrategy extends AbstractBlacklistStrategy { @Override public boolean isValid(String context, String input) { if (input == null) { return false; } for (char c : input.toCharArray()) { if (characterSet.contains(c)) { return false; } } return true; } } | CharacterBlacklistStrategy extends AbstractBlacklistStrategy { @Override public boolean isValid(String context, String input) { if (input == null) { return false; } for (char c : input.toCharArray()) { if (characterSet.contains(c)) { return false; } } return true; } CharacterBlacklistStrategy(); } | CharacterBlacklistStrategy extends AbstractBlacklistStrategy { @Override public boolean isValid(String context, String input) { if (input == null) { return false; } for (char c : input.toCharArray()) { if (characterSet.contains(c)) { return false; } } return true; } CharacterBlacklistStrategy(); @Override boolean isVal... | CharacterBlacklistStrategy extends AbstractBlacklistStrategy { @Override public boolean isValid(String context, String input) { if (input == null) { return false; } for (char c : input.toCharArray()) { if (characterSet.contains(c)) { return false; } } return true; } CharacterBlacklistStrategy(); @Override boolean isVal... |
@Test public void testIsValid() { AbstractBlacklistStrategy strategy = new RegexBlacklistStrategy(); List<String> badRegexStringList = createBadRegexStringList(); strategy.setInputCollection(badRegexStringList); strategy.init(); List<String> badStringList = createBadStringList(); runTestLoop(badStringList, strategy, fa... | @Override public boolean isValid(String context, String input) { if (input == null) { return false; } for (Pattern pattern : patternList) { Matcher matcher = pattern.matcher(input); if (matcher.find()) { return false; } } return true; } | RegexBlacklistStrategy extends AbstractBlacklistStrategy { @Override public boolean isValid(String context, String input) { if (input == null) { return false; } for (Pattern pattern : patternList) { Matcher matcher = pattern.matcher(input); if (matcher.find()) { return false; } } return true; } } | RegexBlacklistStrategy extends AbstractBlacklistStrategy { @Override public boolean isValid(String context, String input) { if (input == null) { return false; } for (Pattern pattern : patternList) { Matcher matcher = pattern.matcher(input); if (matcher.find()) { return false; } } return true; } RegexBlacklistStrategy()... | RegexBlacklistStrategy extends AbstractBlacklistStrategy { @Override public boolean isValid(String context, String input) { if (input == null) { return false; } for (Pattern pattern : patternList) { Matcher matcher = pattern.matcher(input); if (matcher.find()) { return false; } } return true; } RegexBlacklistStrategy()... | RegexBlacklistStrategy extends AbstractBlacklistStrategy { @Override public boolean isValid(String context, String input) { if (input == null) { return false; } for (Pattern pattern : patternList) { Matcher matcher = pattern.matcher(input); if (matcher.find()) { return false; } } return true; } RegexBlacklistStrategy()... |
@Test public void testGetSelfReferenceFields() { Entity srEntity = Mockito.mock(Entity.class); Mockito.when(srEntity.getType()).thenReturn(SELF_REFERENCE_COLLECTION); Entity nonSrEntity = Mockito.mock(Entity.class); Mockito.when(nonSrEntity.getType()).thenReturn(NON_SELF_REFERENCE_COLLECTION); String selfReferenceField... | public String getSelfReferenceFields(Entity entity) { String selfReferenceField = null; NeutralSchema schema = entitySchemaRegistry.getSchema(entity.getType()); if (schema != null) { AppInfo appInfo = schema.getAppInfo(); if (appInfo != null) { selfReferenceField = getSelfReferenceFields(schema, ""); } } return selfRef... | SelfReferenceExtractor { public String getSelfReferenceFields(Entity entity) { String selfReferenceField = null; NeutralSchema schema = entitySchemaRegistry.getSchema(entity.getType()); if (schema != null) { AppInfo appInfo = schema.getAppInfo(); if (appInfo != null) { selfReferenceField = getSelfReferenceFields(schema... | SelfReferenceExtractor { public String getSelfReferenceFields(Entity entity) { String selfReferenceField = null; NeutralSchema schema = entitySchemaRegistry.getSchema(entity.getType()); if (schema != null) { AppInfo appInfo = schema.getAppInfo(); if (appInfo != null) { selfReferenceField = getSelfReferenceFields(schema... | SelfReferenceExtractor { public String getSelfReferenceFields(Entity entity) { String selfReferenceField = null; NeutralSchema schema = entitySchemaRegistry.getSchema(entity.getType()); if (schema != null) { AppInfo appInfo = schema.getAppInfo(); if (appInfo != null) { selfReferenceField = getSelfReferenceFields(schema... | SelfReferenceExtractor { public String getSelfReferenceFields(Entity entity) { String selfReferenceField = null; NeutralSchema schema = entitySchemaRegistry.getSchema(entity.getType()); if (schema != null) { AppInfo appInfo = schema.getAppInfo(); if (appInfo != null) { selfReferenceField = getSelfReferenceFields(schema... |
@Test public void testTokenValidation() throws IllegalArgumentException { List<String> tokens = new ArrayList<String>(); tokens.add("validToken"); schema.getProperties().put(TokenSchema.TOKENS, tokens); String tokenEntity = "validToken"; assertTrue("Token entity validation failed", schema.validate(tokenEntity)); } | @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } | TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } } | TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } TokenSchema(); TokenSchema(Strin... | TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } TokenSchema(); TokenSchema(Strin... | TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } TokenSchema(); TokenSchema(Strin... |
@Test public void testTokenValidationFailure() throws IllegalArgumentException { List<String> tokens = new ArrayList<String>(); tokens.add("validToken"); schema.getProperties().put(TokenSchema.TOKENS, tokens); String tokenEntity = "invalidToken"; assertFalse("Expected TokenSchema invalid token validation failure did no... | @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } | TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } } | TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } TokenSchema(); TokenSchema(Strin... | TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } TokenSchema(); TokenSchema(Strin... | TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } TokenSchema(); TokenSchema(Strin... |
@Test public void testValidationOfBooleanFailure() { Boolean booleanEntity = true; assertFalse("Expected TokenSchema boolean validation failure did not succeed", schema.validate(booleanEntity)); } | @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } | TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } } | TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } TokenSchema(); TokenSchema(Strin... | TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } TokenSchema(); TokenSchema(Strin... | TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } TokenSchema(); TokenSchema(Strin... |
@Test public void testRetrieveDate() { Map<String, Object> body = new HashMap<String, Object>(); body.put(ParameterConstants.BEGIN_DATE, "01-01-01"); Entity studentProgramAssociation = new MongoEntity(EntityNames.STUDENT_PROGRAM_ASSOCIATION, body); Assert.assertEquals("01-01-01", EntityDateHelper.retrieveDate(studentPr... | public static String retrieveDate(Entity entity) { return (String) entity.getBody().get(EntityDates.ENTITY_DATE_FIELDS.get(entity.getType())); } | EntityDateHelper { public static String retrieveDate(Entity entity) { return (String) entity.getBody().get(EntityDates.ENTITY_DATE_FIELDS.get(entity.getType())); } } | EntityDateHelper { public static String retrieveDate(Entity entity) { return (String) entity.getBody().get(EntityDates.ENTITY_DATE_FIELDS.get(entity.getType())); } } | EntityDateHelper { public static String retrieveDate(Entity entity) { return (String) entity.getBody().get(EntityDates.ENTITY_DATE_FIELDS.get(entity.getType())); } static boolean shouldExtract(Entity entity, DateTime upToDate); static String retrieveDate(Entity entity); static boolean isPastOrCurrentDate(String entity... | EntityDateHelper { public static String retrieveDate(Entity entity) { return (String) entity.getBody().get(EntityDates.ENTITY_DATE_FIELDS.get(entity.getType())); } static boolean shouldExtract(Entity entity, DateTime upToDate); static String retrieveDate(Entity entity); static boolean isPastOrCurrentDate(String entity... |
@SuppressWarnings("unchecked") @Test public void testMapIdFieldKey() throws Exception { String[] fields = { "data.element.id" }; BSONObject elem = new BasicBSONObject("value", 7631); BSONObject data = new BasicBSONObject("element", elem); BSONObject entry = new BasicBSONObject("data", data); final BSONWritable entity =... | @Override public void map(T id, BSONWritable entity, Context context) throws IOException, InterruptedException { for (String field : idFields.values()) { BSONUtilities.removeField(entity, field); } context.write(id, entity); } | IDMapper extends Mapper<T, BSONWritable, T, BSONWritable> { @Override public void map(T id, BSONWritable entity, Context context) throws IOException, InterruptedException { for (String field : idFields.values()) { BSONUtilities.removeField(entity, field); } context.write(id, entity); } } | IDMapper extends Mapper<T, BSONWritable, T, BSONWritable> { @Override public void map(T id, BSONWritable entity, Context context) throws IOException, InterruptedException { for (String field : idFields.values()) { BSONUtilities.removeField(entity, field); } context.write(id, entity); } } | IDMapper extends Mapper<T, BSONWritable, T, BSONWritable> { @Override public void map(T id, BSONWritable entity, Context context) throws IOException, InterruptedException { for (String field : idFields.values()) { BSONUtilities.removeField(entity, field); } context.write(id, entity); } @Override void map(T id, BSONWri... | IDMapper extends Mapper<T, BSONWritable, T, BSONWritable> { @Override public void map(T id, BSONWritable entity, Context context) throws IOException, InterruptedException { for (String field : idFields.values()) { BSONUtilities.removeField(entity, field); } context.write(id, entity); } @Override void map(T id, BSONWri... |
@Test public void testValidationOfIntegerFailure() { Integer integerEntity = 0; assertFalse("Expected TokenSchema integer validation failure did not succeed", schema.validate(integerEntity)); } | @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } | TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } } | TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } TokenSchema(); TokenSchema(Strin... | TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } TokenSchema(); TokenSchema(Strin... | TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } TokenSchema(); TokenSchema(Strin... |
@Test public void testValidationOfFloatFailure() { Float floatEntity = new Float(0); assertFalse("Expected TokenSchema float validation failure did not succeed", schema.validate(floatEntity)); } | @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } | TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } } | TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } TokenSchema(); TokenSchema(Strin... | TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } TokenSchema(); TokenSchema(Strin... | TokenSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { return addError(this.matchesToken(entity), fieldName, entity, getQuotedTokens(), ErrorType.ENUMERATION_MISMATCH, errors); } TokenSchema(); TokenSchema(Strin... |
@Test public void testReferenceValidation() throws IllegalArgumentException { List<ValidationError> errors = new ArrayList<ValidationError>(); assertTrue("Reference entity validation failed", spySchema.validate(REFERENCE_FIELDNAME, UUID, errors, repo)); } | @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } boolean found = false; S... | ReferenceSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { ... | ReferenceSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { ... | ReferenceSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { ... | ReferenceSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { ... |
@Test public void testInvalidReferenceValidation() throws IllegalArgumentException { List<ValidationError> errors = new ArrayList<ValidationError>(); assertFalse("Invalid Reference entity validation failed", spySchema.validate(REFERENCE_FIELDNAME, "45679", errors, repo)); } | @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } boolean found = false; S... | ReferenceSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { ... | ReferenceSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { ... | ReferenceSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { ... | ReferenceSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { ... |
@Test public void testNullReferenceValidation() throws IllegalArgumentException { List<ValidationError> errors = new ArrayList<ValidationError>(); assertFalse("Null reference should not be valid", spySchema.validate(REFERENCE_FIELDNAME, null, errors, repo)); } | @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } boolean found = false; S... | ReferenceSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { ... | ReferenceSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { ... | ReferenceSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { ... | ReferenceSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { ... |
@Test public void testNonStringReferenceValidation() throws IllegalArgumentException { List<ValidationError> errors = new ArrayList<ValidationError>(); assertFalse("Non-string reference should not be valid", spySchema.validate(REFERENCE_FIELDNAME, new Integer(0), errors, repo)); } | @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } boolean found = false; S... | ReferenceSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { ... | ReferenceSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { ... | ReferenceSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { ... | ReferenceSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { ... |
@Test public void testEmptyStringReferenceValidation() throws IllegalArgumentException { List<ValidationError> errors = new ArrayList<ValidationError>(); assertFalse("Non-string reference should not be valid", spySchema.validate(REFERENCE_FIELDNAME, "", errors, repo)); } | @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } boolean found = false; S... | ReferenceSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { ... | ReferenceSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { ... | ReferenceSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { ... | ReferenceSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValidReference = isValidReference(entity); if (!addError(isValidReference, fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { ... |
@Test public void testConvert() throws Exception { long value = 10L; Object convertedValue = this.schema.convert("" + value); assertTrue(convertedValue instanceof Long); Long convertedInput = (Long) convertedValue; assertTrue(convertedInput.longValue() == value); } | @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (NumberFormatException nfe) { throw (IllegalArgumentEx... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... |
@Test(expected = IllegalArgumentException.class) public void testBadConvert() { this.schema.convert("INVALID INPUT"); } | @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (NumberFormatException nfe) { throw (IllegalArgumentEx... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... |
@Test public void testNonConvert() { Object convertedValue = this.schema.convert(12345L); assertTrue(convertedValue instanceof Long); } | @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (NumberFormatException nfe) { throw (IllegalArgumentEx... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... |
@Test public void testIsPastOrCurrentDateWithDate() { Assert.assertTrue(EntityDateHelper.isPastOrCurrentDate("2010-05-23", DateTime.parse("2011-05-23", DateHelper.getDateTimeFormat()), EntityNames.DISCIPLINE_INCIDENT)); Assert.assertTrue(EntityDateHelper.isPastOrCurrentDate("2011-05-23", DateTime.parse("2011-05-23", Da... | public static boolean isPastOrCurrentDate(String entityDate, DateTime upToDate, String type) { DateTime finalUpToDate = (upToDate == null) ? DateTime.now() : upToDate; if (YEAR_BASED_ENTITIES.contains(type)) { return isBeforeOrEqualYear(entityDate, finalUpToDate.year().get()); } else { return isBeforeOrEqualDate(entity... | EntityDateHelper { public static boolean isPastOrCurrentDate(String entityDate, DateTime upToDate, String type) { DateTime finalUpToDate = (upToDate == null) ? DateTime.now() : upToDate; if (YEAR_BASED_ENTITIES.contains(type)) { return isBeforeOrEqualYear(entityDate, finalUpToDate.year().get()); } else { return isBefor... | EntityDateHelper { public static boolean isPastOrCurrentDate(String entityDate, DateTime upToDate, String type) { DateTime finalUpToDate = (upToDate == null) ? DateTime.now() : upToDate; if (YEAR_BASED_ENTITIES.contains(type)) { return isBeforeOrEqualYear(entityDate, finalUpToDate.year().get()); } else { return isBefor... | EntityDateHelper { public static boolean isPastOrCurrentDate(String entityDate, DateTime upToDate, String type) { DateTime finalUpToDate = (upToDate == null) ? DateTime.now() : upToDate; if (YEAR_BASED_ENTITIES.contains(type)) { return isBeforeOrEqualYear(entityDate, finalUpToDate.year().get()); } else { return isBefor... | EntityDateHelper { public static boolean isPastOrCurrentDate(String entityDate, DateTime upToDate, String type) { DateTime finalUpToDate = (upToDate == null) ? DateTime.now() : upToDate; if (YEAR_BASED_ENTITIES.contains(type)) { return isBeforeOrEqualYear(entityDate, finalUpToDate.year().get()); } else { return isBefor... |
@Test public void testLongConverter() { long data = 12345L; int intData = (int) data; assertTrue("Failure returning same object", this.schema.convert(data).equals(data)); assertTrue("Failure parsing long from integer", this.schema.convert(intData).equals(data)); assertTrue("Failure parsing long data", this.schema.conve... | @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (NumberFormatException nfe) { throw (IllegalArgumentEx... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... |
@Test(expected = IllegalArgumentException.class) public void testInvalidStringThrowsException() throws IllegalArgumentException { this.schema.convert("INVALID INPUT"); } | @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (NumberFormatException nfe) { throw (IllegalArgumentEx... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... |
@Test(expected = IllegalArgumentException.class) public void testUnsupportedObjectTypeThrowsException() throws IllegalArgumentException { this.schema.convert(new Object()); } | @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (NumberFormatException nfe) { throw (IllegalArgumentEx... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... | LongSchema extends PrimitiveNumericSchema<Long> { @Override public Object convert(Object value) { if (value instanceof Integer) { return ((Integer) value).longValue(); } else if (value instanceof Long) { return (Long) value; } else if (value instanceof String) { try { return Long.parseLong((String) value); } catch (Num... |
@Test public void testStringValidation() throws IllegalArgumentException { String stringEntity = "test"; assertTrue("String entity validation failed", schema.validate(stringEntity)); } | @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) entity; if (this.getProperties() != nul... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... |
@Test public void testValidationOfBooleanFailure() { Boolean booleanEntity = true; assertFalse("Expected StringSchema boolean validation failure did not succeed", schema.validate(booleanEntity)); } | @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) entity; if (this.getProperties() != nul... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... |
@Test public void testValidationOfIntegerFailure() { Integer integerEntity = 0; assertFalse("Expected StringSchema integer validation failure did not succeed", schema.validate(integerEntity)); } | @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) entity; if (this.getProperties() != nul... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... |
@Test public void testValidationOfFloatFailure() { Float floatEntity = new Float(0); assertFalse("Expected StringSchema float validation failure did not succeed", schema.validate(floatEntity)); } | @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) entity; if (this.getProperties() != nul... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... |
@Test public void testRestrictions() { schema.getProperties().put(Restriction.MIN_LENGTH.getValue(), "2"); schema.getProperties().put(Restriction.MAX_LENGTH.getValue(), "4"); assertTrue(schema.validate("12")); assertTrue(schema.validate("1234")); assertFalse(schema.validate("1")); assertFalse(schema.validate("12345"));... | @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) entity; if (this.getProperties() != nul... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... |
@Test public void testStrictBlacklist() { AppInfo info = Mockito.mock(AppInfo.class); Mockito.when(info.isRelaxedBlacklisted()).thenReturn(false); Mockito.when(info.getType()).thenReturn(AnnotationType.APPINFO); AbstractBlacklistStrategy mockStrictStrategy = Mockito.mock(AbstractBlacklistStrategy.class); Mockito.when(m... | @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) entity; if (this.getProperties() != nul... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... |
@Test public void testRelaxedBlacklist() { AppInfo info = Mockito.mock(AppInfo.class); Mockito.when(info.isRelaxedBlacklisted()).thenReturn(true); Mockito.when(info.getType()).thenReturn(AnnotationType.APPINFO); AbstractBlacklistStrategy mockStrictStrategy = Mockito.mock(AbstractBlacklistStrategy.class); Mockito.when(m... | @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) entity; if (this.getProperties() != nul... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... | StringSchema extends NeutralSchema { @Override protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { if (!addError(String.class.isInstance(entity), fieldName, entity, "String", ErrorType.INVALID_DATATYPE, errors)) { return false; } String data = (String) en... |
@Test public void testIsPastOrCurrentDateWithYear() { DateTime dt = DateTime.now(); Assert.assertTrue(EntityDateHelper.isPastOrCurrentDate("2009-2010", DateTime.parse("2011-05-23", DateHelper.getDateTimeFormat()), EntityNames.GRADE)); Assert.assertTrue(EntityDateHelper.isPastOrCurrentDate("2010-2011", DateTime.parse("2... | public static boolean isPastOrCurrentDate(String entityDate, DateTime upToDate, String type) { DateTime finalUpToDate = (upToDate == null) ? DateTime.now() : upToDate; if (YEAR_BASED_ENTITIES.contains(type)) { return isBeforeOrEqualYear(entityDate, finalUpToDate.year().get()); } else { return isBeforeOrEqualDate(entity... | EntityDateHelper { public static boolean isPastOrCurrentDate(String entityDate, DateTime upToDate, String type) { DateTime finalUpToDate = (upToDate == null) ? DateTime.now() : upToDate; if (YEAR_BASED_ENTITIES.contains(type)) { return isBeforeOrEqualYear(entityDate, finalUpToDate.year().get()); } else { return isBefor... | EntityDateHelper { public static boolean isPastOrCurrentDate(String entityDate, DateTime upToDate, String type) { DateTime finalUpToDate = (upToDate == null) ? DateTime.now() : upToDate; if (YEAR_BASED_ENTITIES.contains(type)) { return isBeforeOrEqualYear(entityDate, finalUpToDate.year().get()); } else { return isBefor... | EntityDateHelper { public static boolean isPastOrCurrentDate(String entityDate, DateTime upToDate, String type) { DateTime finalUpToDate = (upToDate == null) ? DateTime.now() : upToDate; if (YEAR_BASED_ENTITIES.contains(type)) { return isBeforeOrEqualYear(entityDate, finalUpToDate.year().get()); } else { return isBefor... | EntityDateHelper { public static boolean isPastOrCurrentDate(String entityDate, DateTime upToDate, String type) { DateTime finalUpToDate = (upToDate == null) ? DateTime.now() : upToDate; if (YEAR_BASED_ENTITIES.contains(type)) { return isBeforeOrEqualYear(entityDate, finalUpToDate.year().get()); } else { return isBefor... |
@Test public void testRequiredValue() { ChoiceSchema choice = new ChoiceSchema(1, 1); choice.addField("aString", new StringSchema()); choice.addField("aLong", new LongSchema()); choice.addField("aDouble", new DoubleSchema()); Map<String, Object> data = new HashMap<String, Object>(); data.put("aString", "abc"); assertTr... | @SuppressWarnings({ "unchecked", "rawtypes" }) @Override protected boolean validate(String fieldName, Object entity_in, List<ValidationError> errors, Repository<Entity> repo) { Object entity = entity_in; if (entity instanceof Set) { entity = new ArrayList<Object>((Set) entity); } if (getMaxOccurs() == 1) { if (getMinOc... | ChoiceSchema extends NeutralSchema { @SuppressWarnings({ "unchecked", "rawtypes" }) @Override protected boolean validate(String fieldName, Object entity_in, List<ValidationError> errors, Repository<Entity> repo) { Object entity = entity_in; if (entity instanceof Set) { entity = new ArrayList<Object>((Set) entity); } if... | ChoiceSchema extends NeutralSchema { @SuppressWarnings({ "unchecked", "rawtypes" }) @Override protected boolean validate(String fieldName, Object entity_in, List<ValidationError> errors, Repository<Entity> repo) { Object entity = entity_in; if (entity instanceof Set) { entity = new ArrayList<Object>((Set) entity); } if... | ChoiceSchema extends NeutralSchema { @SuppressWarnings({ "unchecked", "rawtypes" }) @Override protected boolean validate(String fieldName, Object entity_in, List<ValidationError> errors, Repository<Entity> repo) { Object entity = entity_in; if (entity instanceof Set) { entity = new ArrayList<Object>((Set) entity); } if... | ChoiceSchema extends NeutralSchema { @SuppressWarnings({ "unchecked", "rawtypes" }) @Override protected boolean validate(String fieldName, Object entity_in, List<ValidationError> errors, Repository<Entity> repo) { Object entity = entity_in; if (entity instanceof Set) { entity = new ArrayList<Object>((Set) entity); } if... |
@Test public void testListValue() { ChoiceSchema choice = new ChoiceSchema(1, 5); choice.addField("aString", new StringSchema()); choice.addField("aLong", new LongSchema()); choice.addField("aDouble", new DoubleSchema()); List<Map<String, Object>> data = new ArrayList<Map<String, Object>>(); assertFalse(choice.validate... | @SuppressWarnings({ "unchecked", "rawtypes" }) @Override protected boolean validate(String fieldName, Object entity_in, List<ValidationError> errors, Repository<Entity> repo) { Object entity = entity_in; if (entity instanceof Set) { entity = new ArrayList<Object>((Set) entity); } if (getMaxOccurs() == 1) { if (getMinOc... | ChoiceSchema extends NeutralSchema { @SuppressWarnings({ "unchecked", "rawtypes" }) @Override protected boolean validate(String fieldName, Object entity_in, List<ValidationError> errors, Repository<Entity> repo) { Object entity = entity_in; if (entity instanceof Set) { entity = new ArrayList<Object>((Set) entity); } if... | ChoiceSchema extends NeutralSchema { @SuppressWarnings({ "unchecked", "rawtypes" }) @Override protected boolean validate(String fieldName, Object entity_in, List<ValidationError> errors, Repository<Entity> repo) { Object entity = entity_in; if (entity instanceof Set) { entity = new ArrayList<Object>((Set) entity); } if... | ChoiceSchema extends NeutralSchema { @SuppressWarnings({ "unchecked", "rawtypes" }) @Override protected boolean validate(String fieldName, Object entity_in, List<ValidationError> errors, Repository<Entity> repo) { Object entity = entity_in; if (entity instanceof Set) { entity = new ArrayList<Object>((Set) entity); } if... | ChoiceSchema extends NeutralSchema { @SuppressWarnings({ "unchecked", "rawtypes" }) @Override protected boolean validate(String fieldName, Object entity_in, List<ValidationError> errors, Repository<Entity> repo) { Object entity = entity_in; if (entity instanceof Set) { entity = new ArrayList<Object>((Set) entity); } if... |
@Test public void testComplexSchemas() { ComplexSchema c1 = new ComplexSchema(); c1.addField("s1", new StringSchema()); c1.addField("l1", new LongSchema()); ComplexSchema c2 = new ComplexSchema(); c2.addField("s2", new StringSchema()); c2.addField("l2", new LongSchema()); ChoiceSchema choice = new ChoiceSchema(0, 1); c... | @SuppressWarnings({ "unchecked", "rawtypes" }) @Override protected boolean validate(String fieldName, Object entity_in, List<ValidationError> errors, Repository<Entity> repo) { Object entity = entity_in; if (entity instanceof Set) { entity = new ArrayList<Object>((Set) entity); } if (getMaxOccurs() == 1) { if (getMinOc... | ChoiceSchema extends NeutralSchema { @SuppressWarnings({ "unchecked", "rawtypes" }) @Override protected boolean validate(String fieldName, Object entity_in, List<ValidationError> errors, Repository<Entity> repo) { Object entity = entity_in; if (entity instanceof Set) { entity = new ArrayList<Object>((Set) entity); } if... | ChoiceSchema extends NeutralSchema { @SuppressWarnings({ "unchecked", "rawtypes" }) @Override protected boolean validate(String fieldName, Object entity_in, List<ValidationError> errors, Repository<Entity> repo) { Object entity = entity_in; if (entity instanceof Set) { entity = new ArrayList<Object>((Set) entity); } if... | ChoiceSchema extends NeutralSchema { @SuppressWarnings({ "unchecked", "rawtypes" }) @Override protected boolean validate(String fieldName, Object entity_in, List<ValidationError> errors, Repository<Entity> repo) { Object entity = entity_in; if (entity instanceof Set) { entity = new ArrayList<Object>((Set) entity); } if... | ChoiceSchema extends NeutralSchema { @SuppressWarnings({ "unchecked", "rawtypes" }) @Override protected boolean validate(String fieldName, Object entity_in, List<ValidationError> errors, Repository<Entity> repo) { Object entity = entity_in; if (entity instanceof Set) { entity = new ArrayList<Object>((Set) entity); } if... |
@Test public void testDateTimeStringValidation() throws IllegalArgumentException { String dateTimeString = "2012-01-01T12:00:00-05:00"; assertTrue("DateTime entity validation failed", schema.validate(dateTimeString)); } | protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } return addError(isValid, fieldName, enti... | DateTimeSchema extends NeutralSchema { protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } r... | DateTimeSchema extends NeutralSchema { protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } r... | DateTimeSchema extends NeutralSchema { protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } r... | DateTimeSchema extends NeutralSchema { protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } r... |
@Test public void testDateTimeValidation() { Calendar calendar = Calendar.getInstance(); String dateTimeString = javax.xml.bind.DatatypeConverter.printTime(calendar); assertTrue("DateTime entity validation failed", schema.validate(dateTimeString)); } | protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } return addError(isValid, fieldName, enti... | DateTimeSchema extends NeutralSchema { protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } r... | DateTimeSchema extends NeutralSchema { protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } r... | DateTimeSchema extends NeutralSchema { protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } r... | DateTimeSchema extends NeutralSchema { protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } r... |
@Test public void testValidationOfStringFailure() { String stringEntity = ""; assertFalse("Expected DateTimeSchema string validation failure did not succeed", schema.validate(stringEntity)); } | protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } return addError(isValid, fieldName, enti... | DateTimeSchema extends NeutralSchema { protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } r... | DateTimeSchema extends NeutralSchema { protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } r... | DateTimeSchema extends NeutralSchema { protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } r... | DateTimeSchema extends NeutralSchema { protected boolean validate(String fieldName, Object entity, List<ValidationError> errors, Repository<Entity> repo) { boolean isValid; try { javax.xml.bind.DatatypeConverter.parseDateTime((String) entity); isValid = true; } catch (IllegalArgumentException e2) { isValid = false; } r... |
@Test public void testGetNaturalKeyFields() throws NoNaturalKeysDefinedException { Entity e = setup(); Map<String, Boolean> naturalKeyFields = naturalKeyExtractor.getNaturalKeyFields(e); Assert.assertEquals(1, naturalKeyFields.size()); Assert.assertEquals("someField", naturalKeyFields.entrySet().iterator().next().getKe... | @Override public Map<String, Boolean> getNaturalKeyFields(Entity entity) throws NoNaturalKeysDefinedException { Map<String, Boolean> naturalKeyFields = null; NeutralSchema schema = entitySchemaRegistry.getSchema(entity.getType()); if (schema != null) { AppInfo appInfo = schema.getAppInfo(); if (appInfo != null) { if (a... | NaturalKeyExtractor implements INaturalKeyExtractor { @Override public Map<String, Boolean> getNaturalKeyFields(Entity entity) throws NoNaturalKeysDefinedException { Map<String, Boolean> naturalKeyFields = null; NeutralSchema schema = entitySchemaRegistry.getSchema(entity.getType()); if (schema != null) { AppInfo appIn... | NaturalKeyExtractor implements INaturalKeyExtractor { @Override public Map<String, Boolean> getNaturalKeyFields(Entity entity) throws NoNaturalKeysDefinedException { Map<String, Boolean> naturalKeyFields = null; NeutralSchema schema = entitySchemaRegistry.getSchema(entity.getType()); if (schema != null) { AppInfo appIn... | NaturalKeyExtractor implements INaturalKeyExtractor { @Override public Map<String, Boolean> getNaturalKeyFields(Entity entity) throws NoNaturalKeysDefinedException { Map<String, Boolean> naturalKeyFields = null; NeutralSchema schema = entitySchemaRegistry.getSchema(entity.getType()); if (schema != null) { AppInfo appIn... | NaturalKeyExtractor implements INaturalKeyExtractor { @Override public Map<String, Boolean> getNaturalKeyFields(Entity entity) throws NoNaturalKeysDefinedException { Map<String, Boolean> naturalKeyFields = null; NeutralSchema schema = entitySchemaRegistry.getSchema(entity.getType()); if (schema != null) { AppInfo appIn... |
@Test public void testGetNaturalKeyDescriptor() throws NoNaturalKeysDefinedException { Entity e = setup(); TenantContext.setTenantId("someTenant"); NaturalKeyDescriptor desc = naturalKeyExtractor.getNaturalKeyDescriptor(e); Map<String, String> naturalKeys = desc.getNaturalKeys(); Assert.assertEquals(COLLECTION_TYPE, de... | @Override public NaturalKeyDescriptor getNaturalKeyDescriptor(Entity entity) throws NoNaturalKeysDefinedException { Map<String, String> map = getNaturalKeys(entity); if (map == null) { NaturalKeyDescriptor naturalKeyDescriptor = new NaturalKeyDescriptor(); naturalKeyDescriptor.setNaturalKeysNotNeeded(true); return natu... | NaturalKeyExtractor implements INaturalKeyExtractor { @Override public NaturalKeyDescriptor getNaturalKeyDescriptor(Entity entity) throws NoNaturalKeysDefinedException { Map<String, String> map = getNaturalKeys(entity); if (map == null) { NaturalKeyDescriptor naturalKeyDescriptor = new NaturalKeyDescriptor(); naturalKe... | NaturalKeyExtractor implements INaturalKeyExtractor { @Override public NaturalKeyDescriptor getNaturalKeyDescriptor(Entity entity) throws NoNaturalKeysDefinedException { Map<String, String> map = getNaturalKeys(entity); if (map == null) { NaturalKeyDescriptor naturalKeyDescriptor = new NaturalKeyDescriptor(); naturalKe... | NaturalKeyExtractor implements INaturalKeyExtractor { @Override public NaturalKeyDescriptor getNaturalKeyDescriptor(Entity entity) throws NoNaturalKeysDefinedException { Map<String, String> map = getNaturalKeys(entity); if (map == null) { NaturalKeyDescriptor naturalKeyDescriptor = new NaturalKeyDescriptor(); naturalKe... | NaturalKeyExtractor implements INaturalKeyExtractor { @Override public NaturalKeyDescriptor getNaturalKeyDescriptor(Entity entity) throws NoNaturalKeysDefinedException { Map<String, String> map = getNaturalKeys(entity); if (map == null) { NaturalKeyDescriptor naturalKeyDescriptor = new NaturalKeyDescriptor(); naturalKe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.