/*
 * See LICENSE file in distribution for copyright and licensing information.
 */
package org.pyyaml;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import junit.framework.TestCase;

import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.ConstructorException;
import org.yaml.snakeyaml.scanner.ScannerException;

public class PyRecursiveTest extends TestCase {

    @SuppressWarnings("unchecked")
    public void testDict() {
        Map<AnInstance, AnInstance> value = new HashMap<AnInstance, AnInstance>();
        AnInstance instance = new AnInstance(value, value);
        value.put(instance, instance);
        Yaml yaml = new Yaml();
        try {
            String output1 = yaml.dump(value);
            Map<AnInstance, AnInstance> value2 = (Map<AnInstance, AnInstance>) yaml.load(output1);
            assertEquals(value, value2);
        } catch (ScannerException e) {
            // TODO recursive objects are not allowed
        }
    }

    @SuppressWarnings("unchecked")
    public void testList() {
        List value = new ArrayList();
        value.add(value);
        Yaml yaml = new Yaml();
        try {
            String output1 = yaml.dump(value);
            System.out.println(output1);
            List value2 = (List) yaml.load(output1);
            assertEquals(value, value2);
        } catch (ConstructorException e) {
            // TODO recursive objects are not allowed
        }
    }

    @SuppressWarnings("unchecked")
    public void testSet() {
        Set value = new HashSet();
        value.add(new AnInstance(value, value));
        Yaml yaml = new Yaml();
        try {
            String output1 = yaml.dump(value);
            List value2 = (List) yaml.load(output1);
            assertEquals(value, value2);
        } catch (ScannerException e) {
            // TODO recursive objects are not allowed
        }
    }
}

@@ -391,61 +391,8 @@
 on;%0D
-%0Aimport org.yaml.snakeyaml.scanner.ScannerException;%0D
 %0A%0D%0Ap
@@ -939,38 +939,42 @@
        %7D catch (
-Scanne
+Constructo
 rException e) %7B%0D
@@ -1898,14 +1898,18 @@
 ch (
-Scanne
+Constructo
 rExc

fix exceptions in test