Address FIXME for QueuedNotificationManager
[yangtools.git] / yang / yang-data-impl / src / test / java / org / opendaylight / yangtools / yang / data / impl / test / codecs / EmptyCodecStringTest.java
1 /*
2  * Copyright (c) 2014 Brocade Communications Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.yangtools.yang.data.impl.test.codecs;
10
11 import static org.junit.Assert.*;
12
13 import org.junit.Test;
14 import static org.opendaylight.yangtools.yang.data.impl.test.codecs.TypeDefinitionAwareCodecTestHelper.getCodec;
15 import static org.opendaylight.yangtools.yang.data.impl.test.codecs.TypeDefinitionAwareCodecTestHelper.deserializeWithExpectedIllegalArgEx;
16 import org.opendaylight.yangtools.yang.data.api.codec.EmptyCodec;
17 import org.opendaylight.yangtools.yang.model.util.EmptyType;
18
19 /**
20  * Unit tests for EmptyCodecString.
21  *
22  * @author Thomas Pantelis
23  */
24 public class EmptyCodecStringTest {
25
26     @SuppressWarnings("unchecked")
27     @Test
28     public void testSerialize() {
29         EmptyCodec<String> codec = getCodec( EmptyType.getInstance(), EmptyCodec.class);
30
31         assertEquals( "serialize", "", codec.serialize( null ) );
32     }
33
34     @SuppressWarnings("unchecked")
35     @Test
36     public void testDeserialize() {
37         EmptyCodec<String> codec = getCodec( EmptyType.getInstance(), EmptyCodec.class);
38
39         assertEquals( "deserialize", null, codec.deserialize( "" ) );
40         assertEquals( "deserialize", null, codec.deserialize( null ) );
41
42         deserializeWithExpectedIllegalArgEx( codec, "foo" );
43     }
44
45 }