Rename xxx.lttng to xxx.lttng.core
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.tests / src / org / eclipse / linuxtools / lttng / tests / jni / JniMarkerFieldTest.java
index 03788b0cbf2062e62f4a62aadb3ba36f98be9977..f224c6fd3b475da433c93ed2b99baa57890d4bf2 100644 (file)
@@ -1,14 +1,14 @@
 
 package org.eclipse.linuxtools.lttng.tests.jni;
 
+
+import junit.framework.TestCase;
+
 import org.eclipse.linuxtools.lttng.jni.JniEvent;
-import org.eclipse.linuxtools.lttng.jni.JniException;
 import org.eclipse.linuxtools.lttng.jni.JniMarker;
 import org.eclipse.linuxtools.lttng.jni.JniMarkerField;
-import org.eclipse.linuxtools.lttng.jni.JniTrace;
-import org.eclipse.linuxtools.lttng.jni.Jni_C_Pointer;
-
-import junit.framework.TestCase;
+import org.eclipse.linuxtools.lttng.jni.exception.JniException;
+import org.eclipse.linuxtools.lttng.jni.factory.JniTraceFactory;
 
 /*
  Functions tested here :
@@ -22,6 +22,7 @@ import junit.framework.TestCase;
         public void printMarkerFieldInformation()
 */
 
+@SuppressWarnings("nls")
 public class JniMarkerFieldTest extends TestCase
 {
                private final static boolean printLttDebug = false;
@@ -37,7 +38,7 @@ public class JniMarkerFieldTest extends TestCase
                 // This trace should be valid
                 // We will read the first 2 event to have something interesting to test on
                 try {
-                        tmpEvent = new JniTrace(tracepath, printLttDebug).requestEventByName(eventName);
+                        tmpEvent = JniTraceFactory.getJniTrace(tracepath, null, printLttDebug).requestEventByName(eventName);
                         tmpEvent.readNextEvent();
                         tmpEvent.readNextEvent();
                         
@@ -53,32 +54,26 @@ public class JniMarkerFieldTest extends TestCase
                 
                 JniMarker tmpMarker = null;
                 
-                JniMarkerField tmpMarkerField1 = null;
-                JniMarkerField tmpMarkerField2 = null;
+                @SuppressWarnings("unused")
+                               JniMarkerField tmpMarkerField1 = null;
+                @SuppressWarnings("unused")
+                               JniMarkerField tmpMarkerField2 = null;
                 
                 // This event should be valid and will be used in test
                 try {
-                        tmpMarker = new JniTrace(tracepath, printLttDebug).requestEventByName(eventName).requestEventMarker();
+                        tmpMarker = JniTraceFactory.getJniTrace(tracepath, null, printLttDebug).requestEventByName(eventName).requestEventMarker();
                 }
                 catch( JniException e) { }
                 
-                // Test constructor with pointer on a wrong pointer
-                try {
-                        tmpMarkerField1 = new JniMarkerField( new Jni_C_Pointer(0) );
-                        fail("Construction with wrong pointer should fail!");
-                }
-                catch( JniException e) {
-                }
-                
                 // Test constructor with pointer on a correct pointer
                 try {
-                        tmpMarkerField1 = new JniMarkerField( tmpMarker.getMarkerFieldsArrayList().get(0).getMarkerFieldPtr() );
+                        tmpMarkerField1 = tmpMarker.allocateNewJniMarkerField( tmpMarker.getMarkerFieldsArrayList().get(0).getMarkerFieldPtr() );
                 }
                 catch( JniException e) {
                         fail("Construction with correct pointer failed!");
                 }
                 
-                
+                /*
                 // Test copy constructor
                 try {
                         tmpMarkerField1 = new JniMarkerField( tmpMarker.getMarkerFieldsArrayList().get(0) );
@@ -87,8 +82,8 @@ public class JniMarkerFieldTest extends TestCase
                 catch( Exception e) {
                         fail("Copy constructor failed!");
                 }
-                
                 assertSame("JniMarker name not same after using copy constructor", tmpMarkerField1.getField() , tmpMarkerField2.getField());
+                */
                 
         }
         
This page took 0.02494 seconds and 5 git commands to generate.