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
8 package org.opendaylight.controller.cluster.datastore.node.utils.stream;
10 import static org.junit.Assert.assertEquals;
12 import org.junit.Test;
14 public class LithiumWriteObjectMappingTest {
16 public void testStringType() {
17 assertEquals(LithiumValue.STRING_TYPE, AbstractLithiumDataOutput.getSerializableType("foobar"));
18 final String largeString = largeString(LithiumValue.STRING_BYTES_LENGTH_THRESHOLD);
19 assertEquals(LithiumValue.STRING_BYTES_TYPE, AbstractLithiumDataOutput.getSerializableType(largeString));
22 private static String largeString(final int minSize) {
23 final int pow = (int) (Math.log(minSize * 2) / Math.log(2));
24 StringBuilder sb = new StringBuilder("X");
25 for (int i = 0; i < pow; i++) {