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
protected void addNotify() {
List<Content> children = ContentHierarchyVisitor.getChildren(parent);
/*
// To not display LayoutFiles
Iterator<Content> it = children.iterator();
while(it.hasNext()) {
@ -49,7 +49,7 @@ class ContentChildren extends AbstractContentChildren {
it.remove();
}
}
*/
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)):
shutil.rmtree(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()
testInFile = wabspath(inFile)
@ -90,16 +92,20 @@ def testCompareToGold(inFile):
testC = testConn.cursor()
print("Comparing Artifacts: ")
goldC.execute("select count(*) from blackboard_artifacts")
goldArtifacts = goldC.fetchone()[0]
testC.execute("select count(*) from blackboard_artifacts")
testArtifacts = testC.fetchone()[0]
if(goldArtifacts != testArtifacts):
errString = "Artifact counts do not match!: "
# Keep range in sync with number of items in ARTIFACT_TYPE enum
for type_id in range(1, 13):
goldC.execute("select count(*) from blackboard_artifacts where artifact_type_id=%d" % type_id)
goldArtifacts = goldC.fetchone()[0]
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))
markError(errString, inFile)
else:
print("Artifact counts match!")
else:
print("Artifact counts for artifact type id %d match!" % type_id)
print("Comparing Attributes: ")
goldC.execute("select count(*) from blackboard_attributes")
goldAttributes = goldC.fetchone()[0]
@ -237,6 +243,9 @@ def main():
if hadErrors == True:
print "**********************************************"
print "Tests complete: There were errors"
else:
print "**********************************************"
print "Tests complete: All tests passed"
for k,v in results.items():
print k