common: Make data size and speed formatters static
[deliverable/tracecompass.git] / common / org.eclipse.tracecompass.common.core.tests / src / org / eclipse / tracecompass / common / core / tests / format / DataSpeedFormatTest.java
1 /*******************************************************************************
2 * Copyright (c) 2016 École Polytechnique de Montréal
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
9
10 package org.eclipse.tracecompass.common.core.tests.format;
11
12 import java.text.Format;
13
14 import org.eclipse.jdt.annotation.NonNull;
15 import org.eclipse.tracecompass.common.core.format.DataSpeedWithUnitFormat;
16
17 /**
18 * Test the {@link DataSpeedWithUnitFormat} class
19 *
20 * @author Geneviève Bastien
21 */
22 public class DataSpeedFormatTest extends DataSizeFormatTest {
23
24 private static final @NonNull Format FORMAT = DataSpeedWithUnitFormat.getInstance();
25 private static final String PER_SECOND = "/s";
26
27 /**
28 * Constructor
29 *
30 * @param value
31 * The numeric value to format
32 * @param expected
33 * The expected formatted result
34 */
35 public DataSpeedFormatTest(@NonNull Number value, @NonNull String expected) {
36 super(value, expected + PER_SECOND);
37 }
38
39 @Override
40 protected Format getFormatter() {
41 return FORMAT;
42 }
43 }
This page took 0.030134 seconds and 5 git commands to generate.