Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e6ad899

Browse files
Merge branch 'develop' into allow_multi_before_after_procedures
2 parents 8e8f69d + 3e709fb commit e6ad899

20 files changed

Lines changed: 1397 additions & 446 deletions

.travis/install.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,37 @@ alter session set plsql_warnings = 'ENABLE:ALL', 'DISABLE:(5004,5018,6000,6001,6
1111
@install_headless.sql $UT3_OWNER $UT3_OWNER_PASSWORD
1212
SQL
1313

14+
#uninstall core of utplsql
15+
"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
16+
set feedback off
17+
set verify off
18+
19+
@uninstall_all.sql $UT3_OWNER
20+
declare
21+
v_leftover_objects_count integer;
22+
begin
23+
select sum(cnt)
24+
into v_leftover_objects_count
25+
from (select count(1) cnt from dba_objects where owner = '$UT3_OWNER'
26+
union all
27+
select count(1) cnt from dba_synonyms where table_owner = '$UT3_OWNER'
28+
);
29+
if v_leftover_objects_count > 0 then
30+
raise_application_error(-20000, 'Not all objects were successfully uninstalled - leftover objects count='||v_leftover_objects_count);
31+
end if;
32+
end;
33+
/
34+
SQL
35+
36+
#reinstall core of utplsql
37+
"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
38+
set feedback off
39+
set verify off
40+
41+
alter session set plsql_warnings = 'ENABLE:ALL', 'DISABLE:(5004,5018,6000,6001,6003,6009,6010,7206)';
42+
@install.sql $UT3_OWNER
43+
SQL
44+
1445
#additional privileges to run scripted tests
1546
"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
1647
set feedback on

.travis/lib/xml_validator.jar

9.89 KB
Binary file not shown.

.travis/validate_report_files.sh

Lines changed: 56 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,66 @@
11
#!/usr/bin/env bash
22

3-
echo "validate html"
3+
GL_VALID=1
4+
XSD_DIR="$TRAVIS_BUILD_DIR/.travis/xsd"
5+
XML_JAR_DIR="$TRAVIS_BUILD_DIR/.travis/lib"
6+
#XML Validator
7+
XML_VALIDATOR="$XML_JAR_DIR/xml_validator.jar"
8+
HTML_VALIDATOR_URL="https://validator.w3.org/nu/"
49

510
HTML_FILENAME="coverage.html"
6-
#Exclude existing issue with OL nested in PRE
7-
EXCLUSION_REGEX=".*Element\s.?ol.?\snot\sallowed\sas\schild\sof\selement\s.?pre.*"
8-
HTML_VALIDATOR_URL="https://validator.w3.org/nu/"
9-
VALIDATOR_OUT="gnu"
10-
WARNING_REGEX="info warning:"
11-
ERROR_REGEX="error:"
11+
declare -A XML_FILES
12+
XML_FILES["junit_test_results.xml"]="junit4.xsd"
13+
XML_FILES["tfs_test_results.xml"]="junit_windy.xsd"
14+
15+
function ValidateHtml {
16+
EXCLUSION_REGEX=".*Element\s.?ol.?\snot\sallowed\sas\schild\sof\selement\s.?pre.*"
17+
#HTML Validation API
18+
VALIDATOR_OUT="gnu"
19+
WARNING_REGEX="info warning:"
20+
ERROR_REGEX="error:"
21+
#Validate HTML
22+
HTML_VALIDATION_RESULTS=$(curl -H "Content-Type: text/html; charset=utf-8" --data-binary @$1 "$HTML_VALIDATOR_URL?out=$VALIDATOR_OUT&filterpattern=$EXCLUSION_REGEX")
23+
24+
ERROR_COUNT=$(echo "$HTML_VALIDATION_RESULTS" | grep -c "$ERROR_REGEX")
25+
WARNING_COUNT=$(echo "$HTML_VALIDATION_RESULTS" | grep -c "$WARNING_REGEX")
26+
27+
if [ "$ERROR_COUNT" -gt 0 ]; then
28+
GL_VALID=0
29+
echo ""
30+
echo "******************************"
31+
echo "HTML File is invalid"
32+
echo "There are $ERROR_COUNT errors, $WARNING_COUNT warning in $HTML_FILENAME"
33+
echo "Please see results:"
34+
echo "$HTML_VALIDATION_RESULTS" | grep "$ERROR_REGEX"
35+
fi
36+
}
1237

13-
VALIDATION_RESULTS=$(curl -H "Content-Type: text/html; charset=utf-8" --data-binary @$HTML_FILENAME "$HTML_VALIDATOR_URL?out=$VALIDATOR_OUT&filterpattern=$EXCLUSION_REGEX")
38+
function ValidateXML() {
39+
echo "Validate File $2 against schema $1"
40+
VALIDATION_RESULT=$(java -jar $XML_VALIDATOR -s $1 $2 2>&1)
41+
42+
if [ $? -ne 0 ]; then
43+
GL_VALID=0
44+
echo ""
45+
echo "******************************"
46+
echo "XML is invalid"
47+
echo "Please see results:"
48+
echo "$VALIDATION_RESULT"
49+
fi
50+
}
1451

15-
ERROR_COUNT=`echo "$VALIDATION_RESULTS" | grep -c "$ERROR_REGEX"`
16-
WARNING_COUNT=`echo "$VALIDATION_RESULTS" | grep -c "$WARNING_REGEX"`
52+
ValidateHtml "$HTML_FILENAME"
1753

