use of org.opendaylight.netconf.sal.rest.impl.NormalizedNodeContext in project netconf by opendaylight.
the class NnToXmlTest method nnAsYangEmptyToXmlTest.
@Test
public void nnAsYangEmptyToXmlTest() throws Exception {
final String elName = "lfEmpty";
final NormalizedNodeContext normalizedNodeContext = prepareNNC(TypeDefinitionAwareCodec.from(BaseTypes.emptyType()).deserialize(""), elName);
nnToXml(normalizedNodeContext, "<" + elName + "/>");
}
use of org.opendaylight.netconf.sal.rest.impl.NormalizedNodeContext in project netconf by opendaylight.
the class NnToXmlTest method nnAsYangInt8ToXmlTest.
@Test
public void nnAsYangInt8ToXmlTest() throws Exception {
final String elName = "lfInt8";
final NormalizedNodeContext normalizedNodeContext = prepareNNC(TypeDefinitionAwareCodec.from(BaseTypes.int8Type()).deserialize("14"), elName);
nnToXml(normalizedNodeContext, "<" + elName + ">14</" + elName + ">");
}
use of org.opendaylight.netconf.sal.rest.impl.NormalizedNodeContext in project netconf by opendaylight.
the class NnToXmlTest method nnAsYangBooleanToXmlTest.
@Test
public void nnAsYangBooleanToXmlTest() throws Exception {
final String elName = "lfBoolean";
NormalizedNodeContext normalizedNodeContext = prepareNNC(TypeDefinitionAwareCodec.from(BaseTypes.booleanType()).deserialize("false"), elName);
nnToXml(normalizedNodeContext, "<" + elName + ">false</" + elName + ">");
normalizedNodeContext = prepareNNC(TypeDefinitionAwareCodec.from(BaseTypes.booleanType()).deserialize("true"), elName);
nnToXml(normalizedNodeContext, "<" + elName + ">true</" + elName + ">");
}
use of org.opendaylight.netconf.sal.rest.impl.NormalizedNodeContext in project netconf by opendaylight.
the class NnToXmlTest method nnAsYangIdentityrefWithQNamePrefixToXMLTest.
@Test
public void nnAsYangIdentityrefWithQNamePrefixToXMLTest() throws Exception {
final NormalizedNodeContext normalizedNodeContext = prepareIdrefData("prefix", true);
nnToXml(normalizedNodeContext, "<lf11 xmlns", "=\"referenced:module\">", ":iden</lf11>");
}
use of org.opendaylight.netconf.sal.rest.impl.NormalizedNodeContext in project netconf by opendaylight.
the class NnToXmlTest method nnAsYangEnumerationToXmlTest.
@Test
public void nnAsYangEnumerationToXmlTest() throws Exception {
final EnumTypeDefinition.EnumPair mockEnum = Mockito.mock(EnumTypeDefinition.EnumPair.class);
Mockito.when(mockEnum.getName()).thenReturn("enum2");
final EnumerationTypeBuilder enumerationTypeBuilder = BaseTypes.enumerationTypeBuilder(QName.create("foo", "foo"));
enumerationTypeBuilder.addEnum(mockEnum);
final String elName = "lfEnumeration";
final NormalizedNodeContext normalizedNodeContext = prepareNNC(TypeDefinitionAwareCodec.from(enumerationTypeBuilder.build()).deserialize("enum2"), elName);
nnToXml(normalizedNodeContext, "<" + elName + ">enum2</" + elName + ">");
}
Aggregations