package net.time4j.calendar.bahai;

import net.time4j.calendar.frenchrev.FrenchRepublicanCalendar;
import net.time4j.calendar.frenchrev.Sansculottides;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;


@RunWith(JUnit4.class)
public class SerializationTest {

    @Test
    public void serializeNormal() throws IOException, ClassNotFoundException {
        roundtrip(BadiCalendar.ofComplete(3, 19, 19, BadiMonth.valueOf(19), 19));
    }

    @Test
    public void serializeAyyamIHa() throws IOException, ClassNotFoundException {
        roundtrip(BadiCalendar.ofIntercalary(19, 19, 4));
    }

    private static void roundtrip(Object obj)
        throws IOException, ClassNotFoundException {

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(baos);
        oos.writeObject(obj);
        byte[] data = baos.toByteArray();
        oos.close();
        ByteArrayInputStream bais = new ByteArrayInputStream(data);
        ObjectInputStream ois = new ObjectInputStream(bais);
        assertThat(ois.readObject(), is(obj));
        ois.close();
    }

}
@@ -33,124 +33,8 @@
 i;%0A%0A
-import net.time4j.calendar.frenchrev.FrenchRepublicanCalendar;%0Aimport net.time4j.calendar.frenchrev.Sansculottides;%0A
 impo

remove unused imports