public class LoaderTest extends TestCase {
public void testCompose1() {
Yaml loader = new Yaml();
String yaml = "abc: 3";
MappingNode node = (MappingNode) loader.compose(new StringReader(yaml));
List<NodeTuple> nodes = node.getValue();
assertEquals(1, nodes.size());
NodeTuple pairs = nodes.get(0);
ScalarNode key = (ScalarNode) pairs.getKeyNode();
assertEquals(Tag.STR, key.getTag());
assertEquals("abc", key.getValue());
//
ScalarNode value = (ScalarNode) pairs.getValueNode();
assertEquals(Tag.INT, value.getTag());
assertEquals("3", value.getValue());
//
assertEquals(
"<org.yaml.snakeyaml.nodes.MappingNode (tag=tag:yaml.org,2002:map, values={ key=<org.yaml.snakeyaml.nodes.ScalarNode (tag=tag:yaml.org,2002:str, value=abc)>; value=<NodeTuple keyNode=<org.yaml.snakeyaml.nodes.ScalarNode (tag=tag:yaml.org,2002:str, value=abc)>; valueNode=<org.yaml.snakeyaml.nodes.ScalarNode (tag=tag:yaml.org,2002:int, value=3)>> })>",
node.toString());
}