--- /dev/null
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. 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.mdsal.binding.javav2.dom.adapter.test;
+
+import org.junit.Test;
+import org.opendaylight.mdsal.binding.javav2.api.WriteTransaction;
+import org.opendaylight.mdsal.binding.javav2.spec.base.InstanceIdentifier;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
+import org.opendaylight.mdsal.gen.javav2.urn.test.rev170627.data.MyCont;
+import org.opendaylight.mdsal.gen.javav2.urn.test.rev170627.dto.MyContBuilder;
+
+public class BasicLeafValueTest extends AbstractDataBrokerTest {
+
+ private static final InstanceIdentifier<MyCont> MY_CONT_NODE_PATH
+ = InstanceIdentifier.create(MyCont.class);
+
+ @Test
+ public void testMyContLeafNode() throws TransactionCommitFailedException {
+ final WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
+ final MyContBuilder hello = new MyContBuilder().setMyLeaf("hello");
+ writeTx.put(LogicalDatastoreType.OPERATIONAL, MY_CONT_NODE_PATH, hello.build());
+ writeTx.submit().checkedGet();
+ }
+}
import java.io.IOException;
import org.opendaylight.mdsal.binding.javav2.spec.base.IdentifiableItem;
import org.opendaylight.mdsal.binding.javav2.spec.base.Item;
-import org.opendaylight.mdsal.binding.javav2.spec.structural.Augmentation;
import org.opendaylight.mdsal.binding.javav2.spec.base.TreeNode;
+import org.opendaylight.mdsal.binding.javav2.spec.structural.Augmentation;
/**
* Event Stream Writer for Binding version 2 Representation
* </ul></li>
*
* <li><code>leaf</code> - Leaf node event is emitted using
- * {@link #startleafNode(String, Object)}. {@link #endNode()} MUST NOT be emitted for
+ * {@link #leafNode(String, Object)}. {@link #endNode()} MUST NOT be emitted for
* leaf node.</li>
*
* <li><code>leaf-list</code> - Leaf list start is emitted using
* {@link #startLeafSet(String, int)}. Leaf list end is emitted using
* {@link #endNode()}. Leaf list entries are emitted using
- * {@link #startleafSetEntryNode(Object)}.
+ * {@link #leafSetEntryNode(Object)}.
*
* <li><code>anyxml - Anyxml node event is emitted using
* {@link #startAnyxmlNode(String, Object)}. {@link #endNode()} MUST NOT be emitted
* <code>choice</code> <code>unkeyed list</code> node.
* @throws IOException if an underlying IO error occurs
*/
- void startleafNode(String localName, Object value) throws IOException;
+ void leafNode(String localName, Object value) throws IOException;
/**
*
* Emits a start of leaf set (leaf-list).
* <p>
* Emits start of leaf set, during writing leaf set event, only
- * {@link #startleafSetEntryNode(Object)} calls are valid. Leaf set event is
+ * {@link #leafSetEntryNode(Object)} calls are valid. Leaf set event is
* finished by calling {@link #endNode()}.
*
* @param localName
* Emits a start of leaf set (leaf-list).
* <p>
* Emits start of leaf set, during writing leaf set event, only
- * {@link #startleafSetEntryNode(Object)} calls are valid. Leaf set event is
+ * {@link #leafSetEntryNode(Object)} calls are valid. Leaf set event is
* finished by calling {@link #endNode()}.
*
* @param localName
* If node was emitted outside <code>leaf set</code> node.
* @throws IOException if an underlying IO error occurs
*/
- void startleafSetEntryNode(Object value) throws IOException;
+ void leafSetEntryNode(Object value) throws IOException;
/**
*
* <p>
* Valid sub-events are:
* <ul>
- * <li>{@link #startleafNode(String, Object)}</li>
+ * <li>{@link #leafNode(String, Object)}</li>
* <li>{@link #startContainerNode(Class, int)}</li>
* <li>{@link #startChoiceNode(Item, int)}</li>
* <li>{@link #startLeafSet(String, int)}</li>
* Valid sub-events are:
*
* <ul>
- * <li>{@link #startleafNode(String, Object)}</li>
+ * <li>{@link #leafNode(String, Object)}</li>
* <li>{@link #startContainerNode(Class, int)}</li>
* <li>{@link #startChoiceNode(Item, int)}</li>
* <li>{@link #startLeafSet(String, int)}</li>
* <p>
* Valid sub-events are:
* <ul>
- * <li>{@link #startleafNode(String, Object)}</li>
+ * <li>{@link #leafNode(String, Object)}</li>
* <li>{@link #startContainerNode(Class, int)}</li>
* <li>{@link #startChoiceNode(Item, int)}</li>
* <li>{@link #startLeafSet(String, int)}</li>
* <p>
* Valid sub-events are:
* <ul>
- * <li>{@link #startleafNode(String, Object)}</li>
+ * <li>{@link #leafNode(String, Object)}</li>
* <li>{@link #startContainerNode(Class, int)}</li>
* <li>{@link #startChoiceNode(Item, int)}</li>
* <li>{@link #startLeafSet(String, int)}</li>
* Valid sub-events are:
*
* <ul>
- * <li>{@link #startleafNode(String, Object)}</li>
+ * <li>{@link #leafNode(String, Object)}</li>
* <li>{@link #startContainerNode(Class, int)}</li>
* <li>{@link #startChoiceNode(Item, int)}</li>
* <li>{@link #startLeafSet(String, int)}</li>