Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
import org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.stubs.EntryStub;
import org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.stubs.ExperimentModelStub;
import org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.stubs.IAxisDomainStub;
import org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.stubs.RangeStub;
import org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.stubs.TmfXYAxisDescriptionStub;
import org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.stubs.XyEntryModelStub;
import org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.stubs.XyEntryStub;
import org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.stubs.XyTreeOutputResponseStub;
import org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.stubs.ISamplingStub;
import org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.stubs.TmfXYAxisDescriptionStub;
import org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.stubs.XyModelStub;
import org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.stubs.XyOutputResponseStub;
import org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.stubs.XySeriesStub;
import org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.stubs.XyTreeOutputResponseStub;
import org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.utils.RestServerTest;
import org.eclipse.tracecompass.internal.tmf.core.Activator;
import org.eclipse.tracecompass.tmf.core.model.StyleProperties;
Expand Down Expand Up @@ -227,16 +227,17 @@ public void testCallStackFunctionDensityDataProvider() throws InterruptedExcepti
assertEquals("Name mismatch", "UNKNOWN_PID", seriesStub.getName());

// Validate xValues
ISamplingStub xValues = seriesStub.getXValues();
assertTrue("xValues should be a RangesStub", xValues instanceof ISamplingStub.RangesStub);
List<ISamplingStub.RangesStub.RangeStub> expectedRanges = Arrays.asList(
new ISamplingStub.RangesStub.RangeStub(0L, 1195708549L),
new ISamplingStub.RangesStub.RangeStub(1195708550L, 2391417098L),
new ISamplingStub.RangesStub.RangeStub(2391417099L, 3587125647L),
new ISamplingStub.RangesStub.RangeStub(3587125648L, 4782834196L),
new ISamplingStub.RangesStub.RangeStub(4782834197L, 5978542746L)
List<RangeStub> xValues = seriesStub.getXRanges();
assertNotNull(xValues);
assertFalse(xValues.isEmpty());
List<RangeStub> expectedRanges = Arrays.asList(
new RangeStub(0L, 1195708549L),
new RangeStub(1195708550L, 2391417098L),
new RangeStub(2391417099L, 3587125647L),
new RangeStub(3587125648L, 4782834196L),
new RangeStub(4782834197L, 5978542746L)
);
List<ISamplingStub.RangesStub.RangeStub> actualRanges = ((ISamplingStub.RangesStub) xValues).getRanges();
List<RangeStub> actualRanges = xValues;
assertEquals("Range size mismatch", expectedRanges.size(), actualRanges.size());
assertEquals("Range size mismatch", expectedRanges.size(), actualRanges.size());
for (int i = 0; i < expectedRanges.size(); i++) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/**********************************************************************
* Copyright (c) 2025 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
* accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests.stubs;

import java.io.Serializable;
import java.util.Objects;

import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tracecompass.tmf.core.model.ISampling.Range;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Stub version of {@link Range}.
*
* @author Siwei Zhang
*/
public final class RangeStub implements Serializable {
private static final long serialVersionUID = 1L;

private final long fStart;
private final long fEnd;

/**
* Constructor
*
* @param start
* the start value
* @param end
* the end value
*/
@JsonCreator
public RangeStub(@JsonProperty("start") Long start, @JsonProperty("end") Long end) {
this.fStart = start;
this.fEnd = end;
}

/**
* @return the start value
*/
public long getStart() {
return fStart;
}

/**
* @return the end value
*/
public long getEnd() {
return fEnd;
}

@Override
public boolean equals(@Nullable Object obj) {
return (this == obj) || (obj instanceof RangeStub other &&
fStart == other.fStart && fEnd == other.fEnd);
}

@Override
public int hashCode() {
return Objects.hash(fStart, fEnd);
}

@Override
public String toString() {
return "[" + fStart + ", " + fEnd + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}

This file was deleted.

Loading
Loading