jruby_activiti 1.2.5 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/.ruby-version +1 -1
- data/CHANGELOG +6 -0
- data/Jarfile +5 -0
- data/Jarfile.lock +52 -13
- data/README.md +21 -9
- data/java/build.md +3 -0
- data/java/mapping.md +20 -0
- data/java/pom.xml +30 -0
- data/java/src/main/java/jrubyactiviti/Modeler.java +95 -0
- data/java/src/main/java/jrubyactiviti/ProcessDiagram.java +491 -0
- data/java/src/main/java/jrubyactiviti/ProcessInstanceHighlights.java +237 -0
- data/java/src/main/java/jrubyactiviti/StencilsetResource.java +16 -0
- data/java/src/main/resources/stencilset.json +1339 -0
- data/jruby_activiti.gemspec +3 -2
- data/lib/generators/jruby_activiti/install_generator.rb +4 -0
- data/lib/jar/jrubyactiviti-2.0.jar +0 -0
- data/lib/jruby_activiti/version.rb +1 -1
- data/lib/jruby_activiti/web.rb +81 -0
- data/lib/jruby_activiti.rb +28 -20
- data/test/{base_test.rb → activiti_test.rb} +1 -3
- data/test/instance_hights_test.rb +18 -0
- data/test/modeler_test.rb +35 -0
- data/test/process_diagram_test.rb +33 -0
- data/test/resources/model_init_editor_source.json +1 -0
- data/test/resources/model_json_xml.json +278 -0
- data/test/resources/model_svg_xml.xml +66 -0
- data/test/stencilset_test.rb +7 -0
- data/test/test_helper.rb +2 -0
- data/web/public/diagram-viewer/images/bg.png +0 -0
- data/web/public/diagram-viewer/images/breadcrumbs.png +0 -0
- data/web/public/diagram-viewer/images/checker-bg.png +0 -0
- data/web/public/diagram-viewer/images/deployer/blue/message_catch.png +0 -0
- data/web/public/diagram-viewer/images/deployer/business_rule.png +0 -0
- data/web/public/diagram-viewer/images/deployer/error_catch.png +0 -0
- data/web/public/diagram-viewer/images/deployer/error_throw.png +0 -0
- data/web/public/diagram-viewer/images/deployer/manual.png +0 -0
- data/web/public/diagram-viewer/images/deployer/message_catch.png +0 -0
- data/web/public/diagram-viewer/images/deployer/message_throw.png +0 -0
- data/web/public/diagram-viewer/images/deployer/receive.png +0 -0
- data/web/public/diagram-viewer/images/deployer/script.png +0 -0
- data/web/public/diagram-viewer/images/deployer/send.png +0 -0
- data/web/public/diagram-viewer/images/deployer/service.png +0 -0
- data/web/public/diagram-viewer/images/deployer/signal_catch.png +0 -0
- data/web/public/diagram-viewer/images/deployer/signal_throw.png +0 -0
- data/web/public/diagram-viewer/images/deployer/timer.png +0 -0
- data/web/public/diagram-viewer/images/deployer/user.png +0 -0
- data/web/public/diagram-viewer/index.html +130 -0
- data/web/public/diagram-viewer/js/ActivitiRest.js +74 -0
- data/web/public/diagram-viewer/js/ActivityImpl.js +1 -0
- data/web/public/diagram-viewer/js/Color.js +603 -0
- data/web/public/diagram-viewer/js/LineBreakMeasurer.js +270 -0
- data/web/public/diagram-viewer/js/Polyline.js +387 -0
- data/web/public/diagram-viewer/js/ProcessDiagramCanvas.js +2172 -0
- data/web/public/diagram-viewer/js/ProcessDiagramGenerator.js +1087 -0
- data/web/public/diagram-viewer/js/jquery/jquery.asyncqueue.js +125 -0
- data/web/public/diagram-viewer/js/jquery/jquery.js +9266 -0
- data/web/public/diagram-viewer/js/jquery/jquery.progressbar.js +131 -0
- data/web/public/diagram-viewer/js/jstools.js +23 -0
- data/web/public/diagram-viewer/js/raphael.2.1.1.js +10 -0
- data/web/public/diagram-viewer/js/raphael.js +10 -0
- data/web/public/diagram-viewer/js/raphael_uncompressed.js +5815 -0
- data/web/public/diagram-viewer/js/textlayout.js +441 -0
- data/web/public/diagram-viewer/style.css +1 -0
- data/web/public/editor-app/app-cfg.js +25 -0
- data/web/public/editor-app/app.js +432 -0
- data/web/public/editor-app/configuration/properties/assignment-display-template.html +4 -0
- data/web/public/editor-app/configuration/properties/assignment-popup.html +44 -0
- data/web/public/editor-app/configuration/properties/assignment-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/boolean-property-template.html +4 -0
- data/web/public/editor-app/configuration/properties/condition-expression-display-template.html +2 -0
- data/web/public/editor-app/configuration/properties/condition-expression-popup.html +29 -0
- data/web/public/editor-app/configuration/properties/condition-expression-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/default-value-display-template.html +4 -0
- data/web/public/editor-app/configuration/properties/event-listeners-display-template.html +3 -0
- data/web/public/editor-app/configuration/properties/event-listeners-popup.html +115 -0
- data/web/public/editor-app/configuration/properties/event-listeners-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/execution-listeners-display-template.html +3 -0
- data/web/public/editor-app/configuration/properties/execution-listeners-popup.html +101 -0
- data/web/public/editor-app/configuration/properties/execution-listeners-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/feedback-popup.html +17 -0
- data/web/public/editor-app/configuration/properties/fields-display-template.html +3 -0
- data/web/public/editor-app/configuration/properties/fields-popup.html +61 -0
- data/web/public/editor-app/configuration/properties/fields-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/form-properties-display-template.html +3 -0
- data/web/public/editor-app/configuration/properties/form-properties-popup.html +93 -0
- data/web/public/editor-app/configuration/properties/form-properties-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/in-parameters-display-template.html +3 -0
- data/web/public/editor-app/configuration/properties/in-parameters-popup.html +53 -0
- data/web/public/editor-app/configuration/properties/in-parameters-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/message-definitions-display-template.html +2 -0
- data/web/public/editor-app/configuration/properties/message-definitions-popup.html +50 -0
- data/web/public/editor-app/configuration/properties/message-definitions-write-template.html +3 -0
- data/web/public/editor-app/configuration/properties/message-property-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/multiinstance-property-write-template.html +8 -0
- data/web/public/editor-app/configuration/properties/out-parameters-display-template.html +3 -0
- data/web/public/editor-app/configuration/properties/out-parameters-popup.html +53 -0
- data/web/public/editor-app/configuration/properties/out-parameters-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/sequenceflow-order-display-template.html +3 -0
- data/web/public/editor-app/configuration/properties/sequenceflow-order-popup.html +47 -0
- data/web/public/editor-app/configuration/properties/sequenceflow-order-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/signal-definitions-display-template.html +3 -0
- data/web/public/editor-app/configuration/properties/signal-definitions-popup.html +58 -0
- data/web/public/editor-app/configuration/properties/signal-definitions-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/signal-property-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/string-property-write-mode-template.html +8 -0
- data/web/public/editor-app/configuration/properties/subprocess-reference-display-template.html +3 -0
- data/web/public/editor-app/configuration/properties/subprocess-reference-popup.html +43 -0
- data/web/public/editor-app/configuration/properties/subprocess-reference-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/task-listeners-display-template.html +3 -0
- data/web/public/editor-app/configuration/properties/task-listeners-popup.html +102 -0
- data/web/public/editor-app/configuration/properties/task-listeners-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties/text-popup.html +17 -0
- data/web/public/editor-app/configuration/properties/text-property-write-template.html +4 -0
- data/web/public/editor-app/configuration/properties-assignment-controller.js +150 -0
- data/web/public/editor-app/configuration/properties-condition-expression-controller.js +58 -0
- data/web/public/editor-app/configuration/properties-custom-controllers.js +18 -0
- data/web/public/editor-app/configuration/properties-default-controllers.js +115 -0
- data/web/public/editor-app/configuration/properties-event-listeners-controller.js +266 -0
- data/web/public/editor-app/configuration/properties-execution-listeners-controller.js +326 -0
- data/web/public/editor-app/configuration/properties-fields-controller.js +192 -0
- data/web/public/editor-app/configuration/properties-form-properties-controller.js +192 -0
- data/web/public/editor-app/configuration/properties-in-parameters-controller.js +158 -0
- data/web/public/editor-app/configuration/properties-message-definitions-controller.js +137 -0
- data/web/public/editor-app/configuration/properties-message-scope-controller.js +48 -0
- data/web/public/editor-app/configuration/properties-multiinstance-controller.js +34 -0
- data/web/public/editor-app/configuration/properties-out-parameters-controller.js +158 -0
- data/web/public/editor-app/configuration/properties-sequenceflow-order-controller.js +130 -0
- data/web/public/editor-app/configuration/properties-signal-definitions-controller.js +136 -0
- data/web/public/editor-app/configuration/properties-signal-scope-controller.js +47 -0
- data/web/public/editor-app/configuration/properties-task-listeners-controller.js +325 -0
- data/web/public/editor-app/configuration/properties.js +99 -0
- data/web/public/editor-app/configuration/toolbar-custom-actions.js +18 -0
- data/web/public/editor-app/configuration/toolbar-default-actions.js +429 -0
- data/web/public/editor-app/configuration/toolbar.js +175 -0
- data/web/public/editor-app/configuration/url-config.js +34 -0
- data/web/public/editor-app/css/style-common.css +1518 -0
- data/web/public/editor-app/css/style-editor.css +639 -0
- data/web/public/editor-app/css/style.css +471 -0
- data/web/public/editor-app/editor/css/editor.css +202 -0
- data/web/public/editor-app/editor/i18n/translation_de.js +383 -0
- data/web/public/editor-app/editor/i18n/translation_en_us.js +423 -0
- data/web/public/editor-app/editor/i18n/translation_signavio_de.js +106 -0
- data/web/public/editor-app/editor/i18n/translation_signavio_en_us.js +108 -0
- data/web/public/editor-app/editor/oryx.debug.js +24510 -0
- data/web/public/editor-app/editor/oryx.js +30 -0
- data/web/public/editor-app/editor-config.js +32 -0
- data/web/public/editor-app/editor-controller.js +65 -0
- data/web/public/editor-app/editor-utils.js +135 -0
- data/web/public/editor-app/editor.html +136 -0
- data/web/public/editor-app/eventbus.js +133 -0
- data/web/public/editor-app/fonts/activiti-admin-webfont.eot +0 -0
- data/web/public/editor-app/fonts/activiti-admin-webfont.svg +43 -0
- data/web/public/editor-app/fonts/activiti-admin-webfont.ttf +0 -0
- data/web/public/editor-app/fonts/activiti-admin-webfont.woff +0 -0
- data/web/public/editor-app/fonts/glyphicons-halflings-regular.eot +0 -0
- data/web/public/editor-app/fonts/glyphicons-halflings-regular.svg +229 -0
- data/web/public/editor-app/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/web/public/editor-app/fonts/glyphicons-halflings-regular.woff +0 -0
- data/web/public/editor-app/header-controller.js +31 -0
- data/web/public/editor-app/i18n/en.json +286 -0
- data/web/public/editor-app/images/bpmn-error.png +0 -0
- data/web/public/editor-app/images/bpmn-warning.png +0 -0
- data/web/public/editor-app/images/datadefinition.png +0 -0
- data/web/public/editor-app/images/delete.png +0 -0
- data/web/public/editor-app/images/loading.gif +0 -0
- data/web/public/editor-app/images/logo-2x.png +0 -0
- data/web/public/editor-app/images/logo.png +0 -0
- data/web/public/editor-app/images/nw-handle-dark.gif +0 -0
- data/web/public/editor-app/images/se-handle-dark.gif +0 -0
- data/web/public/editor-app/images/shapemenu_highlight.png +0 -0
- data/web/public/editor-app/images/wrench.png +0 -0
- data/web/public/editor-app/libs/angular-cookies_1.2.13/angular-cookies.min.js +8 -0
- data/web/public/editor-app/libs/angular-cookies_1.2.13/angular-cookies.min.js.map +8 -0
- data/web/public/editor-app/libs/angular-dragdrop.min-1.0.3.js +9 -0
- data/web/public/editor-app/libs/angular-dragdrop_1.0.7/angular-dragdrop.min.js +29 -0
- data/web/public/editor-app/libs/angular-mocks_1.2.13/angular-mocks.js +2136 -0
- data/web/public/editor-app/libs/angular-resource_1.2.13/angular-resource.js +596 -0
- data/web/public/editor-app/libs/angular-resource_1.2.13/angular-resource.min.js +13 -0
- data/web/public/editor-app/libs/angular-resource_1.2.13/angular-resource.min.js.map +8 -0
- data/web/public/editor-app/libs/angular-route_1.2.13/angular-route.js +921 -0
- data/web/public/editor-app/libs/angular-route_1.2.13/angular-route.min.js +14 -0
- data/web/public/editor-app/libs/angular-route_1.2.13/angular-route.min.js.map +8 -0
- data/web/public/editor-app/libs/angular-sanitize_1.2.13/angular-sanitize.js +625 -0
- data/web/public/editor-app/libs/angular-sanitize_1.2.13/angular-sanitize.min.js +14 -0
- data/web/public/editor-app/libs/angular-sanitize_1.2.13/angular-sanitize.min.js.map +8 -0
- data/web/public/editor-app/libs/angular-scroll_0.5.7/angular-scroll.min.js +1 -0
- data/web/public/editor-app/libs/angular-strap_2.0.5/angular-strap.min.js +9 -0
- data/web/public/editor-app/libs/angular-strap_2.0.5/angular-strap.tpl.min.js +8 -0
- data/web/public/editor-app/libs/angular-translate-loader-static-files/.bower.json +19 -0
- data/web/public/editor-app/libs/angular-translate-loader-static-files/angular-translate-loader-static-files.js +31 -0
- data/web/public/editor-app/libs/angular-translate-loader-static-files/angular-translate-loader-static-files.min.js +6 -0
- data/web/public/editor-app/libs/angular-translate-storage-cookie/.bower.json +20 -0
- data/web/public/editor-app/libs/angular-translate-storage-cookie/angular-translate-storage-cookie.js +19 -0
- data/web/public/editor-app/libs/angular-translate-storage-cookie/angular-translate-storage-cookie.min.js +6 -0
- data/web/public/editor-app/libs/angular-translate_2.4.2/angular-translate.js +960 -0
- data/web/public/editor-app/libs/angular-translate_2.4.2/angular-translate.min.js +6 -0
- data/web/public/editor-app/libs/angular_1.2.13/angular-animate.min.js +27 -0
- data/web/public/editor-app/libs/angular_1.2.13/angular.min.js +204 -0
- data/web/public/editor-app/libs/bootstrap-daterangepicker_1.3.7/daterangepicker-bs3.css +267 -0
- data/web/public/editor-app/libs/bootstrap-daterangepicker_1.3.7/daterangepicker.js +1026 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/css/bootstrap-theme.css +347 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/css/bootstrap-theme.css.map +1 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/css/bootstrap-theme.min.css +7 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/css/bootstrap.css +5785 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/css/bootstrap.css.map +1 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/css/bootstrap.min.css +7 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/fonts/glyphicons-halflings-regular.eot +0 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/fonts/glyphicons-halflings-regular.svg +229 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/fonts/glyphicons-halflings-regular.woff +0 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/js/bootstrap.js +1951 -0
- data/web/public/editor-app/libs/bootstrap_3.1.1/js/bootstrap.min.js +6 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/.bower.json +14 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/.gitignore +2 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/CHANGES +93 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/CONTRIBUTORS.md +25 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/LICENSE +19 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/README.md +161 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/es5-sham.js +444 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/es5-sham.map +1 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/es5-sham.min.js +4 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/es5-shim.js +1314 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/es5-shim.map +1 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/es5-shim.min.js +4 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/package.json +34 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/helpers/h-kill.js +64 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/helpers/h-matchers.js +34 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/helpers/h.js +3 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/index.html +64 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/index.min.html +63 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/lib/jasmine-html.js +190 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/lib/jasmine.css +166 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/lib/jasmine.js +2477 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/lib/jasmine_favicon.png +0 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/lib/json2.js +478 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/spec/s-array.js +1223 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/spec/s-date.js +152 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/spec/s-function.js +147 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/spec/s-number.js +14 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/spec/s-object.js +181 -0
- data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/spec/s-string.js +204 -0
- data/web/public/editor-app/libs/jquery-ui-1.10.3.custom.min.js +6 -0
- data/web/public/editor-app/libs/jquery.autogrow-textarea.js +61 -0
- data/web/public/editor-app/libs/jquery_1.11.0/jquery.js +9789 -0
- data/web/public/editor-app/libs/jquery_1.11.0/jquery.min.js +4 -0
- data/web/public/editor-app/libs/jquery_1.11.0/jquery.min.map +1 -0
- data/web/public/editor-app/libs/json3_3.2.6/LICENSE +20 -0
- data/web/public/editor-app/libs/json3_3.2.6/lib/json3.js +861 -0
- data/web/public/editor-app/libs/json3_3.2.6/lib/json3.min.js +18 -0
- data/web/public/editor-app/libs/momentjs_2.5.1/momentjs.min.js +6 -0
- data/web/public/editor-app/libs/mousetrap-1.4.5.min.js +9 -0
- data/web/public/editor-app/libs/ng-grid-2.0.7-min.js +2 -0
- data/web/public/editor-app/libs/ng-grid-2.0.7.min.css +1 -0
- data/web/public/editor-app/libs/path_parser.js +30 -0
- data/web/public/editor-app/libs/prototype-1.5.1.js +3272 -0
- data/web/public/editor-app/libs/ui-utils.min-0.0.4.js +7 -0
- data/web/public/editor-app/partials/root-stencil-item-template.html +11 -0
- data/web/public/editor-app/partials/stencil-item-template.html +27 -0
- data/web/public/editor-app/plugins.xml +58 -0
- data/web/public/editor-app/popups/icon-template.html +3 -0
- data/web/public/editor-app/popups/save-model.html +41 -0
- data/web/public/editor-app/popups/select-shape.html +20 -0
- data/web/public/editor-app/popups/unsaved-changes.html +22 -0
- data/web/public/editor-app/select-shape-controller.js +314 -0
- data/web/public/editor-app/stencil-controller.js +1421 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/event.subprocess.collapsed.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/event.subprocess.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/expanded.subprocess.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.business.rule.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.camel.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.manual.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.mule.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.receive.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.script.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.send.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.service.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.shell.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.user.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/subprocess.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/task.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/artifact/text.annotation.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/catching/cancel.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/catching/compensation.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/catching/error.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/catching/message.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/catching/signal.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/catching/timer.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/connector/association.undirected.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/connector/association.unidirectional.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/connector/messageflow.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/connector/sequenceflow.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/dataobject/data.store.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/diagram.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/endevent/cancel.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/endevent/error.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/endevent/none.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/endevent/terminate.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/gateway/eventbased.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/gateway/exclusive.databased.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/gateway/inclusive.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/gateway/parallel.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/startevent/error.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/startevent/message.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/startevent/none.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/startevent/signal.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/startevent/timer.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/swimlane/lane.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/swimlane/pool.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/throwing/none.png +0 -0
- data/web/public/editor-app/stencilsets/bpmn2.0/icons/throwing/signal.png +0 -0
- data/web/public/editor-app/toolbar-controller.js +162 -0
- data/web/public/modeler.html +140 -0
- data/web/views/models/index.erb +32 -0
- data/web/views/models/new.erb +15 -0
- metadata +334 -10
@@ -0,0 +1,152 @@
|
|
1
|
+
describe('Date', function () {
|
2
|
+
|
3
|
+
describe('now', function () {
|
4
|
+
it('should be the current time', function () {
|
5
|
+
expect(Date.now() === new Date().getTime()).toBe(true);
|
6
|
+
});
|
7
|
+
});
|
8
|
+
|
9
|
+
describe("parse", function () {
|
10
|
+
// TODO: Write the rest of the test.
|
11
|
+
|
12
|
+
it('should support extended years', function () {
|
13
|
+
|
14
|
+
expect(Date.parse('0001-01-01T00:00:00Z')).toBe(-62135596800000);
|
15
|
+
expect(Date.parse('+275760-09-13T00:00:00.000Z')).toBe(8.64e15);
|
16
|
+
expect(Date.parse('+033658-09-27T01:46:40.000Z')).toBe(1e15);
|
17
|
+
expect(Date.parse('-000001-01-01T00:00:00Z')).toBe(-62198755200000);
|
18
|
+
expect(Date.parse('+002009-12-15T00:00:00Z')).toBe(1260835200000);
|
19
|
+
|
20
|
+
});
|
21
|
+
|
22
|
+
it('should work', function () {
|
23
|
+
//Chrome 19 Opera 12 Firefox 11 IE 9 Safari 5.1.1
|
24
|
+
expect(Date.parse("2012-11-31T23:59:59.000Z")).toBeFalsy(); //1354406399000 NaN NaN 1354406399000 NaN
|
25
|
+
expect(Date.parse("2012-12-31T23:59:59.000Z")).toBe(1356998399000); //1356998399000 1356998399000 1356998399000 1356998399000 1356998399000
|
26
|
+
expect(Date.parse("2012-12-31T23:59:60.000Z")).toBeFalsy(); //NaN NaN NaN NaN 1356998400000
|
27
|
+
expect(Date.parse("2012-04-04T05:02:02.170Z")).toBe(1333515722170); //1333515722170 1333515722170 1333515722170 1333515722170 1333515722170
|
28
|
+
expect(Date.parse("2012-04-04T05:02:02.170999Z")).toBe(1333515722170); //1333515722170 1333515722170 1333515722170 1333515722170 1333515722170
|
29
|
+
expect(Date.parse("2012-04-04T05:02:02.17Z")).toBe(1333515722170); //1333515722170 1333515722170 1333515722170 1333515722170 1333515722170
|
30
|
+
expect(Date.parse("2012-04-04T05:02:02.1Z")).toBe(1333515722100); //1333515722170 1333515722170 1333515722170 1333515722170 1333515722170
|
31
|
+
expect(Date.parse("2012-04-04T24:00:00.000Z")).toBe(1333584000000); //NaN 1333584000000 1333584000000 1333584000000 1333584000000
|
32
|
+
expect(Date.parse("2012-04-04T24:00:00.500Z")).toBeFalsy(); //NaN NaN 1333584000500 1333584000500 NaN
|
33
|
+
expect(Date.parse("2012-12-31T10:08:60.000Z")).toBeFalsy(); //NaN NaN NaN NaN 1356948540000
|
34
|
+
expect(Date.parse("2012-13-01T12:00:00.000Z")).toBeFalsy(); //NaN NaN NaN NaN NaN
|
35
|
+
expect(Date.parse("2012-12-32T12:00:00.000Z")).toBeFalsy(); //NaN NaN NaN NaN NaN
|
36
|
+
expect(Date.parse("2012-12-31T25:00:00.000Z")).toBeFalsy(); //NaN NaN NaN NaN NaN
|
37
|
+
expect(Date.parse("2012-12-31T24:01:00.000Z")).toBeFalsy(); //NaN NaN NaN 1356998460000 NaN
|
38
|
+
expect(Date.parse("2012-12-31T12:60:00.000Z")).toBeFalsy(); //NaN NaN NaN NaN NaN
|
39
|
+
expect(Date.parse("2012-12-31T12:00:60.000Z")).toBeFalsy(); //NaN NaN NaN NaN 1356955260000
|
40
|
+
expect(Date.parse("2012-00-31T23:59:59.000Z")).toBeFalsy(); //NaN NaN NaN NaN NaN
|
41
|
+
expect(Date.parse("2012-12-00T23:59:59.000Z")).toBeFalsy(); //NaN NaN NaN NaN NaN
|
42
|
+
expect(Date.parse("2012-02-29T12:00:00.000Z")).toBe(1330516800000); //1330516800000 1330516800000 1330516800000 1330516800000 1330516800000
|
43
|
+
expect(Date.parse("2011-02-29T12:00:00.000Z")).toBeFalsy(); //1298980800000 NaN NaN 1298980800000 NaN
|
44
|
+
expect(Date.parse("2011-03-01T12:00:00.000Z")).toBe(1298980800000); //1298980800000 1298980800000 1298980800000 1298980800000 1298980800000
|
45
|
+
|
46
|
+
// extended years:
|
47
|
+
expect(Date.parse("0000-01-01T00:00:00.000Z")).toBe(-621672192e5); //-621672192e5 -621672192e5 -621672192e5 -621672192e5 -621672192e5
|
48
|
+
expect(Date.parse("+275760-09-13T00:00:00.000Z")).toBe(8.64e15); //8.64e15 NaN 8.64e15 8.64e15 8.64e15
|
49
|
+
expect(Date.parse("-271821-04-20T00:00:00.000Z")).toBe(-8.64e15); //-8.64e15 NaN -8.64e15 -8.64e15 -8.6400000864e15
|
50
|
+
expect(Date.parse("+275760-09-13T00:00:00.001Z")).toBeFalsy(); //NaN NaN NaN 8.64e15 + 1 8.64e15 + 1
|
51
|
+
expect(Date.parse("-271821-04-19T23:59:59.999Z")).toBeFalsy(); //NaN NaN NaN -8.64e15 - 1 -8.6400000864e15 - 1
|
52
|
+
|
53
|
+
// https://github.com/kriskowal/es5-shim/issues/80 Safari bug with leap day
|
54
|
+
expect(Date.parse("2034-03-01T00:00:00.000Z") -
|
55
|
+
Date.parse("2034-02-27T23:59:59.999Z")).toBe(86400001); //86400001 86400001 86400001 86400001 1
|
56
|
+
|
57
|
+
// Time Zone Offset
|
58
|
+
expect(Date.parse("2012-01-29T12:00:00.000+01:00")).toBe(132783480e4);//132783480e4 132783480e4 132783480e4 132783480e4 132783480e4
|
59
|
+
expect(Date.parse("2012-01-29T12:00:00.000-00:00")).toBe(132783840e4);//132783840e4 132783840e4 132783840e4 132783840e4 132783840e4
|
60
|
+
expect(Date.parse("2012-01-29T12:00:00.000+00:00")).toBe(132783840e4);//132783840e4 132783840e4 132783840e4 132783840e4 132783840e4
|
61
|
+
expect(Date.parse("2012-01-29T12:00:00.000+23:59")).toBe(132775206e4);//132775206e4 132775206e4 132775206e4 132775206e4 132775206e4
|
62
|
+
expect(Date.parse("2012-01-29T12:00:00.000-23:59")).toBe(132792474e4);//132792474e4 132792474e4 132792474e4 132792474e4 132792474e4
|
63
|
+
expect(Date.parse("2012-01-29T12:00:00.000+24:00")).toBeFalsy(); //NaN 1327752e6 NaN 1327752000000 1327752000000
|
64
|
+
expect(Date.parse("2012-01-29T12:00:00.000+24:01")).toBeFalsy(); //NaN NaN NaN 1327751940000 1327751940000
|
65
|
+
expect(Date.parse("2012-01-29T12:00:00.000+24:59")).toBeFalsy(); //NaN NaN NaN 1327748460000 1327748460000
|
66
|
+
expect(Date.parse("2012-01-29T12:00:00.000+25:00")).toBeFalsy(); //NaN NaN NaN NaN NaN
|
67
|
+
expect(Date.parse("2012-01-29T12:00:00.000+00:60")).toBeFalsy(); //NaN NaN NaN NaN NaN
|
68
|
+
expect(Date.parse("-271821-04-20T00:00:00.000+00:01")).toBeFalsy(); //NaN NaN NaN -864000000006e4 -864000008646e4
|
69
|
+
expect(Date.parse("-271821-04-20T00:01:00.000+00:01")).toBe(-8.64e15);//-8.64e15 NaN -8.64e15 -8.64e15 -864000008640e4
|
70
|
+
|
71
|
+
// When time zone is missed, local offset should be used (ES 5.1 bug)
|
72
|
+
// see https://bugs.ecmascript.org/show_bug.cgi?id=112
|
73
|
+
var tzOffset = Number(new Date(1970, 0));
|
74
|
+
// same as (new Date().getTimezoneOffset() * 60000)
|
75
|
+
expect(Date.parse('1970-01-01T00:00:00')).toBe(tzOffset); //tzOffset 0 0 0 NaN
|
76
|
+
});
|
77
|
+
|
78
|
+
it("should be able to coerce to a number", function(){
|
79
|
+
var actual = Number(new Date(1970, 0));
|
80
|
+
var expected = parseInt(actual, 10);
|
81
|
+
expect(actual).toBeDefined();
|
82
|
+
expect(actual).toEqual(expected);
|
83
|
+
expect(isNaN(actual)).toBeFalsy();
|
84
|
+
});
|
85
|
+
|
86
|
+
});
|
87
|
+
|
88
|
+
describe("toString", function(){
|
89
|
+
var actual = (new Date(1970, 0)).toString();
|
90
|
+
beforeEach(function(){
|
91
|
+
actual = (new Date(1970, 0)).toString();
|
92
|
+
});
|
93
|
+
it("should show correct date info for "+actual, function(){
|
94
|
+
expect(actual).toMatch(/1970/);
|
95
|
+
expect(actual).toMatch(/jan/i);
|
96
|
+
expect(actual).toMatch(/thu/i);
|
97
|
+
expect(actual).toMatch(/00:00:00/);
|
98
|
+
});
|
99
|
+
});
|
100
|
+
|
101
|
+
describe("valueOf", function(){
|
102
|
+
var actual = (new Date(1970, 0));
|
103
|
+
beforeEach(function(){
|
104
|
+
actual = (new Date(1970, 0)).valueOf();
|
105
|
+
});
|
106
|
+
it("should give an int value", function(){
|
107
|
+
expect(parseInt(actual, 10)).toBeTruthy();
|
108
|
+
});
|
109
|
+
});
|
110
|
+
|
111
|
+
describe("toISOString", function () {
|
112
|
+
// TODO: write the rest of the test.
|
113
|
+
|
114
|
+
it('should support extended years', function () {
|
115
|
+
expect(new Date(-62198755200000).toISOString().indexOf('-000001-01-01')).toBe(0);
|
116
|
+
expect(new Date(8.64e15).toISOString().indexOf('+275760-09-13')).toBe(0);
|
117
|
+
});
|
118
|
+
|
119
|
+
it('should return correct dates', function () {
|
120
|
+
expect(new Date(-1).toISOString()).toBe('1969-12-31T23:59:59.999Z');// Safari 5.1.5 "1969-12-31T23:59:59.-01Z"
|
121
|
+
expect(new Date(-3509827334573292).toISOString()).toBe('-109252-01-01T10:37:06.708Z'); // Opera 11.61/Opera 12 bug with Date#getUTCMonth
|
122
|
+
});
|
123
|
+
|
124
|
+
});
|
125
|
+
|
126
|
+
describe("toJSON", function () {
|
127
|
+
|
128
|
+
// Opera 11.6x/12 bug
|
129
|
+
it('should call toISOString', function () {
|
130
|
+
var date = new Date(0);
|
131
|
+
date.toISOString = function () {
|
132
|
+
return 1;
|
133
|
+
};
|
134
|
+
expect(date.toJSON()).toBe(1);
|
135
|
+
});
|
136
|
+
|
137
|
+
it('should return null for not finite dates', function () {
|
138
|
+
var date = new Date(NaN),
|
139
|
+
json;
|
140
|
+
try {
|
141
|
+
json = date.toJSON();
|
142
|
+
} catch (e) {}
|
143
|
+
expect(json).toBe(null);
|
144
|
+
});
|
145
|
+
|
146
|
+
it('should return the isoString when stringified', function () {
|
147
|
+
var date = new Date();
|
148
|
+
expect(JSON.stringify(date.toISOString())).toBe(JSON.stringify(date));
|
149
|
+
})
|
150
|
+
});
|
151
|
+
|
152
|
+
});
|
@@ -0,0 +1,147 @@
|
|
1
|
+
|
2
|
+
describe('Function', function() {
|
3
|
+
"use strict";
|
4
|
+
describe('bind', function() {
|
5
|
+
var actual, expected,
|
6
|
+
testSubject;
|
7
|
+
|
8
|
+
testSubject = {
|
9
|
+
push: function(o) {
|
10
|
+
this.a.push(o);
|
11
|
+
}
|
12
|
+
};
|
13
|
+
|
14
|
+
function func() {
|
15
|
+
Array.prototype.forEach.call(arguments, function(a) {
|
16
|
+
this.push(a);
|
17
|
+
}, this);
|
18
|
+
return this;
|
19
|
+
};
|
20
|
+
|
21
|
+
beforeEach(function() {
|
22
|
+
actual = [];
|
23
|
+
testSubject.a = [];
|
24
|
+
});
|
25
|
+
|
26
|
+
it('binds properly without a context', function() {
|
27
|
+
var context;
|
28
|
+
testSubject.func = function() {
|
29
|
+
context = this;
|
30
|
+
}.bind();
|
31
|
+
testSubject.func();
|
32
|
+
expect(context).toBe(function() {return this}.call());
|
33
|
+
});
|
34
|
+
it('binds properly without a context, and still supplies bound arguments', function() {
|
35
|
+
var a, context;
|
36
|
+
testSubject.func = function() {
|
37
|
+
a = Array.prototype.slice.call(arguments);
|
38
|
+
context = this;
|
39
|
+
}.bind(undefined, 1,2,3);
|
40
|
+
testSubject.func(1,2,3);
|
41
|
+
expect(a).toEqual([1,2,3,1,2,3]);
|
42
|
+
expect(context).toBe(function() {return this}.call());
|
43
|
+
});
|
44
|
+
it('binds a context properly', function() {
|
45
|
+
testSubject.func = func.bind(actual);
|
46
|
+
testSubject.func(1,2,3);
|
47
|
+
expect(actual).toEqual([1,2,3]);
|
48
|
+
expect(testSubject.a).toEqual([]);
|
49
|
+
});
|
50
|
+
it('binds a context and supplies bound arguments', function() {
|
51
|
+
testSubject.func = func.bind(actual, 1,2,3);
|
52
|
+
testSubject.func(4,5,6);
|
53
|
+
expect(actual).toEqual([1,2,3,4,5,6]);
|
54
|
+
expect(testSubject.a).toEqual([]);
|
55
|
+
});
|
56
|
+
|
57
|
+
it('returns properly without binding a context', function() {
|
58
|
+
testSubject.func = function() {
|
59
|
+
return this;
|
60
|
+
}.bind();
|
61
|
+
var context = testSubject.func();
|
62
|
+
expect(context).toBe(function() {return this}.call());
|
63
|
+
});
|
64
|
+
it('returns properly without binding a context, and still supplies bound arguments', function() {
|
65
|
+
var context;
|
66
|
+
testSubject.func = function() {
|
67
|
+
context = this;
|
68
|
+
return Array.prototype.slice.call(arguments);
|
69
|
+
}.bind(undefined, 1,2,3);
|
70
|
+
actual = testSubject.func(1,2,3);
|
71
|
+
expect(context).toBe(function() {return this}.call());
|
72
|
+
expect(actual).toEqual([1,2,3,1,2,3]);
|
73
|
+
});
|
74
|
+
it('returns properly while binding a context properly', function() {
|
75
|
+
var ret;
|
76
|
+
testSubject.func = func.bind(actual);
|
77
|
+
ret = testSubject.func(1,2,3);
|
78
|
+
expect(ret).toBe(actual);
|
79
|
+
expect(ret).not.toBe(testSubject);
|
80
|
+
});
|
81
|
+
it('returns properly while binding a context and supplies bound arguments', function() {
|
82
|
+
var ret;
|
83
|
+
testSubject.func = func.bind(actual, 1,2,3);
|
84
|
+
ret = testSubject.func(4,5,6);
|
85
|
+
expect(ret).toBe(actual);
|
86
|
+
expect(ret).not.toBe(testSubject);
|
87
|
+
});
|
88
|
+
it('passes the correct arguments as a constructor', function() {
|
89
|
+
var ret, expected = { name: "Correct" };
|
90
|
+
testSubject.func = function(arg) {
|
91
|
+
return arg;
|
92
|
+
}.bind({ name: "Incorrect" });
|
93
|
+
ret = new testSubject.func(expected);
|
94
|
+
expect(ret).toBe(expected);
|
95
|
+
});
|
96
|
+
it('returns the return value of the bound function when called as a constructor', function () {
|
97
|
+
var oracle = [1, 2, 3];
|
98
|
+
var subject = function () {
|
99
|
+
return oracle;
|
100
|
+
}.bind(null);
|
101
|
+
var result = new subject;
|
102
|
+
expect(result).toBe(oracle);
|
103
|
+
});
|
104
|
+
it('returns the correct value if constructor returns primitive', function() {
|
105
|
+
var oracle = [1, 2, 3];
|
106
|
+
var subject = function () {
|
107
|
+
return oracle;
|
108
|
+
}.bind(null);
|
109
|
+
var result = new subject;
|
110
|
+
expect(result).toBe(oracle);
|
111
|
+
|
112
|
+
oracle = {};
|
113
|
+
result = new subject;
|
114
|
+
expect(result).toBe(oracle);
|
115
|
+
|
116
|
+
oracle = function(){};
|
117
|
+
result = new subject;
|
118
|
+
expect(result).toBe(oracle);
|
119
|
+
|
120
|
+
oracle = "asdf";
|
121
|
+
result = new subject;
|
122
|
+
expect(result).not.toBe(oracle);
|
123
|
+
|
124
|
+
oracle = null;
|
125
|
+
result = new subject;
|
126
|
+
expect(result).not.toBe(oracle);
|
127
|
+
|
128
|
+
oracle = true;
|
129
|
+
result = new subject;
|
130
|
+
expect(result).not.toBe(oracle);
|
131
|
+
|
132
|
+
oracle = 1;
|
133
|
+
result = new subject;
|
134
|
+
expect(result).not.toBe(oracle);
|
135
|
+
});
|
136
|
+
it('returns the value that instance of original "class" when called as a constructor', function() {
|
137
|
+
var classA = function(x) {
|
138
|
+
this.name = x || "A";
|
139
|
+
}
|
140
|
+
var classB = classA.bind(null, "B");
|
141
|
+
|
142
|
+
var result = new classB;
|
143
|
+
expect(result instanceof classA).toBe(true);
|
144
|
+
expect(result instanceof classB).toBe(true);
|
145
|
+
});
|
146
|
+
});
|
147
|
+
});
|
@@ -0,0 +1,14 @@
|
|
1
|
+
describe('Number', function () {
|
2
|
+
'use strict';
|
3
|
+
|
4
|
+
describe('toFixed', function () {
|
5
|
+
it('should convert numbers correctly', function () {
|
6
|
+
expect((0.00008).toFixed(3)).toBe('0.000');
|
7
|
+
expect((0.9).toFixed(0)).toBe('1');
|
8
|
+
expect((1.255).toFixed(2)).toBe('1.25');
|
9
|
+
expect((1843654265.0774949).toFixed(5)).toBe('1843654265.07749');
|
10
|
+
expect((1000000000000000128).toFixed(0)).toBe('1000000000000000128');
|
11
|
+
});
|
12
|
+
});
|
13
|
+
|
14
|
+
});
|
@@ -0,0 +1,181 @@
|
|
1
|
+
describe('Object', function () {
|
2
|
+
"use strict";
|
3
|
+
|
4
|
+
describe("Object.keys", function () {
|
5
|
+
var obj = {
|
6
|
+
"str": "boz",
|
7
|
+
"obj": { },
|
8
|
+
"arr": [],
|
9
|
+
"bool": true,
|
10
|
+
"num": 42,
|
11
|
+
"null": null,
|
12
|
+
"undefined": undefined
|
13
|
+
};
|
14
|
+
|
15
|
+
var loopedValues = [];
|
16
|
+
for (var k in obj) {
|
17
|
+
loopedValues.push(k);
|
18
|
+
}
|
19
|
+
|
20
|
+
var keys = Object.keys(obj);
|
21
|
+
it('should have correct length', function () {
|
22
|
+
expect(keys.length).toBe(7);
|
23
|
+
});
|
24
|
+
|
25
|
+
it('should return an Array', function () {
|
26
|
+
expect(Array.isArray(keys)).toBe(true);
|
27
|
+
});
|
28
|
+
|
29
|
+
it('should return names which are own properties', function () {
|
30
|
+
keys.forEach(function (name) {
|
31
|
+
expect(obj.hasOwnProperty(name)).toBe(true);
|
32
|
+
});
|
33
|
+
});
|
34
|
+
|
35
|
+
it('should return names which are enumerable', function () {
|
36
|
+
keys.forEach(function (name) {
|
37
|
+
expect(loopedValues.indexOf(name)).toNotBe(-1);
|
38
|
+
})
|
39
|
+
});
|
40
|
+
|
41
|
+
it('should throw error for non object', function () {
|
42
|
+
var e = {};
|
43
|
+
expect(function () {
|
44
|
+
try {
|
45
|
+
Object.keys(42)
|
46
|
+
} catch (err) {
|
47
|
+
throw e;
|
48
|
+
}
|
49
|
+
}).toThrow(e);
|
50
|
+
});
|
51
|
+
});
|
52
|
+
|
53
|
+
describe("Object.isExtensible", function () {
|
54
|
+
var obj = { };
|
55
|
+
|
56
|
+
it('should return true if object is extensible', function () {
|
57
|
+
expect(Object.isExtensible(obj)).toBe(true);
|
58
|
+
});
|
59
|
+
|
60
|
+
it('should return false if object is not extensible', function () {
|
61
|
+
expect(Object.isExtensible(Object.preventExtensions(obj))).toBe(false);
|
62
|
+
});
|
63
|
+
|
64
|
+
it('should return false if object is seal', function () {
|
65
|
+
expect(Object.isExtensible(Object.seal(obj))).toBe(false);
|
66
|
+
});
|
67
|
+
|
68
|
+
it('should return false if object is freeze', function () {
|
69
|
+
expect(Object.isExtensible(Object.freeze(obj))).toBe(false);
|
70
|
+
});
|
71
|
+
|
72
|
+
it('should throw error for non object', function () {
|
73
|
+
var e1 = {};
|
74
|
+
expect(function () {
|
75
|
+
try {
|
76
|
+
Object.isExtensible(42)
|
77
|
+
} catch (err) {
|
78
|
+
throw e1;
|
79
|
+
}
|
80
|
+
}).toThrow(e1);
|
81
|
+
});
|
82
|
+
});
|
83
|
+
|
84
|
+
describe("Object.defineProperty", function () {
|
85
|
+
var obj;
|
86
|
+
|
87
|
+
beforeEach(function() {
|
88
|
+
obj = {};
|
89
|
+
|
90
|
+
Object.defineProperty(obj, 'name', {
|
91
|
+
value : 'Testing',
|
92
|
+
configurable: true,
|
93
|
+
enumerable: true,
|
94
|
+
writable: true
|
95
|
+
});
|
96
|
+
});
|
97
|
+
|
98
|
+
it('should return the initial value', function () {
|
99
|
+
expect(obj.hasOwnProperty('name')).toBeTruthy();
|
100
|
+
expect(obj.name).toBe('Testing');
|
101
|
+
});
|
102
|
+
|
103
|
+
it('should be setable', function () {
|
104
|
+
obj.name = 'Other';
|
105
|
+
expect(obj.name).toBe('Other');
|
106
|
+
});
|
107
|
+
|
108
|
+
it('should return the parent initial value', function () {
|
109
|
+
var child = Object.create(obj, {});
|
110
|
+
|
111
|
+
expect(child.name).toBe('Testing');
|
112
|
+
expect(child.hasOwnProperty('name')).toBeFalsy();
|
113
|
+
});
|
114
|
+
|
115
|
+
it('should not override the parent value', function () {
|
116
|
+
var child = Object.create(obj, {});
|
117
|
+
|
118
|
+
Object.defineProperty(child, 'name', {
|
119
|
+
value : 'Other'
|
120
|
+
});
|
121
|
+
|
122
|
+
expect(obj.name).toBe('Testing');
|
123
|
+
expect(child.name).toBe('Other');
|
124
|
+
});
|
125
|
+
|
126
|
+
it('should throw error for non object', function () {
|
127
|
+
expect(function () {
|
128
|
+
Object.defineProperty(42, 'name', {});
|
129
|
+
}).toThrow();
|
130
|
+
});
|
131
|
+
});
|
132
|
+
|
133
|
+
describe("Object.getOwnPropertyDescriptor", function () {
|
134
|
+
it('should return undefined because the object does not own the property', function () {
|
135
|
+
var descr = Object.getOwnPropertyDescriptor({}, 'name');
|
136
|
+
|
137
|
+
expect(descr).toBeUndefined()
|
138
|
+
});
|
139
|
+
|
140
|
+
it('should return a data descriptor', function () {
|
141
|
+
var descr = Object.getOwnPropertyDescriptor({name: 'Testing'}, 'name');
|
142
|
+
|
143
|
+
expect(descr).not.toBeUndefined();
|
144
|
+
expect(descr.value).toBe('Testing');
|
145
|
+
expect(descr.writable).toBe(true);
|
146
|
+
expect(descr.enumerable).toBe(true);
|
147
|
+
expect(descr.configurable).toBe(true);
|
148
|
+
});
|
149
|
+
|
150
|
+
it('should return undefined because the object does not own the property', function () {
|
151
|
+
var descr = Object.getOwnPropertyDescriptor(Object.create({name: 'Testing'}, {}), 'name');
|
152
|
+
|
153
|
+
expect(descr).toBeUndefined()
|
154
|
+
});
|
155
|
+
|
156
|
+
it('should return a data descriptor', function () {
|
157
|
+
var obj = Object.create({}, {
|
158
|
+
name: {
|
159
|
+
value : 'Testing',
|
160
|
+
configurable: true,
|
161
|
+
enumerable: true,
|
162
|
+
writable: true
|
163
|
+
}
|
164
|
+
});
|
165
|
+
|
166
|
+
var descr = Object.getOwnPropertyDescriptor(obj, 'name');
|
167
|
+
|
168
|
+
expect(descr).not.toBeUndefined();
|
169
|
+
expect(descr.value).toBe('Testing');
|
170
|
+
expect(descr.writable).toBe(true);
|
171
|
+
expect(descr.enumerable).toBe(true);
|
172
|
+
expect(descr.configurable).toBe(true);
|
173
|
+
});
|
174
|
+
|
175
|
+
it('should throw error for non object', function () {
|
176
|
+
expect(function () {
|
177
|
+
Object.getOwnPropertyDescriptor(42, 'name');
|
178
|
+
}).toThrow();
|
179
|
+
});
|
180
|
+
});
|
181
|
+
});
|