@Test
public void testLookupArray() {
String name = INT_ID;
- AbstractArrayDefinition result = fixture.lookupArray2(name);
+ AbstractArrayDefinition result = fixture.lookupArrayDefinition(name);
assertNull(result);
}
@Test
public void testLookupFixedStringDefinition() {
String name = SEQUENCE_ID;
- AbstractArrayDefinition result = fixture.lookupArray2(name);
+ AbstractArrayDefinition result = fixture.lookupArrayDefinition(name);
assertNotNull(result);
}
*/
@Test
public void testLookupArray() {
- AbstractArrayDefinition result = fixture.lookupArray2(ENUM_3);
+ AbstractArrayDefinition result = fixture.lookupArrayDefinition(ENUM_3);
assertNull(result);
}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.ctf.core.event.scope;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
+
+/**
+ * A lttng specific speedup node (the packet header with ID and V) of a lexical
+ * scope
+ *
+ * @author Matthew Khouzam
+ * @since 3.1
+ */
+@NonNullByDefault
+public class EventHeaderScope extends LexicalScope {
+
+ /**
+ * Event header id string
+ */
+ public static final LexicalScope EVENT_HEADER_ID = new LexicalScope(EVENT_HEADER, "id"); //$NON-NLS-1$
+
+ /**
+ * Event header v as in variant string
+ */
+ public static final LexicalScope EVENT_HEADER_V = new EventHeaderVScope(EVENT_HEADER, "v"); //$NON-NLS-1$
+
+ /**
+ * The scope constructor
+ *
+ * @param parent
+ * The parent node, can be null, but shouldn't
+ * @param name
+ * the name of the field
+ */
+ public EventHeaderScope(LexicalScope parent, String name) {
+ super(parent, name);
+ }
+
+ @Override
+ @Nullable
+ public LexicalScope getChild(String name) {
+ if (name.equals(EVENT_HEADER_ID.getName())) {
+ return EVENT_HEADER_ID;
+ }
+ if (name.equals(EVENT_HEADER_V.getName())) {
+ return EVENT_HEADER_V;
+ }
+ return super.getChild(name);
+ }
+
+ @Override
+ public String toString() {
+ return "event.header"; //$NON-NLS-1$
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.ctf.core.event.scope;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
+
+/**
+ * A lttng specific speedup node (v variant for event headers) of a lexical
+ * scope they normally contain a timestamp
+ *
+ * @author Matthew Khouzam
+ * @since 3.1
+ */
+@NonNullByDefault
+public class EventHeaderVScope extends LexicalScope {
+
+ /**
+ * Packet header v id string
+ */
+ public static final LexicalScope PACKET_HEADER_V_ID = new LexicalScope(PACKET_HEADER, "id"); //$NON-NLS-1$
+ /**
+ * Packet header v timestamp string
+ */
+ public static final LexicalScope PACKET_HEADER_V_TIMESTAMP = new LexicalScope(PACKET_HEADER, "timestamp"); //$NON-NLS-1$
+
+ /**
+ * The scope constructor
+ *
+ * @param parent
+ * The parent node, can be null, but shouldn't
+ * @param name
+ * the name of the field
+ */
+ public EventHeaderVScope(LexicalScope parent, String name) {
+ super(parent, name);
+ }
+
+ @Override
+ @Nullable
+ public LexicalScope getChild(String name) {
+ if (name.equals(PACKET_HEADER_V_TIMESTAMP.getName())) {
+ return PACKET_HEADER_V_TIMESTAMP;
+ }
+ if (name.equals(PACKET_HEADER_V_ID.getName())) {
+ return PACKET_HEADER_V_ID;
+ }
+ return super.getChild(name);
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.ctf.core.event.scope;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
+
+/**
+ * A lttng specific speedup node field scope of a lexical scope
+ *
+ * @author Matthew Khouzam
+ * @since 3.1
+ */
+@NonNullByDefault
+public class FieldsScope extends LexicalScope {
+
+ /**
+ * ret field
+ */
+ public static final LexicalScope FIELDS_RET = new LexicalScope(FIELDS, "_ret"); //$NON-NLS-1$
+
+ /**
+ * tid field
+ */
+ public static final LexicalScope FIELDS_TID = new LexicalScope(FIELDS, "_tid"); //$NON-NLS-1$
+
+ /**
+ * The scope constructor
+ *
+ * @param parent
+ * The parent node, can be null, but shouldn't
+ * @param name
+ * the name of the field
+ */
+ public FieldsScope(LexicalScope parent, String name) {
+ super(parent, name);
+ }
+
+ @Override
+ @Nullable
+ public LexicalScope getChild(String name) {
+ if (name.equals(FIELDS_RET.getName())) {
+ return FIELDS_RET;
+ }
+ if (name.equals(FIELDS_TID.getName())) {
+ return FIELDS_TID;
+ }
+ return super.getChild(name);
+ }
+
+}
*
* @since 3.0
*/
- public static final LexicalScope ROOT = new LexicalScope(null, ""); //$NON-NLS-1$
+ public static final LexicalScope ROOT = new RootScope();
/**
* Trace string
* @since 3.0
*
*/
- public static final LexicalScope PACKET_HEADER = new LexicalScope(PACKET, "header"); //$NON-NLS-1$
+ public static final LexicalScope PACKET_HEADER = new PacketHeaderScope();
/**
* Stream packet scope
*/
public static final LexicalScope STREAM_EVENT_HEADER = new LexicalScope(STREAM_EVENT, "header"); //$NON-NLS-1$
+ /**
+ * Event header
+ *
+ * @since 3.1
+ */
+ public static final LexicalScope EVENT_HEADER = new EventHeaderScope(EVENT, "header"); //$NON-NLS-1$
+
/**
* Fields in an event
*
* @since 3.0
*/
- public static final LexicalScope FIELDS = new LexicalScope(ROOT, "fields"); //$NON-NLS-1$
+ public static final LexicalScope FIELDS = new FieldsScope(ROOT, "fields"); //$NON-NLS-1$
/**
* Context of an event
private final String fPath;
private final Map<String, LexicalScope> fChildren;
-
/**
* The scope constructor
*
pathString = pathString.substring(1);
}
if (pathString == null) {
- // we should get an NPE on pathString.startsWith before getting this
+ // we should get an NPE on pathString.startsWith before getting
+ // this
throw new IllegalStateException(
"Lexical scope constructor had null pathstring for " + //$NON-NLS-1$
parent.toString() + " and " + name); //$NON-NLS-1$
@Override
public String toString() {
- return fPath + '.' + fName;
+ return (fPath.isEmpty() ? fName : fPath + '.' + fName);
}
@Override
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.ctf.core.event.scope;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+
+/**
+ * A lttng specific speedup node (the packet header with magic, uuid and stream
+ * id ) of a lexical scope the sole reason to have this is to accelerate tostring()
+ *
+ * @author Matthew Khouzam
+ * @since 3.1
+ */
+@NonNullByDefault
+public class PacketHeaderScope extends LexicalScope {
+
+ /**
+ * Constructor
+ */
+ public PacketHeaderScope() {
+ super(PACKET, "header"); //$NON-NLS-1$
+ }
+
+ @Override
+ public String toString() {
+ return "packet.header"; //$NON-NLS-1$
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.ctf.core.event.scope;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
+
+/**
+ * A lttng specific speedup node a root with accelerated returns for some scopes
+ * of a lexical scope
+ *
+ * @author Matthew Khouzam
+ * @since 3.1
+ */
+@NonNullByDefault
+public class RootScope extends LexicalScope {
+
+ /**
+ * The scope constructor
+ */
+ public RootScope() {
+ super(null, ""); //$NON-NLS-1$
+ }
+
+ @Override
+ @Nullable
+ public LexicalScope getChild(String name) {
+ /*
+ * This happens ~40 % of the time
+ */
+ if (name.equals(EVENT_HEADER.toString())) {
+ return EVENT_HEADER;
+ }
+ /*
+ * This happens ~30 % of the time
+ */
+ if (name.equals(FIELDS.toString())) {
+ return FIELDS;
+ }
+ /*
+ * This happens ~30 % of the time
+ */
+ if (name.equals(CONTEXT.toString())) {
+ return CONTEXT;
+ }
+ /*
+ * This happens ~1 % of the time
+ */
+ if (name.equals(PACKET_HEADER.toString())) {
+ return PACKET_HEADER;
+ }
+ return super.getChild(name);
+ }
+
+}
* @since 3.0
*/
public Definition(@NonNull IDeclaration declaration, IDefinitionScope definitionScope, @NonNull String fieldName) {
+ this(declaration, definitionScope, fieldName, declaration.getPath(definitionScope, fieldName));
+ }
+
+ /**
+ * Constructor This one takes the scope and thus speeds up definition creation
+ *
+ *
+ * @param declaration
+ * the event declaration
+ *
+ * @param definitionScope
+ * the definition is in a scope, (normally a struct) what is it?
+ *
+ * @param fieldName
+ * the name of the defintions. it is a field in the parent scope.
+ *
+ * @param scope
+ * the scope
+ * @since 3.1
+ */
+ public Definition(@NonNull IDeclaration declaration, IDefinitionScope definitionScope, @NonNull String fieldName, LexicalScope scope) {
fDeclaration = declaration;
fDefinitionScope = definitionScope;
fFieldName = fieldName;
- fPath = fDeclaration.getPath(definitionScope, fieldName);
+ fPath = scope;
}
// ------------------------------------------------------------------------
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.linuxtools.ctf.core.event.scope.IDefinitionScope;
+import org.eclipse.linuxtools.ctf.core.event.scope.LexicalScope;
/**
* Scoped defintion. a defintion where you can lookup various datatypes
super(declaration, definitionScope, fieldName);
}
+ /**
+ * Constructor This one takes the scope and thus speeds up definition
+ * creation
+ *
+ * @param declaration
+ * the parent declaration
+ * @param definitionScope
+ * the parent scope
+ * @param fieldName
+ * the field name
+ * @param scope
+ * the lexical scope
+ * @since 3.1
+ */
+ public ScopedDefinition(StructDeclaration declaration, @Nullable IDefinitionScope definitionScope, String fieldName, LexicalScope scope) {
+ super(declaration, definitionScope, fieldName, scope);
+ }
+
/**
* Lookup an array in a struct. If the name returns a non-array (like an
* int) then the method returns null
* the name of the array
* @return the array or null.
*/
- @Nullable
- public AbstractArrayDefinition lookupArray2(String name){
+ public @Nullable AbstractArrayDefinition lookupArrayDefinition(String name) {
Definition def = lookupDefinition(name);
return (AbstractArrayDefinition) ((def instanceof AbstractArrayDefinition) ? def : null);
}
* @param name
* the name of the array
* @return the array or null.
+ * @deprecated use {@link ScopedDefinition#lookupArrayDefinition(String)}
*/
@Deprecated
@Nullable
* @return the sequence or null if a definition is not found or it does not
* match the desired datatype.
* @since 3.0
+ * @deprecated use {@link ScopedDefinition#lookupArrayDefinition(String)}
*/
@Deprecated
@Nullable
package org.eclipse.linuxtools.ctf.core.event.types;
+import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
+import java.util.Set;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.linuxtools.ctf.core.event.io.BitBuffer;
import org.eclipse.linuxtools.ctf.core.event.scope.IDefinitionScope;
+import org.eclipse.linuxtools.ctf.core.event.scope.LexicalScope;
import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
/**
return structDefinition;
}
+ /**
+ * Accelerated create definition
+ *
+ * @param definitionScope
+ * the definition scope
+ * @param fieldScope
+ * the lexical scope of this element
+ * @param input
+ * the {@Link BitBuffer} to read
+ * @return the Struct definition
+ * @throws CTFReaderException
+ * read error and such
+ * @since 3.1
+ */
+ public StructDefinition createDefinition(IDefinitionScope definitionScope,
+ LexicalScope fieldScope, @NonNull BitBuffer input) throws CTFReaderException {
+ alignRead(input);
+ final Definition[] myFields = new Definition[fFieldMap.size()];
+ Set<String> keySet = fFieldMap.keySet();
+ if (keySet == null) {
+ keySet = Collections.EMPTY_SET;
+ if( keySet == null ) {
+ throw new IllegalStateException();
+ }
+ }
+ StructDefinition structDefinition = new StructDefinition(this, definitionScope, fieldScope, fieldScope.getName(), keySet, myFields);
+ Iterator<Map.Entry<String, IDeclaration>> iter = fFieldMap.entrySet().iterator();
+ for (int i = 0; i < fFieldMap.size(); i++) {
+ Map.Entry<String, IDeclaration> entry = iter.next();
+ String fieldName = entry.getKey();
+ if (fieldName == null) {
+ throw new IllegalStateException();
+ }
+ myFields[i] = entry.getValue().createDefinition(structDefinition, fieldName, input);
+ }
+ return structDefinition;
+ }
+
/**
* Add a field to the struct
*
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.linuxtools.ctf.core.event.scope.IDefinitionScope;
+import org.eclipse.linuxtools.ctf.core.event.scope.LexicalScope;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
super(declaration, definitionScope, structFieldName);
fFieldNames = ImmutableList.copyOf(fieldNames);
fDefinitions = definitions;
+ if (fFieldNames.isEmpty()) {
+ fDefinitionsMap = Collections.EMPTY_MAP;
+ }
+ }
+
+ /**
+ * Constructor This one takes the scope and thus speeds up definition
+ * creation
+ *
+ * @param declaration
+ * the parent declaration
+ * @param definitionScope
+ * the parent scope
+ * @param scope
+ * the scope of this variable
+ * @param structFieldName
+ * the field name
+ * @param fieldNames
+ * the list of fields
+ * @param definitions
+ * the definitions
+ * @since 3.1
+ */
+ public StructDefinition(@NonNull StructDeclaration declaration,
+ IDefinitionScope definitionScope, @NonNull LexicalScope scope,
+ @NonNull String structFieldName, @NonNull Iterable<String> fieldNames, Definition[] definitions) {
+ super(declaration, definitionScope, structFieldName, scope);
+ fFieldNames = ImmutableList.copyOf(fieldNames);
+ fDefinitions = definitions;
if (fFieldNames == null) {
fDefinitionsMap = Collections.EMPTY_MAP;
}
private void parseTracePacketHeader(StructDeclaration tracePacketHeaderDecl,
@NonNull BitBuffer bitBuffer) throws CTFReaderException {
- StructDefinition tracePacketHeaderDef = tracePacketHeaderDecl.createDefinition(fStream.getTrace(), LexicalScope.TRACE_PACKET_HEADER.getName(), bitBuffer);
+ StructDefinition tracePacketHeaderDef = tracePacketHeaderDecl.createDefinition(fStream.getTrace(), LexicalScope.TRACE_PACKET_HEADER, bitBuffer);
/*
* Check the CTF magic number
private void parsePacketContext(long fileSizeBytes,
StructDeclaration streamPacketContextDecl, @NonNull BitBuffer bitBuffer,
StreamInputPacketIndexEntry packetIndex) throws CTFReaderException {
- StructDefinition streamPacketContextDef = streamPacketContextDecl.createDefinition(null, LexicalScope.STREAM_PACKET_CONTEXT.getName(), bitBuffer);
+ StructDefinition streamPacketContextDef = streamPacketContextDecl.createDefinition(this, LexicalScope.STREAM_PACKET_CONTEXT, bitBuffer);
for (String field : streamPacketContextDef.getDeclaration()
.getFieldsList()) {
* out of bounds exception or such
*/
public StructDefinition getEventContextDefinition(@NonNull BitBuffer input) throws CTFReaderException {
- return fStreamEventContextDecl.createDefinition(this, LexicalScope.STREAM_EVENT_CONTEXT.getName(), input);
+ return fStreamEventContextDecl.createDefinition(fStreamInputReader.getStreamInput(), LexicalScope.STREAM_EVENT_CONTEXT, input);
}
/**
* out of bounds exception or such
*/
public StructDefinition getStreamEventHeaderDefinition(@NonNull BitBuffer input) throws CTFReaderException {
- return fStreamEventHeaderDecl.createDefinition(this, LexicalScope.STREAM_EVENT_HEADER.getName(), input);
+ return fStreamEventHeaderDecl.createDefinition(this, LexicalScope.EVENT_HEADER, input);
}
/**
* out of bounds exception or such
*/
public StructDefinition getStreamPacketContextDefinition(@NonNull BitBuffer input) throws CTFReaderException {
- return fStreamPacketContextDecl.createDefinition(this, LexicalScope.STREAM_PACKET_CONTEXT.getName(), input);
+ return fStreamPacketContextDecl.createDefinition(fStreamInputReader.getStreamInput(), LexicalScope.STREAM_PACKET_CONTEXT, input);
}
/**
* out of bounds exception or such
*/
public StructDefinition getTracePacketHeaderDefinition(@NonNull BitBuffer input) throws CTFReaderException {
- return fTracePacketHeaderDecl.createDefinition(this, LexicalScope.TRACE_PACKET_HEADER.getName(), input);
+ return fTracePacketHeaderDecl.createDefinition(fStreamInputReader.getStreamInput().getStream().getTrace(), LexicalScope.TRACE_PACKET_HEADER, input);
}
/**
import java.nio.ByteOrder;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.linuxtools.ctf.core.event.EventDefinition;
import org.eclipse.linuxtools.ctf.core.event.IEventDeclaration;
import org.eclipse.linuxtools.ctf.core.event.types.StructDeclaration;
/**
* The StreamInput we are reading.
*/
- private final CTFStreamInput fStreamInput;
+ private final @NonNull CTFStreamInput fStreamInput;
/**
* The packet reader used to read packets from this trace file.
* if an error occurs
*/
public CTFStreamInputReader(CTFStreamInput streamInput) throws CTFReaderException {
+ if (streamInput == null) {
+ throw new IllegalArgumentException("streamInput cannot be null"); //$NON-NLS-1$
+ }
fStreamInput = streamInput;
fPacketReader = new CTFStreamInputPacketReader(this);
/*
int result = 1;
result = (prime * result) + fId;
result = (prime * result)
- + ((fStreamInput == null) ? 0 : fStreamInput.hashCode());
+ + fStreamInput.hashCode();
return result;
}
if (fId != other.fId) {
return false;
}
- if (fStreamInput == null) {
- if (other.fStreamInput != null) {
- return false;
- }
- } else if (!fStreamInput.equals(other.fStreamInput)) {
- return false;
- }
- return true;
+ return fStreamInput.equals(other.fStreamInput);
}
@Override
if (fPacketHeaderDecl != null) {
/* Read the packet header */
- fPacketHeaderDef = fPacketHeaderDecl.createDefinition(null, LexicalScope.PACKET_HEADER.toString(), streamBitBuffer);
+ fPacketHeaderDef = fPacketHeaderDecl.createDefinition(this, LexicalScope.PACKET_HEADER, streamBitBuffer);
/* Check the magic number */
IntegerDefinition magicDef = (IntegerDefinition) fPacketHeaderDef.lookupDefinition("magic"); //$NON-NLS-1$
*/
public class EventDeclaration implements IEventDeclaration {
- @NonNull private static final String FIELDS = "fields"; //$NON-NLS-1$
-
- @NonNull private static final String CONTEXT = "context"; //$NON-NLS-1$
-
/** Id of lost events */
public static final long LOST_EVENT_ID = -1L;
@Override
public EventDefinition createDefinition(CTFStreamInputReader streamInputReader, @NonNull BitBuffer input, long timestamp) throws CTFReaderException {
StructDeclaration streamEventContextDecl = streamInputReader.getStreamEventContextDecl();
- StructDefinition streamEventContext = streamEventContextDecl != null ? streamEventContextDecl.createDefinition(null, LexicalScope.STREAM_EVENT_CONTEXT.toString(), input) : null;
+ StructDefinition streamEventContext = streamEventContextDecl != null ? streamEventContextDecl.createDefinition(fStream.getTrace(), LexicalScope.STREAM_EVENT_CONTEXT, input) : null;
StructDefinition packetContext = streamInputReader.getPacketReader().getCurrentPacketEventHeader();
- StructDefinition eventContext = fContext != null ? fContext.createDefinition(null, CONTEXT, input) : null;
- StructDefinition eventPayload = fFields != null ? fFields.createDefinition(null, FIELDS, input) : null;
+ StructDefinition eventContext = fContext != null ? fContext.createDefinition(fStream.getTrace(), LexicalScope.CONTEXT, input) : null;
+ StructDefinition eventPayload = fFields != null ? fFields.createDefinition(fStream.getTrace(), LexicalScope.FIELDS, input) : null;
// a bit lttng specific
// CTF doesn't require a timestamp,
*/
@Test
public void testParseField_array_float() {
- Definition fieldDef = fixture.lookupArray2(ARRAY_FLOAT);
+ Definition fieldDef = fixture.lookupArrayDefinition(ARRAY_FLOAT);
CtfTmfEventField result = CtfTmfEventField.parseField(fieldDef, NAME);
assertEquals("test=[2.0, 2.0]", result.toString());
}
*/
@Test
public void testParseField_array_int() {
- Definition fieldDef = fixture.lookupArray2(ARRAY_INT);
+ Definition fieldDef = fixture.lookupArrayDefinition(ARRAY_INT);
CtfTmfEventField result = CtfTmfEventField.parseField(fieldDef, NAME);
assertEquals("test=[2, 2]", result.toString());
}
*/
@Test
public void testParseField_array_string() {
- Definition fieldDef = fixture.lookupArray2(ARRAY_STR);
+ Definition fieldDef = fixture.lookupArrayDefinition(ARRAY_STR);
CtfTmfEventField result = CtfTmfEventField.parseField(fieldDef, NAME);
assertEquals("test=[two, two]", result.toString());
}
*/
@Test
public void testParseField_array_struct() {
- Definition fieldDef = fixture.lookupArray2(ARRAY_STRUCT);
+ Definition fieldDef = fixture.lookupArrayDefinition(ARRAY_STRUCT);
CtfTmfEventField result = CtfTmfEventField.parseField(fieldDef, NAME);
assertEquals("test=[[str=two, int=2], [str=two, int=2]]", result.toString());
}
*/
@Test
public void testParseField_array_enum() {
- Definition fieldDef = fixture.lookupArray2(ARRAY_ENUM);
+ Definition fieldDef = fixture.lookupArrayDefinition(ARRAY_ENUM);
CtfTmfEventField result = CtfTmfEventField.parseField(fieldDef, NAME);
assertEquals("test=[float, float]", result.toString());
}
*/
@Test
public void testParseField_array_variant() {
- Definition fieldDef = fixture.lookupArray2(ARRAY_VARIANT);
+ Definition fieldDef = fixture.lookupArrayDefinition(ARRAY_VARIANT);
CtfTmfEventField result = CtfTmfEventField.parseField(fieldDef, NAME);
assertEquals("test=[float=2.0, float=2.0]", result.toString());
}