[Bug309731] Fixed a problem with generic requests and component registration/deregist...
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.tests / src / org / eclipse / linuxtools / tmf / tests / event / TmfEventContentTest.java
index 39102259034b887f36f5f37febb8028da7afb34a..6bd5b0a80e6ee83bb3bbd1ea74d3c31df63bf9b8 100644 (file)
@@ -156,6 +156,30 @@ public class TmfEventContentTest extends TestCase {
                assertTrue("equals", !fStubContent.equals(null));
        }
        
+       // ------------------------------------------------------------------------
+       // hashCode
+       // ------------------------------------------------------------------------
+
+       public void testHashCode() throws Exception {
+               assertTrue("hashCode", fBasicContent0.hashCode() == fBasicContent2.hashCode());
+               assertTrue("hashCode", fBasicContent0.hashCode() != fStubContent.hashCode());
+       }
+       
+       public void testHashCode2() throws Exception {
+               TmfEventContent basicContent0 = new TmfEventContent(null, fRawContent0);
+               TmfEventContent basicContent1 = new TmfEventContent(fEvent, null);
+               TmfEventContent basicContent2 = new TmfEventContent(null, null);
+
+               assertTrue("hashCode", fBasicContent0.hashCode() != basicContent0.hashCode());
+               assertTrue("hashCode", fBasicContent0.hashCode() != basicContent1.hashCode());
+               assertTrue("hashCode", fBasicContent0.hashCode() != basicContent2.hashCode());
+
+               assertTrue("hashCode", basicContent0.hashCode() != basicContent1.hashCode());
+               assertTrue("hashCode", basicContent0.hashCode() != basicContent2.hashCode());
+
+               assertTrue("hashCode", basicContent1.hashCode() != basicContent2.hashCode());
+       }
+       
        // ------------------------------------------------------------------------
        // toString
        // ------------------------------------------------------------------------
This page took 0.025042 seconds and 5 git commands to generate.