001/*
002 * #%L
003 * Netarchivesuite - common - test
004 * %%
005 * Copyright (C) 2005 - 2018 The Royal Danish Library, 
006 *             the National Library of France and the Austrian National Library.
007 * %%
008 * This program is free software: you can redistribute it and/or modify
009 * it under the terms of the GNU Lesser General Public License as
010 * published by the Free Software Foundation, either version 2.1 of the
011 * License, or (at your option) any later version.
012 * 
013 * This program is distributed in the hope that it will be useful,
014 * but WITHOUT ANY WARRANTY; without even the implied warranty of
015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016 * GNU General Lesser Public License for more details.
017 * 
018 * You should have received a copy of the GNU General Lesser Public
019 * License along with this program.  If not, see
020 * <http://www.gnu.org/licenses/lgpl-2.1.html>.
021 * #L%
022 */
023package dk.netarkivet.common.utils;
024
025import java.io.File;
026import java.util.HashSet;
027import java.util.Set;
028
029import dk.netarkivet.common.distribute.JMSConnectionSunMQ;
030
031/*
032 * Constants used by various test classes in modules common-test, and deploy-test. 
033 */
034public class TestInfo {
035    public static final File BASEDIR = new File("./tests/dk/netarkivet/common/utils");
036    public static final File TEMPDIR = new File(BASEDIR, "working");
037    public static final File DATADIR = new File(BASEDIR, "data");
038    public static final File TESTXML = new File(TEMPDIR, "test.xml");
039    public static final File NEWXML = new File(TEMPDIR, "savedtest.xml");
040    public static final File INVALIDXML = new File(TEMPDIR, "invalid.xml");
041    public static final String SETTINGSFILENAME = new File(TEMPDIR, "settings.xml").getAbsolutePath();
042    public static final String PORT = JMSConnectionSunMQ.JMS_BROKER_PORT;
043
044    public static final String PORTVALUE = "7676";
045    public static final String PROCESS_TIMEOUT_VALUE = "5000";
046    public static final String TIMEOUT = "settings.common.arcrepositoryClient.timeout";
047    public static final String FIVE_HUNDRED_MEGA_FILE_ZIPPED = "500-mega.zip";
048    public static final String FIVE_HUNDRED_MEGA_FILE_UNZIPPED = "500-mega";
049    public static final File MD5_EMPTY_FILE = new File(TEMPDIR, "MD5-empty-file");
050    public static final String UNUSED_PROPERTY = "settings.never.ever.define.this.property";
051
052    static final File FILEUTILS_DATADIR = new File(BASEDIR, "fileutils_data");
053    static final File CDX_FILTER_TEST_DATA_DIR = new File(FILEUTILS_DATADIR, "cdx-filter");
054    static final Set<String> CDX_FILTER_TEST_CDX_FILES = new HashSet<String>(java.util.Arrays.asList(new String[] {
055            "Reader1.cdx", "Reader2.cdx"}));
056    public static final File XML_FILE_1 = new File(TestInfo.TEMPDIR, "test1.xml");
057    public static final File XML_FILE_2 = new File(TestInfo.TEMPDIR, "test2.xml");
058    public static final String XML_FILE_1_XPATH_1 = "/test/file/attachHere";
059    public static final String LAST_LINE_TEXT = "last line";
060    public static final File FILE_WITH_NEWLINE_AT_END = new File(TEMPDIR, "newlinedfile.txt");
061    public static final File FILE_WITH_NO_NEWLINE_AT_END = new File(TEMPDIR, "nonewlinedfile.txt");
062    public static final File FILE_WITH_ONE_LINE = new File(TEMPDIR, "onelinedfile.txt");
063    public static final File EMPTY_FILE = new File(TEMPDIR, "emptyfile.txt");
064    public static final File ZIPDIR = new File(TEMPDIR, "zipdir");
065    public static final File ZIPPED_DIR = new File(TestInfo.ZIPDIR, "zippedDir.zip");
066    public static final File ZIPPED_DIR_WITH_SUBDIRS = new File(TestInfo.ZIPDIR, "sub/zippedDirWithSubdirs.zip");
067
068    public static final File NON_EXISTING_FILE = new File("/no/such/file");
069    public static final File SETTINGS_FILE = new File(TEMPDIR, "settings.xml");
070
071}