/*
- * Copyright (c) 2014 Brocade Communications Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.yangtools.yang.data.impl.test.codecs;
+package org.opendaylight.yangtools.yang.data.impl.codecs;
import static org.junit.Assert.*;
-import static org.opendaylight.yangtools.yang.data.impl.test.codecs.TypeDefinitionAwareCodecTestHelper.deserializeWithExpectedIllegalArgEx;
-import static org.opendaylight.yangtools.yang.data.impl.test.codecs.TypeDefinitionAwareCodecTestHelper.getCodec;
import java.math.BigInteger;
@SuppressWarnings("unchecked")
@Test
public void testSerialize() {
- Uint64Codec<String> codec = getCodec(Uint64.getInstance(), Uint64Codec.class);
+ Uint64Codec<String> codec = TypeDefinitionAwareCodecTestHelper.getCodec(Uint64.getInstance(), Uint64Codec.class);
assertEquals("serialize", "123456789", codec.serialize(BigInteger.valueOf( 123456789 )));
assertEquals("serialize", "", codec.serialize(null));
final String octal = "03536670743556272";
final String integer = "129664115727546";
- Uint64Codec<String> codec = getCodec(Uint64.getInstance(), Uint64Codec.class);
+ Uint64Codec<String> codec = TypeDefinitionAwareCodecTestHelper.getCodec(Uint64.getInstance(), Uint64Codec.class);
assertEquals("deserialize", codec.deserialize(hexa), new BigInteger("75EDC78edCBA", 16));
assertEquals("deserialize", codec.deserialize(octal), new BigInteger(octal, 8));
assertEquals("deserialize", codec.deserialize(integer), new BigInteger(integer, 10));
- deserializeWithExpectedIllegalArgEx(codec, "12345o");
- deserializeWithExpectedIllegalArgEx(codec, "");
- deserializeWithExpectedIllegalArgEx(codec, null);
+ TypeDefinitionAwareCodecTestHelper.deserializeWithExpectedIllegalArgEx(codec, "12345o");
+ TypeDefinitionAwareCodecTestHelper.deserializeWithExpectedIllegalArgEx(codec, "");
+ TypeDefinitionAwareCodecTestHelper.deserializeWithExpectedIllegalArgEx(codec, null);
}
}