package org.bench4q.agent.test;

import static org.junit.Assert.*;

import java.io.File;
import java.io.IOException;

import javax.xml.bind.JAXBException;

import org.apache.commons.io.FileUtils;
import org.bench4q.agent.scenario.Scenario;
import org.bench4q.share.helper.MarshalHelper;
import org.bench4q.share.models.agent.RunScenarioModel;
import org.junit.Test;

public class ExtractScenarioTest {

	@Test
	public void test() throws JAXBException, IOException {
		RunScenarioModel runScenarioModel = (RunScenarioModel) MarshalHelper
				.unmarshal(RunScenarioModel.class, FileUtils
						.readFileToString(new File("Scripts/goodForPage.xml")));
		Scenario scenario = Scenario.scenarioBuilderWithCompile(runScenarioModel);

		assertTrue(scenario.getPages().length > 0);
	}
}
