39 |
39 |
40 <hlm:metadatafilterset id="all-regex-filterfile"> |
40 <hlm:metadatafilterset id="all-regex-filterfile"> |
41 <metadatafilterset filterfile="${metadata-filterfile}" /> |
41 <metadatafilterset filterfile="${metadata-filterfile}" /> |
42 </hlm:metadatafilterset> |
42 </hlm:metadatafilterset> |
43 |
43 |
|
44 <!-- Test categorization for sbs scanlog |
|
45 --> |
|
46 <target name="test-categorization"> |
|
47 <delete file="${project.dir}/../output/categorization.sqlite" failonerror="false" /> |
|
48 <echo message="categorization validation" /> |
|
49 <hlm:metadatarecord database="${project.dir}/../output/categorization.sqlite"> |
|
50 <hlm:sbsmetadatainput cleanLogFile="${project.dir}/../data/categorization_clean.log"> |
|
51 <fileset dir="${project.dir}/../data/"> |
|
52 <include name="categorization.log"/> |
|
53 </fileset> |
|
54 <metadatafilterset refid="all-regex-filterfile" /> |
|
55 </hlm:sbsmetadatainput> |
|
56 </hlm:metadatarecord> |
|
57 <hlm:metadataCountSeverity severity="error" log="categorization.log" db="${project.dir}/../output/categorization.sqlite" property="cleanlog_errors"/> |
|
58 <au:assertTrue> |
|
59 <equals arg1="${cleanlog_errors}" arg2="2"/> |
|
60 </au:assertTrue> |
|
61 </target> |
|
62 |
|
63 <!-- Test parser error |
|
64 --> |
|
65 <target name="test-parser-error"> |
|
66 <delete file="${project.dir}/../output/parser_error.sqlite" failonerror="false" /> |
|
67 <au:expectfailure> |
|
68 <hlm:metadatarecord database="${project.dir}/../output/parser_error.sqlite"> |
|
69 <hlm:sbsmetadatainput> |
|
70 <fileset dir="${project.dir}/../data/"> |
|
71 <include name="parser_error.log"/> |
|
72 </fileset> |
|
73 <metadatafilterset refid="all-regex-filterfile" /> |
|
74 </hlm:sbsmetadatainput> |
|
75 </hlm:metadatarecord> |
|
76 </au:expectfailure> |
|
77 </target> |
|
78 |
|
79 <!-- Test parser error |
|
80 --> |
|
81 <target name="test-parser-error-keepgoing"> |
|
82 <delete file="${project.dir}/../output/parser_error.sqlite" failonerror="false" /> |
|
83 <hlm:metadatarecord database="${project.dir}/../output/parser_error.sqlite" failonerror="false"> |
|
84 <hlm:sbsmetadatainput> |
|
85 <fileset dir="${project.dir}/../data/"> |
|
86 <include name="parser_error.log"/> |
|
87 </fileset> |
|
88 <metadatafilterset refid="all-regex-filterfile" /> |
|
89 </hlm:sbsmetadatainput> |
|
90 </hlm:metadatarecord> |
|
91 </target> |
|
92 |
|
93 |
|
94 <!-- Test categorization without cleanLogFile |
|
95 --> |
|
96 <target name="test-categorization-nocleanlog"> |
|
97 <delete file="${project.dir}/../output/categorization.sqlite" failonerror="false" /> |
|
98 <echo message="categorization validation" /> |
|
99 <hlm:metadatarecord database="${project.dir}/../output/categorization.sqlite"> |
|
100 <hlm:sbsmetadatainput> |
|
101 <fileset dir="${project.dir}/../data/"> |
|
102 <include name="categorization.log"/> |
|
103 </fileset> |
|
104 <metadatafilterset refid="all-regex-filterfile" /> |
|
105 </hlm:sbsmetadatainput> |
|
106 </hlm:metadatarecord> |
|
107 <hlm:metadataCountSeverity severity="error" log="categorization.log" db="${project.dir}/../output/categorization.sqlite" property="nocleanlog_errors"/> |
|
108 <au:assertTrue> |
|
109 <equals arg1="${nocleanlog_errors}" arg2="1"/> |
|
110 </au:assertTrue> |
|
111 </target> |
|
112 |
|
113 <target name="test-log-entry-for-no-errors"> |
|
114 <delete file="${project.dir}/../output/log-entry-for-no-error.sqlite" failonerror="false" /> |
|
115 <echo message="categorization validation" /> |
|
116 <hlm:metadatarecord database="${project.dir}/../output/log-entry-for-no-error.sqlite"> |
|
117 <hlm:sbsmetadatainput> |
|
118 <fileset dir="${project.dir}/../data/"> |
|
119 <include name="noerror.log"/> |
|
120 </fileset> |
|
121 <metadatafilterset refid="all-regex-filterfile" /> |
|
122 </hlm:sbsmetadatainput> |
|
123 </hlm:metadatarecord> |
|
124 <fmpp sourceFile="${project.dir}/../../src/templates/general_category.txt.ftl" |
|
125 outputfile="${project.dir}/../output/general_category.txt"> |
|
126 <freemarkerLinks expandProperties="yes"> |
|
127 macro: ${project.dir}/../../src/templates/macro |
|
128 </freemarkerLinks> |
|
129 <data expandProperties="yes"> |
|
130 dbPath: ${project.dir}/../output/log-entry-for-no-error.sqlite |
|
131 ant: antProperties() |
|
132 </data> |
|
133 </fmpp> |
|
134 <au:assertFileExists file="${project.dir}/../output/general_category.txt" message="Error in test cases"/> |
|
135 <loadfile property="logEntry" |
|
136 srcFile="${project.dir}/../output/general_category.txt"/> |
|
137 <au:assertMatches string="${logEntry}" pattern="component : general : logfile : " |
|
138 casesensitive="false"/> |
|
139 </target> |
44 |
140 |
45 <!-- Check for all the regular expression defined in the filter file, |
141 <!-- Check for all the regular expression defined in the filter file, |
46 The log file contains text for matching regular expression. |
142 The log file contains text for matching regular expression. |
47 --> |
143 --> |
48 <target name="test-all-regex-filterfile"> |
144 <target name="test-all-regex-filterfile"> |
272 </hlm:metadatafilterset> |
368 </hlm:metadatafilterset> |
273 |
369 |
274 |
370 |
275 <target name="test-ant_log_metadata_input"> |
371 <target name="test-ant_log_metadata_input"> |
276 <property name="metadata-read-db" value="${project.dir}/../output/log_ant_metadata_input.sqlite"/> |
372 <property name="metadata-read-db" value="${project.dir}/../output/log_ant_metadata_input.sqlite"/> |
277 <delete file="${metadata-ant-db}" failonerror="false" /> |
373 <delete file="${metadata-read-db}" failonerror="false" /> |
278 <echo message="ant log metadata input validation" /> |
374 <echo message="ant log metadata input validation" /> |
279 <echo message="database:${metadata-read-db}" /> |
375 <echo message="database:${metadata-read-db}" /> |
280 <au:assertFileExists file="${metadata-filterfile}" message="${metadata-filterfile} filter file does not exist"/> |
376 <au:assertFileExists file="${metadata-filterfile}" message="${metadata-filterfile} filter file does not exist"/> |
281 <mkdir dir="${project.dir}/../output"/> |
377 <mkdir dir="${project.dir}/../output"/> |
282 |
378 |