/******************************************************************************* * Copyright (c) 2010 Red Hat, Inc. * Distributed under license by Red Hat, Inc. All rights reserved. * This program is made available under the terms of the * Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Red Hat, Inc. - initial API and implementation ******************************************************************************/ package org.jboss.tools.seam.xml.test; import junit.extensions.TestSetup; import junit.framework.Test; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.NullProgressMonitor; import org.jboss.tools.test.util.JobUtils; import org.jboss.tools.test.util.ResourcesUtils; /** * @author Viacheslav Kabanovich */ public class SeamXMLTestSetup extends TestSetup { protected IProject project; public SeamXMLTestSetup(Test test) { super(test); } @Override protected void setUp() throws Exception { project = ResourcesUtils.importProject( "org.jboss.tools.seam.xml.test","/projects/Test" , new NullProgressMonitor()); JobUtils.waitForIdle(); } @Override protected void tearDown() throws Exception { boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false); JobUtils.waitForIdle(); project.delete(true, true, null); JobUtils.waitForIdle(); ResourcesUtils.setBuildAutomatically(saveAutoBuild); } }