# Path: md/logger.py
# def secondsToHMS(seconds=0):
# def Logger():
# def setLogger(loggerName="", logOutputDir=""):
# def close():
# def writeMessage(message, targetName="", targetStep="", forceStdOut=False):
# def writeError(message, targetName="", targetStep="", filePath="", lineNumber=0, exitProgram=False):
# def reportSkipped(targetName="", targetStep="", reason=""):
# def reportStart(targetName="", targetStep=""):
# def reportSuccess(targetName="", targetStep="", timeInSeconds=0):
# def reportFailure(targetName="", targetStep="", timeInSeconds=0, returnCode=0, exitProgram=False):
# def getOutFd(targetName="", targetStep=""):
# def getErrorFd(targetName="", targetStep=""):
#     def _writeStdOut(self, message):
#     def _writeStdErr(self, message):
#     def close(self):
#     def writeMessage(self, message, targetName="", targetStep=""):
#     def writeError(self, message, targetName="", targetStep="", filePath="", lineNumber=0, exitProgram=False):
#     def reportSkipped(self, targetName="", targetStep="", reason=""):
#     def reportStart(self, targetName="", targetStep=""):
#     def reportSuccess(self, targetName="", targetStep="", timeInSeconds=0):
#     def reportFailure(self, targetName="", targetStep="", timeInSeconds=0, returnCode=0, exitProgram=False):
#     def getOutFd(self, targetName="", targetStep=""):
#     def getErrorFd(self, targetName="", targetStep=""):
# class LoggerBase(object):
# 
# Path: md/utilityFunctions.py
# def boolToStr(s):
# def downloadFile(URL, downloadDir):
# def executeCommand(command, args="", workingDirectory="", verbose=False, exitOnError=False):
# def executeSubProcess(command, workingDirectory=tempfile.gettempdir(), outFileHandle=1, verbose=False, exitOnError=False):
# def findFilesWithExtension(path, extension):
# def findShallowestFile(startPath, fileList):
# def getBasename(path):
# def haveWriteAccess(path):
# def isURL(url):
# def __pathExists(directory, basename):
# def pathExists(path, forceCaseSensitive=False):
# def prettyPrintList(list, header="", headerIndent="", itemIndent=""):
# def printErrorAndExit(errorStr, filePath="", lineNumber=0):
# def removeDir(path):
# def removeDuplicatesFromList(myList):
# def splitFileName(fileName):
# def stripItemsInList(value):
# def untar(tarPath, outPath="", stripDir=False):
# def unzip(zipPath, outPath="", stripDir=False):
# def URLToFilename(url):
# def hasTarFileExtension(path):
# def validateCompressedFile(path, logger=None):
# def setVariables(filename, variableList):
# def is_exe(fpath):
# def isInstalled(program):


import os, socket, sys, unittest, mdTestUtilities
from md import logger, utilityFunctions

            neonPath = utilityFunctions.downloadFile(neonURL, downloadDir)
            self.assertNotEquals(neonPath, "", "Neon failed to download")

            sqlitePath = utilityFunctions.downloadFile(sqliteURL, downloadDir)
            self.assertNotEquals(sqlitePath, "", "Sqlite failed to download")

            importRC = utilityFunctions.executeSubProcess("mixdown --import " + svnPath + " " + aprPath + " " + aprUtilPath + " " + neonPath + " " + sqlitePath, tempDir)
            self.assertEquals(importRC, 0, "Subversion test case failed import.")

            buildRC = utilityFunctions.executeSubProcess("mixdown subversion-1.6.12.md -ptestPrefix" + skipAPRPreconfig, tempDir)
            self.assertEquals(buildRC, 0, "Subversion test case failed build.")

            cleanRC = utilityFunctions.executeSubProcess("mixdown --clean subversion-1.6.12.md", tempDir)
            self.assertEquals(cleanRC, 0, "Subversion test case failed clean.")

            prefix = os.path.join(tempDir, "testPrefix")
            binDir = os.path.join(prefix, "bin")
            libDir = os.path.join(prefix, "lib")
            self.assertEquals(os.path.exists(os.path.join(binDir, "svn")), True, "Executable does not exist after building CMake Hello test case.")
        finally:
            utilityFunctions.removeDir(tempDir)
            os.environ["PATH"] = origPath

def suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(Test_MixDownLong))
    return suite

if __name__ == "__main__":

