// Path: src/main/java/org/yaml/snakeyaml/DumperOptions.java
// public enum ScalarStyle {
//     DOUBLE_QUOTED(Character.valueOf('"')), SINGLE_QUOTED(Character.valueOf('\'')), LITERAL(
//             Character.valueOf('|')), FOLDED(Character.valueOf('>')), PLAIN(null);
//     private Character styleChar;
// 
//     private ScalarStyle(Character style) {
//         this.styleChar = style;
//     }
// 
//     public Character getChar() {
//         return styleChar;
//     }
// 
//     @Override
//     public String toString() {
//         return "Scalar style: '" + styleChar + "'";
//     }
// 
//     public static ScalarStyle createStyle(Character style) {
//         if (style == null) {
//             return PLAIN;
//         } else {
//             switch (style) {
//             case '"':
//                 return DOUBLE_QUOTED;
//             case '\'':
//                 return SINGLE_QUOTED;
//             case '|':
//                 return LITERAL;
//             case '>':
//                 return FOLDED;
//             default:
//                 throw new YAMLException("Unknown scalar style character: " + style);
//             }
//         }
//     }
// }


import java.io.InputStream;
import java.util.Map;
import junit.framework.TestCase;
import org.yaml.snakeyaml.DumperOptions.ScalarStyle;
/**
 * Copyright (c) 2008, http://www.snakeyaml.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.yaml.snakeyaml;




/**
 * Test Chapter 2.3 from the YAML specification
 * 
 * @see <a href="http://yaml.org/spec/1.1/"></a>
 */
public class Chapter2_3Test extends TestCase {

    public void testExample_2_13() {
        YamlDocument document = new YamlDocument("example2_13.yaml");
        String data = (String) document.getNativeData();
        assertEquals("\\//||\\/||\n// ||  ||__\n", data);
    }

    public void testExample_2_14() {
        YamlDocument document = new YamlDocument("example2_14.yaml");
        String data = (String) document.getNativeData();
        assertEquals("Mark McGwire's year was crippled by a knee injury.", data);
    }

    public void testExample_2_15() {
        String etalon = "Sammy Sosa completed another fine season with great stats.\n\n  63 Home Runs\n  0.288 Batting Average\n\nWhat a year!\n";
        InputStream input = YamlDocument.class.getClassLoader().getResourceAsStream(
                YamlDocument.ROOT + "example2_15.yaml");
        DumperOptions options = new DumperOptions();
// Path: src/main/java/org/yaml/snakeyaml/DumperOptions.java
// public enum ScalarStyle {
//     DOUBLE_QUOTED(Character.valueOf('"')), SINGLE_QUOTED(Character.valueOf('\'')), LITERAL(
//             Character.valueOf('|')), FOLDED(Character.valueOf('>')), PLAIN(null);
//     private Character styleChar;
// 
//     private ScalarStyle(Character style) {
//         this.styleChar = style;
//     }
// 
//     public Character getChar() {
//         return styleChar;
//     }
// 
//     @Override
//     public String toString() {
//         return "Scalar style: '" + styleChar + "'";
//     }
// 
//     public static ScalarStyle createStyle(Character style) {
//         if (style == null) {
//             return PLAIN;
//         } else {
//             switch (style) {
//             case '"':
//                 return DOUBLE_QUOTED;
//             case '\'':
//                 return SINGLE_QUOTED;
//             case '|':
//                 return LITERAL;
//             case '>':
//                 return FOLDED;
//             default:
//                 throw new YAMLException("Unknown scalar style character: " + style);
//             }
//         }
//     }
// }


// Path: src/test/java/org/yaml/snakeyaml/Chapter2_3Test.java
import java.io.InputStream;
import java.util.Map;
import junit.framework.TestCase;
import org.yaml.snakeyaml.DumperOptions.ScalarStyle;

/**
 * Copyright (c) 2008, http://www.snakeyaml.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.yaml.snakeyaml;




/**
 * Test Chapter 2.3 from the YAML specification
 * 
 * @see <a href="http://yaml.org/spec/1.1/"></a>
 */
public class Chapter2_3Test extends TestCase {

    public void testExample_2_13() {
        YamlDocument document = new YamlDocument("example2_13.yaml");
        String data = (String) document.getNativeData();
        assertEquals("\\//||\\/||\n// ||  ||__\n", data);
    }

    public void testExample_2_14() {
        YamlDocument document = new YamlDocument("example2_14.yaml");
        String data = (String) document.getNativeData();
        assertEquals("Mark McGwire's year was crippled by a knee injury.", data);
    }

    public void testExample_2_15() {
        String etalon = "Sammy Sosa completed another fine season with great stats.\n\n  63 Home Runs\n  0.288 Batting Average\n\nWhat a year!\n";
        InputStream input = YamlDocument.class.getClassLoader().getResourceAsStream(
                YamlDocument.ROOT + "example2_15.yaml");
        DumperOptions options = new DumperOptions();
        options.setDefaultScalarStyle(ScalarStyle.FOLDED);