Class ConfigurationTestUtils


  • public abstract class ConfigurationTestUtils
    extends org.junit.Assert

    ConfigurationTestUtils class.

    Version:
    $Id: $
    Author:
    ranger
    • Constructor Detail

      • ConfigurationTestUtils

        public ConfigurationTestUtils()
    • Method Detail

      • getUrlForResource

        public static URL getUrlForResource​(Object obj,
                                            String resource)

        getUrlForResource

        Parameters:
        obj - a Object object.
        resource - a String object.
        Returns:
        a URL object.
      • getSpringResourceForResource

        public static org.springframework.core.io.Resource getSpringResourceForResource​(Object obj,
                                                                                        String resource)

        getSpringResourceForResource

        Parameters:
        obj - a Object object.
        resource - a String object.
        Returns:
        a Resource object.
      • getSpringResourceForResourceWithReplacements

        public static org.springframework.core.io.Resource getSpringResourceForResourceWithReplacements​(Object obj,
                                                                                                        String resource,
                                                                                                        String[]... replacements)
                                                                                                 throws IOException
        Throws:
        IOException
      • getFileForResource

        public static File getFileForResource​(Object obj,
                                              String resource)

        getFileForResource

        Parameters:
        obj - a Object object.
        resource - a String object.
        Returns:
        a File object.
      • getReaderForResource

        public static Reader getReaderForResource​(Object obj,
                                                  String resource)
        Deprecated.
        Use getInputStreamForResource instead.
        Parameters:
        obj - a Object object.
        resource - a String object.
        Returns:
        a Reader object.
      • getInputStreamForResource

        public static InputStream getInputStreamForResource​(Object obj,
                                                            String resource)

        getInputStreamForResource

        Parameters:
        obj - a Object object.
        resource - a String object.
        Returns:
        a InputStream object.
      • getInputStreamForResource

        public static InputStream getInputStreamForResource​(String resource)

        getInputStreamForResource

        Parameters:
        resource - a String object.
        Returns:
        a InputStream object.
      • getReaderForResourceWithReplacements

        public static Reader getReaderForResourceWithReplacements​(Object obj,
                                                                  String resource,
                                                                  String[]... replacements)
                                                           throws IOException

        getReaderForResourceWithReplacements

        Parameters:
        obj - a Object object.
        resource - a String object.
        replacements - an array of String objects.
        Returns:
        a Reader object.
        Throws:
        IOException - if any.
      • getInputStreamForResourceWithReplacements

        public static InputStream getInputStreamForResourceWithReplacements​(Object obj,
                                                                            String resource,
                                                                            String[]... replacements)
                                                                     throws IOException

        getInputStreamForResourceWithReplacements

        Parameters:
        obj - a Object object.
        resource - a String object.
        replacements - an array of String objects.
        Returns:
        a InputStream object.
        Throws:
        IOException - if any.
      • getResourceForConfigWithReplacements

        public static org.springframework.core.io.Resource getResourceForConfigWithReplacements​(String config,
                                                                                                String[]... replacements)

        getInputStreamForResourceWithReplacements

        Parameters:
        config - a String config file contents.
        replacements - an array of String objects.
        Returns:
        a InputStream object.
        Throws:
        IOException - if any.
      • getConfigForResourceWithReplacements

        public static String getConfigForResourceWithReplacements​(Object obj,
                                                                  String resource,
                                                                  String[]... replacements)
                                                           throws IOException

        getConfigForResourceWithReplacements

        Parameters:
        obj - a Object object.
        resource - a String object.
        replacements - an array of String objects.
        Returns:
        a String object.
        Throws:
        IOException - if any.
      • performReplacements

        public static String performReplacements​(String newConfig,
                                                 String[]... replacements)
      • getFileForConfigFile

        public static File getFileForConfigFile​(String configFile)

        getFileForConfigFile

        Parameters:
        configFile - a String object.
        Returns:
        a File object.
      • getDaemonEtcDirectory

        public static File getDaemonEtcDirectory()

        getDaemonEtcDirectory

        Returns:
        a File object.
      • setRelativeHomeDirectory

        public static void setRelativeHomeDirectory​(String relativeHomeDirectory)

        setRelativeHomeDirectory

        Parameters:
        relativeHomeDirectory - a String object.
      • setAbsoluteHomeDirectory

        public static void setAbsoluteHomeDirectory​(String absoluteHomeDirectory)

        setAbsoluteHomeDirectory

        Parameters:
        absoluteHomeDirectory - a String object.
      • getTopProjectDirectory

        public static File getTopProjectDirectory()

        getTopProjectDirectory

        Returns:
        a File object.
      • getDaemonProjectDirectory

        public static File getDaemonProjectDirectory()

        getDaemonProjectDirectory

        Returns:
        a File object.
      • setRrdBinary

        public static void setRrdBinary​(String path)

        setRrdBinary

        Parameters:
        path - a String object.
      • setRelativeRrdBaseDirectory

        public static void setRelativeRrdBaseDirectory​(String relativePath)

        setRelativeRrdBaseDirectory

        Parameters:
        relativePath - a String object.
      • setRelativeImporterDirectory

        public static void setRelativeImporterDirectory​(String relativeImporterDirectory)

        setRelativeImporterDirectory

        Parameters:
        relativeImporterDirectory - a String object.
      • setRelativeForeignSourceDirectory

        public static void setRelativeForeignSourceDirectory​(String relativeForeignSourceDirectory)

        setRelativeForeignSourceDirectory

        Parameters:
        relativeForeignSourceDirectory - a String object.