-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server.tests: Add tests for querying marker sets and annotations
Signed-off-by: Bernd Hufmann <[email protected]>
- Loading branch information
Showing
12 changed files
with
744 additions
and
1 deletion.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
...org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core.tests/config/markers.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<marker-sets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="markers.xsd"> | ||
<marker-set name="Example" id="example.id"> | ||
<marker name="Frame" color="#ff0000" period="10" unit="ms" range="0..4095"> | ||
<submarker name="Subframe" color="#00ff00" label="#%d Normal" range="0..9" index="0,2..9"> | ||
<submarker name="Slot" color="#008800" range="0..1"/> | ||
</submarker> | ||
<submarker name="Subframe" color="#ff8800" label="#%d Special" range="0..9" index="1"> | ||
<segments name="Slot"> | ||
<segment label="A" color="#884400" length="1"/> | ||
<segment label="B" color="#884400" length="3"/> | ||
<segment label="C" color="#884400" length="2"/> | ||
</segments> | ||
</submarker> | ||
</marker> | ||
</marker-set> | ||
</marker-sets> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...ss/incubator/trace/server/jersey/rest/core/tests/stubs/AnnotationCategoriesModelStub.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/********************************************************************** | ||
* Copyright (c) 2024 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.List; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* Basic Implementation of the serialized annotation category used by clients. | ||
* | ||
* @author Bernd Hufmann | ||
*/ | ||
public class AnnotationCategoriesModelStub implements Serializable{ | ||
|
||
private static final long serialVersionUID = -7146696718088222398L; | ||
private final List<String> fAnnotationCategories; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param annotationCategories | ||
* List of categories | ||
*/ | ||
public AnnotationCategoriesModelStub(@JsonProperty("annotationCategories") List<String> annotationCategories) { | ||
fAnnotationCategories = annotationCategories; | ||
} | ||
|
||
/** | ||
* Annotation categories for the model | ||
* | ||
* @return List of categories | ||
*/ | ||
public List<String> getAnnotationCategories() { | ||
return fAnnotationCategories; | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
...tor/trace/server/jersey/rest/core/tests/stubs/AnnotationCategoriesOutputResponseStub.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/********************************************************************** | ||
* Copyright (c) 2024 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 com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* A stub class for the response to a Annotation Categories' request. It contains | ||
* the generic response, as well as an lsit of {@link AnnotationCategoriesModelStub} | ||
* | ||
* @author Bernd Hufmann | ||
*/ | ||
public class AnnotationCategoriesOutputResponseStub extends OutputResponseStub { | ||
|
||
private static final long serialVersionUID = -2547573713331714274L; | ||
private final AnnotationCategoriesModelStub fModel; | ||
|
||
/** | ||
* {@link JsonCreator} Constructor from json | ||
* | ||
* @param model | ||
* The model for this response | ||
* @param status | ||
* The status of the response | ||
* @param statusMessage | ||
* The custom status message of the response | ||
*/ | ||
public AnnotationCategoriesOutputResponseStub(@JsonProperty("model") AnnotationCategoriesModelStub model, | ||
@JsonProperty("status") String status, | ||
@JsonProperty("statusMessage") String statusMessage) { | ||
super(status, statusMessage); | ||
fModel = model; | ||
} | ||
|
||
/** | ||
* Get the model for this response | ||
* | ||
* @return The model for the response | ||
*/ | ||
public AnnotationCategoriesModelStub getModel() { | ||
return fModel; | ||
} | ||
|
||
} |
Oops, something went wrong.