package com.ericsson.ims.mtas.xdms.communication.diversion.binder;

import static org.junit.Assert.fail;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import com.ericsson.ims.mtas.xdms.communication.diversion.document.CommunicationDiversionDocument;
import com.ericsson.ims.mtas.xdms.communication.diversion.document.ICommunicationDiversionDocument;

public class CommunicationDiversionBinderTest
{
	ICommunicationDiversionBinder binder;

	ICommunicationDiversionDocument document;

	String moType = "MMTel@http://schemas.ericsson.com/mtas/mmtel/cai3g";

	String id = "sip:lulseged.zerfu@ericsson.com";

	@BeforeClass
	public static void setUpBeforeClass() throws Exception
	{

	}

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

	@Before
	public void setUp() throws Exception
	{
		binder = new CommunicationDiversionBinder();
		document = new CommunicationDiversionDocument();
	}

	@After
	public void tearDown() throws Exception
	{
		binder = null;
	}

	@Test
	public void testMarshallCreate()
	{
		try
		{
			binder.marshall(document.createCreate(moType, id));
		}
		catch (Exception e)
		{
			fail("This fails");
		}
	}

	@Test
	public void testMarshallGet()
	{
		try
		{
			binder.marshall(document.createGet(moType, id));
		}
		catch (Exception e)
		{
			fail("This fails");
		}
	}

	@Test
	public void testMarshallDelete()
	{
		try
		{
			binder.marshall(document.createDelete(moType, id));
		}
		catch (Exception e)
		{
			fail("This fails");
		}
	}
}
