Audit validation using XSD and related tests

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@15875 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2009-08-24 20:10:49 +00:00
parent b8c93f89f3
commit 598ecfb27b
27 changed files with 1112 additions and 224 deletions

View File

@@ -0,0 +1,19 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Default Audit Configuration -->
<Audit
xmlns="http://www.alfresco.org/repo/audit/model/3.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd"
>
<Application name="Alfresco Test Bad 01" key="test-bad-01">
<AuditPath key="1.1">
<AuditPath key="2.1">
<RecordValue key="value.1" dataExtractor="blah"/>
</AuditPath>
</AuditPath>
</Application>
</Audit>

View File

@@ -0,0 +1,19 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Default Audit Configuration -->
<Audit
xmlns="http://www.alfresco.org/repo/audit/model/3.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd"
>
<Application name="Alfresco Test Bad 02" key="test-bad-02">
<AuditPath key="1.1">
<AuditPath key="2.1">
<GenerateValue key="value.1" dataGenerator="blah" scope="AUDIT"/>
</AuditPath>
</AuditPath>
</Application>
</Audit>

View File

@@ -0,0 +1,22 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Default Audit Configuration -->
<Audit
xmlns="http://www.alfresco.org/repo/audit/model/3.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd"
>
<Application name="Alfresco Test Bad 03" key="test-bad-03">
<AuditPath key="1.1">
<AuditPath key="2.1">
<RecordValue key="value.1" dataExtractor="simpleValue"/>
</AuditPath>
<AuditPath key="2.1">
<RecordValue key="value.1" dataExtractor="simpleValue"/>
</AuditPath>
</AuditPath>
</Application>
</Audit>

View File

@@ -0,0 +1,19 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Default Audit Configuration -->
<Audit
xmlns="http://www.alfresco.org/repo/audit/model/3.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd"
>
<Application name="Alfresco Test Bad 04" key="test-bad-04">
<AuditPath key="1.1">
<AuditPath key="2.1">
<RecordValue key="value.UPPER" dataExtractor="simpleValue"/>
</AuditPath>
</AuditPath>
</Application>
</Audit>

View File

@@ -0,0 +1,19 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Default Audit Configuration -->
<Audit
xmlns="http://www.alfresco.org/repo/audit/model/3.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd"
>
<Application name="Alfresco Test Bad 05" key="test-bad-05">
<AuditPath key="1.1">
<AuditPath key="2.1">
<GenerateValue key="time" dataGenerator="systemTime" scope="SESSIOn"/>
</AuditPath>
</AuditPath>
</Application>
</Audit>

View File

@@ -0,0 +1,66 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Default Audit Configuration -->
<Audit
xmlns="http://www.alfresco.org/repo/audit/model/3.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd"
>
<!-- Includes duplicate definitions of the extractors and generators -->
<DataExtractors>
<DataExtractor name="simpleValue" class="org.alfresco.repo.audit.extractor.SimpleValueDataExtractor"/>
</DataExtractors>
<DataGenerators>
<DataGenerator name="systemTime" class="org.alfresco.repo.audit.generator.SystemTimeDataGenerator"/>
</DataGenerators>
<Application name="Alfresco Test" key="test">
<GenerateValue key="time" dataGenerator="systemTime" scope="SESSION"/>
<AuditPath key="1.1">
<AuditPath key="2.1">
<AuditPath key="3.1">
<RecordValue key="value.1" dataExtractor="simpleValue"/>
<AuditPath key="4.1">
<RecordValue key="value.1" dataExtractor="simpleValue"/>
</AuditPath>
<AuditPath key="4.2">
<RecordValue key="value.2" dataExtractor="simpleValue"/>
</AuditPath>
</AuditPath>
<AuditPath key="3.2">
<AuditPath key="4.1">
<RecordValue key="value.1" dataExtractor="simpleValue"/>
<GenerateValue key="time" dataGenerator="systemTime" scope="AUDIT"/>
</AuditPath>
<AuditPath key="4.2">
<RecordValue key="value.1" dataExtractor="simpleValue"/>
</AuditPath>
</AuditPath>
</AuditPath>
<AuditPath key="2.2">
<AuditPath key="3.1">
<AuditPath key="4.1">
<RecordValue key="value.1" dataExtractor="simpleValue"/>
</AuditPath>
<AuditPath key="4.2">
<RecordValue key="value.2" dataExtractor="simpleValue"/>
</AuditPath>
</AuditPath>
<AuditPath key="3.2">
<AuditPath key="4.1">
<RecordValue key="value.1" dataExtractor="simpleValue"/>
<GenerateValue key="time" dataGenerator="systemTime" scope="ALL"/>
</AuditPath>
<AuditPath key="4.2">
<RecordValue key="value.1" dataExtractor="simpleValue"/>
</AuditPath>
</AuditPath>
</AuditPath>
</AuditPath>
</Application>
</Audit>