コード例 #1
0
 @Test
 public void testCreateFieldDefinitionComparatorEqual() throws Exception {
   CronFieldName name = CronFieldName.DAY_OF_MONTH;
   FieldDefinition fieldDefinition1 = new FieldDefinition(name, mockConstraints);
   FieldDefinition fieldDefinition2 = new FieldDefinition(name, mock(FieldConstraints.class));
   assertEquals(name.getOrder(), name.getOrder());
   assertEquals(
       0,
       FieldDefinition.createFieldDefinitionComparator()
           .compare(fieldDefinition1, fieldDefinition2));
 }
コード例 #2
0
 @Test
 public void testCreateFieldDefinitionComparatorLesser() throws Exception {
   CronFieldName name1 = CronFieldName.DAY_OF_MONTH;
   CronFieldName name2 = CronFieldName.SECOND;
   FieldDefinition fieldDefinition1 = new FieldDefinition(name1, mockConstraints);
   FieldDefinition fieldDefinition2 = new FieldDefinition(name2, mock(FieldConstraints.class));
   assertNotEquals(name1.getOrder(), name2.getOrder());
   assertTrue(
       FieldDefinition.createFieldDefinitionComparator()
               .compare(fieldDefinition2, fieldDefinition1)
           < 0);
 }
コード例 #3
0
 @Test
 public void testGetConstraints() throws Exception {
   assertEquals(mockConstraints, fieldDefinition.getConstraints());
 }
コード例 #4
0
 @Test
 public void testCreateFieldDefinitionComparatorNotNull() throws Exception {
   assertNotNull(FieldDefinition.createFieldDefinitionComparator());
 }
コード例 #5
0
 @Test
 public void testGetFieldName() throws Exception {
   assertEquals(testFieldName, fieldDefinition.getFieldName());
 }