Skip to content

Commit ffd060b

Browse files
committed
Initial commit.
1 parent 06d6f97 commit ffd060b

File tree

11 files changed

+105
-20
lines changed

11 files changed

+105
-20
lines changed

basic/.classpath

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,22 @@
66
<attribute name="maven.pomderived" value="true"/>
77
</attributes>
88
</classpathentry>
9-
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/resources"/>
9+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
10+
<attributes>
11+
<attribute name="maven.pomderived" value="true"/>
12+
</attributes>
13+
</classpathentry>
1014
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
1115
<attributes>
1216
<attribute name="optional" value="true"/>
1317
<attribute name="maven.pomderived" value="true"/>
1418
</attributes>
1519
</classpathentry>
16-
<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
20+
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
21+
<attributes>
22+
<attribute name="maven.pomderived" value="true"/>
23+
</attributes>
24+
</classpathentry>
1725
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
1826
<attributes>
1927
<attribute name="maven.pomderived" value="true"/>

runtime/.classpath

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,23 @@
66
<attribute name="maven.pomderived" value="true"/>
77
</attributes>
88
</classpathentry>
9-
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/resources"/>
9+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
10+
<attributes>
11+
<attribute name="maven.pomderived" value="true"/>
12+
</attributes>
13+
</classpathentry>
1014
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
1115
<attributes>
1216
<attribute name="optional" value="true"/>
1317
<attribute name="maven.pomderived" value="true"/>
1418
</attributes>
1519
</classpathentry>
16-
<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
17-
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
20+
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
21+
<attributes>
22+
<attribute name="maven.pomderived" value="true"/>
23+
</attributes>
24+
</classpathentry>
25+
<classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
1826
<attributes>
1927
<attribute name="maven.pomderived" value="true"/>
2028
</attributes>

tests/issues/.classpath

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
<attribute name="maven.pomderived" value="true"/>
77
</attributes>
88
</classpathentry>
9-
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/resources"/>
9+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
10+
<attributes>
11+
<attribute name="maven.pomderived" value="true"/>
12+
</attributes>
13+
</classpathentry>
1014
<classpathentry including="**/*.java" kind="src" output="target/classes" path="target/generated-sources/xjc">
1115
<attributes>
1216
<attribute name="optional" value="true"/>
@@ -19,7 +23,11 @@
1923
<attribute name="maven.pomderived" value="true"/>
2024
</attributes>
2125
</classpathentry>
22-
<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
26+
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
27+
<attributes>
28+
<attribute name="maven.pomderived" value="true"/>
29+
</attributes>
30+
</classpathentry>
2331
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
2432
<attributes>
2533
<attribute name="maven.pomderived" value="true"/>

tests/simple-hashCode-equals-01/.classpath

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
<attribute name="maven.pomderived" value="true"/>
77
</attributes>
88
</classpathentry>
9-
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/resources"/>
9+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
10+
<attributes>
11+
<attribute name="maven.pomderived" value="true"/>
12+
</attributes>
13+
</classpathentry>
1014
<classpathentry including="**/*.java" kind="src" output="target/classes" path="target/generated-sources/xjc">
1115
<attributes>
1216
<attribute name="optional" value="true"/>
@@ -19,7 +23,11 @@
1923
<attribute name="maven.pomderived" value="true"/>
2024
</attributes>
2125
</classpathentry>
22-
<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
26+
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
27+
<attributes>
28+
<attribute name="maven.pomderived" value="true"/>
29+
</attributes>
30+
</classpathentry>
2331
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
2432
<attributes>
2533
<attribute name="maven.pomderived" value="true"/>

tests/simple-hashCode-equals-01/pom.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
<configuration>
3131
<extension>true</extension>
3232
<args>
33-
<!--arg>-Xequals</arg>
34-
<arg>-XhashCode</arg-->
3533
<arg>-XsimpleEquals</arg>
3634
<arg>-XsimpleHashCode</arg>
3735
<!-- arg>-XsimpleToString</arg-->

tests/simple-hashCode-equals-01/src/main/resources/main.xjb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
jaxb:extensionBindingPrefixes="xjc">
1313

1414
<jaxb:bindings schemaLocation="main.xsd" node="/xs:schema">
15-
<!--jaxb:globalBindings
15+
<jaxb:globalBindings
1616
optionalProperty="primitive"
1717
generateIsSetMethod="true">
18-
</jaxb:globalBindings-->
18+
</jaxb:globalBindings>
1919
<jaxb:schemaBindings>
2020
<jaxb:package name="org.jvnet.jaxb2_commons.tests.simple_hashcode_equals_01.main"/>
2121
</jaxb:schemaBindings>

