Do not generate union builders
[mdsal.git] / binding / mdsal-binding-dom-codec / src / test / java / org / opendaylight / mdsal / binding / dom / codec / impl / UnionTypeTest.java
1 /*
2  * Copyright (c) 2015 Cisco 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 package org.opendaylight.mdsal.binding.dom.codec.impl;
9
10 public class UnionTypeTest extends AbstractBindingCodecTest {
11     // FIXME: MDSAL-741: re-enable this test
12     //    private static final String TEST_STRING = "testtesttest";
13     //    private static final QName WRAPPER_QNAME = QName.create(
14     //        "urn:opendaylight:params:xml:ns:yang:yangtools:test:union", "2015-01-21", "wrapper");
15     //    private static final QName WRAP_LEAF_QNAME = QName.create(WRAPPER_QNAME, "wrap");
16
17     //    @Test
18     //    public void unionTest() {
19     //        TopLevel topLevel = TopLevelBuilder.getDefaultInstance(TEST_STRING);
20     //        Wrapper wrapper = new WrapperBuilder().setWrap(topLevel).build();
21     //        NormalizedNode topLevelEntry = codecContext.toNormalizedNode(InstanceIdentifier.create(Wrapper.class),
22     //            wrapper).getValue();
23     //
24     //        ContainerNode containerNode = ImmutableContainerNodeBuilder.create()
25     //                .withNodeIdentifier(new NodeIdentifier(WRAPPER_QNAME))
26     //                .withChild(ImmutableNodes.leafNode(WRAP_LEAF_QNAME, TEST_STRING))
27     //                .build();
28     //        Assert.assertEquals(topLevelEntry, containerNode);
29     //    }
30     //
31     //    @Test
32     //    public void bug5446Test() {
33     //        IpAddressBinary ipAddress = IpAddressBinaryBuilder.getDefaultInstance("fwAAAQ==");
34     //        Root root = new RootBuilder().setIpAddress(ipAddress).build();
35     //        NormalizedNode rootNode = codecContext.toNormalizedNode(InstanceIdentifier.create(Root.class), root)
36     //                .getValue();
37     //
38     //        Entry<InstanceIdentifier<?>, DataObject> rootEntry = codecContext.fromNormalizedNode(
39     //                YangInstanceIdentifier.of(rootNode.getIdentifier().getNodeType()), rootNode);
40     //
41     //        DataObject rootObj = rootEntry.getValue();
42     //        assertTrue(rootObj instanceof Root);
43     //        IpAddressBinary desIpAddress = ((Root) rootObj).getIpAddress();
44     //        assertEquals(ipAddress, desIpAddress);
45     //    }
46 }