01: /***************************************************************************************************
02: * Copyright (c) 2003, 2005 IBM Corporation and others. All rights reserved. This program and the
03: * accompanying materials are made available under the terms of the Eclipse Public License v1.0
04: * which accompanies this distribution, and is available at
05: * http://www.eclipse.org/legal/epl-v10.html
06: *
07: * Contributors: IBM Corporation - initial API and implementation
08: **************************************************************************************************/package org.eclipse.ui.tests.navigator.util;
09:
10: import org.eclipse.core.resources.IProject;
11: import org.eclipse.core.resources.ResourcesPlugin;
12: import org.eclipse.core.runtime.Path;
13:
14: public class TestWorkspace {
15: public static final String TEST_PROJECT_NAME = "Test"; //$NON-NLS-1$
16:
17: private static final String TEST_TESTDATA = "/testdata/Test.zip"; //$NON-NLS-1$
18:
19: public static void init() {
20:
21: // setup test resource project
22: ProjectUnzipUtil util = new ProjectUnzipUtil(new Path(
23: TEST_TESTDATA), new String[] { TEST_PROJECT_NAME });
24:
25: if (!getTestProject().isAccessible()) {
26: util.createProjects();
27: } else {
28: util.reset();
29: }
30:
31: }
32:
33: public static IProject getTestProject() {
34: return ResourcesPlugin.getWorkspace().getRoot().getProject(
35: TEST_PROJECT_NAME);
36: }
37: }
|