package org.bench4q.agent.test.model;

import static org.junit.Assert.*;

import java.io.File;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;

import org.bench4q.share.models.agent.scriptrecord.BehaviorModel;
import org.junit.Test;

public class UserBehaviorModelTest {

	@Test
	public void testUnmarshal() throws JAXBException {
		Unmarshaller unmarshaller = JAXBContext.newInstance(
				BehaviorModel.class).createUnmarshaller();
		Object object = unmarshaller.unmarshal(new File("Scripts"
				+ System.getProperty("file.separator") + "behaviorModel.xml"));
		BehaviorModel userBehaviorModel = (BehaviorModel) object;
		System.out.println(userBehaviorModel.getUse());
		assertTrue(object instanceof BehaviorModel);
	}
}
