| File was renamed from opends/tests/unit-tests-testng/src/server/org/opends/quicksetup/Utils.java |
| | |
| | | |
| | | import org.opends.quicksetup.util.ZipExtractor; |
| | | import org.opends.quicksetup.util.ServerController; |
| | | import org.opends.quicksetup.util.FileManager; |
| | | import org.opends.server.TestCaseUtils; |
| | | import org.opends.server.types.OperatingSystem; |
| | | |
| | |
| | | /** |
| | | * |
| | | */ |
| | | public class Utils { |
| | | public class TestUtilities { |
| | | |
| | | /** |
| | | * The name of the system property that specifies the server build root. |
| | |
| | | if (!initialized) { |
| | | if (qsServerRoot.exists()) { |
| | | stopServer(); |
| | | if (!qsServerRoot.delete()) { |
| | | throw new IllegalStateException("cannot delete stale installation"); |
| | | } |
| | | new FileManager().deleteRecursively(qsServerRoot); |
| | | } |
| | | ZipExtractor extractor = new ZipExtractor(getInstallPackageFile()); |
| | | extractor.extract(qsServerRoot); |
| | |
| | | } |
| | | |
| | | static public Installation getInstallation() { |
| | | return new Installation(Utils.getQuickSetupTestServerRootDir()); |
| | | return new Installation(getQuickSetupTestServerRootDir()); |
| | | } |
| | | |
| | | static private void setupServer() throws IOException, InterruptedException { |
| | |
| | | return installPackageFile; |
| | | } |
| | | |
| | | static public File getQuickSetupTestServerRootDir() { |
| | | static public File getQuickSetupTestWorkspace() { |
| | | String buildRoot = System.getProperty(PROPERTY_BUILD_ROOT); |
| | | File buildDir = new File(buildRoot, "build"); |
| | | File unitRootDir = new File(buildDir, "unit-tests"); |
| | | return new File(unitRootDir, "quicksetup"); |
| | | } |
| | | |
| | | static public File getQuickSetupTestServerRootDir() { |
| | | return new File(getQuickSetupTestWorkspace(), "OpenDS"); |
| | | } |
| | | |
| | | } |