# Path: md/logger.py
# def secondsToHMS(seconds=0):
# def Logger():
# def setLogger(loggerName="", logOutputDir=""):
# def close():
# def writeMessage(message, targetName="", targetStep="", forceStdOut=False):
# def writeError(message, targetName="", targetStep="", filePath="", lineNumber=0, exitProgram=False):
# def reportSkipped(targetName="", targetStep="", reason=""):
# def reportStart(targetName="", targetStep=""):
# def reportSuccess(targetName="", targetStep="", timeInSeconds=0):
# def reportFailure(targetName="", targetStep="", timeInSeconds=0, returnCode=0, exitProgram=False):
# def getOutFd(targetName="", targetStep=""):
# def getErrorFd(targetName="", targetStep=""):
#     def _writeStdOut(self, message):
#     def _writeStdErr(self, message):
#     def close(self):
#     def writeMessage(self, message, targetName="", targetStep=""):
#     def writeError(self, message, targetName="", targetStep="", filePath="", lineNumber=0, exitProgram=False):
#     def reportSkipped(self, targetName="", targetStep="", reason=""):
#     def reportStart(self, targetName="", targetStep=""):
#     def reportSuccess(self, targetName="", targetStep="", timeInSeconds=0):
#     def reportFailure(self, targetName="", targetStep="", timeInSeconds=0, returnCode=0, exitProgram=False):
#     def getOutFd(self, targetName="", targetStep=""):
#     def getErrorFd(self, targetName="", targetStep=""):
# class LoggerBase(object):
# 
# Path: md/utilityFunctions.py
# def boolToStr(s):
# def downloadFile(URL, downloadDir):
# def executeCommand(command, args="", workingDirectory="", verbose=False, exitOnError=False):
# def executeSubProcess(command, workingDirectory=tempfile.gettempdir(), outFileHandle=1, verbose=False, exitOnError=False):
# def findFilesWithExtension(path, extension):
# def findShallowestFile(startPath, fileList):
# def getBasename(path):
# def haveWriteAccess(path):
# def isURL(url):
# def __pathExists(directory, basename):
# def pathExists(path, forceCaseSensitive=False):
# def prettyPrintList(list, header="", headerIndent="", itemIndent=""):
# def printErrorAndExit(errorStr, filePath="", lineNumber=0):
# def removeDir(path):
# def removeDuplicatesFromList(myList):
# def splitFileName(fileName):
# def stripItemsInList(value):
# def untar(tarPath, outPath="", stripDir=False):
# def unzip(zipPath, outPath="", stripDir=False):
# def URLToFilename(url):
# def hasTarFileExtension(path):
# def validateCompressedFile(path, logger=None):
# def setVariables(filename, variableList):
# def is_exe(fpath):
# def isInstalled(program):


# Path: test/test_MixDownLong.py
import os, socket, sys, unittest, mdTestUtilities
from md import logger, utilityFunctions


            neonPath = utilityFunctions.downloadFile(neonURL, downloadDir)
            self.assertNotEquals(neonPath, "", "Neon failed to download")

            sqlitePath = utilityFunctions.downloadFile(sqliteURL, downloadDir)
            self.assertNotEquals(sqlitePath, "", "Sqlite failed to download")

            importRC = utilityFunctions.executeSubProcess("mixdown --import " + svnPath + " " + aprPath + " " + aprUtilPath + " " + neonPath + " " + sqlitePath, tempDir)
            self.assertEquals(importRC, 0, "Subversion test case failed import.")

            buildRC = utilityFunctions.executeSubProcess("mixdown subversion-1.6.12.md -ptestPrefix" + skipAPRPreconfig, tempDir)
            self.assertEquals(buildRC, 0, "Subversion test case failed build.")

            cleanRC = utilityFunctions.executeSubProcess("mixdown --clean subversion-1.6.12.md", tempDir)
            self.assertEquals(cleanRC, 0, "Subversion test case failed clean.")

            prefix = os.path.join(tempDir, "testPrefix")
            binDir = os.path.join(prefix, "bin")
            libDir = os.path.join(prefix, "lib")
            self.assertEquals(os.path.exists(os.path.join(binDir, "svn")), True, "Executable does not exist after building CMake Hello test case.")
        finally:
            utilityFunctions.removeDir(tempDir)
            os.environ["PATH"] = origPath

def suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(Test_MixDownLong))
    return suite

if __name__ == "__main__":

    logger.setLogger("Console")