Skip to content

Commit

Permalink
Simplified PEBL by removing NoTestPartner with empty list.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonharrer committed Jan 4, 2017
1 parent b338277 commit 214d3ec
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import pebl.benchmark.feature.Group;
import pebl.benchmark.test.Test;
import pebl.benchmark.test.TestPartner;
import pebl.benchmark.test.partner.NoTestPartner;
import pebl.benchmark.test.partner.RuleBasedWSDLTestPartner;
import pebl.benchmark.test.partner.WSDLTestPartner;
import pebl.benchmark.test.partner.rules.AnyInput;
Expand Down Expand Up @@ -301,7 +300,7 @@ private static List<Error> getInputToErrorCode() {
result.add(new Error(60025, "soap-xsd-mod_ns-wrong_ns", SOAP_CONSTRUCT));
result.add(new Error(60026, "soap-xsd-mod_ns-unbound_prefix", SOAP_CONSTRUCT));
result.add(new Error(50001, "tcp-dns-unresolveable", TCP_CONSTRUCT, new WSDLTestPartner("http://thishostisnotusedeverreally:2000/bpel-testpartner", Paths.get("TestPartner.wsdl"))));
result.add(new Error(50002, "tcp-host-unreachable", TCP_CONSTRUCT, new NoTestPartner()));
result.add(new Error(50002, "tcp-host-unreachable", TCP_CONSTRUCT, null));
result.add(new Error(50003, "tcp-timeout", TCP_CONSTRUCT, new RuleBasedWSDLTestPartner(Paths.get("TestPartner.wsdl"),
"http://localhost:2000/bpel-testpartner",
new OperationInputOutputRule("startProcessSync", new AnyInput(), new NoOutput()))));
Expand Down
8 changes: 0 additions & 8 deletions pebl-builder/src/main/java/pebl/builder/Builder.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import pebl.benchmark.feature.Language;
import pebl.benchmark.feature.MetricType;
import pebl.benchmark.test.Test;
import pebl.benchmark.test.partner.NoTestPartner;
import pebl.xsd.Features;
import pebl.xsd.PEBL;

Expand All @@ -41,16 +40,9 @@ public static PEBL getPebl() {

addPerformance(pebl);

// as a very last step
addNoTestPartnerForAllTestsWithoutTestPartners(pebl);

return pebl;
}

private static void addNoTestPartnerForAllTestsWithoutTestPartners(PEBL pebl) {
pebl.benchmark.tests.stream().filter(t -> t.getTestPartners().isEmpty()).forEach(t -> t.addTestPartner(new NoTestPartner()));
}

private static void addPerformance(PEBL pebl) {
// feature tree
final Capability performance = Capabilities.PERFORMANCE;
Expand Down
1 change: 0 additions & 1 deletion pebl/doc/benchmark-test-partner.puml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@startuml

class NoTestPartner extends TestPartner
class WSDLTestPartner extends TestPartner {
url : String
wsdl : String
Expand Down
2 changes: 1 addition & 1 deletion pebl/src/main/java/pebl/benchmark/test/Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class Test implements Comparable<Test>, HasName, HasId, FeatureDimension,
@XmlList
private final List<Path> files;

@XmlElement(required = true)
@XmlElement
@XmlElementRef
@XmlElementWrapper(name = "testPartners")
private final List<TestPartner> partners;
Expand Down
3 changes: 1 addition & 2 deletions pebl/src/main/java/pebl/benchmark/test/TestPartner.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@

import pebl.HasExtensions;
import pebl.MapAdapter;
import pebl.benchmark.test.partner.NoTestPartner;
import pebl.benchmark.test.partner.RuleBasedWSDLTestPartner;
import pebl.benchmark.test.partner.ScriptBasedWSDLTestPartner;

@XmlSeeAlso({RuleBasedWSDLTestPartner.class, NoTestPartner.class, ScriptBasedWSDLTestPartner.class})
@XmlSeeAlso({RuleBasedWSDLTestPartner.class, ScriptBasedWSDLTestPartner.class})
public class TestPartner implements HasExtensions {

@XmlJavaTypeAdapter(MapAdapter.class)
Expand Down
10 changes: 0 additions & 10 deletions pebl/src/main/java/pebl/benchmark/test/partner/NoTestPartner.java

This file was deleted.

36 changes: 7 additions & 29 deletions pebl/src/main/resources/pebl/pebl.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"type" : "array",
"items" : {
"type" : "string",
"enum" : [ "TIME_BEHAVIOUR", "AUTHENTICITY", "PORTABILITY", "APPROPRIATENESS_RECOGNISABILITY", "ACCESSIBILITY", "MODULARITY", "COMPATABILITY", "FUNCTIONAL_CORRECTNESS", "CONFIDENTIALITY", "FUNCTIONAL_SUITABILITY", "CO_EXISTENCE", "LEARNABILITY", "ANALYSABILITY", "OPERABILITY", "REPLACEABILITY", "MATURITY", "FAULT_TOLERANCE", "AVAILABILITY", "ADAPTABILITY", "RECOVERABILITY", "USABILITY", "RELIABILITY", "MAINTAINABILITY", "USER_INTERFACE_AESTHETICS", "NON_REPUDIATION", "SECURITY", "REUSABILITY", "MODIFIABILITY", "INTEGRITY", "FUNCTIONAL_APPROPRIATENESS", "INTEROPERABILITY", "USER_ERROR_PROTECTION", "INSTALLABILITY", "FUNCTIONAL_COMPLETENESS", "RESOURCE_UTILISATION", "PERFORMANCE_EFFICIENCY", "TESTABILITY", "ACCOUNTABILITY", "CAPACITY" ]
"enum" : [ "FUNCTIONAL_COMPLETENESS", "LEARNABILITY", "ADAPTABILITY", "AVAILABILITY", "INTEGRITY", "REPLACEABILITY", "USER_INTERFACE_AESTHETICS", "INTEROPERABILITY", "ANALYSABILITY", "FUNCTIONAL_SUITABILITY", "PERFORMANCE_EFFICIENCY", "COMPATABILITY", "ACCESSIBILITY", "FAULT_TOLERANCE", "FUNCTIONAL_APPROPRIATENESS", "RECOVERABILITY", "ACCOUNTABILITY", "MAINTAINABILITY", "AUTHENTICITY", "TIME_BEHAVIOUR", "MODULARITY", "MATURITY", "NON_REPUDIATION", "INSTALLABILITY", "CONFIDENTIALITY", "TESTABILITY", "REUSABILITY", "MODIFIABILITY", "FUNCTIONAL_CORRECTNESS", "USABILITY", "RELIABILITY", "SECURITY", "CO_EXISTENCE", "OPERABILITY", "CAPACITY", "APPROPRIATENESS_RECOGNISABILITY", "PORTABILITY", "RESOURCE_UTILISATION", "USER_ERROR_PROTECTION" ]
}
},
"extensions" : {
Expand Down Expand Up @@ -322,16 +322,6 @@
} ]
}
},
"noTestPartner" : {
"type" : "array",
"items" : {
"anyOf" : [ {
"$ref" : "#/definitions/NoTestPartner"
}, {
"$ref" : "#/definitions/TestPartner"
} ]
}
},
"scriptBasedWSDLTestPartner" : {
"type" : "array",
"items" : {
Expand Down Expand Up @@ -1306,10 +1296,10 @@
"anyInput" : {
"anyOf" : [ {
"$ref" : "#/definitions/AnyInput"
}, {
"$ref" : "#/definitions/ScriptPredicate"
}, {
"$ref" : "#/definitions/XpathPredicate"
}, {
"$ref" : "#/definitions/ScriptPredicate"
} ]
},
"xpathPredicate" : {
Expand Down Expand Up @@ -1522,18 +1512,6 @@
},
"additionalProperties" : false
},
"NoTestPartner" : {
"type" : "object",
"properties" : {
"type" : {
"type" : "string"
},
"extensions" : {
"$ref" : "#/definitions/AdaptedMap"
}
},
"additionalProperties" : false
},
"MetricType" : {
"type" : "object",
"properties" : {
Expand Down Expand Up @@ -1580,13 +1558,13 @@
}
}
},
"featureResults" : {
"aggregatedResults" : {
"type" : "object",
"properties" : {
"featureResult" : {
"aggregatedResult" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/FeatureResult"
"$ref" : "#/definitions/AggregatedResult"
}
}
}
Expand Down Expand Up @@ -1703,7 +1681,7 @@
},
"additionalProperties" : false
},
"FeatureResult" : {
"AggregatedResult" : {
"type" : "object",
"properties" : {
"measurements" : {
Expand Down
39 changes: 15 additions & 24 deletions pebl/src/main/resources/pebl/pebl.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="noTestPartner">
<xsd:complexContent>
<xsd:extension base="testPartner">
<xsd:sequence/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="featureSet">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
Expand Down Expand Up @@ -54,6 +47,18 @@
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="aggregatedResult">
<xsd:sequence>
<xsd:element name="measurements" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="measurement" type="measurement" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="engine" type="xsd:IDREF" use="required"/>
</xsd:complexType>
<xsd:complexType name="language">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
Expand Down Expand Up @@ -108,10 +113,10 @@
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="featureResults" minOccurs="0">
<xsd:element name="aggregatedResults" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="featureResult" type="featureResult" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="aggregatedResult" type="aggregatedResult" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Expand Down Expand Up @@ -308,10 +313,9 @@
<xsd:element name="testPartners" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:choice maxOccurs="unbounded">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element ref="ruleBasedWSDLTestPartner"/>
<xsd:element ref="wsdlTestPartner"/>
<xsd:element ref="noTestPartner"/>
<xsd:element ref="scriptBasedWSDLTestPartner"/>
</xsd:choice>
</xsd:sequence>
Expand Down Expand Up @@ -527,18 +531,6 @@
<xsd:attribute name="engine" type="xsd:IDREF" use="required"/>
<xsd:attribute name="tool" type="xsd:string" use="required"/>
</xsd:complexType>
<xsd:complexType name="featureResult">
<xsd:sequence>
<xsd:element name="measurements" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="measurement" type="measurement" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="engine" type="xsd:IDREF" use="required"/>
</xsd:complexType>
<xsd:complexType name="testCase">
<xsd:sequence>
<xsd:element name="extensions" type="adaptedMap" minOccurs="0"/>
Expand All @@ -561,7 +553,6 @@
<xsd:attribute name="number" type="xsd:int" use="required"/>
</xsd:complexType>
<xsd:element name="sendSoapMessage" type="sendSoapMessage"/>
<xsd:element name="noTestPartner" type="noTestPartner"/>
<xsd:element name="assertXpath" type="assertXpath"/>
<xsd:element name="pebl" type="pebl"/>
<xsd:element name="anyInput" type="anyInput"/>
Expand Down

0 comments on commit 214d3ec

Please sign in to comment.