001// Copyright 2013 The Apache Software Foundation
002//
003// Licensed under the Apache License, Version 2.0 (the "License");
004// you may not use this file except in compliance with the License.
005// You may obtain a copy of the License at
006//
007//     http://www.apache.org/licenses/LICENSE-2.0
008//
009// Unless required by applicable law or agreed to in writing, software
010// distributed under the License is distributed on an "AS IS" BASIS,
011// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012// See the License for the specific language governing permissions and
013// limitations under the License.
014
015package org.apache.tapestry5.test.constants;
016
017import java.io.File;
018
019/**
020 * @since 5.4
021 */
022public class TapestryRunnerConstants
023{
024    /**
025     * The current working directory (i.e., property "user.dir").
026     */
027    public static final String CURRENT_DIR_PATH = System.getProperty("user.dir");
028    /**
029     * The Surefire plugin sets basedir but DOES NOT change the current working directory. When
030     * building across modules, basedir changes for each module, but user.dir does not. This value should be used when
031     * referencing local files. Outside of surefire, the "basedir" property will not be set, and the current working
032     * directory will be the default.
033     */
034    public static final String MODULE_BASE_DIR_PATH = System.getProperty("basedir", CURRENT_DIR_PATH);
035    /**
036     * {@link #MODULE_BASE_DIR_PATH} as a file.
037     */
038    public static final File MODULE_BASE_DIR = new File(MODULE_BASE_DIR_PATH);
039}