use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.WSDLImport in project kie-wb-common by kiegroup.
the class DiagramSetTest method testHashCode.
@Test
public void testHashCode() {
DiagramSet a = new DiagramSet();
DiagramSet b = new DiagramSet();
assertEquals(a.hashCode(), b.hashCode());
DefaultImport defaultImport = new DefaultImport("className");
WSDLImport wsdlImport = new WSDLImport("location", "namespace");
ImportsValue importsValue = new ImportsValue();
importsValue.addImport(defaultImport);
importsValue.addImport(wsdlImport);
DiagramSet c = new DiagramSet();
c.setImports(new Imports(importsValue));
DiagramSet d = new DiagramSet();
assertNotEquals(c.hashCode(), d.hashCode());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.WSDLImport in project kie-wb-common by kiegroup.
the class PropertyWriterUtils method toImport.
public static Import toImport(WSDLImport wsdlImport) {
Import imp = Bpmn2Factory.eINSTANCE.createImport();
imp.setImportType("http://schemas.xmlsoap.org/wsdl/");
imp.setLocation(wsdlImport.getLocation());
imp.setNamespace(wsdlImport.getNamespace());
return imp;
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.WSDLImport in project kie-wb-common by kiegroup.
the class DefinitionsConverterTest method toDefinitions.
@Test
public void toDefinitions() {
final String LOCATION = "Location";
final String NAMESPACE = "Namespace";
ImportsValue importsValue = new ImportsValue();
importsValue.addImport(new WSDLImport(LOCATION, NAMESPACE));
BPMNDiagramImpl diag = new BPMNDiagramImpl();
diag.setDiagramSet(new DiagramSet(new Name(), new Documentation(), new Id(), new Package(), new ProcessType(), new Version(), new AdHoc(false), new ProcessInstanceDescription(), new Imports(importsValue), new Executable(true), new SLADueDate()));
GraphNodeStoreImpl nodeStore = new GraphNodeStoreImpl();
NodeImpl x = new NodeImpl("x");
x.setContent(new ViewImpl<>(diag, Bounds.create()));
nodeStore.add(x);
ConverterFactory f = new ConverterFactory(new DefinitionsBuildingContext(new GraphImpl("x", nodeStore)), new PropertyWriterFactory());
DefinitionsConverter definitionsConverter = new DefinitionsConverter(f, new PropertyWriterFactory());
Definitions definitions = definitionsConverter.toDefinitions();
assertImportsValue(LOCATION, NAMESPACE, definitions);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.WSDLImport in project kie-wb-common by kiegroup.
the class DefinitionsPropertyWriterTest method setWSDLImports.
@Test
public void setWSDLImports() {
final String LOCATION = "location";
final String NAMESPACE = "namespace";
final int QTY = 10;
List<WSDLImport> wsdlImports = new ArrayList<>();
for (int i = 0; i < QTY; i++) {
wsdlImports.add(new WSDLImport(LOCATION + i, NAMESPACE + i));
}
tested.setWSDLImports(wsdlImports);
List<Import> imports = definitions.getImports();
assertEquals(QTY, imports.size());
for (int i = 0; i < QTY; i++) {
assertEquals(LOCATION + i, imports.get(i).getLocation());
assertEquals(NAMESPACE + i, imports.get(i).getNamespace());
}
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.WSDLImport in project kie-wb-common by kiegroup.
the class ImportsFieldEditorWidget method copyImportsValue.
protected ImportsValue copyImportsValue(ImportsValue importsValue) {
ImportsValue copy = new ImportsValue();
if (importsValue != null) {
for (DefaultImport defaultImport : importsValue.getDefaultImports()) {
DefaultImport importCopy = new DefaultImport();
importCopy.setClassName(defaultImport.getClassName());
copy.addImport(importCopy);
}
for (WSDLImport wsdlImport : importsValue.getWSDLImports()) {
WSDLImport importCopy = new WSDLImport();
importCopy.setLocation(wsdlImport.getLocation());
importCopy.setNamespace(wsdlImport.getNamespace());
copy.addImport(importCopy);
}
}
return copy;
}
Aggregations