Make test script more granular (each artifact type)

Hide LayoutFiles from tree
This commit is contained in:
Dick Fickling 2012-06-01 08:47:23 -04:00
parent aa91ca7133
commit 2bc25b7e4a
2 changed files with 19 additions and 10 deletions

View File

@ -40,7 +40,7 @@ class ContentChildren extends AbstractContentChildren {
@Override @Override
protected void addNotify() { protected void addNotify() {
List<Content> children = ContentHierarchyVisitor.getChildren(parent); List<Content> children = ContentHierarchyVisitor.getChildren(parent);
/*
// To not display LayoutFiles // To not display LayoutFiles
Iterator<Content> it = children.iterator(); Iterator<Content> it = children.iterator();
while(it.hasNext()) { while(it.hasNext()) {
@ -49,7 +49,7 @@ class ContentChildren extends AbstractContentChildren {
it.remove(); it.remove();
} }
} }
*/
setKeys(children.subList(0, Math.min(children.size(), MAX_CHILD_COUNT))); setKeys(children.subList(0, Math.min(children.size(), MAX_CHILD_COUNT)));
} }

View File

@ -35,6 +35,8 @@ def testAddImageIngest(inFile):
if os.path.exists(os.path.join(outDir,testCaseName)): if os.path.exists(os.path.join(outDir,testCaseName)):
shutil.rmtree(os.path.join(outDir,testCaseName)) shutil.rmtree(os.path.join(outDir,testCaseName))
os.makedirs(os.path.join(outDir,testCaseName)) os.makedirs(os.path.join(outDir,testCaseName))
if not os.path.exists(inDir):
markError("input dir does not exist", inFile)
cwd = wgetcwd() cwd = wgetcwd()
testInFile = wabspath(inFile) testInFile = wabspath(inFile)
@ -90,16 +92,20 @@ def testCompareToGold(inFile):
testC = testConn.cursor() testC = testConn.cursor()
print("Comparing Artifacts: ") print("Comparing Artifacts: ")
goldC.execute("select count(*) from blackboard_artifacts")
goldArtifacts = goldC.fetchone()[0] # Keep range in sync with number of items in ARTIFACT_TYPE enum
testC.execute("select count(*) from blackboard_artifacts") for type_id in range(1, 13):
testArtifacts = testC.fetchone()[0] goldC.execute("select count(*) from blackboard_artifacts where artifact_type_id=%d" % type_id)
if(goldArtifacts != testArtifacts): goldArtifacts = goldC.fetchone()[0]
errString = "Artifact counts do not match!: " testC.execute("select count(*) from blackboard_artifacts where artifact_type_id=%d" % type_id)
testArtifacts = testC.fetchone()[0]
if(goldArtifacts != testArtifacts):
errString = str("Artifact counts do not match for type id %d!: " % type_id)
errString += str("Gold: %d, Test: %d" % (goldArtifacts, testArtifacts)) errString += str("Gold: %d, Test: %d" % (goldArtifacts, testArtifacts))
markError(errString, inFile) markError(errString, inFile)
else: else:
print("Artifact counts match!") print("Artifact counts for artifact type id %d match!" % type_id)
print("Comparing Attributes: ") print("Comparing Attributes: ")
goldC.execute("select count(*) from blackboard_attributes") goldC.execute("select count(*) from blackboard_attributes")
goldAttributes = goldC.fetchone()[0] goldAttributes = goldC.fetchone()[0]
@ -237,6 +243,9 @@ def main():
if hadErrors == True: if hadErrors == True:
print "**********************************************" print "**********************************************"
print "Tests complete: There were errors" print "Tests complete: There were errors"
else:
print "**********************************************"
print "Tests complete: All tests passed"
for k,v in results.items(): for k,v in results.items():
print k print k