test(draw/BpmnRenderer): add collaboration label test

This commit is contained in:
Nico Rehwaldt 2014-05-06 10:00:06 +02:00
parent ca0e0fbd97
commit 7d9ffa820a
2 changed files with 96 additions and 5 deletions

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" id="_qNeOgNTyEeORzsRKJ7o0Ew" targetNamespace="http://activiti.org/bpmn">
<bpmn2:collaboration id="_Collaboration_2">
<bpmn2:participant id="_Participant_2" name="single line" processRef="Process_1"/>
<bpmn2:participant id="Participant_1" name="multi line label&#xD;&#xA;(manual break)" processRef="Process_3"/>
<bpmn2:participant id="Participant_2" name="with lanes" processRef="Process_2"/>
<bpmn2:participant id="Participant_3" name="pool with very long label" processRef="Process_4"/>
</bpmn2:collaboration>
<bpmn2:process id="Process_1" isExecutable="false">
<bpmn2:dataObject id="DataObject_1" name="Data Object 1"/>
<bpmn2:dataObjectReference id="DataObjectReference_1" dataObjectRef="DataObject_1"/>
</bpmn2:process>
<bpmn2:process id="Process_2" isExecutable="false">
<bpmn2:laneSet id="LaneSet_1" name="Lane Set 1">
<bpmn2:lane id="Lane_1" name="single line label"/>
<bpmn2:lane id="Lane_2" name="multi-line label&#xD;&#xA;(manual break)">
<bpmn2:childLaneSet xsi:type="bpmn2:tLaneSet" id="LaneSet_2">
<bpmn2:lane id="Lane_3" name="nested lane"/>
<bpmn2:lane id="Lane_4" name="another nested lane"/>
</bpmn2:childLaneSet>
</bpmn2:lane>
</bpmn2:laneSet>
</bpmn2:process>
<bpmn2:process id="Process_3" isExecutable="false">
<bpmn2:startEvent id="StartEvent_1"/>
</bpmn2:process>
<bpmn2:process id="Process_4" isExecutable="false">
<bpmn2:task id="Task_1"/>
</bpmn2:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="_Collaboration_2">
<bpmndi:BPMNShape id="_BPMNShape_Participant_2" bpmnElement="_Participant_2" isHorizontal="true">
<dc:Bounds height="133.0" width="540.0" x="72.0" y="48.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_Participant_3" bpmnElement="Participant_1" isHorizontal="true">
<dc:Bounds height="148.0" width="540.0" x="72.0" y="216.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_Participant_4" bpmnElement="Participant_2" isHorizontal="true">
<dc:Bounds height="469.0" width="540.0" x="72.0" y="528.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_Lane_2" bpmnElement="Lane_1" isHorizontal="true">
<dc:Bounds height="157.0" width="510.0" x="102.0" y="528.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_Lane_3" bpmnElement="Lane_2" isHorizontal="true">
<dc:Bounds height="313.0" width="510.0" x="102.0" y="684.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_Lane_4" bpmnElement="Lane_3" isHorizontal="true">
<dc:Bounds height="157.0" width="480.0" x="132.0" y="684.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_Lane_5" bpmnElement="Lane_4" isHorizontal="true">
<dc:Bounds height="157.0" width="480.0" x="132.0" y="840.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_Participant_5" bpmnElement="Participant_3" isHorizontal="true">
<dc:Bounds height="100.0" width="540.0" x="72.0" y="396.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds height="36.0" width="36.0" x="516.0" y="255.0"/>
<bpmndi:BPMNLabel>
<dc:Bounds height="0.0" width="0.0" x="534.0" y="296.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_Task_2" bpmnElement="Task_1">
<dc:Bounds height="80.0" width="100.0" x="492.0" y="407.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_DataObjectReference_2" bpmnElement="DataObjectReference_1">
<dc:Bounds height="50.0" width="36.0" x="540.0" y="72.0"/>
<bpmndi:BPMNLabel>
<dc:Bounds height="22.0" width="148.0" x="484.0" y="127.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>

View File

@ -1,3 +1,5 @@
'use strict';
var fs = require('fs');
var Viewer = require('../../../../lib/Viewer');
@ -17,7 +19,9 @@ describe('import - labels', function() {
});
it('should import embedded labels', function(done) {
describe('should import embedded labels', function() {
it('on flow nodes', function(done) {
var xml = fs.readFileSync('test/fixtures/bpmn/labels/embedded.bpmn', 'utf8');
@ -29,6 +33,20 @@ describe('import - labels', function() {
});
it('on pools and lanes', function(done) {
var xml = fs.readFileSync('test/fixtures/bpmn/labels/collaboration.bpmn', 'utf8');
var renderer = new Viewer(container);
renderer.importXML(xml, function(err) {
done(err);
});
});
});
describe('should import external labels', function() {
it('with di', function(done) {