/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package hu.astrid.xmltools.beantoxml;

import java.io.ByteArrayOutputStream;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author inagy
 */
public class BeanToXmlConverterTest {

    public BeanToXmlConverterTest() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }

    @Before
    public void setUp() {
    }

    @After
    public void tearDown() {
    }

    /**
     * Test of BeanToXmlConverter(URL,OutputStream) method, of class BeanToXmlConverter.
     */
    @Test
    public void testBeanToXmlConverter_URL_OutputStream() {
        try {
            System.out.println("testBeanToXmlConverter_URL_OutputStream");
            BeanToXmlConverter instance = new BeanToXmlConverter(new URL("http://biobank.genreposit.hu/test/patient.xsd"), new ByteArrayOutputStream());
            assertEquals("http://www.astrid.hu/debgenbiobank/biobankpatient", instance.getNameSpace());
            assertEquals("biobankpatient", instance.getNameSpacePrefix());
            assertTrue("Should validate.", instance.validate);
            assertTrue("Should use Schema.", instance.isUseSchema());
            assertEquals("1.0", instance.getVersion());
            assertEquals("http://biobank.genreposit.hu/test/patient.xsd", instance.getSchemaLocation());
        } catch (Exception ex) {
            Logger.getLogger(BeanToXmlConverterTest.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}