-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
06d6f97
commit ffd060b
Showing
11 changed files
with
105 additions
and
20 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
41 changes: 41 additions & 0 deletions
41
...y-02/src/test/java/org/jvnet/jaxb2_commons/plugin/simplify/tests02/RunSimplifyPlugin.java
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,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); | ||
} | ||
} |
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
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