def runTestSuite(): """ Transfer function for setup.py script ro-manager-test """ base = os.path.dirname(__file__) #print "Run test suite assuming base path "+base sys.path.insert(0, os.path.normpath(base+"/..") ) sys.path.insert(0, os.path.normpath(base+"/../..") ) sys.path.insert(0, os.path.normpath(base+"/../../iaeval/test") ) sys.path.insert(0, os.path.normpath(base+"/../../sync/test") ) #print "Path: "+repr(sys.path) TestUtils.runTests("TestAll", getTestSuite, sys.argv) return 0
""" testdict = { "unit": [ "testUnits" , "testNull" , "testSetupConfig" , "testMinimRead" , "testGetConstraints" , "testGetConstraint" , "testGetModels" , "testGetModel" , "testGetRequirements" , "testGetListRequirements" ], "component": [ "testComponents" ], "integration": [ "testIntegration" ], "pending": [ "testPending" ] } return TestUtils.getTestSuite(TestMinimAccess2, testdict, select=select) if __name__ == "__main__": TestUtils.runTests("TestMinimAccess2.log", getTestSuite, sys.argv) # End.
name a single named test to be run """ testdict = { "unit": [ "testUnits" , "testSimpleAskQuery" , "testSimpleSelectQuery" , "testDatatypeFilter" , "testIntegerStringFilter" , "testRegexFilter" , "testDefaultQuery" , "testGraphReadTerms" , "testLiteralCompare" ], "component": [ "testComponents" ], "integration": [ "testIntegration" ], "pending": [ "testPending" ] } return TestUtils.getTestSuite(TestSparqlQueries, testdict, select=select) if __name__ == "__main__": TestUtils.runTests("TestSparqlQueries.log", getTestSuite, sys.argv) # End.
""" Get test suite select is one of the following: "unit" return suite of unit tests only "component" return suite of unit and component tests "all" return suite of unit, component and integration tests "pending" return suite of pending tests name a single named test to be run """ testdict = { "unit": [ "testUnits" ], "component": [ "testComponents" ], "integration": [ "testIntegration" ], "pending": [ "testPending" ] } return TestUtils.getTestSuite(TestROSupport, testdict, select=select) if __name__ == "__main__": TestUtils.runTests("TestROSupport.log", getTestSuite, sys.argv) # End.
, "testGetAnnotationByUri" , "testGetAnnotationNameByUri" , "testMakeAnnotationFilename" , "testCreateReadRoAnnotationBody" , "testCreateReadFileAnnotationBody" , "testGetInitialRoAnnotations" , "testAddGetRoAnnotations" , "testRemoveGetRoAnnotations" , "testReplaceGetRoAnnotations" , "testAddGetFileAnnotations" , "testRemoveGetFileAnnotations" , "testAddGetAllAnnotations" , "testAddGetAnnotationValues" ], "component": [ "testComponents" ], "integration": [ "testIntegration" ], "pending": [ "testPending" ] } return TestUtils.getTestSuite(TestAnnotationUtils, testdict, select=select) if __name__ == "__main__": TestUtils.runTests("TestAnnotationUtils.log", getTestSuite, sys.argv) # End.
, "testSetupConfig" , "testEvalAllPresent" , "testEvalMustMissing" , "testEvalShouldMissing" , "testEvalMayMissing" , "testEvalFormatSummary" , "testEvalFormatDetail" , "testEvaluateChecklistCommand" , "testEvaluateWfInputs" , "testEvaluateWfInputsRDF" , "testEvaluateMissing" , "testEvaluateMissingRDF" ], "component": [ "testComponents" ], "integration": [ "testIntegration" ], "pending": [ "testPending" , "testEvaluateChecklistRemote" ] } return TestUtils.getTestSuite(TestEvalChecklist, testdict, select=select) if __name__ == "__main__": TestUtils.runTests("TestEvalChecklist.log", getTestSuite, sys.argv) # End.
Get test suite select is one of the following: "unit" return suite of unit tests only "component" return suite of unit and component tests "all" return suite of unit, component and integration tests "pending" return suite of pending tests name a single named test to be run """ testdict = { "unit": [ "testUnits" , "testNull" ], "component": [ "testComponents" , "testPush" , "testPushZip" ], "integration": [ "testIntegration" ], "pending": [ "testPending" ] } return TestUtils.getTestSuite(TestRosrsSync, testdict, select=select) if __name__ == "__main__": TestUtils.runTests("TestRosrsSync.log", getTestSuite, sys.argv)
name a single named test to be run """ testdict = { "unit": [ "testUnits" , "testNull" , "testManifestContent" , "testAddAggregatedResources" , "testAddAggregatedResourcesCommand" , "testGetRoUri" , "testGetComponentUri" , "testGetComponentUriRel" , "testGetComponentUriRelUri" ], "component": [ "testComponents" ], "integration": [ "testIntegration" ], "pending": [ "testPending" ] } return TestUtils.getTestSuite(TestManifest, testdict, select=select) if __name__ == "__main__": TestUtils.runTests("TestManifest.log", getTestSuite, sys.argv) # End.
select is one of the following: "unit" return suite of unit tests only "component" return suite of unit and component tests "all" return suite of unit, component and integration tests "pending" return suite of pending tests name a single named test to be run """ testdict = { "unit": [ "testUnits" , "testCase" ], "component": [ "testComponents" ], "integration": [ "testIntegration" ], "pending": [ "testPending" ] } return TestUtils.getTestSuite(TestExample, testdict, select=select) # Run unit tests directly from command line if __name__ == "__main__": TestUtils.runTests("TestExample", getTestSuite, sys.argv) # End.
, "testCollectDirsShallow" , "testCollectDirsRecursive" , "testCollectDirsRecursiveBaseEndswithSep" , "testCollectDirsRecursiveEmptyBase" , "testCollectFilesShallow" , "testCollectFilesRecursive" , "testCollectFilesRecursiveBaseEndswithSep" , "testCollectFilesRecursiveEmptyBase" , "testCollectAllShallow" , "testCollectAllRecursive" , "testCollectAllRecursiveBaseEndswithSep" , "testCollectAllRecursiveEmptyBase" ], "component": [ "testComponents" ], "integration": [ "testIntegration" ], "pending": [ "testPending" ] } return TestUtils.getTestSuite(TestScanDirectories, testdict, select=select) if __name__ == "__main__": TestUtils.runTests("TestScanDirectories.log", getTestSuite, sys.argv) #logging.basicConfig(level=logging.DEBUG) #runner = unittest.TextTestRunner() #runner.run(getTestSuite())
testdict = { "unit": [ "testUnits" , "testNull" , "testEvalQueryTestModelMin" , "testEvalQueryTestModelExists" , "testEvalQueryTestModel" , "testEvalQueryTestReportList" , "testEvalQueryTestChembox" , "testEvalQueryTestChemboxFail" , "testEvalFormatSummary" , "testEvalFormatDetail" , "testEvaluateRDF" ], "component": [ "testComponents" ], "integration": [ "testIntegration" ], "pending": [ "testPending" ] } return TestUtils.getTestSuite(TestEvalQueryMatch, testdict, select=select) if __name__ == "__main__": TestUtils.runTests("TestEvalQueryMatch.log", getTestSuite, sys.argv) # End.
name a single named test to be run """ testdict = { "unit": [ "testUnits" , "testNull" , "testLink" , "testLinkType" , "testLinkCreated" , "testLinkRdfType" , "testLinkUnknownUri" , "testLinkWithGraph" , "testLinkWithNotExistentGraph" ], "component": [ "testComponents" ], "integration": [ "testIntegration" ], "pending": [ "testPending" ] } return TestUtils.getTestSuite(TestLinks, testdict, select=select) if __name__ == "__main__": TestUtils.runTests("TestLinks.log", getTestSuite, sys.argv) # End.
def getTestSuite(select="unit"): """ Get test suite select is one of the following: "unit" return suite of unit tests only "component" return suite of unit and component tests "all" return suite of unit, component and integration tests "pending" return suite of pending tests name a single named test to be run """ testdict = { "unit": [ ], "component": [ "testSnapshot" , "testArchive" ], "integration": [ ], "pending": [ ] } return TestUtils.getTestSuite(TestEvo, testdict, select=select) if __name__ == "__main__": TestUtils.runTests("TestEvo.log", getTestSuite, sys.argv)
sys.path.append("../..") import TestTestUtils import TestFunctions import TestCombinators import TestDomHelpers import TestScanFiles import TestScanDirectories import TestNetUtils import TestSuperGlobal # Code to run unit tests from all library test modules def getTestSuite(select="unit"): suite = unittest.TestSuite() suite.addTest(TestTestUtils.getTestSuite(select=select)) suite.addTest(TestFunctions.getTestSuite()) suite.addTest(TestCombinators.getTestSuite()) suite.addTest(TestDomHelpers.getTestSuite()) suite.addTest(TestScanFiles.getTestSuite()) suite.addTest(TestScanDirectories.getTestSuite()) suite.addTest(TestNetUtils.getTestSuite()) suite.addTest(TestSuperGlobal.getTestSuite()) return suite from MiscUtils import TestUtils if __name__ == "__main__": TestUtils.runTests("TestAll", getTestSuite, sys.argv) # End.
select is one of the following: "unit" return suite of unit tests only "component" return suite of unit and component tests "all" return suite of unit, component and integration tests "pending" return suite of pending tests name a single named test to be run """ testdict = { "unit": [ "testUnits", "testNull", "testSetupConfig", "testGridRead", "testGridMatch", "testMkMinim", "testChecklistEval", "testChecklistEvalExcel", ], "component": ["testComponents"], "integration": ["testIntegration"], "pending": ["testPending"], } return TestUtils.getTestSuite(TestMkMinim, testdict, select=select) if __name__ == "__main__": TestUtils.runTests("TestMkMinim.log", getTestSuite, sys.argv) # End.
, "testGetROResourceProxy" # Annotation tests , "testCreateROAnnotationInt" , "testGetROAnnotationGraph" , "testCreateROAnnotationExt" , "testUpdateROAnnotationInt" , "testUpdateROAnnotationExt" , "testRemoveROAnnotation" # Evolution tests , "testCopyRO" , "testCancelCopyRO" , "testUpdateROStatus" , "testGetROEvolution" ], "component": [ "testComponents" ], "integration": [ "testIntegration" ], "pending": [ "testPending" ] } return TestUtils.getTestSuite(TestROSRS_Session, testdict, select=select) if __name__ == "__main__": TestUtils.runTests("TestROSRS_Session.log", getTestSuite, sys.argv) # End.
"all" return suite of unit, component and integration tests "pending" return suite of pending tests name a single named test to be run """ testdict = { "unit": [ "testUnits" , "testNull" ], "component": [ "testComponents" , "testPush" , "testPushZip" , "testPushZipSynchronous" , "testPushZipAsynchronous" , "testCheckout" ], "integration": [ "testIntegration" ], "pending": [ "testPending" ] } return TestUtils.getTestSuite(TestSyncCommands, testdict, select=select) if __name__ == "__main__": TestUtils.runTests("TestSyncCommands.log", getTestSuite, sys.argv) # End.
"component" return suite of unit and component tests "all" return suite of unit, component and integration tests "pending" return suite of pending tests name a single named test to be run """ testdict = { "unit": [ "testUnits" , "testNull" , "testCreateRoMetadata" , "testReadRoAnnotationBody" , "testGetInitialRoAnnotations" , "testQueryAnnotations" ], "component": [ "testComponents" ], "integration": [ "testIntegration" ], "pending": [ "testPending" ] } return TestUtils.getTestSuite(TestROSRSMetadata, testdict, select=select) if __name__ == "__main__": TestUtils.runTests("TestROSRSMetadata.log", getTestSuite, sys.argv) # End.