new Annotation[] {
Annotation.EMPTY_ANNOTATION, Annotation.EMPTY_ANNOTATION },
new Annotation[] {
- Annotation.EMPTY_ANNOTATION, Annotation.EMPTY_ANNOTATION } } };
+ Annotation.EMPTY_ANNOTATION, Annotation.EMPTY_ANNOTATION } },
+ {
+ new Annotation[] { null, null, null, null },
+ new Annotation[] { null, null, null, null } } };
}
@Test(groups = { "Functional" }, dataProvider = "matchingAnnotationsLists")
new Annotation(null, null, ' ', 0.0f) },
{
new Annotation(null, "", ' ', 0.0f),
- new Annotation("", null, ' ', 0.0f) } };
+ new Annotation("", null, ' ', 0.0f) },
+ { new Annotation(0f), Annotation.EMPTY_ANNOTATION },
+ { new Annotation(1f), new Annotation("", "", ' ', 1f, null) }, };
}
@Test(groups = { "Functional" }, dataProvider = "matchingAnnotations")
assert AnnotationsMatcher.annotationsEqual(first, second);
}
+ @DataProvider
+ public Object[][] mismatchingAnnotations()
+ {
+ return new Object[][] {
+ {
+ new Annotation("A", "aaa", 'A', 1f),
+ new Annotation("A", "aaa", 'B', 1f) },
+ { new Annotation(1f), new Annotation(2f) },
+ { new Annotation(1f), new Annotation("A", "", 'A', 1f) } };
+ }
+
+ @Test(groups = { "Functional" }, dataProvider = "mismatchingAnnotations")
+ public void testAnnotationsEqual_mismatchingAnnotations(Annotation first,
+ Annotation second)
+ {
+ assert !AnnotationsMatcher.annotationsEqual(first, second);
+ }
+
+ @Test(groups = { "Functional" })
+ public void testAnnotationsEqual_nullsMatch()
+ {
+ assert AnnotationsMatcher.annotationsEqual(null, null);
+ }
+
+ @Test(groups = { "Functional" })
+ public void testAnnotationsEqual_nullNotMatchEmpty()
+ {
+ assert !AnnotationsMatcher
+ .annotationsEqual(null, Annotation.EMPTY_ANNOTATION);
+ assert !AnnotationsMatcher
+ .annotationsEqual(Annotation.EMPTY_ANNOTATION, null);
+ }
+
@Test(groups = { "Functional" })
public void testAnnotationsEqual_compareNullDisplayCharToEmpty()
{