From 7943ee7971676e8b8c44ac9acfb9729d026dfc25 Mon Sep 17 00:00:00 2001 From: Kieron Briggs Date: Sun, 23 Jun 2013 12:47:42 +1000 Subject: [PATCH] [JENKINS-18154] Add test for OUTPUT_DIRECTORY=. --- .../plugins/doxygen/DoxygenArchiverTest.java | 42 +++++- .../hudson/plugins/doxygen/Doxyfile-dot | 125 ++++++++++++++++++ 2 files changed, 165 insertions(+), 2 deletions(-) create mode 100644 src/test/resources/hudson/plugins/doxygen/Doxyfile-dot diff --git a/src/test/java/hudson/plugins/doxygen/DoxygenArchiverTest.java b/src/test/java/hudson/plugins/doxygen/DoxygenArchiverTest.java index d076ba9..8c8d692 100644 --- a/src/test/java/hudson/plugins/doxygen/DoxygenArchiverTest.java +++ b/src/test/java/hudson/plugins/doxygen/DoxygenArchiverTest.java @@ -227,6 +227,44 @@ public void retrieveDoxygenFromLoadFileWithWhereRun() throws Exception { classContext.assertIsSatisfied(); context.assertIsSatisfied(); - } - + } + + + @Test + public void retrieveDoxygenFromLoadFileWithWhereRunDot() throws Exception { + + String whereRun = "testWhereRun"; + + //Create the doxyfile with content in the temporary workspace + FilePath doxyfileDir = new FilePath(workspace,whereRun); + FilePath doxyfilePath = doxyfileDir.child("Doxyfile-dot"); + doxyfileDir.mkdirs(); + FileOutputStream fos = new FileOutputStream(new File(doxyfilePath.toURI())); + fos.write(readAsString("Doxyfile-dot").getBytes()); + fos.close(); + + //Create the generated doxygen directory + String commandDoxygenGeneratedDirectoryName="html"; + FilePath doxygenDir=new FilePath(doxyfileDir,commandDoxygenGeneratedDirectoryName); + doxygenDir.mkdirs(); + + + DoxygenDirectoryParser doxygenDirectoryParser = + new DoxygenDirectoryParser(DoxygenArchiverDescriptor.DOXYGEN_DOXYFILE_PUBLISHTYPE ,doxyfilePath.toString(),"",whereRun); + + classContext.checking(new Expectations() { + { + ignoring(taskListener).getLogger(); + will(returnValue(new PrintStream(new ByteArrayOutputStream()))); + } + }); + + FilePath resultDoxygenDirectory = doxygenDirectoryParser.invoke(parentFile, virtualChannel); + assertEquals("The computed doxygen directory is not correct", doxygenDir.toURI(),resultDoxygenDirectory.toURI()); + + + classContext.assertIsSatisfied(); + context.assertIsSatisfied(); + } + } diff --git a/src/test/resources/hudson/plugins/doxygen/Doxyfile-dot b/src/test/resources/hudson/plugins/doxygen/Doxyfile-dot new file mode 100644 index 0000000..f6b846c --- /dev/null +++ b/src/test/resources/hudson/plugins/doxygen/Doxyfile-dot @@ -0,0 +1,125 @@ +# Doxyfile 1.5.7.1 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = test +PROJECT_NUMBER = test +OUTPUT_DIRECTORY = . +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = "C:/Documents and Settings/s0011918/" +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = YES +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +TYPEDEF_HIDES_STRUCT = NO +SYMBOL_CACHE_SIZE = 0 +INPUT = src/main/java +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.f90 \ + *.f \ + *.vhd \ + *.vhdl +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +HTML_DYNAMIC_SECTIONS = NO +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_BUNDLE_ID = org.doxygen.Project +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +CHM_INDEX_ENCODING = +BINARY_TOC = NO +TOC_EXPAND = NO +GENERATE_QHP = NO +QCH_FILE = +QHP_NAMESPACE = org.doxygen.Project +QHP_VIRTUAL_FOLDER = doc +QHG_LOCATION = +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NONE +TREEVIEW_WIDTH = 250 +FORMULA_FONTSIZE = 10