Refactor TmfCheckpoint and dependencies
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core.tests / src / org / eclipse / linuxtools / tmf / core / tests / trace / TmfContextTest.java
index 558211dd7ff2ad61d8742954bbaf191d71aa06e8..9eb3db9115c96930128d2e0509ab38eeedeb9ec6 100644 (file)
@@ -117,6 +117,19 @@ public class TmfContextTest extends TestCase {
         assertEquals("getRank", fRank3, context3.getRank());
     }
 
+    public void testTmfContextCopy2() {
+        try {
+            new TmfContext((TmfContext) null);
+            fail("Copy constructor: no exception");
+        }
+        catch (final IllegalArgumentException e) {
+            // pass
+        }
+        catch (final Exception e) {
+            fail("Copy constructor: wrong exception");
+        }
+    }
+
     // ------------------------------------------------------------------------
     // equals
     // ------------------------------------------------------------------------
@@ -232,6 +245,13 @@ public class TmfContextTest extends TestCase {
             assertEquals("clone", context1, fContext1);
             assertEquals("clone", context2, fContext2);
             assertEquals("clone", context3, fContext3);
+
+            context1.setLocation(null);
+            final TmfContext context4 = context1.clone();
+            assertEquals("clone", context1, context4);
+            assertNull(context1.getLocation());
+            assertNull(context4.getLocation());
+
         } catch (final InternalError e) {
             fail("clone()");
         }
This page took 0.024237 seconds and 5 git commands to generate.