18-
echo "There are $ERROR_COUNT errors, $WARNING_COUNT warning in $HTML_FILENAME"
54+
for XMLFILE in "${!XML_FILES[@]}"; do
55+
#echo "$XMLFILE" "${XML_FILES[$XMLFILE]}";
56+
ValidateXML "$XSD_DIR/${XML_FILES[$XMLFILE]}" "$XMLFILE"
57+
done
1958

20-
if [ $ERROR_COUNT -gt 0 ]; then
21-
echo "$VALIDATION_RESULTS" | grep "$ERROR_REGEX"
22-
exit 1
59+
if [ $GL_VALID -ne 1 ]; then
60+
echo ""
61+
echo "******************************"
62+
echo "Validation failed please see results above."
63+
exit 1
2364
else
24-
exit 0
65+
exit 0
2566
fi

.travis/xsd/junit4.xsd

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
3+
4+
<xs:element name="failure">
5+
<xs:complexType mixed="true">
6+
<xs:attribute name="type" type="xs:string" use="optional"/>
7+
<xs:attribute name="message" type="xs:string" use="optional"/>
8+
</xs:complexType>
9+
</xs:element>
10+
11+
<xs:element name="error">
12+
<xs:complexType mixed="true">
13+
<xs:attribute name="type" type="xs:string" use="optional"/>
14+
<xs:attribute name="message" type="xs:string" use="optional"/>
15+
</xs:complexType>
16+
</xs:element>
17+
18+
<xs:element name="properties">
19+
<xs:complexType>
20+
<xs:sequence>
21+
<xs:element ref="property" maxOccurs="unbounded"/>
22+
</xs:sequence>
23+
</xs:complexType>
24+
</xs:element>
25+
26+
<xs:element name="property">
27+
<xs:complexType>
28+
<xs:attribute name="name" type="xs:string" use="required"/>
29+
<xs:attribute name="value" type="xs:string" use="required"/>
30+
</xs:complexType>
31+
</xs:element>
32+
33+
<xs:element name="skipped" type="xs:string"/>
34+
<xs:element name="system-err" type="xs:string"/>
35+
<xs:element name="system-out" type="xs:string"/>
36+
37+
<xs:element name="testcase">
38+
<xs:complexType>
39+
<xs:sequence>
40+
<xs:element ref="skipped" minOccurs="0" maxOccurs="1"/>
41+
<xs:element ref="error" minOccurs="0" maxOccurs="unbounded"/>
42+
<xs:element ref="failure" minOccurs="0" maxOccurs="unbounded"/>
43+
<xs:element ref="system-out" minOccurs="0" maxOccurs="unbounded"/>
44+
<xs:element ref="system-err" minOccurs="0" maxOccurs="unbounded"/>
45+
</xs:sequence>
46+
<xs:attribute name="name" type="xs:string" use="required"/>
47+
<xs:attribute name="assertions" type="xs:string" use="optional"/>
48+
<xs:attribute name="time" type="xs:string" use="optional"/>
49+
<xs:attribute name="classname" type="xs:string" use="optional"/>
50+
<xs:attribute name="status" type="xs:string" use="optional"/>
51+
</xs:complexType>
52+
</xs:element>
53+
54+
<xs:element name="testsuite">
55+
<xs:complexType>
56+
<xs:sequence>
57+
<xs:element ref="properties" minOccurs="0" maxOccurs="1"/>
58+
<xs:element ref="testsuite" minOccurs="0" maxOccurs="unbounded"/>
59+
<xs:element ref="testcase" minOccurs="0" maxOccurs="unbounded"/>
60+
<xs:element ref="system-out" minOccurs="0" maxOccurs="1"/>
61+
<xs:element ref="system-err" minOccurs="0" maxOccurs="1"/>
62+
</xs:sequence>
63+
<xs:attribute name="name" type="xs:string" use="required"/>
64+
<xs:attribute name="tests" type="xs:string" use="required"/>
65+
<xs:attribute name="failures" type="xs:string" use="optional"/>
66+
<xs:attribute name="errors" type="xs:string" use="optional"/>
67+
<xs:attribute name="time" type="xs:string" use="optional"/>
68+
<xs:attribute name="disabled" type="xs:string" use="optional"/>
69+
<xs:attribute name="skipped" type="xs:string" use="optional"/>
70+
<xs:attribute name="timestamp" type="xs:string" use="optional"/>
71+
<xs:attribute name="hostname" type="xs:string" use="optional"/>
72+
<xs:attribute name="id" type="xs:string" use="optional"/>
73+
<xs:attribute name="package" type="xs:string" use="optional"/>
74+
</xs:complexType>
75+
</xs:element>
76+
77+
<xs:element name="testsuites">
78+
<xs:complexType>
79+
<xs:sequence>
80+
<xs:element ref="testsuite" minOccurs="0" maxOccurs="unbounded"/>
81+
</xs:sequence>
82+
<xs:attribute name="name" type="xs:string" use="optional"/>
83+
<xs:attribute name="time" type="xs:string" use="optional"/>
84+
<xs:attribute name="tests" type="xs:string" use="optional"/>
85+
<xs:attribute name="failures" type="xs:string" use="optional"/>
86+
<xs:attribute name="disabled" type="xs:string" use="optional"/>
87+
<xs:attribute name="errors" type="xs:string" use="optional"/>
88+
</xs:complexType>
89+
</xs:element>
90+
91+
92+
</xs:schema>

0 commit comments

Comments
 (0)