2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.cluster.datastore.node.utils.stream;
11 import static org.junit.Assert.assertEquals;
12 import org.junit.Test;
14 public class ValueTypesTest {
16 public void testStringType(){
17 assertEquals(ValueTypes.STRING_TYPE, ValueTypes.getSerializableType("foobar"));
18 final String largeString = largeString(ValueTypes.STRING_BYTES_LENGTH_THRESHOLD);
19 assertEquals(ValueTypes.STRING_BYTES_TYPE, ValueTypes.getSerializableType(largeString));
22 private static String largeString(int minSize){
23 final int pow = (int) (Math.log(minSize * 2) / Math.log(2));
25 for(int i=0;i<pow;i++){
26 StringBuilder b = new StringBuilder();
27 b.append(s).append(s);