content: /*
   * This file was automatically generated by EvoSuite
   */
  
  package com.lts.xmlser;
  
  import org.junit.Test;
  import org.junit.runner.RunWith;
  import org.evosuite.junit.EvoSuiteRunner;
  import static org.junit.Assert.*;
  import com.lts.LTSException;
  import com.lts.io.IndentingPrintWriter;
  import com.lts.xmlser.AbstractTag;
  import com.lts.xmlser.Fixup;
  import com.lts.xmlser.XmlSerializer;
  import com.lts.xmlser.tags.DateTag;
  import java.io.ByteArrayOutputStream;
  import java.io.InvalidObjectException;
  import java.io.NotSerializableException;
  import java.io.OutputStream;
  import java.io.OutputStreamWriter;
  import java.io.PipedOutputStream;
  import java.io.PrintWriter;
  import java.io.StringWriter;
  import java.io.Writer;
  import java.sql.Timestamp;
  import java.util.HashMap;
  import java.util.LinkedList;
  import java.util.List;
  import javax.imageio.metadata.IIOMetadataNode;
  import org.junit.BeforeClass;
  import org.w3c.dom.Element;
  
  @RunWith(EvoSuiteRunner.class)
  public class XmlSerializerEvoSuiteTest {
  
    @BeforeClass 
    public static void initEvoSuiteFramework(){ 
      org.evosuite.Properties.REPLACE_CALLS = true; 
    } 
  
  
    @Test
    public void test0()  throws Throwable  {
        Class<?> class0 = XmlSerializer.class;
        AbstractTag abstractTag0 = XmlSerializer.specialClassToTag(class0);
        assertNull(abstractTag0);
    }
  
    @Test
    public void test1()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        Class<?> class0 = XmlSerializer.class;
        boolean boolean0 = xmlSerializer0.isStringSerialized(class0);
        assertEquals(true, boolean0);
        assertEquals(false, xmlSerializer0.serializeNulls());
        assertEquals(true, xmlSerializer0.stringSerializePrimitives());
        assertEquals(false, xmlSerializer0.forgiving());
    }
  
    @Test
    public void test2()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        StringWriter stringWriter0 = new StringWriter();
        PrintWriter printWriter0 = new PrintWriter((Writer) stringWriter0);
        IndentingPrintWriter indentingPrintWriter0 = new IndentingPrintWriter((Writer) printWriter0);
        xmlSerializer0.printAttribute(indentingPrintWriter0, "UQu~k':o#IhXk@Gzfs", "UQu~k':o#IhXk@Gzfs");
        assertEquals("UQu~k':o#IhXk@Gzfs=\"UQu~k':o#IhXk@Gzfs\"", stringWriter0.toString());
    }
  
    @Test
    public void test3()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(1397);
        IndentingPrintWriter indentingPrintWriter0 = new IndentingPrintWriter((OutputStream) byteArrayOutputStream0);
        xmlSerializer0.printObject(indentingPrintWriter0, (Object) "class", "not impelemented");
        assertEquals(322, byteArrayOutputStream0.size());
        assertEquals("<!-- class -->\n<not impelemented id=\"0\" class=\"java.lang.String\">\n    <count>5</count>\n    <hash>0</hash>\n    <offset>0</offset>\n    <value id=\"1\" array=\"true\" class=\"char\">\n        <char>c</char>\n        <char>l</char>\n        <char>a</char>\n        <char>s</char>\n        <char>s</char>\n    </value>\n</not impelemented>\n", byteArrayOutputStream0.toString());
    }
  
    @Test
    public void test4()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        assertEquals(false, xmlSerializer0.serializeNulls());
        
        xmlSerializer0.setSerializeNulls(true);
        assertEquals(true, xmlSerializer0.serializeNulls());
        assertEquals(true, xmlSerializer0.getSerializeNulls());
    }
  
    @Test
    public void test5()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        // Undeclared exception!
        try {
          xmlSerializer0.writeObject((IndentingPrintWriter) null, (Object) "class");
          fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        }
    }
  
    @Test
    public void test6()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        boolean boolean0 = xmlSerializer0.serializeNulls();
        assertEquals(true, xmlSerializer0.getStringSerializePrimitives());
        assertEquals(false, boolean0);
        assertEquals(false, xmlSerializer0.forgiving());
    }
  
    @Test
    public void test7()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        IIOMetadataNode iIOMetadataNode0 = new IIOMetadataNode();
        // Undeclared exception!
        try {
          xmlSerializer0.toObject((Element) iIOMetadataNode0);
          fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        }
    }
  
    @Test
    public void test8()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        Integer integer0 = new Integer((-1479));
        xmlSerializer0.idToObject(integer0);
        assertEquals(false, xmlSerializer0.serializeNulls());
        assertEquals(false, xmlSerializer0.forgiving());
        assertEquals(true, xmlSerializer0.stringSerializePrimitives());
        assertEquals(false, xmlSerializer0.getSerializeNulls());
    }
  
    @Test
    public void test9()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        xmlSerializer0.setForgiving(false);
        assertEquals(false, xmlSerializer0.forgiving());
        assertEquals(true, xmlSerializer0.getStringSerializePrimitives());
        assertEquals(false, xmlSerializer0.getSerializeNulls());
        assertEquals(false, xmlSerializer0.serializeNulls());
    }
  
    @Test
    public void test10()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream();
        OutputStreamWriter outputStreamWriter0 = new OutputStreamWriter((OutputStream) byteArrayOutputStream0);
        IndentingPrintWriter indentingPrintWriter0 = new IndentingPrintWriter((Writer) outputStreamWriter0);
        xmlSerializer0.printWhatever(indentingPrintWriter0, (Object) null, "9iNub`O<2tmX");
        assertEquals(28, byteArrayOutputStream0.size());
        assertEquals("<9iNub`O<2tmX null=\"true\"/>\n", byteArrayOutputStream0.toString());
    }
  
    @Test
    public void test11()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        boolean boolean0 = xmlSerializer0.getStringSerializePrimitives();
        assertEquals(false, xmlSerializer0.forgiving());
        assertEquals(false, xmlSerializer0.serializeNulls());
        assertEquals(true, boolean0);
    }
  
    @Test
    public void test12()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        PipedOutputStream pipedOutputStream0 = new PipedOutputStream();
        IndentingPrintWriter indentingPrintWriter0 = new IndentingPrintWriter((OutputStream) pipedOutputStream0);
        xmlSerializer0.printClosingElement(indentingPrintWriter0, "Mq@[38W9=(P6p%uC");
        assertEquals(true, indentingPrintWriter0.checkError());
    }
  
    @Test
    public void test13()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        assertEquals(true, xmlSerializer0.getStringSerializePrimitives());
        
        xmlSerializer0.setStringSerializePrimitives(false);
        assertEquals(false, xmlSerializer0.stringSerializePrimitives());
        assertEquals(false, xmlSerializer0.getStringSerializePrimitives());
    }
  
    @Test
    public void test14()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        Fixup fixup0 = new Fixup();
        xmlSerializer0.addDeferredFixup(fixup0);
        assertEquals(false, xmlSerializer0.serializeNulls());
        assertEquals(false, xmlSerializer0.forgiving());
        assertEquals(true, xmlSerializer0.stringSerializePrimitives());
    }
  
    @Test
    public void test15()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        boolean boolean0 = xmlSerializer0.getSerializeNulls();
        assertEquals(true, xmlSerializer0.stringSerializePrimitives());
        assertEquals(false, xmlSerializer0.forgiving());
        assertEquals(false, boolean0);
    }
  
    @Test
    public void test16()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream();
        OutputStreamWriter outputStreamWriter0 = new OutputStreamWriter((OutputStream) byteArrayOutputStream0);
        IndentingPrintWriter indentingPrintWriter0 = new IndentingPrintWriter((Writer) outputStreamWriter0);
        xmlSerializer0.printClosingElement(indentingPrintWriter0, "null", false);
        assertEquals(false, indentingPrintWriter0.needToPrintPrefix());
        assertEquals(7, byteArrayOutputStream0.size());
    }
  
    @Test
    public void test17()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        PipedOutputStream pipedOutputStream0 = new PipedOutputStream();
        IndentingPrintWriter indentingPrintWriter0 = new IndentingPrintWriter((OutputStream) pipedOutputStream0);
        HashMap<Byte, Timestamp> hashMap0 = new HashMap<Byte, Timestamp>();
        xmlSerializer0.printValue(indentingPrintWriter0, (Object) hashMap0);
        assertEquals(true, indentingPrintWriter0.checkError());
    }
  
    @Test
    public void test18()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        StringWriter stringWriter0 = new StringWriter();
        IndentingPrintWriter indentingPrintWriter0 = new IndentingPrintWriter((Writer) stringWriter0);
        xmlSerializer0.printValue(indentingPrintWriter0, (Object) xmlSerializer0.BYTE_TAG, "true");
        assertEquals("<true id=\"0\" class=\"com.lts.xmlser.tags.ByteTag\">\n</true>\n", stringWriter0.toString());
    }
  
    @Test
    public void test19()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(428);
        IndentingPrintWriter indentingPrintWriter0 = new IndentingPrintWriter((OutputStream) byteArrayOutputStream0);
        xmlSerializer0.printValue(indentingPrintWriter0, (Object) null, "id", false);
        assertEquals("<id null=\"true\"/>\n", byteArrayOutputStream0.toString());
        assertEquals(18, byteArrayOutputStream0.size());
    }
  
    @Test
    public void test20()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        // Undeclared exception!
        try {
          xmlSerializer0.printPrimitive((IndentingPrintWriter) null, (Object) "~KJ~#", "~KJ~#");
          fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        }
    }
  
    @Test
    public void test21()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        Class<?> class0 = XmlSerializer.class;
        IIOMetadataNode iIOMetadataNode0 = new IIOMetadataNode();
        // Undeclared exception!
        try {
          xmlSerializer0.readField((Element) iIOMetadataNode0, (Class) class0);
          fail("Expecting exception: ClassCastException");
        } catch(ClassCastException e) {
          /*
           * java.lang.Object cannot be cast to com.lts.xmlser.AbstractTag
           */
        }
    }
  
    @Test
    public void test22()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        IIOMetadataNode iIOMetadataNode0 = new IIOMetadataNode("null");
        xmlSerializer0.readObject((Element) iIOMetadataNode0);
        assertEquals(false, xmlSerializer0.forgiving());
        assertEquals(false, xmlSerializer0.getSerializeNulls());
        assertEquals(true, xmlSerializer0.getStringSerializePrimitives());
    }
  
    @Test
    public void test23()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        Class<?> class0 = XmlSerializer.class;
        xmlSerializer0.findResolveMethod(class0);
        xmlSerializer0.findResolveMethod(class0);
        assertEquals(false, xmlSerializer0.forgiving());
        assertEquals(false, xmlSerializer0.serializeNulls());
        assertEquals(true, xmlSerializer0.getStringSerializePrimitives());
    }
  
    @Test
    public void test24()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        DateTag dateTag0 = new DateTag();
        xmlSerializer0.invokeResolve((Object) dateTag0);
        assertEquals(false, xmlSerializer0.serializeNulls());
        assertEquals(true, xmlSerializer0.stringSerializePrimitives());
        assertEquals(false, xmlSerializer0.forgiving());
        assertEquals(false, xmlSerializer0.getSerializeNulls());
    }
  
    @Test
    public void test25()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        Fixup fixup0 = new Fixup();
        Integer integer0 = new Integer(20);
        xmlSerializer0.addIdFixup(integer0, fixup0);
        try {
          xmlSerializer0.addObject((Integer) 20, (Object) xmlSerializer0.SHORT_TAG);
          fail("Expecting exception: LTSException");
        } catch(LTSException e) {
          /*
           * not impelemented
           */
        }
    }
  
    @Test
    public void test26()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        Integer integer0 = new Integer((-1359));
        LinkedList<Double> linkedList0 = new LinkedList<Double>();
        xmlSerializer0.addObject(integer0, (Object) linkedList0);
        xmlSerializer0.validateGraph();
        assertEquals(true, xmlSerializer0.stringSerializePrimitives());
        assertEquals(false, xmlSerializer0.getSerializeNulls());
        assertEquals(false, xmlSerializer0.forgiving());
    }
  
    @Test
    public void test27()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        xmlSerializer0.validateGraph();
        assertEquals(false, xmlSerializer0.forgiving());
        assertEquals(true, xmlSerializer0.getStringSerializePrimitives());
        assertEquals(false, xmlSerializer0.serializeNulls());
        assertEquals(true, xmlSerializer0.stringSerializePrimitives());
    }
  
    @Test
    public void test28()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        List<Object> list0 = xmlSerializer0.getDeferredFixups();
        assertNotNull(list0);
        
        xmlSerializer0.fixupReferences((Object) "-0x1.0p0", (List) list0);
        assertEquals(false, xmlSerializer0.forgiving());
        assertEquals(false, xmlSerializer0.serializeNulls());
        assertEquals(true, xmlSerializer0.stringSerializePrimitives());
    }
  
    @Test
    public void test29()  throws Throwable  {
        XmlSerializer xmlSerializer0 = new XmlSerializer();
        xmlSerializer0.performFixups();
        assertEquals(false, xmlSerializer0.forgiving());
        assertEquals(true, xmlSerializer0.getStringSerializePrimitives());
        assertEquals(false, xmlSerializer0.getSerializeNulls());
        assertEquals(true, xmlSerializer0.stringSerializePrimitives());
    }
  }
  