Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
highsource committed Apr 6, 2016
1 parent 06d6f97 commit ffd060b
Show file tree
Hide file tree
Showing 11 changed files with 105 additions and 20 deletions.
12 changes: 10 additions & 2 deletions basic/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,22 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
Expand Down
14 changes: 11 additions & 3 deletions runtime/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,23 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
Expand Down
12 changes: 10 additions & 2 deletions tests/issues/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry including="**/*.java" kind="src" output="target/classes" path="target/generated-sources/xjc">
<attributes>
<attribute name="optional" value="true"/>
Expand All @@ -19,7 +23,11 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
Expand Down
12 changes: 10 additions & 2 deletions tests/simple-hashCode-equals-01/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry including="**/*.java" kind="src" output="target/classes" path="target/generated-sources/xjc">
<attributes>
<attribute name="optional" value="true"/>
Expand All @@ -19,7 +23,11 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
Expand Down
2 changes: 0 additions & 2 deletions tests/simple-hashCode-equals-01/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
<configuration>
<extension>true</extension>
<args>
<!--arg>-Xequals</arg>
<arg>-XhashCode</arg-->
<arg>-XsimpleEquals</arg>
<arg>-XsimpleHashCode</arg>
<!-- arg>-XsimpleToString</arg-->
Expand Down
4 changes: 2 additions & 2 deletions tests/simple-hashCode-equals-01/src/main/resources/main.xjb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
jaxb:extensionBindingPrefixes="xjc">

<jaxb:bindings schemaLocation="main.xsd" node="/xs:schema">
<!--jaxb:globalBindings
<jaxb:globalBindings
optionalProperty="primitive"
generateIsSetMethod="true">
</jaxb:globalBindings-->
</jaxb:globalBindings>
<jaxb:schemaBindings>
<jaxb:package name="org.jvnet.jaxb2_commons.tests.simple_hashcode_equals_01.main"/>
</jaxb:schemaBindings>
Expand Down
5 changes: 2 additions & 3 deletions tests/simplify-02/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@
<build>
<defaultGoal>test</defaultGoal>
<plugins>
<plugin>
<!-- plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<configuration>
<extension>true</extension>
<args>
<arg>-Xsimplify</arg>
<!--arg>-Xsimplify-usePluralForm=true</arg-->
</args>
<plugins>
<plugin>
Expand All @@ -44,7 +43,7 @@
</plugin>
</plugins>
</configuration>
</plugin>
</plugin-->
</plugins>
</build>
</project>
6 changes: 4 additions & 2 deletions tests/simplify-02/src/main/resources/bindings.xjb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
xmlns:simplify="http://jaxb2-commons.dev.java.net/basic/simplify"
jaxb:extensionBindingPrefixes="simplify">

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

</jaxb:bindings>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package org.jvnet.jaxb2_commons.plugin.simplify.tests02;

import java.io.File;
import java.net.URL;

import org.junit.Before;
import org.junit.Test;

import com.sun.codemodel.JCodeModel;
import com.sun.tools.xjc.ConsoleErrorReporter;
import com.sun.tools.xjc.ModelLoader;
import com.sun.tools.xjc.Options;
import com.sun.tools.xjc.model.Model;

public class RunSimplifyPlugin {

@Before
public void setUp() {
System.setProperty("javax.xml.accessExternalSchema", "all");
}

@Test
public void compilesSchema() throws Exception {

new File("target/generated-sources/xjc").mkdirs();

URL schema = getClass().getResource("/schema.xsd");
URL binding = getClass().getResource("/bindings.xjb");
final String[] arguments = new String[] { "-xmlschema",
schema.toExternalForm(), "-b", binding.toExternalForm(), "-d",
"target/generated-sources/xjc", "-extension", "-Xsimplify", "-Xsimplify-usePluralForm=true"};

Options options = new Options();
options.parseArguments(arguments);
ConsoleErrorReporter receiver = new ConsoleErrorReporter();
Model model = ModelLoader.load(options, new JCodeModel(), receiver);
model.generateCode(options, receiver);
com.sun.codemodel.CodeWriter cw = options.createCodeWriter();
model.codeModel.build(cw);
}
}
12 changes: 10 additions & 2 deletions tests/wildcard/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry including="**/*.java" kind="src" output="target/classes" path="target/generated-sources/xjc">
<attributes>
<attribute name="optional" value="true"/>
Expand All @@ -19,7 +23,11 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
Expand Down
5 changes: 5 additions & 0 deletions tools/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,10 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

0 comments on commit ffd060b

Please sign in to comment.