Skip to content

Commit

Permalink
Initial Wirecloud.ui.WiringEditor.Endpoint unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aarranz committed Oct 12, 2018
1 parent 83a079d commit 8648a53
Show file tree
Hide file tree
Showing 8 changed files with 144 additions and 276 deletions.
86 changes: 48 additions & 38 deletions src/js_tests/wirecloud/wiring/KeywordSuggestionSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/* globals Wirecloud */


(function (ns) {
(function (ns, utils) {

"use strict";

Expand All @@ -33,91 +33,101 @@
return this.id === other.id;
};

var BASIC_INPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint("target",
{
var SourceEndpoint = function (options) {
Object.assign(this, options);
};
utils.inherit(SourceEndpoint, Wirecloud.wiring.SourceEndpoint);

var TargetEndpoint = function (options) {
Object.assign(this, options);
};
utils.inherit(TargetEndpoint, Wirecloud.wiring.TargetEndpoint);

var BASIC_INPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint(
new TargetEndpoint({
id: "widget/19/condition-list",
friendcodeList: ["list"],
name: "condition-list",
description: "",
label: ""
},
}),
{
id: "CoNWeT/jenkins-project-build-list/0.1.9",
type: "widget",
equals: equals
}
);

var BASIC_OUTPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint("source",
{
var BASIC_OUTPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint(
new SourceEndpoint({
id: "widget/19/condition-list",
friendcodeList: ["list"],
name: "condition-list",
description: "",
label: ""
},
}),
{
id: "CoNWeT/jenkins-project-build-list/0.1.9",
type: "widget",
equals: equals
}
);

var EXTRA_INPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint("target",
{
var EXTRA_INPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint(
new TargetEndpoint({
id: "widget/22/other-endpoint",
friendcodeList: ["other"],
name: "other-endpoint",
description: "",
label: ""
},
}),
{
id: "CoNWeT/jenkins-project-build-list/0.1.9",
type: "widget",
equals: equals
}
);

var EXTRA_OUTPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint("source",
{
var EXTRA_OUTPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint(
new SourceEndpoint({
id: "widget/22/other-endpoint",
friendcodeList: ["other"],
name: "other-endpoint",
description: "",
label: ""
},
}),
{
id: "CoNWeT/jenkins-project-build-list/0.1.9",
type: "widget",
equals: equals
}
);

var MISSING_INPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint("target",
{
var MISSING_INPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint(
new TargetEndpoint({
id: "widget/20/condition-list",
friendcodeList: ["list"],
name: "condition-list",
description: "",
label: "",
missing: true
},
}),
{
id: "CoNWeT/jenkins-project-build-list/0.1.9",
type: "widget",
equals: equals
}
);

var MISSING_OUTPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint("source",
{
var MISSING_OUTPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint(
new SourceEndpoint({
id: "widget/20/condition-list",
friendcodeList: ["list"],
name: "condition-list",
description: "",
label: "",
missing: true
},
}),
{
id: "CoNWeT/jenkins-project-build-list/0.1.9",
type: "widget",
Expand All @@ -126,89 +136,89 @@
}
);

var OPERATOR_INPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint("target",
{
var OPERATOR_INPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint(
new TargetEndpoint({
id: "operator/1/list",
friendcodeList: ["list"],
name: "list",
description: "",
label: ""
},
}),
{
id: "CoNWeT/example-1/1.0",
type: "operator",
equals: equals
}
);

var OPERATOR_OUTPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint("source",
{
var OPERATOR_OUTPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint(
new SourceEndpoint({
id: "operator/1/list",
friendcodeList: ["list"],
name: "list",
description: "",
label: ""
},
}),
{
id: "CoNWeT/example-1/1.0",
type: "operator",
equals: equals
}
);

var WIDGET_INPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint("target",
{
var WIDGET_INPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint(
new TargetEndpoint({
id: "widget/21/other-endpoint",
friendcodeList: ["list"],
name: "other-endpoint",
description: "",
label: ""
},
}),
{
id: "CoNWeT/jenkins-project-build-list/0.1.9",
type: "widget",
equals: equals
}
);

var WIDGET_OUTPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint("source",
{
var WIDGET_OUTPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint(
new SourceEndpoint({
id: "widget/21/other-outputendpoint",
friendcodeList: ["list"],
name: "other-outputendpoint",
description: "",
label: ""
},
}),
{
id: "CoNWeT/jenkins-project-build-list/0.1.9",
type: "widget",
equals: equals
}
);

var FRIENDCODES_OUTPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint("source",
{
var FRIENDCODES_OUTPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint(
new SourceEndpoint({
id: "operator/1/query",
friendcodeList: ["query", "string"],
name: "query",
description: "",
label: ""
},
}),
{
id: "CoNWeT/example-1/1.0",
type: "operator",
equals: equals
}
);

var FRIENDCODES_INPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint("target",
{
var FRIENDCODES_INPUT_ENDPOINT = new Wirecloud.ui.WiringEditor.Endpoint(
new TargetEndpoint({
id: "widget/21/keywords",
friendcodeList: ["keywords", "query", "input-text"],
name: "keywords",
description: "",
label: ""
},
}),
{
id: "CoNWeT/jenkins-project-build-list/0.1.9",
type: "widget",
Expand Down Expand Up @@ -543,4 +553,4 @@
});
});

})(Wirecloud.wiring);
})(Wirecloud.wiring, StyledElements.Utils);
3 changes: 1 addition & 2 deletions src/wirecloud/platform/core/plugins.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-

# Copyright (c) 2012-2017 CoNWeT Lab., Universidad Politécnica de Madrid
# Copyright (c) 2018 Future Internet Consulting and Development Solutions S.L.

# This file is part of Wirecloud.

Expand Down Expand Up @@ -43,8 +44,6 @@
'js/wirecloud/ui/WiringEditor/BehaviourPrefs.js',
'js/wirecloud/ui/WiringEditor/BehaviourEngine.js',
'js/wirecloud/ui/WiringEditor/Endpoint.js',
'js/wirecloud/ui/WiringEditor/SourceEndpoint.js',
'js/wirecloud/ui/WiringEditor/TargetEndpoint.js',
'js/wirecloud/ui/WiringEditor/EndpointGroup.js',
'js/wirecloud/ui/WiringEditor/Component.js',
'js/wirecloud/ui/WiringEditor/ComponentPrefs.js',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2015-2016 CoNWeT Lab., Universidad Politécnica de Madrid
* Copyright (c) 2018 Future Internet Consulting and Development Solutions S.L.
*
* This file is part of Wirecloud Platform.
*
Expand Down Expand Up @@ -69,8 +70,8 @@
this._component = wiringComponent;

this.endpoints = {
source: new ns.EndpointGroup('source', this, ns.SourceEndpoint),
target: new ns.EndpointGroup('target', this, ns.TargetEndpoint)
source: new ns.EndpointGroup('source', this),
target: new ns.EndpointGroup('target', this)
};

this.body
Expand Down
Loading

0 comments on commit 8648a53

Please sign in to comment.