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;
*/
@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);
}
*/
@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);
}