Kaydet (Commit) 1a152091 authored tarafından Liu Zhe's avatar Liu Zhe

Move Testspace into testcommon.

üst cadff32a
......@@ -24,11 +24,10 @@
package testlib;
import static testlib.UIMap.*;
import java.io.File;
import org.openoffice.test.common.Condition;
import org.openoffice.test.common.FileUtil;
import org.openoffice.test.common.SystemUtil;
import org.openoffice.test.common.Testspace;
import org.openoffice.test.vcl.Tester;
import org.openoffice.test.vcl.widgets.VclWindow;
......@@ -83,16 +82,10 @@ public class AppUtil extends Tester {
* @return a absolute path on the local
*/
public static String testFile(String path) {
File source = new File("data", path);
File target = Testspace.getFile("data/" + path);
FileUtil.copyFile(source, target);
return target.getAbsolutePath();
return Testspace.prepareData(path);
}
public static String fullPath(String relativePath) {
File file = new File(relativePath);
if (file.isAbsolute())
return relativePath;
return Testspace.getPath(relativePath);
}
......
......@@ -32,6 +32,7 @@ import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
import org.openoffice.test.OpenOffice;
import org.openoffice.test.common.GraphicsUtil;
import org.openoffice.test.common.Testspace;
import org.openoffice.test.vcl.client.CommunicationException;
/**
......
/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
package testlib;
import java.io.File;
/**
*
*
*/
public class Testspace {
private static final File testspace = new File(System.getProperty("testspace", "../testspace"));
public static String getPath() {
return testspace.getAbsolutePath();
}
public static String getPath(String file) {
return getFile(file).getAbsolutePath();
}
public static File getFile() {
return testspace;
}
public static File getFile(String file) {
return new File(testspace, file);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment