Sync with 5.4.0
[deliverable/titan.core.git] / titan_executor_api / TITAN_Executor_API_test / src / org / eclipse / titan / executorapi / test / StringUtilTest.java
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;
9
10 import static org.junit.Assert.assertEquals;
11
12 import org.eclipse.titan.executorapi.util.Log;
13 import org.eclipse.titan.executorapi.util.StringUtil;
14 import org.junit.Test;
15
16 public class StringUtilTest {
17
18 @Test
19 public void testAppendObjectArray() {
20 Log.fi();
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 );
32 sb.append(", ");
33 StringUtil.appendObject(sb, chararray );
34 sb.append(", ");
35 StringUtil.appendObject(sb, bytearray );
36 sb.append(", ");
37 StringUtil.appendObject(sb, shortarray );
38 sb.append(", ");
39 StringUtil.appendObject(sb, intarray );
40 sb.append(", ");
41 StringUtil.appendObject(sb, longarray );
42 sb.append(", ");
43 StringUtil.appendObject(sb, floatarray );
44 sb.append(", ");
45 StringUtil.appendObject(sb, doublearray );
46 assertEquals(sb.toString(), EXPECTED);
47 Log.f(sb.toString());
48 Log.fo();
49 }
50 }
This page took 0.033982 seconds and 5 git commands to generate.