Search in sources :

Example 11 with LamiTableEntryAspect

use of org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTableEntryAspect in project tracecompass by tracecompass.

the class LamiAspectTest method lamiEmptyAspectTest.

/**
 * Test the empty aspect
 *
 * @throws JSONException
 *             won't happen
 */
@Test
public void lamiEmptyAspectTest() throws JSONException {
    LamiTableEntryAspect aspect = LamiEmptyAspect.INSTANCE;
    LamiTableEntry entry1 = createLamiData(1);
    LamiTableEntry entry2 = createLamiData(2);
    assertEquals("", aspect.getLabel());
    assertEquals("", aspect.getName());
    assertEquals(0, aspect.getComparator().compare(entry1, entry2));
    assertNull(aspect.resolveString(entry1));
    assertNull(aspect.resolveNumber(entry1));
}
Also used : LamiTableEntryAspect(org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTableEntryAspect) LamiTableEntry(org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiTableEntry) Test(org.junit.Test)

Example 12 with LamiTableEntryAspect

use of org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTableEntryAspect in project tracecompass by tracecompass.

the class LamiAspectTest method lamiProcessNameAspectTest.

/**
 * Test the process name aspect
 *
 * @throws JSONException
 *             won't happen
 */
@Test
public void lamiProcessNameAspectTest() throws JSONException {
    LamiTableEntryAspect aspect = new LamiProcessNameAspect(ASPECT_NAME, 0);
    LamiTableEntry entry1 = createLamiData(1);
    LamiTableEntry entry2 = createLamiData(2);
    assertEquals(ASPECT_NAME + " (name)", aspect.getLabel());
    assertEquals(ASPECT_NAME + " (name)", aspect.getName());
    assertEquals(0, aspect.getComparator().compare(entry1, entry2));
    assertNull(aspect.resolveString(entry1));
    assertNull(aspect.resolveNumber(entry1));
}
Also used : LamiProcessNameAspect(org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiProcessNameAspect) LamiTableEntryAspect(org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTableEntryAspect) LamiTableEntry(org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiTableEntry) Test(org.junit.Test)

Example 13 with LamiTableEntryAspect

use of org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTableEntryAspect in project tracecompass by tracecompass.

the class LamiAspectTest method lamiTimestampAspectTest.

/**
 * Test the timestamp aspect
 *
 * @throws JSONException
 *             won't happen
 */
@Test
public void lamiTimestampAspectTest() throws JSONException {
    LamiTableEntryAspect aspect = new LamiTimestampAspect(ASPECT_NAME, 0);
    LamiTableEntry entry1 = createLamiData(1);
    LamiTableEntry entry2 = createLamiData(2);
    assertEquals(ASPECT_NAME, aspect.getLabel());
    assertEquals(ASPECT_NAME, aspect.getName());
    assertEquals(0, aspect.getComparator().compare(entry1, entry2));
    assertNull(aspect.resolveString(entry1));
    assertNull(aspect.resolveNumber(entry1));
}
Also used : LamiTableEntryAspect(org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTableEntryAspect) LamiTimestampAspect(org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTimestampAspect) LamiTableEntry(org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiTableEntry) Test(org.junit.Test)

Example 14 with LamiTableEntryAspect

use of org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTableEntryAspect in project tracecompass by tracecompass.

the class LamiAspectTest method lamiTimeRangeBeginAspectTest.

/**
 * Test the time range begin aspect
 *
 * @throws JSONException
 *             won't happen
 */
@Test
public void lamiTimeRangeBeginAspectTest() throws JSONException {
    LamiTableEntryAspect aspect = new LamiTimeRangeBeginAspect(ASPECT_NAME, 5);
    LamiTableEntry entry1 = createLamiData(1);
    LamiTableEntry entry2 = createLamiData(2);
    assertEquals(ASPECT_NAME + " (begin)", aspect.getLabel());
    assertEquals(ASPECT_NAME + " (begin)", aspect.getName());
    assertEquals(-1, aspect.getComparator().compare(entry1, entry2));
    String timeRangeString = aspect.resolveString(entry1);
    assertNotNull(timeRangeString);
    timeRangeString = timeRangeString.substring(timeRangeString.indexOf(".") + 1, timeRangeString.length());
    assertEquals("000 000 001", timeRangeString);
    assertEquals(1L, aspect.resolveNumber(entry1));
}
Also used : LamiTableEntryAspect(org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTableEntryAspect) LamiTableEntry(org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiTableEntry) LamiTimeRangeBeginAspect(org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTimeRangeBeginAspect) Test(org.junit.Test)

Example 15 with LamiTableEntryAspect

use of org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTableEntryAspect in project tracecompass by tracecompass.

the class LamiAspectTest method lamiTimeRangeEndAspectTest.

/**
 * Test the time range end aspect
 *
 * @throws JSONException
 *             won't happen
 */
@Test
public void lamiTimeRangeEndAspectTest() throws JSONException {
    LamiTableEntryAspect aspect = new LamiTimeRangeEndAspect(ASPECT_NAME, 5);
    LamiTableEntry entry1 = createLamiData(1);
    LamiTableEntry entry2 = createLamiData(2);
    assertEquals(ASPECT_NAME + " (end)", aspect.getLabel());
    assertEquals(ASPECT_NAME + " (end)", aspect.getName());
    assertEquals(-1, aspect.getComparator().compare(entry1, entry2));
    String timeRangeString = aspect.resolveString(entry1);
    assertNotNull(timeRangeString);
    timeRangeString = timeRangeString.substring(timeRangeString.indexOf(".") + 1, timeRangeString.length());
    assertEquals("000 000 012", timeRangeString);
    assertEquals(12L, aspect.resolveNumber(entry1));
}
Also used : LamiTableEntryAspect(org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTableEntryAspect) LamiTimeRangeEndAspect(org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTimeRangeEndAspect) LamiTableEntry(org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiTableEntry) Test(org.junit.Test)

Aggregations

LamiTableEntryAspect (org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTableEntryAspect)20 Test (org.junit.Test)16 LamiTableEntry (org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiTableEntry)15 NonNullUtils.nullToEmptyString (org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString)3 LamiProcessTIDAspect (org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiProcessTIDAspect)3 LamiTimeRangeEndAspect (org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTimeRangeEndAspect)3 LamiTimestampAspect (org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTimestampAspect)3 LamiAnalysisStub (org.eclipse.tracecompass.analysis.lami.core.tests.shared.analysis.LamiAnalysisStub)2 LamiDurationAspect (org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiDurationAspect)2 LamiGenericAspect (org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiGenericAspect)2 LamiIRQNameAspect (org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiIRQNameAspect)2 LamiIRQNumberAspect (org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiIRQNumberAspect)2 LamiMixedAspect (org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiMixedAspect)2 LamiProcessNameAspect (org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiProcessNameAspect)2 LamiProcessPIDAspect (org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiProcessPIDAspect)2 LamiTimeRangeBeginAspect (org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTimeRangeBeginAspect)2 LamiTimeRangeDurationAspect (org.eclipse.tracecompass.internal.provisional.analysis.lami.core.aspect.LamiTimeRangeDurationAspect)2 LamiTableClass (org.eclipse.tracecompass.internal.provisional.analysis.lami.core.module.LamiTableClass)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 ImmutableList (com.google.common.collect.ImmutableList)1