tests/simplify-02/pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,13 @@
2828
<build>
2929
<defaultGoal>test</defaultGoal>
3030
<plugins>
31-
<plugin>
31+
<!-- plugin>
3232
<groupId>org.jvnet.jaxb2.maven2</groupId>
3333
<artifactId>maven-jaxb2-plugin</artifactId>
3434
<configuration>
3535
<extension>true</extension>
3636
<args>
3737
<arg>-Xsimplify</arg>
38-
<!--arg>-Xsimplify-usePluralForm=true</arg-->
3938
</args>
4039
<plugins>
4140
<plugin>
@@ -44,7 +43,7 @@
4443
</plugin>
4544
</plugins>
4645
</configuration>
47-
</plugin>
46+
</plugin-->
4847
</plugins>
4948
</build>
5049
</project>

tests/simplify-02/src/main/resources/bindings.xjb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
xmlns:simplify="http://jaxb2-commons.dev.java.net/basic/simplify"
55
jaxb:extensionBindingPrefixes="simplify">
66

7-
<jaxb:bindings schemaLocation="schema.xsd" node="/xs:schema/xs:complexType[@name='oai_dcType']/xs:choice/xs:element[@ref='dc:subject']">
8-
<simplify:as-element-property />
7+
<jaxb:bindings schemaLocation="schema.xsd" node="/xs:schema/xs:complexType[@name='oai_dcType']">
8+
<simplify:property name="titleOrCreatorOrSubject">
9+
<simplify:as-element-property/>
10+
</simplify:property>
911
</jaxb:bindings>
1012

1113
</jaxb:bindings>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package org.jvnet.jaxb2_commons.plugin.simplify.tests02;
2+
3+
import java.io.File;
4+
import java.net.URL;
5+
6+
import org.junit.Before;
7+
import org.junit.Test;
8+
9+
import com.sun.codemodel.JCodeModel;
10+
import com.sun.tools.xjc.ConsoleErrorReporter;
11+
import com.sun.tools.xjc.ModelLoader;
12+
import com.sun.tools.xjc.Options;
13+
import com.sun.tools.xjc.model.Model;
14+
15+
public class RunSimplifyPlugin {
16+
17+
@Before
18+
public void setUp() {
19+
System.setProperty("javax.xml.accessExternalSchema", "all");
20+
}
21+
22+
@Test
23+
public void compilesSchema() throws Exception {
24+
25+
new File("target/generated-sources/xjc").mkdirs();
26+
27+
URL schema = getClass().getResource("/schema.xsd");
28+
URL binding = getClass().getResource("/bindings.xjb");
29+
final String[] arguments = new String[] { "-xmlschema",
30+
schema.toExternalForm(), "-b", binding.toExternalForm(), "-d",
31+
"target/generated-sources/xjc", "-extension", "-Xsimplify", "-Xsimplify-usePluralForm=true"};
32+
33+
Options options = new Options();
34+
options.parseArguments(arguments);
35+
ConsoleErrorReporter receiver = new ConsoleErrorReporter();
36+
Model model = ModelLoader.load(options, new JCodeModel(), receiver);
37+
model.generateCode(options, receiver);
38+
com.sun.codemodel.CodeWriter cw = options.createCodeWriter();
39+
model.codeModel.build(cw);
40+
}
41+
}

tests/wildcard/.classpath

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
<attribute name="maven.pomderived" value="true"/>
77
</attributes>
88
</classpathentry>
9-
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/resources"/>
9+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
10+
<attributes>
11+
<attribute name="maven.pomderived" value="true"/>
12+
</attributes>
13+
</classpathentry>
1014
<classpathentry including="**/*.java" kind="src" output="target/classes" path="target/generated-sources/xjc">
1115
<attributes>
1216
<attribute name="optional" value="true"/>
@@ -19,7 +23,11 @@
1923
<attribute name="maven.pomderived" value="true"/>
2024
</attributes>
2125
</classpathentry>
22-
<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
26+
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
27+
<attributes>
28+
<attribute name="maven.pomderived" value="true"/>
29+
</attributes>
30+
</classpathentry>
2331
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
2432
<attributes>
2533
<attribute name="maven.pomderived" value="true"/>

0 commit comments

Comments
 (0)