forked from membrane/soa-model
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refs #membrane#277 Parse the version attribute and generate diff..
Includes tests for parsing attribute version and diff.
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
core/src/test/groovy/com/predic8/schema/SchemaVersionTest.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.predic8.schema; | ||
|
||
import com.predic8.xml.util.ClasspathResolver; | ||
|
||
public class SchemaVersionTest extends GroovyTestCase { | ||
def schema | ||
|
||
void setUp() { | ||
def parser = new SchemaParser(resourceResolver: new ClasspathResolver()) | ||
schema = parser.parse("/schema/version/schema-version.xsd") | ||
} | ||
|
||
void testSchemaVersion() { | ||
def expected = "1.0" | ||
def version = schema.version | ||
assertEquals( expected, version ) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" | ||
targetNamespace="http://predic8.com/human-resources/" xmlns:tns="http://predic8.com/human-resources/" | ||
elementFormDefault="unqualified" xmlns:ct="http://predic8.com/common-types/" | ||
version="1.0" | ||
> | ||
|
||
<xsd:group name="PersonGroup"> | ||
<xsd:all> | ||
<xsd:element name="firstName" type="xsd:string" /> | ||
<xsd:element name="lastName" type="xsd:string" /> | ||
<xsd:element name="isHuman" /> | ||
</xsd:all> | ||
</xsd:group> | ||
|
||
<xsd:complexType name="EmployeeType"> | ||
<xsd:all minOccurs="1"> | ||
<xsd:element name="person"> | ||
<xsd:complexType> | ||
<xsd:group ref="tns:PersonGroup" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
<xsd:element name="city" type="xsd:string" /> | ||
</xsd:all> | ||
</xsd:complexType> | ||
|
||
<xsd:element name="employee" type="tns:EmployeeType" /> | ||
|
||
</xsd:schema> |