// Constructors
// ------------------------------------------------------------------------
+ /**
+ *
+ */
public void testDefaultConstructor() {
final ITmfEventType type = new TmfEventType();
assertEquals("getContext", ITmfEventType.DEFAULT_CONTEXT_ID, type.getContext());
assertNull("getFieldName", type.getFieldName(0));
}
+ /**
+ *
+ */
public void testFullConstructor() {
final ITmfEventType type0 = new TmfEventType(fContext1, fTypeId1, TmfEventField.makeRoot(fLabels0));
assertEquals("getContext", fContext1, type0.getContext());
assertNull("getFieldName", type2.getFieldName(labels2.length));
}
+ /**
+ *
+ */
public void testConstructorCornerCases() {
try {
new TmfEventType(null, fTypeId1, null);
}
}
+ /**
+ *
+ */
public void testCopyConstructor() {
final TmfEventType original = new TmfEventType(fContext1, fTypeId1, TmfEventField.makeRoot(fLabels1));
final TmfEventType copy = new TmfEventType(original);
assertNull("getFieldName", copy.getFieldName(labels1.length));
}
+ /**
+ *
+ */
public void testCopyConstructorCornerCases() {
try {
new TmfEventType(null);
// clone
// ------------------------------------------------------------------------
- public static class MyEventType extends TmfEventType {
-
- @Override
- public boolean equals(final Object other) {
- return super.equals(other);
- }
-
- @Override
- public MyEventType clone() {
- return (MyEventType) super.clone();
- }
- }
-
- public void testClone() throws Exception {
+ /**
+ *
+ */
+ public void testClone() {
final ITmfEventType clone = fType1.clone();
assertTrue("clone", fType1.clone().equals(fType1));
assertEquals("clone", fType1, clone);
}
- public void testClone2() throws Exception {
+ /**
+ *
+ */
+ public void testClone2() {
final ITmfEventType type = new TmfEventType();
final ITmfEventType clone = type.clone();
// hashCode
// ------------------------------------------------------------------------
- public void testHashCode() throws Exception {
+ /**
+ *
+ */
+ public void testHashCode() {
final TmfEventType copy1 = new TmfEventType(fType0);
assertTrue("hashCode", fType0.hashCode() == copy1.hashCode());
// equals
// ------------------------------------------------------------------------
- public void testEqualsReflexivity() throws Exception {
+ /**
+ *
+ */
+ public void testEqualsReflexivity() {
assertTrue("equals", fType0.equals(fType0));
assertTrue("equals", fType3.equals(fType3));
assertFalse("equals", fType3.equals(fType0));
}
- public void testEqualsSymmetry() throws Exception {
+ /**
+ *
+ */
+ public void testEqualsSymmetry() {
final TmfEventType copy0 = new TmfEventType(fType0);
assertTrue("equals", fType0.equals(copy0));
assertTrue("equals", copy0.equals(fType0));
assertTrue("equals", copy2.equals(fType2));
}
- public void testEqualsTransivity() throws Exception {
+ /**
+ *
+ */
+ public void testEqualsTransivity() {
TmfEventType copy1 = new TmfEventType(fType1);
TmfEventType copy2 = new TmfEventType(copy1);
assertTrue("equals", fType1.equals(copy1));
assertTrue("equals", fType3.equals(copy2));
}
- public void testEqualsNull() throws Exception {
+ /**
+ *
+ */
+ public void testEqualsNull() {
assertFalse("equals", fType0.equals(null));
assertFalse("equals", fType3.equals(null));
}
- public void testNonEquals() throws Exception {
+ /**
+ *
+ */
+ public void testNonEquals() {
assertFalse("equals", fType0.equals(fType1));
assertFalse("equals", fType1.equals(fType2));
assertFalse("equals", fType2.equals(fType3));
assertFalse("equals", fType3.equals(fType0));
}
- public void testNonEqualsClasses() throws Exception {
+ /**
+ *
+ */
+ public void testNonEqualsClasses() {
assertFalse("equals", fType1.equals(fLabels1));
}
// toString
// ------------------------------------------------------------------------
+ /**
+ *
+ */
public void testToString() {
final String expected1 = "TmfEventType [fContext=" + ITmfEventType.DEFAULT_CONTEXT_ID +
", fTypeId=" + ITmfEventType.DEFAULT_TYPE_ID + "]";