ctf: Hide internal functionalities of StringDefinition.
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core.tests / src / org / eclipse / linuxtools / ctf / core / tests / types / StringDefinitionTest.java
index a0fa11f280e2770c653ecfdcffb89d4c8272f57a..2d263ec20e4d3cd6bfdbc2519abd6eb44f4de26e 100644 (file)
 
 package org.eclipse.linuxtools.ctf.core.tests.types;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
 import org.eclipse.linuxtools.ctf.core.event.io.BitBuffer;
 import org.eclipse.linuxtools.ctf.core.event.types.IDefinitionScope;
 import org.eclipse.linuxtools.ctf.core.event.types.StringDeclaration;
 import org.eclipse.linuxtools.ctf.core.event.types.StringDefinition;
+import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -62,37 +64,36 @@ public class StringDefinitionTest {
      */
     @Test
     public void testGetDeclaration() {
-        fixture.setString(new StringBuilder());
         StringDeclaration result = fixture.getDeclaration();
         assertNotNull(result);
     }
 
     /**
-     * Run the StringBuilder getString() method test.
+     * Run the String getValue() method test.
      */
     @Test
-    public void testGetString() {
-        fixture.setString(new StringBuilder());
-        StringBuilder result = fixture.getString();
+    public void testGetValue() {
+        String result = fixture.getValue();
         assertNotNull(result);
     }
 
     /**
-     * Run the String getValue() method test.
+     * Run the String setValue() method test.
      */
     @Test
-    public void testGetValue() {
-        fixture.setString(new StringBuilder());
+    public void testSetValue() {
+        fixture.setValue("dummy");
         String result = fixture.getValue();
         assertNotNull(result);
+        assertEquals("dummy", result);
     }
 
     /**
      * Run the void read(BitBuffer) method test.
+     * @throws CTFReaderException error
      */
     @Test
-    public void testRead() {
-        fixture.setString(new StringBuilder());
+    public void testRead() throws CTFReaderException {
         BitBuffer input = new BitBuffer(java.nio.ByteBuffer.allocateDirect(128));
         fixture.read(input);
     }
@@ -102,27 +103,15 @@ public class StringDefinitionTest {
      */
     @Test
     public void testSetDeclaration() {
-        fixture.setString(new StringBuilder());
         StringDeclaration declaration = new StringDeclaration();
         fixture.setDeclaration(declaration);
     }
 
-    /**
-     * Run the void setString(StringBuilder) method test.
-     */
-    @Test
-    public void testSetString() {
-        fixture.setString(new StringBuilder());
-        StringBuilder string = new StringBuilder();
-        fixture.setString(string);
-    }
-
     /**
      * Run the String toString() method test.
      */
     @Test
     public void testToString() {
-        fixture.setString(new StringBuilder());
         String result = fixture.toString();
         assertNotNull(result);
     }
This page took 0.02442 seconds and 5 git commands to generate.