File: Annotations.java

package info (click to toggle)
libjibx1.2-java 1.2.6-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 26,260 kB
  • sloc: java: 75,013; xml: 14,068; makefile: 17
file content (80 lines) | stat: -rw-r--r-- 2,832 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

package org.jibx.schema.elements;

import org.jibx.schema.SchemaTestBase;

/**
 * Test handling of simple schemas with annotations.
 */
public class Annotations extends SchemaTestBase
{
    public static final String EMPTY_ANNOTATION =
        "<schema targetNamespace='urn:anything'" +
        "    xmlns='http://www.w3.org/2001/XMLSchema'" +
        "    elementFormDefault='qualified'>\n" +
        "  <annotation/>\n" +
        "</schema>";

    public static final String DOCUMENTATION_ANNOTATION =
        "<schema targetNamespace='urn:anything'" +
        "    xmlns='http://www.w3.org/2001/XMLSchema'" +
        "    elementFormDefault='qualified'>\n" +
        "  <annotation>\n" +
        "    <documentation source='urn:a' xml:lang='en'>\n" +
        "      this is <b xmlns='urn:b'>all</b> good" +
        "    </documentation>\n" +
        "  </annotation>\n" +
        "</schema>";

    public static final String APPINFO_ANNOTATION =
        "<schema targetNamespace='urn:anything'" +
        "    xmlns='http://www.w3.org/2001/XMLSchema'" +
        "    elementFormDefault='qualified'>\n" +
        "  <annotation>\n" +
        "    <appinfo>\n" +
        "      <j:jibx xmlns:j='http://www.jibx.org'>special good stuff</j:jibx>\n" +
        "    </appinfo>\n" +
        "  </annotation>\n" +
        "</schema>";

    public static final String MULTIPLE_ANNOTATION =
        "<schema targetNamespace='urn:anything'" +
        "    xmlns='http://www.w3.org/2001/XMLSchema'" +
        "    elementFormDefault='qualified'>\n" +
        "  <annotation>\n" +
        "    <appinfo>\n" +
        "      <j:jibx xmlns:j='http://www.jibx.org'>special good stuff</j:jibx>\n" +
        "    </appinfo>\n" +
        "    <documentation>\n" +
        "      this is <b xmlns='urn:b'>all</b> good" +
        "    </documentation>\n" +
        "    <documentation xml:lang='en'>\n" +
        "      this is <b xmlns='urn:b'>all</b> good" +
        "    </documentation>\n" +
        "    <appinfo>\n" +
        "      <j:jibx xmlns:j='http://www.jibx.org' source='http://www.jibx.org'>\n" +
        "        more good stuff" +
        "      </j:jibx>\n" +
        "    </appinfo>\n" +
        "    <appinfo>\n" +
        "      <j:jibx xmlns:j='http://www.jibx.org'>last good stuff</j:jibx>\n" +
        "    </appinfo>\n" +
        "  </annotation>\n" +
        "</schema>";

    public void testEmptyAnnotation() throws Exception {
        runNoErrors(EMPTY_ANNOTATION);
    }
    
    public void testDocumentationAnnotation() throws Exception {
        runNoErrors(DOCUMENTATION_ANNOTATION);
    }
    
    public void testAppInfoAnnotation() throws Exception {
        runNoErrors(APPINFO_ANNOTATION);
    }
    
    public void testMultipleAnnotation() throws Exception {
        runNoErrors(MULTIPLE_ANNOTATION);
    }
}