Skip to content

Commit

Permalink
Fix compilation errors with incomplete functionality from merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jhannes committed May 29, 2018
1 parent dbe7a74 commit a171f28
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/main/java/org/eaxy/experimental/SampleXmlBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ public class SampleXmlBuilder {
private Random random = new Random();
private String nsPrefix;

public SampleXmlBuilder(Document schemaDoc, String nsPrefix, SampleData sampleData) throws IOException {
public SampleXmlBuilder(Document schemaDoc, String nsPrefix) throws IOException {
this.schemaDoc = schemaDoc;
this.nsPrefix = nsPrefix;
this.sampleData = sampleData;

xsNamespace = schemaDoc.getRootElement().getName().getNamespace();
for (Element xsdInclude : schemaDoc.find("import")) {
Expand All @@ -49,7 +48,7 @@ public SampleXmlBuilder(Document schemaDoc, String nsPrefix, SampleData sampleDa
}

public SampleXmlBuilder(URL resource, String nsPrefix) throws IOException {
this(Xml.read(resource), nsPrefix, new SampleData());
this(Xml.read(resource), nsPrefix);
}

public SampleXmlBuilder(String nsPrefix, Document schemaDoc, List<Document> includedSchemas) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/eaxy/experimental/SoapSimulatorWebApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private static Map<String, String> readMultipart(String boundary, InputStream in
return formData;
}

public static class StockQuoteRandomData extends SampleData {
private static class StockQuoteRandomData extends SampleData {

private static Namespace NS = new Namespace("http://example.com/stockquote.xsd");

Expand All @@ -146,7 +146,7 @@ public String randomElementText(QualifiedName elementName, Element typeDefinitio
public static void main(String[] args) throws IOException {
SoapSimulatorWebApp server = new SoapSimulatorWebApp(10080);
server.addSoapEndpoint("/soap/stockQuote",
new SampleSoapXmlBuilder(Xml.read(new File("src/test/resources/xsd/StockQuoteService.wsdl")), new StockQuoteRandomData()));
new SampleSoapXmlBuilder(Xml.read(new File("src/test/resources/xsd/StockQuoteService.wsdl"))));
server.addSoapEndpoint("/soap/airport",
new SampleSoapXmlBuilder(Xml.read(new File("src/test/xml/wsdl-suite/airport.wsdl"))));
server.start();
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/eaxy/experimental/SampleXmlBuilderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void shouldGenerateMessageFromWsdl() throws IOException {
@Test
public void shouldGenerateAttributeValues() throws IOException {
Document schemaDoc = Xml.readResource("/mailmessage.xsd");
SampleXmlBuilder generator = new SampleXmlBuilder(schemaDoc, null, new SampleData());
SampleXmlBuilder generator = new SampleXmlBuilder(schemaDoc, null);
generator.setFull(true);
Element element = generator.createRandomElement("message");
assertThat(element.find("recipients", "recipient").first().attr("type")).isIn("email", "phone");
Expand All @@ -41,7 +41,7 @@ public void shouldGenerateAttributeValues() throws IOException {
@Test
public void shouldGenerateManyElementsWhenAppropriate() throws Exception {
Document schemaDoc = Xml.readResource("/mailmessage.xsd");
SampleXmlBuilder generator = new SampleXmlBuilder(schemaDoc, "msg", new SampleData());
SampleXmlBuilder generator = new SampleXmlBuilder(schemaDoc, "msg");
generator.setFull(true);
Element element = generator.createRandomElement("message");
generator.getValidator().validate(element);
Expand All @@ -63,7 +63,7 @@ public void shouldBuildFull() throws IOException {
@Test
public void shouldBuildMinimal() throws IOException {
Document schemaDoc = Xml.readResource("/xsd/po.xsd");
SampleXmlBuilder generator = new SampleXmlBuilder(schemaDoc, null, new SampleData());
SampleXmlBuilder generator = new SampleXmlBuilder(schemaDoc, null);
generator.setMinimal(true);
Element el = generator.createRandomElement("purchaseOrder");
assertThat(el.hasAttr("orderDate")).isFalse();
Expand Down

0 comments on commit a171f28

Please sign in to comment.