1 /******************************************************************************
2 * Copyright (c) 2000-2015 Ericsson Telecom AB
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 ******************************************************************************/
8 package org
.eclipse
.titan
.executorapi
.test
;
10 import static org
.junit
.Assert
.assertEquals
;
12 import org
.eclipse
.titan
.executorapi
.util
.Log
;
13 import org
.eclipse
.titan
.executorapi
.util
.StringUtil
;
14 import org
.junit
.Test
;
16 public class StringUtilTest
{
19 public void testAppendObjectArray() {
21 final String EXPECTED
= "[ false, true, false, true ], [ a, b, c, d ], [ 0, 1, 2, 3 ], [ 0, 1, 2, 3 ], [ 0, 1, 2, 3 ], [ 0, 1, 2, 3 ], [ 0.0, 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0, 3.0 ]";
22 boolean[] booleanarray
= {false, true, false, true};
23 char[] chararray
= {'a','b','c','d'};
24 byte[] bytearray
= {0,1,2,3};
25 short[] shortarray
= {0,1,2,3};
26 int[] intarray
= {0,1,2,3};
27 long[] longarray
= {0,1,2,3};
28 float[] floatarray
= {0,1,2,3};
29 double[] doublearray
= {0,1,2,3};
30 StringBuilder sb
= new StringBuilder();
31 StringUtil
.appendObject(sb
, booleanarray
);
33 StringUtil
.appendObject(sb
, chararray
);
35 StringUtil
.appendObject(sb
, bytearray
);
37 StringUtil
.appendObject(sb
, shortarray
);
39 StringUtil
.appendObject(sb
, intarray
);
41 StringUtil
.appendObject(sb
, longarray
);
43 StringUtil
.appendObject(sb
, floatarray
);
45 StringUtil
.appendObject(sb
, doublearray
);
46 assertEquals(sb
.toString(), EXPECTED
);
This page took 0.033982 seconds and 5 git commands to generate.