From 272d71b92764602b7f7f512dfe2967340806054e Mon Sep 17 00:00:00 2001 From: Matthias Osswald Date: Thu, 3 Nov 2022 16:45:37 +0100 Subject: [PATCH 1/6] [INTERNAL] Enable test for transformApiJson script --- package.json | 2 +- .../library/j/designtime/apiref/api.json | 1 + test/lib/builder/builder.js | 3 +- .../processors/jsdoc/lib/transformApiJson.js | 64 +++++++++++++++++++ 4 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 test/expected/build/library.j/dest/test-resources/library/j/designtime/apiref/api.json create mode 100644 test/lib/processors/jsdoc/lib/transformApiJson.js diff --git a/package.json b/package.json index 6248eb3cb..43ac78d73 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "text-summary" ], "exclude": [ - "lib/processors/jsdoc/lib/**", + "lib/processors/jsdoc/lib/ui5/template/**", "docs/**", "jsdocs/**", "coverage/**", diff --git a/test/expected/build/library.j/dest/test-resources/library/j/designtime/apiref/api.json b/test/expected/build/library.j/dest/test-resources/library/j/designtime/apiref/api.json new file mode 100644 index 000000000..cb36ca1cb --- /dev/null +++ b/test/expected/build/library.j/dest/test-resources/library/j/designtime/apiref/api.json @@ -0,0 +1 @@ +{"$schema-ref":"http://schemas.sap.com/sapui5/designtime/api.json/1.0","version":"1.0.0","library":"library.j","symbols":[{"kind":"namespace","name":"library.j","basename":"j","resource":"library/j/some.js","module":"library/j/some","static":true,"visibility":"public","displayName":"library.j","nodes":[{"name":"library.j.aaa","description":"","href":"api/library.j.aaa"},{"name":"library.j.Foo","description":"

My super documentation of this class

","href":"api/library.j.Foo"}],"title":"namespace library.j","subTitle":""},{"kind":"class","name":"library.j.aaa","basename":"aaa","resource":"library/j/dependency-es6-2.js","module":"library/j/dependency-es6-2","export":"","static":true,"visibility":"public","since":"1.22","extends":"library.j.a","ui5-metamodel":true,"ui5-metadata":{"properties":[{"name":"MyProp","type":"boolean","defaultValue":false,"group":"undefined","visibility":"public","since":"1.46","description":"

MyProp property

Since: 1.46.

","methods":["getMyProp","setMyProp"]}]},"constructor":{"visibility":"public","parameters":[{"name":"sId","optional":true,"description":"

ID for the new control, generated automatically if no ID is given

","phoneName":"sId","depth":0,"types":[{"name":"string","linkEnabled":false}],"defaultValue":""},{"name":"mSettings","optional":true,"description":"

Initial settings for the new control

","phoneName":"mSettings","depth":0,"types":[{"name":"object","linkEnabled":false}],"defaultValue":""}],"description":"

Constructor for a new library.j.aaa.

","references":[],"codeExample":"
new library.j.aaa(sId?, mSettings?)
"},"methods":[{"name":"library.j.aaa.extend","visibility":"public","static":true,"returnValue":{"type":"function","description":"

Created class / constructor function

","types":[{"value":"function"}]},"parameters":[{"name":"sClassName","optional":false,"description":"

Name of the class being created

","types":[{"value":"string"}],"defaultValue":""},{"name":"oClassInfo","optional":true,"description":"

Object literal with information about the class

","types":[{"value":"object"}],"defaultValue":""},{"name":"FNMetaImpl","optional":true,"description":"

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

","types":[{"value":"function"}],"defaultValue":""}],"description":"

Creates a new subclass of class library.j.aaa with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in library.j.a.extend.

","href":"api/library.j.aaa#methods/library.j.aaa.extend","code":"
library.j.aaa.extend(sClassName, oClassInfo?, FNMetaImpl?) : function
"},{"name":"library.j.aaa.getMetadata","visibility":"public","static":true,"returnValue":{"type":"sap.ui.base.Metadata","description":"

Metadata object describing this class

","types":[{"value":"sap.ui.base.Metadata","href":"api/sap.ui.base.Metadata","linkEnabled":true}]},"description":"

Returns a metadata object for class library.j.aaa.

","href":"api/library.j.aaa#methods/library.j.aaa.getMetadata","code":"
library.j.aaa.getMetadata() : sap.ui.base.Metadata
"},{"name":"getMyProp","visibility":"public","since":"1.46","returnValue":{"type":"boolean","description":"

Value of property MyProp

","types":[{"value":"boolean"}]},"description":"

Gets current value of property MyProp.

MyProp property

Default value is false.

","href":"api/library.j.aaa#methods/getMyProp","code":"
getMyProp() : boolean
"},{"name":"setMyProp","visibility":"public","since":"1.46","returnValue":{"type":"this","description":"

Reference to this in order to allow method chaining

","types":[{"value":"this"}]},"parameters":[{"name":"bMyProp","optional":true,"defaultValue":false,"description":"

New value for property MyProp

","types":[{"value":"boolean"}]}],"description":"

Sets a new value for property MyProp.

MyProp property

When called with a value of null or undefined, the default value of the property will be restored.

Default value is false.

","href":"api/library.j.aaa#methods/setMyProp","code":"
setMyProp(bMyProp?) : this
"}],"displayName":"library.j.aaa","title":"class library.j.aaa","subTitle":""},{"kind":"class","name":"library.j.Foo","basename":"Foo","resource":"library/j/dependency-es6-1.js","module":"library/j/dependency-es6-1","static":true,"visibility":"public","extends":"library.j.Bar","description":"

My super documentation of this class

","constructor":{"visibility":"public","references":[],"codeExample":"
new library.j.Foo()
"},"displayName":"library.j.Foo","title":"class library.j.Foo","subTitle":""},{"name":"library","displayName":"library","kind":"namespace","nodes":[{"name":"library.j","description":"","href":"api/library.j"}],"title":"namespace library","subTitle":""}]} \ No newline at end of file diff --git a/test/lib/builder/builder.js b/test/lib/builder/builder.js index da01e9586..c81f00bfa 100644 --- a/test/lib/builder/builder.js +++ b/test/lib/builder/builder.js @@ -890,8 +890,7 @@ test.serial("Build library.j with JSDoc build only", async (t) => { graph.setTaskRepository(taskRepository); await graph.build({ destPath, - includedTasks: ["generateJsdoc"], - excludedTasks: ["*"] + jsdoc: true }); const expectedFiles = await findFiles(expectedPath); diff --git a/test/lib/processors/jsdoc/lib/transformApiJson.js b/test/lib/processors/jsdoc/lib/transformApiJson.js new file mode 100644 index 000000000..4b7b0dcdd --- /dev/null +++ b/test/lib/processors/jsdoc/lib/transformApiJson.js @@ -0,0 +1,64 @@ +import test from "ava"; +import esmock from "esmock"; +import sinonGlobal from "sinon"; + +test.beforeEach(async (t) => { + t.context.sinon = sinonGlobal.createSandbox(); + t.context.transformApiJson = await esmock("../../../../../lib/processors/jsdoc/lib/transformApiJson.cjs"); +}); + +test.afterEach.always((t) => { + t.context.sinon.restore(); +}); + +test("Basic test without symbols", async (t) => { + const {sinon, transformApiJson} = t.context; + + const apiJsonPath = "/test-resources/sap/ui5/tooling/test/designtime/api.json"; + const fakeTargetPath = "/ignore/this/path/resource/will/be/returned"; + const dotLibraryPath = "/resources/sap/ui5/tooling/test/.library"; + const dependencyApiJsonPaths = [ + "/resources/some/path/x/api.json", + "/resources/some/path/y/api.json" + ]; + + const fs = { + readFile: sinon.stub().yieldsAsync(new Error("Not found!")) + .withArgs("/some/path/.library").yieldsAsync(null, ` + + + + sap.ui5.tooling.test + SAP SE + Some copyright notice + 1.2.3 + + UI5 Tooling Test Library + + `) + .withArgs("/test-resources/sap/ui5/tooling/test/designtime/api.json").yieldsAsync(null, JSON.stringify( + { + "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", + "version": "1.2.3", + "library": "sap.ui5.tooling.test", + "symbols": [] + } + )), + + readdir: sinon.stub().yieldsAsync(new Error("Not found!")) + }; + + const apiJsonContent = await transformApiJson( + apiJsonPath, fakeTargetPath, dotLibraryPath, dependencyApiJsonPaths, "", { + fs, + returnOutputFiles: true + } + ); + + t.is(apiJsonContent, JSON.stringify({ + "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", + "version": "1.2.3", + "library": "sap.ui5.tooling.test", + "symbols": [] + })); +}); From 366f330f3b1016807ae32c8667eeb2ab1d61c0ff Mon Sep 17 00:00:00 2001 From: Matthias Osswald Date: Fri, 4 Nov 2022 10:31:35 +0100 Subject: [PATCH 2/6] [INTERNAL] Enhance transformApiJson tests --- package.json | 3 +- .../processors/jsdoc/lib/transformApiJson.js | 1052 ++++++++++++++++- 2 files changed, 1031 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index 43ac78d73..285d0528d 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,8 @@ "text-summary" ], "exclude": [ - "lib/processors/jsdoc/lib/ui5/template/**", + "lib/processors/jsdoc/lib/ui5/**", + "lib/processors/jsdoc/lib/createIndexFiles.cjs", "docs/**", "jsdocs/**", "coverage/**", diff --git a/test/lib/processors/jsdoc/lib/transformApiJson.js b/test/lib/processors/jsdoc/lib/transformApiJson.js index 4b7b0dcdd..4cfa93991 100644 --- a/test/lib/processors/jsdoc/lib/transformApiJson.js +++ b/test/lib/processors/jsdoc/lib/transformApiJson.js @@ -14,6 +14,58 @@ test.afterEach.always((t) => { test("Basic test without symbols", async (t) => { const {sinon, transformApiJson} = t.context; + const apiJsonPath = "/test-resources/sap/ui5/tooling/test/designtime/api.json"; + const fakeTargetPath = "/ignore/this/path/resource/will/be/returned"; + const dotLibraryPath = "/resources/sap/ui5/tooling/test/.library"; + const dependencyApiJsonPaths = []; + + const readFile = sinon.stub().yieldsAsync(new Error("Not found!")); + + readFile.withArgs("/resources/sap/ui5/tooling/test/.library").yieldsAsync(null, ` + + + + sap.ui5.tooling.test + SAP SE + Some copyright notice + 1.2.3 + + UI5 Tooling Test Library + + ` + ); + + readFile.withArgs("/test-resources/sap/ui5/tooling/test/designtime/api.json").yieldsAsync(null, JSON.stringify( + { + "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", + "version": "2.1.0", + "library": "sap.ui5.tooling.test", + "symbols": [] + } + )); + + const readdir = sinon.stub().yieldsAsync(new Error("Not found!")); + + const fs = {readFile, readdir}; + + const apiJsonContent = await transformApiJson( + apiJsonPath, fakeTargetPath, dotLibraryPath, dependencyApiJsonPaths, "", { + fs, + returnOutputFiles: true + } + ); + + t.deepEqual(JSON.parse(apiJsonContent), { + "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", + "version": "2.1.0", + "library": "sap.ui5.tooling.test", + "symbols": [] + }); +}); + +test("Test with library, control, enum", async (t) => { + const {sinon, transformApiJson} = t.context; + const apiJsonPath = "/test-resources/sap/ui5/tooling/test/designtime/api.json"; const fakeTargetPath = "/ignore/this/path/resource/will/be/returned"; const dotLibraryPath = "/resources/sap/ui5/tooling/test/.library"; @@ -22,31 +74,350 @@ test("Basic test without symbols", async (t) => { "/resources/some/path/y/api.json" ]; - const fs = { - readFile: sinon.stub().yieldsAsync(new Error("Not found!")) - .withArgs("/some/path/.library").yieldsAsync(null, ` - - + const readFile = sinon.stub().yieldsAsync(new Error("Not found!")); - sap.ui5.tooling.test - SAP SE - Some copyright notice - 1.2.3 + readFile.withArgs("/resources/sap/ui5/tooling/test/.library").yieldsAsync(null, ` + + - UI5 Tooling Test Library + sap.ui5.tooling.test + SAP SE + Some copyright notice + 1.2.3 - `) - .withArgs("/test-resources/sap/ui5/tooling/test/designtime/api.json").yieldsAsync(null, JSON.stringify( + UI5 Tooling Test Library + + `); + + readFile.withArgs("/test-resources/sap/ui5/tooling/test/designtime/api.json").yieldsAsync(null, JSON.stringify( + /* eslint-disable max-len */ + { + "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", + "version": "2.1.0", + "library": "sap.ui5.tooling.test", + "symbols": [ + { + "kind": "namespace", + "name": "sap.ui5.tooling.test", + "basename": "test", + "resource": "sap/ui5/tooling/test/library.js", + "module": "sap/ui5/tooling/test/library", + "export": "", + "static": true, + "visibility": "public", + "since": "1.0.0", + "description": "UI5 Tooling Test Library", + "deprecated": { + "since": "2.0.0" + } + }, + { + "kind": "class", + "name": "sap.ui5.tooling.test.TestControl", + "basename": "TestControl", + "resource": "sap/ui5/tooling/test/TestControl.js", + "module": "sap/ui5/tooling/test/TestControl", + "export": "", + "static": true, + "visibility": "public", + "extends": "sap.ui.core.Control", + "description": "This control is just for UI5 Tooling testing purposes.", + "experimental": { + "since": "1.4", + "text": "The API may change. Use with care." + }, + "deprecated": { + "since": "2.0", + "text": "there's no replacement for this functionality" + }, + "ui5-metadata": { + "stereotype": "control", + "properties": [ + { + "name": "value", + "type": "int", + "defaultValue": 0, + "group": "Misc", + "visibility": "public", + "description": "Property with type int", + "methods": [ + "getValue", + "setValue" + ] + }, + { + "name": "color", + "type": "sap.ui5.tooling.test.TestEnum", + "defaultValue": "Red", + "group": "Misc", + "visibility": "public", + "description": "Property with an Enum", + "methods": [ + "getColor", + "setColor" + ] + } + ], + "events": [ + { + "name": "press", + "visibility": "public", + "description": "Event is fired when the user clicks the control.", + "methods": [ + "attachPress", + "detachPress", + "firePress" + ] + } + ] + }, + "constructor": { + "visibility": "public", + "parameters": [ + { + "name": "sId", + "type": "string", + "optional": true, + "description": "id for the new control, generated automatically if no id is given" + }, + { + "name": "mSettings", + "type": "object", + "optional": true, + "description": "initial settings for the new control" + } + ], + "description": "Constructor for a new TestControl.\n\nAccepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description of the syntax of the settings object." + }, + "events": [ + { + "name": "press", + "visibility": "public", + "parameters": [ + { + "name": "oControlEvent", + "type": "sap.ui.base.Event", + "parameterProperties": { + "getSource": { + "name": "getSource", + "type": "sap.ui.base.EventProvider", + "optional": false + }, + "getParameters": { + "name": "getParameters", + "type": "object", + "optional": false + } + } + } + ], + "description": "Event is fired when the user clicks the control." + } + ], + "methods": [ + { + "name": "attachPress", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "Reference to this in order to allow method chaining" + }, + "parameters": [ + { + "name": "oData", + "type": "object", + "optional": true, + "description": "An application-specific payload object that will be passed to the event handler along with the event object when firing the event" + }, + { + "name": "fnFunction", + "type": "function(sap.ui.base.Event) : void", + "optional": false, + "description": "The function to be called when the event occurs" + }, + { + "name": "oListener", + "type": "object", + "optional": true, + "description": "Context object to call the event handler with. Defaults to this sap.ui5.tooling.test.TestControl itself" + } + ], + "description": "Attaches event handler fnFunction to the {@link #event:press press} event of this sap.ui5.tooling.test.TestControl.\n\nWhen called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui5.tooling.test.TestControl itself.\n\nEvent is fired when the user clicks the control." + }, + { + "name": "detachPress", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "Reference to this in order to allow method chaining" + }, + "parameters": [ + { + "name": "fnFunction", + "type": "function(sap.ui.base.Event) : void", + "optional": false, + "description": "The function to be called, when the event occurs" + }, + { + "name": "oListener", + "type": "object", + "optional": true, + "description": "Context object on which the given function had to be called" + } + ], + "description": "Detaches event handler fnFunction from the {@link #event:press press} event of this sap.ui5.tooling.test.TestControl.\n\nThe passed function and listener object must match the ones used for event registration." + }, + { + "name": "extend", + "visibility": "public", + "static": true, + "returnValue": { + "type": "function", + "description": "Created class / constructor function" + }, + "parameters": [ + { + "name": "sClassName", + "type": "string", + "optional": false, + "description": "Name of the class being created" + }, + { + "name": "oClassInfo", + "type": "object", + "optional": true, + "description": "Object literal with information about the class" + }, + { + "name": "FNMetaImpl", + "type": "function", + "optional": true, + "description": "Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class" + } + ], + "description": "Creates a new subclass of class sap.ui5.tooling.test.TestControl with name sClassName and enriches it with the information contained in oClassInfo.\n\noClassInfo might contain the same kind of information as described in {@link sap.ui.core.Control.extend}." + }, + { + "name": "firePress", + "visibility": "protected", + "returnValue": { + "type": "this", + "description": "Reference to this in order to allow method chaining" + }, + "parameters": [ + { + "name": "mParameters", + "type": "object", + "optional": true, + "description": "Parameters to pass along with the event" + } + ], + "description": "Fires event {@link #event:press press} to attached listeners." + }, + { + "name": "getColor", + "visibility": "public", + "returnValue": { + "type": "sap.ui5.tooling.test.TestEnum", + "description": "Value of property color" + }, + "description": "Gets current value of property {@link #getColor color}.\n\nProperty with an Enum\n\nDefault value is Red." + }, + { + "name": "getMetadata", + "visibility": "public", + "static": true, + "returnValue": { + "type": "sap.ui.core.ElementMetadata", + "description": "Metadata object describing this class" + }, + "description": "Returns a metadata object for class sap.ui5.tooling.test.TestControl." + }, + { + "name": "getValue", + "visibility": "public", + "returnValue": { + "type": "int", + "description": "Value of property value" + }, + "description": "Gets current value of property {@link #getValue value}.\n\nProperty with type int\n\nDefault value is 0." + }, + { + "name": "setColor", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "Reference to this in order to allow method chaining" + }, + "parameters": [ + { + "name": "sColor", + "type": "sap.ui5.tooling.test.TestEnum", + "optional": true, + "defaultValue": "Red", + "description": "New value for property color" + } + ], + "description": "Sets a new value for property {@link #getColor color}.\n\nProperty with an Enum\n\nWhen called with a value of null or undefined, the default value of the property will be restored.\n\nDefault value is Red." + }, + { + "name": "setValue", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "Reference to this in order to allow method chaining" + }, + "parameters": [ + { + "name": "iValue", + "type": "int", + "optional": true, + "defaultValue": 0, + "description": "New value for property value" + } + ], + "description": "Sets a new value for property {@link #getValue value}.\n\nProperty with type int\n\nWhen called with a value of null or undefined, the default value of the property will be restored.\n\nDefault value is 0." + } + ] + }, { - "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", - "version": "1.2.3", - "library": "sap.ui5.tooling.test", - "symbols": [] + "kind": "enum", + "name": "sap.ui5.tooling.test.TestEnum", + "basename": "TestEnum", + "resource": "sap/ui5/tooling/test/library.js", + "module": "sap/ui5/tooling/test/library", + "export": "TestEnum", + "static": true, + "visibility": "public", + "description": "Defines colors", + "ui5-metadata": { + "stereotype": "enum" + }, + "properties": [ + { + "name": "Blue", + "visibility": "public", + "static": true, + "type": "string", + "description": "Yellow" + }, + { + "name": "Red", + "visibility": "public", + "static": true, + "type": "string", + "description": "Red" + } + ] } - )), + ] + } + /* eslint-enable max-len */ + )); + + const readdir = sinon.stub().yieldsAsync(new Error("Not found!")); - readdir: sinon.stub().yieldsAsync(new Error("Not found!")) - }; + const fs = {readFile, readdir}; const apiJsonContent = await transformApiJson( apiJsonPath, fakeTargetPath, dotLibraryPath, dependencyApiJsonPaths, "", { @@ -55,10 +426,645 @@ test("Basic test without symbols", async (t) => { } ); - t.is(apiJsonContent, JSON.stringify({ + /* eslint-disable max-len */ + t.deepEqual(JSON.parse(apiJsonContent), { "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", - "version": "1.2.3", + "version": "2.1.0", "library": "sap.ui5.tooling.test", - "symbols": [] - })); + "symbols": [ + { + "kind": "namespace", + "name": "sap.ui5.tooling.test", + "basename": "test", + "resource": "sap/ui5/tooling/test/library.js", + "module": "sap/ui5/tooling/test/library", + "export": "", + "static": true, + "visibility": "public", + "since": "1.0.0", + "description": "

UI5 Tooling Test Library

", + "displayName": "sap.ui5.tooling.test", + "nodes": [ + { + "name": "sap.ui5.tooling.test.TestControl", + "description": "

This control is just for UI5 Tooling testing purposes.

", + "href": "api/sap.ui5.tooling.test.TestControl", + "deprecated": true + }, + { + "name": "sap.ui5.tooling.test.TestEnum", + "description": "

Defines colors

", + "href": "api/sap.ui5.tooling.test.TestEnum" + } + ], + "title": "namespace sap.ui5.tooling.test", + "subTitle": "Deprecated in version: 2.0.0", + "deprecatedText": "Deprecated as of version 2.0.0" + }, + { + "kind": "class", + "name": "sap.ui5.tooling.test.TestControl", + "basename": "TestControl", + "resource": "sap/ui5/tooling/test/TestControl.js", + "module": "sap/ui5/tooling/test/TestControl", + "export": "", + "static": true, + "visibility": "public", + "extends": "sap.ui.core.Control", + "description": "

This control is just for UI5 Tooling testing purposes.

", + "experimental": { + "since": "1.4", + "text": "The API may change. Use with care." + }, + "ui5-metadata": { + "stereotype": "control", + "properties": [ + { + "name": "color", + "type": "sap.ui5.tooling.test.TestEnum", + "defaultValue": "Red", + "group": "Misc", + "visibility": "public", + "description": "

Property with an Enum

", + "methods": [ + "getColor", + "setColor" + ], + "linkEnabled": true + }, + { + "name": "value", + "type": "int", + "defaultValue": 0, + "group": "Misc", + "visibility": "public", + "description": "

Property with type int

", + "methods": [ + "getValue", + "setValue" + ] + } + ] + }, + "constructor": { + "visibility": "public", + "parameters": [ + { + "name": "sId", + "optional": true, + "description": "

id for the new control, generated automatically if no id is given

", + "phoneName": "sId", + "depth": 0, + "types": [ + { + "name": "string", + "linkEnabled": false + } + ], + "defaultValue": "" + }, + { + "name": "mSettings", + "optional": true, + "description": "

initial settings for the new control

", + "phoneName": "mSettings", + "depth": 0, + "types": [ + { + "name": "object", + "linkEnabled": false + } + ], + "defaultValue": "" + } + ], + "description": "

Constructor for a new TestControl.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.

", + "references": [], + "codeExample": "
new sap.ui5.tooling.test.TestControl(sId?, mSettings?)
" + }, + "events": [ + { + "name": "press", + "visibility": "public", + "parameters": [ + { + "name": "oControlEvent", + "type": "sap.ui.base.Event", + "linkEnabled": true + }, + { + "name": "getSource", + "type": "sap.ui.base.EventProvider", + "optional": false, + "depth": 1, + "phoneName": "oControlEvent.getSource", + "linkEnabled": true + }, + { + "name": "getParameters", + "type": "object", + "optional": false, + "depth": 1, + "phoneName": "oControlEvent.getParameters" + } + ], + "description": "

Event is fired when the user clicks the control.

" + } + ], + "methods": [ + { + "name": "attachPress", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", + "types": [ + { + "value": "this" + } + ] + }, + "parameters": [ + { + "name": "oData", + "optional": true, + "description": "

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" + }, + { + "name": "fnFunction", + "optional": false, + "description": "

The function to be called when the event occurs

", + "types": [ + { + "value": "function(sap.ui.base.Event) : void" + } + ], + "defaultValue": "" + }, + { + "name": "oListener", + "optional": true, + "description": "

Context object to call the event handler with. Defaults to this sap.ui5.tooling.test.TestControl itself

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" + } + ], + "description": "

Attaches event handler fnFunction to the press event of this sap.ui5.tooling.test.TestControl.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui5.tooling.test.TestControl itself.

Event is fired when the user clicks the control.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/attachPress", + "code": "
attachPress(oData?, fnFunction, oListener?) : this
" + }, + { + "name": "detachPress", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", + "types": [ + { + "value": "this" + } + ] + }, + "parameters": [ + { + "name": "fnFunction", + "optional": false, + "description": "

The function to be called, when the event occurs

", + "types": [ + { + "value": "function(sap.ui.base.Event) : void" + } + ], + "defaultValue": "" + }, + { + "name": "oListener", + "optional": true, + "description": "

Context object on which the given function had to be called

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" + } + ], + "description": "

Detaches event handler fnFunction from the press event of this sap.ui5.tooling.test.TestControl.

The passed function and listener object must match the ones used for event registration.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/detachPress", + "code": "
detachPress(fnFunction, oListener?) : this
" + }, + { + "name": "sap.ui5.tooling.test.TestControl.extend", + "visibility": "public", + "static": true, + "returnValue": { + "type": "function", + "description": "

Created class / constructor function

", + "types": [ + { + "value": "function" + } + ] + }, + "parameters": [ + { + "name": "sClassName", + "optional": false, + "description": "

Name of the class being created

", + "types": [ + { + "value": "string" + } + ], + "defaultValue": "" + }, + { + "name": "oClassInfo", + "optional": true, + "description": "

Object literal with information about the class

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" + }, + { + "name": "FNMetaImpl", + "optional": true, + "description": "

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

", + "types": [ + { + "value": "function" + } + ], + "defaultValue": "" + } + ], + "description": "

Creates a new subclass of class sap.ui5.tooling.test.TestControl with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/sap.ui5.tooling.test.TestControl.extend", + "code": "
sap.ui5.tooling.test.TestControl.extend(sClassName, oClassInfo?, FNMetaImpl?) : function
" + }, + { + "name": "firePress", + "visibility": "protected", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", + "types": [ + { + "value": "this" + } + ] + }, + "parameters": [ + { + "name": "mParameters", + "optional": true, + "description": "

Parameters to pass along with the event

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" + } + ], + "description": "

Fires event press to attached listeners.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/firePress", + "code": "
firePress(mParameters?) : this
" + }, + { + "name": "getColor", + "visibility": "public", + "returnValue": { + "type": "sap.ui5.tooling.test.TestEnum", + "description": "

Value of property color

", + "types": [ + { + "value": "sap.ui5.tooling.test.TestEnum" + } + ] + }, + "description": "

Gets current value of property color.

Property with an Enum

Default value is Red.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/getColor", + "code": "
getColor() : sap.ui5.tooling.test.TestEnum
" + }, + { + "name": "sap.ui5.tooling.test.TestControl.getMetadata", + "visibility": "public", + "static": true, + "returnValue": { + "type": "sap.ui.core.ElementMetadata", + "description": "

Metadata object describing this class

", + "types": [ + { + "value": "sap.ui.core.ElementMetadata", + "href": "api/sap.ui.core.ElementMetadata", + "linkEnabled": true + } + ] + }, + "description": "

Returns a metadata object for class sap.ui5.tooling.test.TestControl.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/sap.ui5.tooling.test.TestControl.getMetadata", + "code": "
sap.ui5.tooling.test.TestControl.getMetadata() : sap.ui.core.ElementMetadata
" + }, + { + "name": "getValue", + "visibility": "public", + "returnValue": { + "type": "int", + "description": "

Value of property value

", + "types": [ + { + "value": "int" + } + ] + }, + "description": "

Gets current value of property value.

Property with type int

Default value is 0.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/getValue", + "code": "
getValue() : int
" + }, + { + "name": "setColor", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", + "types": [ + { + "value": "this" + } + ] + }, + "parameters": [ + { + "name": "sColor", + "optional": true, + "defaultValue": "Red", + "description": "

New value for property color

", + "types": [ + { + "value": "sap.ui5.tooling.test.TestEnum" + } + ] + } + ], + "description": "

Sets a new value for property color.

Property with an Enum

When called with a value of null or undefined, the default value of the property will be restored.

Default value is Red.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/setColor", + "code": "
setColor(sColor?) : this
" + }, + { + "name": "setValue", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", + "types": [ + { + "value": "this" + } + ] + }, + "parameters": [ + { + "name": "iValue", + "optional": true, + "defaultValue": 0, + "description": "

New value for property value

", + "types": [ + { + "value": "int" + } + ] + } + ], + "description": "

Sets a new value for property value.

Property with type int

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 0.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/setValue", + "code": "
setValue(iValue?) : this
" + } + ], + "displayName": "sap.ui5.tooling.test.TestControl", + "title": "class sap.ui5.tooling.test.TestControl", + "subTitle": "Deprecated in version: 2.0", + "deprecatedText": "Deprecated as of version 2.0. there's no replacement for this functionality" + }, + { + "kind": "enum", + "name": "sap.ui5.tooling.test.TestEnum", + "basename": "TestEnum", + "resource": "sap/ui5/tooling/test/library.js", + "module": "sap/ui5/tooling/test/library", + "export": "TestEnum", + "static": true, + "visibility": "public", + "description": "

Defines colors

", + "ui5-metadata": { + "stereotype": "enum" + }, + "properties": [ + { + "name": "sap.ui5.tooling.test.TestEnum.Blue", + "visibility": "public", + "description": "

Yellow

" + }, + { + "name": "sap.ui5.tooling.test.TestEnum.Red", + "visibility": "public", + "description": "

Red

" + } + ], + "displayName": "sap.ui5.tooling.test.TestEnum", + "title": "enum sap.ui5.tooling.test.TestEnum", + "subTitle": "" + }, + { + "name": "sap", + "displayName": "sap", + "kind": "namespace", + "nodes": [ + { + "name": "sap.ui5", + "description": "", + "href": "api/sap.ui5" + } + ], + "title": "namespace sap", + "subTitle": "" + }, + { + "name": "sap.ui5", + "displayName": "sap.ui5", + "kind": "namespace", + "nodes": [ + { + "name": "sap.ui5.tooling", + "description": "", + "href": "api/sap.ui5.tooling" + } + ], + "title": "namespace sap.ui5", + "subTitle": "" + }, + { + "name": "sap.ui5.tooling", + "displayName": "sap.ui5.tooling", + "kind": "namespace", + "nodes": [ + { + "name": "sap.ui5.tooling.test", + "description": "

UI5 Tooling Test Library

", + "href": "api/sap.ui5.tooling.test", + "deprecated": true + } + ], + "title": "namespace sap.ui5.tooling", + "subTitle": "" + } + ] + }); + /* eslint-enable max-len */ +}); + +test("Test with docuindex.json reference", async (t) => { + const {sinon, transformApiJson} = t.context; + + const apiJsonPath = "/test-resources/sap/ui5/tooling/test/designtime/api.json"; + const fakeTargetPath = "/ignore/this/path/resource/will/be/returned"; + const dotLibraryPath = "/resources/sap/ui5/tooling/test/.library"; + const dependencyApiJsonPaths = []; + + const readFile = sinon.stub().yieldsAsync(new Error("Not found!")); + + readFile.withArgs("/resources/sap/ui5/tooling/test/.library").yieldsAsync(null, ` + + + + sap.ui5.tooling.test + SAP SE + Some copyright notice + 1.2.3 + + UI5 Tooling Test Library + + + + + + `); + + readFile.withArgs("/test-resources/sap/ui5/tooling/test/designtime/api.json").yieldsAsync(null, JSON.stringify( + { + "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", + "version": "2.1.0", + "library": "sap.ui5.tooling.test", + "symbols": [ + { + "kind": "namespace", + "name": "sap.ui5.tooling.test", + "basename": "test", + "resource": "sap/ui5/tooling/test/library.js", + "module": "sap/ui5/tooling/test/library", + "export": "", + "static": true, + "visibility": "public", + "since": "1.0.0", + "description": "UI5 Tooling Test Library", + "deprecated": { + "since": "2.0.0" + } + }, + ] + } + )); + + const readdir = sinon.stub().yieldsAsync(new Error("Not found!")); + + const fs = {readFile, readdir}; + + const apiJsonContent = await transformApiJson( + apiJsonPath, fakeTargetPath, dotLibraryPath, dependencyApiJsonPaths, "", { + fs, + returnOutputFiles: true + } + ); + + t.deepEqual(JSON.parse(apiJsonContent), { + "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", + "version": "2.1.0", + "library": "sap.ui5.tooling.test", + "symbols": [ + { + basename: "test", + deprecatedText: "Deprecated as of version 2.0.0", + description: "

UI5 Tooling Test Library

", + displayName: "sap.ui5.tooling.test", + export: "", + kind: "namespace", + module: "sap/ui5/tooling/test/library", + name: "sap.ui5.tooling.test", + resource: "sap/ui5/tooling/test/library.js", + since: "1.0.0", + static: true, + subTitle: "Deprecated in version: 2.0.0", + title: "namespace sap.ui5.tooling.test", + visibility: "public", + }, + { + displayName: "sap", + kind: "namespace", + name: "sap", + nodes: [ + { + description: "", + href: "api/sap.ui5", + name: "sap.ui5", + }, + ], + subTitle: "", + title: "namespace sap", + }, + { + displayName: "sap.ui5", + kind: "namespace", + name: "sap.ui5", + nodes: [ + { + description: "", + href: "api/sap.ui5.tooling", + name: "sap.ui5.tooling", + }, + ], + subTitle: "", + title: "namespace sap.ui5", + }, + { + displayName: "sap.ui5.tooling", + kind: "namespace", + name: "sap.ui5.tooling", + nodes: [ + { + deprecated: true, + description: "

UI5 Tooling Test Library

", + href: "api/sap.ui5.tooling.test", + name: "sap.ui5.tooling.test", + }, + ], + subTitle: "", + title: "namespace sap.ui5.tooling", + }, + ] + }); }); From 74ac58182d467525ec36bd0d99d4395906787c11 Mon Sep 17 00:00:00 2001 From: Matthias Osswald Date: Fri, 4 Nov 2022 15:03:24 +0100 Subject: [PATCH 3/6] [INTERNAL] Further enhance tests --- .../processors/jsdoc/lib/transformApiJson.js | 223 ++++++++++++++++++ 1 file changed, 223 insertions(+) diff --git a/test/lib/processors/jsdoc/lib/transformApiJson.js b/test/lib/processors/jsdoc/lib/transformApiJson.js index 4cfa93991..c9bb1be1b 100644 --- a/test/lib/processors/jsdoc/lib/transformApiJson.js +++ b/test/lib/processors/jsdoc/lib/transformApiJson.js @@ -986,10 +986,97 @@ test("Test with docuindex.json reference", async (t) => { "since": "2.0.0" } }, + { + "kind": "class", + "name": "sap.ui5.tooling.test.TestControl", + "basename": "TestControl", + "resource": "sap/ui5/tooling/test/TestControl.js", + "module": "sap/ui5/tooling/test/TestControl", + "export": "", + "static": true, + "visibility": "public", + "extends": "sap.ui.core.Control", + "description": "This control is just for UI5 Tooling testing purposes.", + "ui5-metadata": { + "stereotype": "control" + }, + "constructor": { + "visibility": "public", + "parameters": [ + { + "name": "sId", + "type": "string", + "optional": true, + "description": "TEST DESCRIPTION", + }, + { + "name": "mSettings", + "type": "object", + "optional": true, + "description": "TEST DESCRIPTION", + } + ], + "description": "TEST DESCRIPTION", + }, + "methods": [ + { + "name": "extend", + "visibility": "public", + "static": true, + "returnValue": { + "type": "function", + "description": "TEST DESCRIPTION", + }, + "parameters": [ + { + "name": "sClassName", + "type": "string", + "optional": false, + "description": "TEST DESCRIPTION", + }, + { + "name": "oClassInfo", + "type": "object", + "optional": true, + "description": "TEST DESCRIPTION", + }, + { + "name": "FNMetaImpl", + "type": "function", + "optional": true, + "description": "TEST DESCRIPTION", + } + ], + "description": "TEST DESCRIPTION", + }, + { + "name": "getMetadata", + "visibility": "public", + "static": true, + "returnValue": { + "type": "sap.ui.core.ElementMetadata", + "description": "TEST DESCRIPTION", + }, + "description": "TEST DESCRIPTION", + } + ] + }, ] } )); + readFile.withArgs("/test-resources/sap/ui5/tooling/test/demokit/docuindex.json").yieldsAsync(null, JSON.stringify( + { + "explored": { + "entities": [ + // { + // "id": "sap.ui5.tooling.test.TestControl" + // } + ] + } + } + )); + const readdir = sinon.stub().yieldsAsync(new Error("Not found!")); const fs = {readFile, readdir}; @@ -1001,6 +1088,7 @@ test("Test with docuindex.json reference", async (t) => { } ); + /* eslint-disable max-len */ t.deepEqual(JSON.parse(apiJsonContent), { "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", "version": "2.1.0", @@ -1014,6 +1102,13 @@ test("Test with docuindex.json reference", async (t) => { export: "", kind: "namespace", module: "sap/ui5/tooling/test/library", + nodes: [ + { + "name": "sap.ui5.tooling.test.TestControl", + "description": "

This control is just for UI5 Tooling testing purposes.

", + "href": "api/sap.ui5.tooling.test.TestControl", + } + ], name: "sap.ui5.tooling.test", resource: "sap/ui5/tooling/test/library.js", since: "1.0.0", @@ -1022,6 +1117,133 @@ test("Test with docuindex.json reference", async (t) => { title: "namespace sap.ui5.tooling.test", visibility: "public", }, + { + "kind": "class", + "name": "sap.ui5.tooling.test.TestControl", + "basename": "TestControl", + "resource": "sap/ui5/tooling/test/TestControl.js", + "module": "sap/ui5/tooling/test/TestControl", + "export": "", + "static": true, + "visibility": "public", + "extends": "sap.ui.core.Control", + "description": "

This control is just for UI5 Tooling testing purposes.

", + "ui5-metadata": { + "stereotype": "control" + }, + "constructor": { + "visibility": "public", + "parameters": [ + { + "name": "sId", + "optional": true, + "description": "

TEST DESCRIPTION

", + "phoneName": "sId", + "depth": 0, + "types": [ + { + "name": "string", + "linkEnabled": false + } + ], + "defaultValue": "" + }, + { + "name": "mSettings", + "optional": true, + "description": "

TEST DESCRIPTION

", + "phoneName": "mSettings", + "depth": 0, + "types": [ + { + "name": "object", + "linkEnabled": false + } + ], + "defaultValue": "" + } + ], + "description": "

TEST DESCRIPTION

", + "references": [], + "codeExample": "
new sap.ui5.tooling.test.TestControl(sId?, mSettings?)
" + }, + "methods": [ + { + "name": "sap.ui5.tooling.test.TestControl.extend", + "visibility": "public", + "static": true, + "returnValue": { + "type": "function", + "description": "

TEST DESCRIPTION

", + "types": [ + { + "value": "function" + } + ] + }, + "parameters": [ + { + "name": "sClassName", + "optional": false, + "description": "

TEST DESCRIPTION

", + "types": [ + { + "value": "string" + } + ], + "defaultValue": "" + }, + { + "name": "oClassInfo", + "optional": true, + "description": "

TEST DESCRIPTION

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" + }, + { + "name": "FNMetaImpl", + "optional": true, + "description": "

TEST DESCRIPTION

", + "types": [ + { + "value": "function" + } + ], + "defaultValue": "" + } + ], + "description": "

TEST DESCRIPTION

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/sap.ui5.tooling.test.TestControl.extend", + "code": "
sap.ui5.tooling.test.TestControl.extend(sClassName, oClassInfo?, FNMetaImpl?) : function
" + }, + { + "name": "sap.ui5.tooling.test.TestControl.getMetadata", + "visibility": "public", + "static": true, + "returnValue": { + "type": "sap.ui.core.ElementMetadata", + "description": "

TEST DESCRIPTION

", + "types": [ + { + "value": "sap.ui.core.ElementMetadata", + "href": "api/sap.ui.core.ElementMetadata", + "linkEnabled": true + } + ] + }, + "description": "

TEST DESCRIPTION

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/sap.ui5.tooling.test.TestControl.getMetadata", + "code": "
sap.ui5.tooling.test.TestControl.getMetadata() : sap.ui.core.ElementMetadata
" + } + ], + "displayName": "sap.ui5.tooling.test.TestControl", + "title": "class sap.ui5.tooling.test.TestControl", + "subTitle": "", + }, { displayName: "sap", kind: "namespace", @@ -1067,4 +1289,5 @@ test("Test with docuindex.json reference", async (t) => { }, ] }); + /* eslint-enable max-len */ }); From 5aed1e855322f4a35769e2eaf353d877b958d4e9 Mon Sep 17 00:00:00 2001 From: Matthias Osswald Date: Fri, 4 Nov 2022 15:53:36 +0100 Subject: [PATCH 4/6] [INTERNAL] Further enhance tests, part 2 --- .../processors/jsdoc/lib/transformApiJson.js | 1072 +++++++++++++++-- 1 file changed, 992 insertions(+), 80 deletions(-) diff --git a/test/lib/processors/jsdoc/lib/transformApiJson.js b/test/lib/processors/jsdoc/lib/transformApiJson.js index c9bb1be1b..df32c3f38 100644 --- a/test/lib/processors/jsdoc/lib/transformApiJson.js +++ b/test/lib/processors/jsdoc/lib/transformApiJson.js @@ -1,3 +1,4 @@ +/* eslint-disable max-len */ import test from "ava"; import esmock from "esmock"; import sinonGlobal from "sinon"; @@ -90,7 +91,7 @@ test("Test with library, control, enum", async (t) => { `); readFile.withArgs("/test-resources/sap/ui5/tooling/test/designtime/api.json").yieldsAsync(null, JSON.stringify( - /* eslint-disable max-len */ + { "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", "version": "2.1.0", @@ -158,6 +159,39 @@ test("Test with library, control, enum", async (t) => { ] } ], + "aggregations": [ + { + "name": "items", + "singularName": "item", + "type": "sap.ui.core.Control", + "cardinality": "0..n", + "visibility": "public", + "description": "Items to be rendered", + "methods": [ + "getItems", + "destroyItems", + "insertItem", + "addItem", + "removeItem", + "indexOfItem", + "removeAllItems" + ] + } + ], + "associations": [ + { + "name": "selectedItem", + "singularName": "selectedItem", + "type": "sap.ui.core.Control", + "cardinality": "0..1", + "visibility": "public", + "description": "Selected item", + "methods": [ + "getSelectedItem", + "setSelectedItem" + ] + } + ], "events": [ { "name": "press", @@ -168,6 +202,23 @@ test("Test with library, control, enum", async (t) => { "detachPress", "firePress" ] + }, + { + "name": "change", + "visibility": "public", + "description": "Fires when an item is changed.", + "parameters": { + "item": { + "name": "item", + "type": "sap.ui.core.Control", + "description": "Reference to the item" + } + }, + "methods": [ + "attachChange", + "detachChange", + "fireChange" + ] } ] }, @@ -190,6 +241,37 @@ test("Test with library, control, enum", async (t) => { "description": "Constructor for a new TestControl.\n\nAccepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description of the syntax of the settings object." }, "events": [ + { + "name": "change", + "visibility": "public", + "parameters": [ + { + "name": "oControlEvent", + "type": "sap.ui.base.Event", + "parameterProperties": { + "getSource": { + "name": "getSource", + "type": "sap.ui.base.EventProvider", + "optional": false + }, + "getParameters": { + "name": "getParameters", + "type": "object", + "optional": false, + "parameterProperties": { + "item": { + "name": "item", + "type": "sap.ui.core.Control", + "optional": false, + "description": "Reference to the item" + } + } + } + } + } + ], + "description": "Fires when an item is changed." + }, { "name": "press", "visibility": "public", @@ -215,6 +297,52 @@ test("Test with library, control, enum", async (t) => { } ], "methods": [ + { + "name": "addItem", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "Reference to this in order to allow method chaining" + }, + "parameters": [ + { + "name": "oItem", + "type": "sap.ui.core.Control", + "optional": false, + "description": "The item to add; if empty, nothing is inserted" + } + ], + "description": "Adds some item to the aggregation {@link #getItems items}." + }, + { + "name": "attachChange", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "Reference to this in order to allow method chaining" + }, + "parameters": [ + { + "name": "oData", + "type": "object", + "optional": true, + "description": "An application-specific payload object that will be passed to the event handler along with the event object when firing the event" + }, + { + "name": "fnFunction", + "type": "function(sap.ui.base.Event) : void", + "optional": false, + "description": "The function to be called when the event occurs" + }, + { + "name": "oListener", + "type": "object", + "optional": true, + "description": "Context object to call the event handler with. Defaults to this sap.ui5.tooling.test.TestControl itself" + } + ], + "description": "Attaches event handler fnFunction to the {@link #event:change change} event of this sap.ui5.tooling.test.TestControl.\n\nWhen called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui5.tooling.test.TestControl itself.\n\nFires when an item is changed." + }, { "name": "attachPress", "visibility": "public", @@ -244,6 +372,38 @@ test("Test with library, control, enum", async (t) => { ], "description": "Attaches event handler fnFunction to the {@link #event:press press} event of this sap.ui5.tooling.test.TestControl.\n\nWhen called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui5.tooling.test.TestControl itself.\n\nEvent is fired when the user clicks the control." }, + { + "name": "destroyItems", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "Reference to this in order to allow method chaining" + }, + "description": "Destroys all the items in the aggregation {@link #getItems items}." + }, + { + "name": "detachChange", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "Reference to this in order to allow method chaining" + }, + "parameters": [ + { + "name": "fnFunction", + "type": "function(sap.ui.base.Event) : void", + "optional": false, + "description": "The function to be called, when the event occurs" + }, + { + "name": "oListener", + "type": "object", + "optional": true, + "description": "Context object on which the given function had to be called" + } + ], + "description": "Detaches event handler fnFunction from the {@link #event:change change} event of this sap.ui5.tooling.test.TestControl.\n\nThe passed function and listener object must match the ones used for event registration." + }, { "name": "detachPress", "visibility": "public", @@ -297,6 +457,36 @@ test("Test with library, control, enum", async (t) => { ], "description": "Creates a new subclass of class sap.ui5.tooling.test.TestControl with name sClassName and enriches it with the information contained in oClassInfo.\n\noClassInfo might contain the same kind of information as described in {@link sap.ui.core.Control.extend}." }, + { + "name": "fancyFunction", + "visibility": "public", + "description": "Some fancy function" + }, + { + "name": "fireChange", + "visibility": "protected", + "returnValue": { + "type": "this", + "description": "Reference to this in order to allow method chaining" + }, + "parameters": [ + { + "name": "mParameters", + "type": "object", + "optional": true, + "parameterProperties": { + "item": { + "name": "item", + "type": "sap.ui.core.Control", + "optional": true, + "description": "Reference to the item" + } + }, + "description": "Parameters to pass along with the event" + } + ], + "description": "Fires event {@link #event:change change} to attached listeners." + }, { "name": "firePress", "visibility": "protected", @@ -323,6 +513,14 @@ test("Test with library, control, enum", async (t) => { }, "description": "Gets current value of property {@link #getColor color}.\n\nProperty with an Enum\n\nDefault value is Red." }, + { + "name": "getItems", + "visibility": "public", + "returnValue": { + "type": "sap.ui.core.Control[]" + }, + "description": "Gets content of aggregation {@link #getItems items}.\n\nItems to be rendered" + }, { "name": "getMetadata", "visibility": "public", @@ -333,6 +531,14 @@ test("Test with library, control, enum", async (t) => { }, "description": "Returns a metadata object for class sap.ui5.tooling.test.TestControl." }, + { + "name": "getSelectedItem", + "visibility": "public", + "returnValue": { + "type": "sap.ui.core.ID" + }, + "description": "ID of the element which is the current target of the association {@link #getSelectedItem selectedItem}, or null." + }, { "name": "getValue", "visibility": "public", @@ -342,6 +548,72 @@ test("Test with library, control, enum", async (t) => { }, "description": "Gets current value of property {@link #getValue value}.\n\nProperty with type int\n\nDefault value is 0." }, + { + "name": "indexOfItem", + "visibility": "public", + "returnValue": { + "type": "int", + "description": "The index of the provided control in the aggregation if found, or -1 otherwise" + }, + "parameters": [ + { + "name": "oItem", + "type": "sap.ui.core.Control", + "optional": false, + "description": "The item whose index is looked for" + } + ], + "description": "Checks for the provided sap.ui.core.Control in the aggregation {@link #getItems items}. and returns its index if found or -1 otherwise." + }, + { + "name": "insertItem", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "Reference to this in order to allow method chaining" + }, + "parameters": [ + { + "name": "oItem", + "type": "sap.ui.core.Control", + "optional": false, + "description": "The item to insert; if empty, nothing is inserted" + }, + { + "name": "iIndex", + "type": "int", + "optional": false, + "description": "The 0-based index the item should be inserted at; for a negative value of iIndex, the item is inserted at position 0; for a value greater than the current size of the aggregation, the item is inserted at the last position" + } + ], + "description": "Inserts a item into the aggregation {@link #getItems items}." + }, + { + "name": "removeAllItems", + "visibility": "public", + "returnValue": { + "type": "sap.ui.core.Control[]", + "description": "An array of the removed elements (might be empty)" + }, + "description": "Removes all the controls from the aggregation {@link #getItems items}.\n\nAdditionally, it unregisters them from the hosting UIArea." + }, + { + "name": "removeItem", + "visibility": "public", + "returnValue": { + "type": "sap.ui.core.Control|null", + "description": "The removed item or null" + }, + "parameters": [ + { + "name": "vItem", + "type": "int|string|sap.ui.core.Control", + "optional": false, + "description": "The item to remove or its index or id" + } + ], + "description": "Removes a item from the aggregation {@link #getItems items}." + }, { "name": "setColor", "visibility": "public", @@ -360,6 +632,23 @@ test("Test with library, control, enum", async (t) => { ], "description": "Sets a new value for property {@link #getColor color}.\n\nProperty with an Enum\n\nWhen called with a value of null or undefined, the default value of the property will be restored.\n\nDefault value is Red." }, + { + "name": "setSelectedItem", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "Reference to this in order to allow method chaining" + }, + "parameters": [ + { + "name": "oSelectedItem", + "type": "sap.ui.core.ID|sap.ui.core.Control", + "optional": false, + "description": "ID of an element which becomes the new target of this selectedItem association; alternatively, an element instance may be given" + } + ], + "description": "Sets the associated {@link #getSelectedItem selectedItem}." + }, { "name": "setValue", "visibility": "public", @@ -412,7 +701,6 @@ test("Test with library, control, enum", async (t) => { } ] } - /* eslint-enable max-len */ )); const readdir = sinon.stub().yieldsAsync(new Error("Not found!")); @@ -426,7 +714,6 @@ test("Test with library, control, enum", async (t) => { } ); - /* eslint-disable max-len */ t.deepEqual(JSON.parse(apiJsonContent), { "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", "version": "2.1.0", @@ -504,7 +791,42 @@ test("Test with library, control, enum", async (t) => { "setValue" ] } - ] + ], + "aggregations": [ + { + cardinality: "0..n", + description: "

Items to be rendered

", + linkEnabled: true, + methods: [ + "getItems", + "destroyItems", + "insertItem", + "addItem", + "removeItem", + "indexOfItem", + "removeAllItems", + ], + name: "items", + singularName: "item", + type: "sap.ui.core.Control", + visibility: "public", + }, + ], + "associations": [ + { + cardinality: "0..1", + description: "

Selected item

", + linkEnabled: true, + methods: [ + "getSelectedItem", + "setSelectedItem", + ], + name: "selectedItem", + singularName: "selectedItem", + type: "sap.ui.core.Control", + visibility: "public", + }, + ], }, "constructor": { "visibility": "public", @@ -543,6 +865,42 @@ test("Test with library, control, enum", async (t) => { "codeExample": "
new sap.ui5.tooling.test.TestControl(sId?, mSettings?)
" }, "events": [ + { + "name": "change", + "visibility": "public", + "parameters": [ + { + "name": "oControlEvent", + "type": "sap.ui.base.Event", + "linkEnabled": true + }, + { + "name": "getSource", + "type": "sap.ui.base.EventProvider", + "optional": false, + "depth": 1, + "phoneName": "oControlEvent.getSource", + "linkEnabled": true + }, + { + "name": "getParameters", + "type": "object", + "optional": false, + "depth": 1, + "phoneName": "oControlEvent.getParameters" + }, + { + "name": "item", + "type": "sap.ui.core.Control", + "optional": false, + "description": "

Reference to the item

", + "depth": 2, + "phoneName": "oControlEvent.getParameters.item", + "linkEnabled": true + } + ], + "description": "

Fires when an item is changed.

" + }, { "name": "press", "visibility": "public", @@ -573,7 +931,38 @@ test("Test with library, control, enum", async (t) => { ], "methods": [ { - "name": "attachPress", + "name": "addItem", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", + "types": [ + { + "value": "this" + } + ] + }, + "parameters": [ + { + "name": "oItem", + "optional": false, + "description": "

The item to add; if empty, nothing is inserted

", + "types": [ + { + "value": "sap.ui.core.Control", + "linkEnabled": true, + "href": "api/sap.ui.core.Control" + } + ], + "defaultValue": "" + } + ], + "description": "

Adds some item to the aggregation items.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/addItem", + "code": "
addItem(oItem) : this
" + }, + { + "name": "attachChange", "visibility": "public", "returnValue": { "type": "this", @@ -619,9 +1008,116 @@ test("Test with library, control, enum", async (t) => { "defaultValue": "" } ], - "description": "

Attaches event handler fnFunction to the press event of this sap.ui5.tooling.test.TestControl.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui5.tooling.test.TestControl itself.

Event is fired when the user clicks the control.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/attachPress", - "code": "
attachPress(oData?, fnFunction, oListener?) : this
" + "description": "

Attaches event handler fnFunction to the change event of this sap.ui5.tooling.test.TestControl.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui5.tooling.test.TestControl itself.

Fires when an item is changed.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/attachChange", + "code": "
attachChange(oData?, fnFunction, oListener?) : this
" + }, + { + "name": "attachPress", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", + "types": [ + { + "value": "this" + } + ] + }, + "parameters": [ + { + "name": "oData", + "optional": true, + "description": "

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" + }, + { + "name": "fnFunction", + "optional": false, + "description": "

The function to be called when the event occurs

", + "types": [ + { + "value": "function(sap.ui.base.Event) : void" + } + ], + "defaultValue": "" + }, + { + "name": "oListener", + "optional": true, + "description": "

Context object to call the event handler with. Defaults to this sap.ui5.tooling.test.TestControl itself

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" + } + ], + "description": "

Attaches event handler fnFunction to the press event of this sap.ui5.tooling.test.TestControl.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui5.tooling.test.TestControl itself.

Event is fired when the user clicks the control.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/attachPress", + "code": "
attachPress(oData?, fnFunction, oListener?) : this
" + }, + { + "name": "destroyItems", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", + "types": [ + { + "value": "this" + } + ] + }, + "description": "

Destroys all the items in the aggregation items.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/destroyItems", + "code": "
destroyItems() : this
" + }, + { + "name": "detachChange", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", + "types": [ + { + "value": "this" + } + ] + }, + "parameters": [ + { + "name": "fnFunction", + "optional": false, + "description": "

The function to be called, when the event occurs

", + "types": [ + { + "value": "function(sap.ui.base.Event) : void" + } + ], + "defaultValue": "" + }, + { + "name": "oListener", + "optional": true, + "description": "

Context object on which the given function had to be called

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" + } + ], + "description": "

Detaches event handler fnFunction from the change event of this sap.ui5.tooling.test.TestControl.

The passed function and listener object must match the ones used for event registration.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/detachChange", + "code": "
detachChange(fnFunction, oListener?) : this
" }, { "name": "detachPress", @@ -678,46 +1174,242 @@ test("Test with library, control, enum", async (t) => { }, "parameters": [ { - "name": "sClassName", + "name": "sClassName", + "optional": false, + "description": "

Name of the class being created

", + "types": [ + { + "value": "string" + } + ], + "defaultValue": "" + }, + { + "name": "oClassInfo", + "optional": true, + "description": "

Object literal with information about the class

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" + }, + { + "name": "FNMetaImpl", + "optional": true, + "description": "

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

", + "types": [ + { + "value": "function" + } + ], + "defaultValue": "" + } + ], + "description": "

Creates a new subclass of class sap.ui5.tooling.test.TestControl with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/sap.ui5.tooling.test.TestControl.extend", + "code": "
sap.ui5.tooling.test.TestControl.extend(sClassName, oClassInfo?, FNMetaImpl?) : function
" + }, + { + "name": "fancyFunction", + "visibility": "public", + "description": "

Some fancy function

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/fancyFunction", + "code": "
fancyFunction() : void
" + }, + { + "name": "fireChange", + "visibility": "protected", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", + "types": [ + { + "value": "this" + } + ] + }, + "parameters": [ + { + "name": "mParameters", + "optional": true, + "description": "

Parameters to pass along with the event

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" + }, + { + "name": "item", + "optional": true, + "description": "

Reference to the item

", + "depth": 1, + "types": [ + { + "value": "sap.ui.core.Control", + "linkEnabled": true, + "href": "api/sap.ui.core.Control" + } + ], + "phoneName": "mParameters.item", + "defaultValue": "" + } + ], + "description": "

Fires event change to attached listeners.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/fireChange", + "code": "
fireChange(mParameters?) : this
" + }, + { + "name": "firePress", + "visibility": "protected", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", + "types": [ + { + "value": "this" + } + ] + }, + "parameters": [ + { + "name": "mParameters", + "optional": true, + "description": "

Parameters to pass along with the event

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" + } + ], + "description": "

Fires event press to attached listeners.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/firePress", + "code": "
firePress(mParameters?) : this
" + }, + { + "name": "getColor", + "visibility": "public", + "returnValue": { + "type": "sap.ui5.tooling.test.TestEnum", + "description": "

Value of property color

", + "types": [ + { + "value": "sap.ui5.tooling.test.TestEnum" + } + ] + }, + "description": "

Gets current value of property color.

Property with an Enum

Default value is Red.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/getColor", + "code": "
getColor() : sap.ui5.tooling.test.TestEnum
" + }, + { + "name": "getItems", + "visibility": "public", + "returnValue": { + "type": "sap.ui.core.Control[]", + "types": [ + { + "value": "sap.ui.core.Control[]" + } + ], + "description": "" + }, + "description": "

Gets content of aggregation items.

Items to be rendered

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/getItems", + "code": "
getItems() : sap.ui.core.Control[]
" + }, + { + "name": "sap.ui5.tooling.test.TestControl.getMetadata", + "visibility": "public", + "static": true, + "returnValue": { + "type": "sap.ui.core.ElementMetadata", + "description": "

Metadata object describing this class

", + "types": [ + { + "value": "sap.ui.core.ElementMetadata", + "href": "api/sap.ui.core.ElementMetadata", + "linkEnabled": true + } + ] + }, + "description": "

Returns a metadata object for class sap.ui5.tooling.test.TestControl.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/sap.ui5.tooling.test.TestControl.getMetadata", + "code": "
sap.ui5.tooling.test.TestControl.getMetadata() : sap.ui.core.ElementMetadata
" + }, + { + "name": "getSelectedItem", + "visibility": "public", + "returnValue": { + "type": "sap.ui.core.ID", + "types": [ + { + "value": "sap.ui.core.ID", + "href": "api/sap.ui.core.ID", + "linkEnabled": true + } + ], + "description": "" + }, + "description": "

ID of the element which is the current target of the association selectedItem, or null.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/getSelectedItem", + "code": "
getSelectedItem() : sap.ui.core.ID
" + }, + { + "name": "getValue", + "visibility": "public", + "returnValue": { + "type": "int", + "description": "

Value of property value

", + "types": [ + { + "value": "int" + } + ] + }, + "description": "

Gets current value of property value.

Property with type int

Default value is 0.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/getValue", + "code": "
getValue() : int
" + }, + { + "name": "indexOfItem", + "visibility": "public", + "returnValue": { + "type": "int", + "description": "

The index of the provided control in the aggregation if found, or -1 otherwise

", + "types": [ + { + "value": "int" + } + ] + }, + "parameters": [ + { + "name": "oItem", "optional": false, - "description": "

Name of the class being created

", - "types": [ - { - "value": "string" - } - ], - "defaultValue": "" - }, - { - "name": "oClassInfo", - "optional": true, - "description": "

Object literal with information about the class

", - "types": [ - { - "value": "object" - } - ], - "defaultValue": "" - }, - { - "name": "FNMetaImpl", - "optional": true, - "description": "

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

", + "description": "

The item whose index is looked for

", "types": [ { - "value": "function" + "value": "sap.ui.core.Control", + "linkEnabled": true, + "href": "api/sap.ui.core.Control" } ], "defaultValue": "" } ], - "description": "

Creates a new subclass of class sap.ui5.tooling.test.TestControl with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/sap.ui5.tooling.test.TestControl.extend", - "code": "
sap.ui5.tooling.test.TestControl.extend(sClassName, oClassInfo?, FNMetaImpl?) : function
" + "description": "

Checks for the provided sap.ui.core.Control in the aggregation items. and returns its index if found or -1 otherwise.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/indexOfItem", + "code": "
indexOfItem(oItem) : int
" }, { - "name": "firePress", - "visibility": "protected", + "name": "insertItem", + "visibility": "public", "returnValue": { "type": "this", "description": "

Reference to this in order to allow method chaining

", @@ -729,71 +1421,91 @@ test("Test with library, control, enum", async (t) => { }, "parameters": [ { - "name": "mParameters", - "optional": true, - "description": "

Parameters to pass along with the event

", + "name": "oItem", + "optional": false, + "description": "

The item to insert; if empty, nothing is inserted

", "types": [ { - "value": "object" + "value": "sap.ui.core.Control", + "linkEnabled": true, + "href": "api/sap.ui.core.Control" + } + ], + "defaultValue": "" + }, + { + "name": "iIndex", + "optional": false, + "description": "

The 0-based index the item should be inserted at; for a negative value of iIndex, the item is inserted at position 0; for a value greater than the current size of the aggregation, the item is inserted at the last position

", + "types": [ + { + "value": "int" } ], "defaultValue": "" } ], - "description": "

Fires event press to attached listeners.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/firePress", - "code": "
firePress(mParameters?) : this
" + "description": "

Inserts a item into the aggregation items.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/insertItem", + "code": "
insertItem(oItem, iIndex) : this
" }, { - "name": "getColor", + "name": "removeAllItems", "visibility": "public", "returnValue": { - "type": "sap.ui5.tooling.test.TestEnum", - "description": "

Value of property color

", + "type": "sap.ui.core.Control[]", + "description": "

An array of the removed elements (might be empty)

", "types": [ { - "value": "sap.ui5.tooling.test.TestEnum" + "value": "sap.ui.core.Control[]" } ] }, - "description": "

Gets current value of property color.

Property with an Enum

Default value is Red.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/getColor", - "code": "
getColor() : sap.ui5.tooling.test.TestEnum
" + "description": "

Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/removeAllItems", + "code": "
removeAllItems() : sap.ui.core.Control[]
" }, { - "name": "sap.ui5.tooling.test.TestControl.getMetadata", + "name": "removeItem", "visibility": "public", - "static": true, "returnValue": { - "type": "sap.ui.core.ElementMetadata", - "description": "

Metadata object describing this class

", + "type": "sap.ui.core.Control|null", + "description": "

The removed item or null

", "types": [ { - "value": "sap.ui.core.ElementMetadata", - "href": "api/sap.ui.core.ElementMetadata", + "value": "sap.ui.core.Control", + "href": "api/sap.ui.core.Control", "linkEnabled": true - } - ] - }, - "description": "

Returns a metadata object for class sap.ui5.tooling.test.TestControl.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/sap.ui5.tooling.test.TestControl.getMetadata", - "code": "
sap.ui5.tooling.test.TestControl.getMetadata() : sap.ui.core.ElementMetadata
" - }, - { - "name": "getValue", - "visibility": "public", - "returnValue": { - "type": "int", - "description": "

Value of property value

", - "types": [ + }, { - "value": "int" + "value": "null" } ] }, - "description": "

Gets current value of property value.

Property with type int

Default value is 0.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/getValue", - "code": "
getValue() : int
" + "parameters": [ + { + "name": "vItem", + "optional": false, + "description": "

The item to remove or its index or id

", + "types": [ + { + "value": "int" + }, + { + "value": "string" + }, + { + "value": "sap.ui.core.Control", + "linkEnabled": true, + "href": "api/sap.ui.core.Control" + } + ], + "defaultValue": "" + } + ], + "description": "

Removes a item from the aggregation items.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/removeItem", + "code": "
removeItem(vItem) : sap.ui.core.Control|null
" }, { "name": "setColor", @@ -824,6 +1536,42 @@ test("Test with library, control, enum", async (t) => { "href": "api/sap.ui5.tooling.test.TestControl#methods/setColor", "code": "
setColor(sColor?) : this
" }, + { + "name": "setSelectedItem", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", + "types": [ + { + "value": "this" + } + ] + }, + "parameters": [ + { + "name": "oSelectedItem", + "optional": false, + "description": "

ID of an element which becomes the new target of this selectedItem association; alternatively, an element instance may be given

", + "types": [ + { + "value": "sap.ui.core.ID", + "linkEnabled": true, + "href": "api/sap.ui.core.ID" + }, + { + "value": "sap.ui.core.Control", + "linkEnabled": true, + "href": "api/sap.ui.core.Control" + } + ], + "defaultValue": "" + } + ], + "description": "

Sets the associated selectedItem.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/setSelectedItem", + "code": "
setSelectedItem(oSelectedItem) : this
" + }, { "name": "setValue", "visibility": "public", @@ -933,10 +1681,9 @@ test("Test with library, control, enum", async (t) => { } ] }); - /* eslint-enable max-len */ }); -test("Test with docuindex.json reference", async (t) => { +test(".library with docuindex.json reference", async (t) => { const {sinon, transformApiJson} = t.context; const apiJsonPath = "/test-resources/sap/ui5/tooling/test/designtime/api.json"; @@ -1088,7 +1835,6 @@ test("Test with docuindex.json reference", async (t) => { } ); - /* eslint-disable max-len */ t.deepEqual(JSON.parse(apiJsonContent), { "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", "version": "2.1.0", @@ -1289,5 +2035,171 @@ test("Test with docuindex.json reference", async (t) => { }, ] }); - /* eslint-enable max-len */ +}); + +test(".library with information", async (t) => { + const {sinon, transformApiJson} = t.context; + + const apiJsonPath = "/test-resources/sap/ui5/tooling/test/designtime/api.json"; + const fakeTargetPath = "/ignore/this/path/resource/will/be/returned"; + const dotLibraryPath = "/resources/sap/ui5/tooling/test/.library"; + const dependencyApiJsonPaths = []; + + const readFile = sinon.stub().yieldsAsync(new Error("Not found!")); + + readFile.withArgs("/resources/sap/ui5/tooling/test/.library").yieldsAsync(null, ` + + + + sap.ui5.tooling.test + SAP SE + Some copyright notice + 1.2.3 + + UI5 Tooling Test Library + + + + UI5-TOOLING + + UI5-TOOLING-EXT + + sap/ui5/tooling/test/ext/* + + + + + + `); + + readFile.withArgs("/test-resources/sap/ui5/tooling/test/designtime/api.json").yieldsAsync(null, JSON.stringify( + { + "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", + "version": "2.1.0", + "library": "sap.ui5.tooling.test", + "symbols": [ + { + "kind": "namespace", + "name": "sap.ui5.tooling.test", + "basename": "test", + "resource": "sap/ui5/tooling/test/library.js", + "module": "sap/ui5/tooling/test/library", + "export": "", + "static": true, + "visibility": "public", + "description": "UI5 Tooling Test Library", + }, + { + "kind": "namespace", + "name": "sap.ui5.tooling.test.ext", + "basename": "ext", + "resource": "sap/ui5/tooling/test/ext/ext.js", + "module": "sap/ui5/tooling/test/ext/ext", + "export": "", + "static": true, + "visibility": "public", + "description": "UI5 Tooling Test Library - Extension", + } + ] + } + )); + + const readdir = sinon.stub().yieldsAsync(new Error("Not found!")); + + const fs = {readFile, readdir}; + + const apiJsonContent = await transformApiJson( + apiJsonPath, fakeTargetPath, dotLibraryPath, dependencyApiJsonPaths, "", { + fs, + returnOutputFiles: true + } + ); + + t.deepEqual(JSON.parse(apiJsonContent), { + "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", + "version": "2.1.0", + "library": "sap.ui5.tooling.test", + "defaultComponent": "UI5-TOOLING", + "symbols": [ + { + basename: "test", + component: "UI5-TOOLING", + description: "

UI5 Tooling Test Library

", + displayName: "sap.ui5.tooling.test", + export: "", + kind: "namespace", + module: "sap/ui5/tooling/test/library", + name: "sap.ui5.tooling.test", + nodes: [ + { + description: "

UI5 Tooling Test Library - Extension

", + href: "api/sap.ui5.tooling.test.ext", + name: "sap.ui5.tooling.test.ext", + } + ], + resource: "sap/ui5/tooling/test/library.js", + static: true, + subTitle: "", + title: "namespace sap.ui5.tooling.test", + visibility: "public", + }, + { + basename: "ext", + component: "UI5-TOOLING-EXT", + description: "

UI5 Tooling Test Library - Extension

", + displayName: "sap.ui5.tooling.test.ext", + export: "", + kind: "namespace", + module: "sap/ui5/tooling/test/ext/ext", + name: "sap.ui5.tooling.test.ext", + resource: "sap/ui5/tooling/test/ext/ext.js", + static: true, + subTitle: "", + title: "namespace sap.ui5.tooling.test.ext", + visibility: "public", + }, + { + displayName: "sap", + kind: "namespace", + name: "sap", + nodes: [ + { + description: "", + href: "api/sap.ui5", + name: "sap.ui5", + }, + ], + subTitle: "", + title: "namespace sap", + }, + { + displayName: "sap.ui5", + kind: "namespace", + name: "sap.ui5", + nodes: [ + { + description: "", + href: "api/sap.ui5.tooling", + name: "sap.ui5.tooling", + }, + ], + subTitle: "", + title: "namespace sap.ui5", + }, + { + displayName: "sap.ui5.tooling", + kind: "namespace", + name: "sap.ui5.tooling", + nodes: [ + { + description: "

UI5 Tooling Test Library

", + href: "api/sap.ui5.tooling.test", + name: "sap.ui5.tooling.test", + }, + ], + subTitle: "", + title: "namespace sap.ui5.tooling", + }, + ] + }); }); From 40b669fbae9a7f4af03bc72ba8ad200cdfad2849 Mon Sep 17 00:00:00 2001 From: Matthias Osswald Date: Fri, 4 Nov 2022 16:10:26 +0100 Subject: [PATCH 5/6] [INTERNAL] Further enhance tests, part 3 --- .../processors/jsdoc/lib/transformApiJson.js | 249 +++++++++++++++--- 1 file changed, 214 insertions(+), 35 deletions(-) diff --git a/test/lib/processors/jsdoc/lib/transformApiJson.js b/test/lib/processors/jsdoc/lib/transformApiJson.js index df32c3f38..9a76658fe 100644 --- a/test/lib/processors/jsdoc/lib/transformApiJson.js +++ b/test/lib/processors/jsdoc/lib/transformApiJson.js @@ -64,19 +64,106 @@ test("Basic test without symbols", async (t) => { }); }); -test("Test with library, control, enum", async (t) => { +test("Reading dependency api.json paths", async (t) => { const {sinon, transformApiJson} = t.context; const apiJsonPath = "/test-resources/sap/ui5/tooling/test/designtime/api.json"; const fakeTargetPath = "/ignore/this/path/resource/will/be/returned"; const dotLibraryPath = "/resources/sap/ui5/tooling/test/.library"; const dependencyApiJsonPaths = [ - "/resources/some/path/x/api.json", - "/resources/some/path/y/api.json" + "/test-resources/sap/ui/core/designtime/api.json", + "/test-resources/some/library/not/found/api.json" // to test the error case when reading the file ]; const readFile = sinon.stub().yieldsAsync(new Error("Not found!")); + readFile.withArgs("/test-resources/sap/ui5/tooling/test/designtime/api.json").yieldsAsync(null, JSON.stringify( + { + "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", + "version": "2.1.0", + "library": "sap.ui5.tooling.test", + "symbols": [] + } + )); + + readFile.withArgs("/test-resources/sap/ui/core/designtime/api.json").yieldsAsync(null, JSON.stringify( + { + "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", + "version": "1.111.1", + "library": "sap.ui.core", + "symbols": [] + } + )); + + const readdir = sinon.stub().yieldsAsync(new Error("Not found!")); + + const fs = {readFile, readdir}; + + const apiJsonContent = await transformApiJson( + apiJsonPath, fakeTargetPath, dotLibraryPath, dependencyApiJsonPaths, "", { + fs, + returnOutputFiles: true + } + ); + + t.deepEqual(JSON.parse(apiJsonContent), { + "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", + "version": "2.1.0", + "library": "sap.ui5.tooling.test", + "symbols": [] + }); +}); + +test("Reading dependency api.json paths from directory", async (t) => { + const {sinon, transformApiJson} = t.context; + + const apiJsonPath = "/test-resources/sap/ui5/tooling/test/designtime/api.json"; + const fakeTargetPath = "/ignore/this/path/resource/will/be/returned"; + const dotLibraryPath = "/resources/sap/ui5/tooling/test/.library"; + const dependencyApiJsonPaths = "/api-jsons"; + + const readFile = sinon.stub().yieldsAsync(new Error("Not found!")); + + readFile.withArgs("/test-resources/sap/ui5/tooling/test/designtime/api.json").yieldsAsync(null, JSON.stringify( + { + "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", + "version": "2.1.0", + "library": "sap.ui5.tooling.test", + "symbols": [] + } + )); + + const readdir = sinon.stub().yieldsAsync(new Error("Not found!")); + + readdir.withArgs("/api-jsons").yieldsAsync(null, ["lib1-api.json", "lib2-api.json"]); + + const fs = {readFile, readdir}; + + const apiJsonContent = await transformApiJson( + apiJsonPath, fakeTargetPath, dotLibraryPath, dependencyApiJsonPaths, "", { + fs, + returnOutputFiles: true + } + ); + + t.deepEqual(JSON.parse(apiJsonContent), { + "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", + "version": "2.1.0", + "library": "sap.ui5.tooling.test", + "symbols": [] + }); +}); + +test("Test with library, control, enum", async (t) => { + const {sinon, transformApiJson} = t.context; + + const apiJsonPath = "/test-resources/sap/ui5/tooling/test/designtime/api.json"; + const fakeTargetPath = "/ignore/this/path/resource/will/be/returned"; + const dotLibraryPath = "/resources/sap/ui5/tooling/test/.library"; + const dependencyApiJsonPaths = []; + + const readFile = sinon.stub().yieldsAsync(new Error("Not found!")); + readFile.withArgs("/resources/sap/ui5/tooling/test/.library").yieldsAsync(null, ` @@ -91,7 +178,6 @@ test("Test with library, control, enum", async (t) => { `); readFile.withArgs("/test-resources/sap/ui5/tooling/test/designtime/api.json").yieldsAsync(null, JSON.stringify( - { "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", "version": "2.1.0", @@ -133,6 +219,13 @@ test("Test with library, control, enum", async (t) => { }, "ui5-metadata": { "stereotype": "control", + "specialSettings": [ + { + "name": "specialControlData", + "type": "any", + "visibility": "public" + } + ], "properties": [ { "name": "value", @@ -141,6 +234,9 @@ test("Test with library, control, enum", async (t) => { "group": "Misc", "visibility": "public", "description": "Property with type int", + "deprecated": { + "since": "2.0" + }, "methods": [ "getValue", "setValue" @@ -197,6 +293,9 @@ test("Test with library, control, enum", async (t) => { "name": "press", "visibility": "public", "description": "Event is fired when the user clicks the control.", + "deprecated": { + "since": "2.0" + }, "methods": [ "attachPress", "detachPress", @@ -206,6 +305,7 @@ test("Test with library, control, enum", async (t) => { { "name": "change", "visibility": "public", + "since": "1.4", "description": "Fires when an item is changed.", "parameters": { "item": { @@ -244,6 +344,7 @@ test("Test with library, control, enum", async (t) => { { "name": "change", "visibility": "public", + "since": "1.4", "parameters": [ { "name": "oControlEvent", @@ -293,7 +394,10 @@ test("Test with library, control, enum", async (t) => { } } ], - "description": "Event is fired when the user clicks the control." + "description": "Event is fired when the user clicks the control.", + "deprecated": { + "since": "2.0" + } } ], "methods": [ @@ -317,6 +421,7 @@ test("Test with library, control, enum", async (t) => { { "name": "attachChange", "visibility": "public", + "since": "1.4", "returnValue": { "type": "this", "description": "Reference to this in order to allow method chaining" @@ -370,7 +475,10 @@ test("Test with library, control, enum", async (t) => { "description": "Context object to call the event handler with. Defaults to this sap.ui5.tooling.test.TestControl itself" } ], - "description": "Attaches event handler fnFunction to the {@link #event:press press} event of this sap.ui5.tooling.test.TestControl.\n\nWhen called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui5.tooling.test.TestControl itself.\n\nEvent is fired when the user clicks the control." + "description": "Attaches event handler fnFunction to the {@link #event:press press} event of this sap.ui5.tooling.test.TestControl.\n\nWhen called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui5.tooling.test.TestControl itself.\n\nEvent is fired when the user clicks the control.", + "deprecated": { + "since": "2.0" + } }, { "name": "destroyItems", @@ -384,6 +492,7 @@ test("Test with library, control, enum", async (t) => { { "name": "detachChange", "visibility": "public", + "since": "1.4", "returnValue": { "type": "this", "description": "Reference to this in order to allow method chaining" @@ -425,7 +534,10 @@ test("Test with library, control, enum", async (t) => { "description": "Context object on which the given function had to be called" } ], - "description": "Detaches event handler fnFunction from the {@link #event:press press} event of this sap.ui5.tooling.test.TestControl.\n\nThe passed function and listener object must match the ones used for event registration." + "description": "Detaches event handler fnFunction from the {@link #event:press press} event of this sap.ui5.tooling.test.TestControl.\n\nThe passed function and listener object must match the ones used for event registration.", + "deprecated": { + "since": "2.0" + } }, { "name": "extend", @@ -460,11 +572,21 @@ test("Test with library, control, enum", async (t) => { { "name": "fancyFunction", "visibility": "public", - "description": "Some fancy function" + "throws": [ + { + "type": "Error", + "description": "In case something bad happens" + } + ], + "description": "Some fancy function", + "deprecated": { + "since": "2.0" + } }, { "name": "fireChange", "visibility": "protected", + "since": "1.4", "returnValue": { "type": "this", "description": "Reference to this in order to allow method chaining" @@ -502,7 +624,10 @@ test("Test with library, control, enum", async (t) => { "description": "Parameters to pass along with the event" } ], - "description": "Fires event {@link #event:press press} to attached listeners." + "description": "Fires event {@link #event:press press} to attached listeners.", + "deprecated": { + "since": "2.0" + } }, { "name": "getColor", @@ -546,7 +671,10 @@ test("Test with library, control, enum", async (t) => { "type": "int", "description": "Value of property value" }, - "description": "Gets current value of property {@link #getValue value}.\n\nProperty with type int\n\nDefault value is 0." + "description": "Gets current value of property {@link #getValue value}.\n\nProperty with type int\n\nDefault value is 0.", + "deprecated": { + "since": "2.0" + } }, { "name": "indexOfItem", @@ -665,7 +793,10 @@ test("Test with library, control, enum", async (t) => { "description": "New value for property value" } ], - "description": "Sets a new value for property {@link #getValue value}.\n\nProperty with type int\n\nWhen called with a value of null or undefined, the default value of the property will be restored.\n\nDefault value is 0." + "description": "Sets a new value for property {@link #getValue value}.\n\nProperty with type int\n\nWhen called with a value of null or undefined, the default value of the property will be restored.\n\nDefault value is 0.", + "deprecated": { + "since": "2.0" + } } ] }, @@ -765,6 +896,14 @@ test("Test with library, control, enum", async (t) => { }, "ui5-metadata": { "stereotype": "control", + "specialSettings": [ + { + "name": "specialControlData", + "type": "any", + "visibility": "public", + "description": "" + } + ], "properties": [ { "name": "color", @@ -789,44 +928,45 @@ test("Test with library, control, enum", async (t) => { "methods": [ "getValue", "setValue" - ] + ], + "deprecatedText": "Deprecated as of version 2.0" } ], "aggregations": [ { - cardinality: "0..n", - description: "

Items to be rendered

", - linkEnabled: true, - methods: [ + "name": "items", + "singularName": "item", + "type": "sap.ui.core.Control", + "cardinality": "0..n", + "visibility": "public", + "description": "

Items to be rendered

", + "methods": [ "getItems", "destroyItems", "insertItem", "addItem", "removeItem", "indexOfItem", - "removeAllItems", + "removeAllItems" ], - name: "items", - singularName: "item", - type: "sap.ui.core.Control", - visibility: "public", - }, + "linkEnabled": true + } ], "associations": [ { - cardinality: "0..1", - description: "

Selected item

", - linkEnabled: true, - methods: [ + "name": "selectedItem", + "singularName": "selectedItem", + "type": "sap.ui.core.Control", + "cardinality": "0..1", + "visibility": "public", + "description": "

Selected item

", + "methods": [ "getSelectedItem", - "setSelectedItem", + "setSelectedItem" ], - name: "selectedItem", - singularName: "selectedItem", - type: "sap.ui.core.Control", - visibility: "public", - }, - ], + "linkEnabled": true + } + ] }, "constructor": { "visibility": "public", @@ -868,6 +1008,7 @@ test("Test with library, control, enum", async (t) => { { "name": "change", "visibility": "public", + "since": "1.4", "parameters": [ { "name": "oControlEvent", @@ -899,7 +1040,7 @@ test("Test with library, control, enum", async (t) => { "linkEnabled": true } ], - "description": "

Fires when an item is changed.

" + "description": "

Fires when an item is changed.

Since: 1.4.

" }, { "name": "press", @@ -926,7 +1067,11 @@ test("Test with library, control, enum", async (t) => { "phoneName": "oControlEvent.getParameters" } ], - "description": "

Event is fired when the user clicks the control.

" + "description": "

Event is fired when the user clicks the control.

", + "deprecated": { + "since": "2.0" + }, + "deprecatedText": "Deprecated as of version 2.0" } ], "methods": [ @@ -964,6 +1109,7 @@ test("Test with library, control, enum", async (t) => { { "name": "attachChange", "visibility": "public", + "since": "1.4", "returnValue": { "type": "this", "description": "

Reference to this in order to allow method chaining

", @@ -1060,7 +1206,11 @@ test("Test with library, control, enum", async (t) => { } ], "description": "

Attaches event handler fnFunction to the press event of this sap.ui5.tooling.test.TestControl.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui5.tooling.test.TestControl itself.

Event is fired when the user clicks the control.

", + "deprecated": { + "since": "2.0" + }, "href": "api/sap.ui5.tooling.test.TestControl#methods/attachPress", + "deprecatedText": "Deprecated as of version 2.0", "code": "
attachPress(oData?, fnFunction, oListener?) : this
" }, { @@ -1082,6 +1232,7 @@ test("Test with library, control, enum", async (t) => { { "name": "detachChange", "visibility": "public", + "since": "1.4", "returnValue": { "type": "this", "description": "

Reference to this in order to allow method chaining

", @@ -1156,7 +1307,11 @@ test("Test with library, control, enum", async (t) => { } ], "description": "

Detaches event handler fnFunction from the press event of this sap.ui5.tooling.test.TestControl.

The passed function and listener object must match the ones used for event registration.

", + "deprecated": { + "since": "2.0" + }, "href": "api/sap.ui5.tooling.test.TestControl#methods/detachPress", + "deprecatedText": "Deprecated as of version 2.0", "code": "
detachPress(fnFunction, oListener?) : this
" }, { @@ -1214,13 +1369,25 @@ test("Test with library, control, enum", async (t) => { { "name": "fancyFunction", "visibility": "public", + "throws": [ + { + "type": "Error", + "description": "

In case something bad happens

", + "linkEnabled": false + } + ], "description": "

Some fancy function

", + "deprecated": { + "since": "2.0" + }, "href": "api/sap.ui5.tooling.test.TestControl#methods/fancyFunction", + "deprecatedText": "Deprecated as of version 2.0", "code": "
fancyFunction() : void
" }, { "name": "fireChange", "visibility": "protected", + "since": "1.4", "returnValue": { "type": "this", "description": "

Reference to this in order to allow method chaining

", @@ -1288,7 +1455,11 @@ test("Test with library, control, enum", async (t) => { } ], "description": "

Fires event press to attached listeners.

", + "deprecated": { + "since": "2.0" + }, "href": "api/sap.ui5.tooling.test.TestControl#methods/firePress", + "deprecatedText": "Deprecated as of version 2.0", "code": "
firePress(mParameters?) : this
" }, { @@ -1373,7 +1544,11 @@ test("Test with library, control, enum", async (t) => { ] }, "description": "

Gets current value of property value.

Property with type int

Default value is 0.

", + "deprecated": { + "since": "2.0" + }, "href": "api/sap.ui5.tooling.test.TestControl#methods/getValue", + "deprecatedText": "Deprecated as of version 2.0", "code": "
getValue() : int
" }, { @@ -1598,7 +1773,11 @@ test("Test with library, control, enum", async (t) => { } ], "description": "

Sets a new value for property value.

Property with type int

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 0.

", + "deprecated": { + "since": "2.0" + }, "href": "api/sap.ui5.tooling.test.TestControl#methods/setValue", + "deprecatedText": "Deprecated as of version 2.0", "code": "
setValue(iValue?) : this
" } ], From 526a97799c998ec97ac037679e52c1fc4a4622b0 Mon Sep 17 00:00:00 2001 From: Matthias Osswald Date: Mon, 7 Nov 2022 11:18:40 +0100 Subject: [PATCH 6/6] Enhance coverage --- .../processors/jsdoc/lib/transformApiJson.js | 1810 +++++++++-------- 1 file changed, 939 insertions(+), 871 deletions(-) diff --git a/test/lib/processors/jsdoc/lib/transformApiJson.js b/test/lib/processors/jsdoc/lib/transformApiJson.js index 9a76658fe..808d37bfe 100644 --- a/test/lib/processors/jsdoc/lib/transformApiJson.js +++ b/test/lib/processors/jsdoc/lib/transformApiJson.js @@ -229,11 +229,11 @@ test("Test with library, control, enum", async (t) => { "properties": [ { "name": "value", - "type": "int", - "defaultValue": 0, + "type": "string", + "defaultValue": "", "group": "Misc", "visibility": "public", - "description": "Property with type int", + "description": "Property with type string", "deprecated": { "since": "2.0" }, @@ -311,7 +311,14 @@ test("Test with library, control, enum", async (t) => { "item": { "name": "item", "type": "sap.ui.core.Control", + "since": "1.4", "description": "Reference to the item" + }, + "pressed": { + "name": "pressed", + "type": "boolean", + "description": "Whether pressed", + "deprecated": {} } }, "methods": [ @@ -338,7 +345,18 @@ test("Test with library, control, enum", async (t) => { "description": "initial settings for the new control" } ], - "description": "Constructor for a new TestControl.\n\nAccepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description of the syntax of the settings object." + "throws": [ + { + "type": "Error", + "description": "In case something bad happens" + } + ], + "description": "Constructor for a new TestControl.\n\nAccepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description of the syntax of the settings object.", + "examples": [ + { + "text": "new TestControl();" + } + ] }, "events": [ { @@ -365,6 +383,12 @@ test("Test with library, control, enum", async (t) => { "type": "sap.ui.core.Control", "optional": false, "description": "Reference to the item" + }, + "pressed": { + "name": "pressed", + "type": "boolean", + "optional": false, + "description": "Whether pressed" } } } @@ -578,7 +602,7 @@ test("Test with library, control, enum", async (t) => { "description": "In case something bad happens" } ], - "description": "Some fancy function", + "description": "Some fancy function.\n\nSome links: {@link https://openui5.org OpenUI5} {@link demo:foo} {@link sap.ui.core.Control.prototype.placeAt} {@link sap.m.Button#event:press} {@link sap.m.Button#setText} {@link fiori:/flexible-column-layout/ Flexible Column Layout} {@link topic:59a0e11712e84a648bb990a1dba76bc7 Link text} {@link module:sap/ui/comp/smartfield/SmartField#annotation:TextArrangement TextArrangement}", "deprecated": { "since": "2.0" } @@ -602,6 +626,12 @@ test("Test with library, control, enum", async (t) => { "type": "sap.ui.core.Control", "optional": true, "description": "Reference to the item" + }, + "pressed": { + "name": "pressed", + "type": "boolean", + "optional": true, + "description": "Whether pressed" } }, "description": "Parameters to pass along with the event" @@ -668,10 +698,10 @@ test("Test with library, control, enum", async (t) => { "name": "getValue", "visibility": "public", "returnValue": { - "type": "int", + "type": "string", "description": "Value of property value" }, - "description": "Gets current value of property {@link #getValue value}.\n\nProperty with type int\n\nDefault value is 0.", + "description": "Gets current value of property {@link #getValue value}.\n\nProperty with type string\n\nDefault value is empty string.", "deprecated": { "since": "2.0" } @@ -786,14 +816,14 @@ test("Test with library, control, enum", async (t) => { }, "parameters": [ { - "name": "iValue", - "type": "int", + "name": "sValue", + "type": "string", "optional": true, - "defaultValue": 0, + "defaultValue": "\"\"", "description": "New value for property value" } ], - "description": "Sets a new value for property {@link #getValue value}.\n\nProperty with type int\n\nWhen called with a value of null or undefined, the default value of the property will be restored.\n\nDefault value is 0.", + "description": "Sets a new value for property {@link #getValue value}.\n\nProperty with type string\n\nWhen called with a value of null or undefined, the default value of the property will be restored.\n\nDefault value is empty string.", "deprecated": { "since": "2.0" } @@ -845,1021 +875,1059 @@ test("Test with library, control, enum", async (t) => { } ); - t.deepEqual(JSON.parse(apiJsonContent), { - "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", - "version": "2.1.0", - "library": "sap.ui5.tooling.test", - "symbols": [ - { - "kind": "namespace", - "name": "sap.ui5.tooling.test", - "basename": "test", - "resource": "sap/ui5/tooling/test/library.js", - "module": "sap/ui5/tooling/test/library", - "export": "", - "static": true, - "visibility": "public", - "since": "1.0.0", - "description": "

UI5 Tooling Test Library

", - "displayName": "sap.ui5.tooling.test", - "nodes": [ - { - "name": "sap.ui5.tooling.test.TestControl", - "description": "

This control is just for UI5 Tooling testing purposes.

", - "href": "api/sap.ui5.tooling.test.TestControl", - "deprecated": true - }, - { - "name": "sap.ui5.tooling.test.TestEnum", - "description": "

Defines colors

", - "href": "api/sap.ui5.tooling.test.TestEnum" - } - ], - "title": "namespace sap.ui5.tooling.test", - "subTitle": "Deprecated in version: 2.0.0", - "deprecatedText": "Deprecated as of version 2.0.0" - }, - { - "kind": "class", - "name": "sap.ui5.tooling.test.TestControl", - "basename": "TestControl", - "resource": "sap/ui5/tooling/test/TestControl.js", - "module": "sap/ui5/tooling/test/TestControl", - "export": "", - "static": true, - "visibility": "public", - "extends": "sap.ui.core.Control", - "description": "

This control is just for UI5 Tooling testing purposes.

", - "experimental": { - "since": "1.4", - "text": "The API may change. Use with care." - }, - "ui5-metadata": { - "stereotype": "control", - "specialSettings": [ - { - "name": "specialControlData", - "type": "any", - "visibility": "public", - "description": "" - } - ], - "properties": [ - { - "name": "color", - "type": "sap.ui5.tooling.test.TestEnum", - "defaultValue": "Red", - "group": "Misc", - "visibility": "public", - "description": "

Property with an Enum

", - "methods": [ - "getColor", - "setColor" - ], - "linkEnabled": true - }, - { - "name": "value", - "type": "int", - "defaultValue": 0, - "group": "Misc", - "visibility": "public", - "description": "

Property with type int

", - "methods": [ - "getValue", - "setValue" - ], - "deprecatedText": "Deprecated as of version 2.0" - } - ], - "aggregations": [ - { - "name": "items", - "singularName": "item", - "type": "sap.ui.core.Control", - "cardinality": "0..n", - "visibility": "public", - "description": "

Items to be rendered

", - "methods": [ - "getItems", - "destroyItems", - "insertItem", - "addItem", - "removeItem", - "indexOfItem", - "removeAllItems" - ], - "linkEnabled": true - } - ], - "associations": [ - { - "name": "selectedItem", - "singularName": "selectedItem", - "type": "sap.ui.core.Control", - "cardinality": "0..1", - "visibility": "public", - "description": "

Selected item

", - "methods": [ - "getSelectedItem", - "setSelectedItem" - ], - "linkEnabled": true - } - ] - }, - "constructor": { + t.deepEqual(JSON.parse(apiJsonContent), + { + "$schema-ref": "http://schemas.sap.com/sapui5/designtime/api.json/1.0", + "version": "2.1.0", + "library": "sap.ui5.tooling.test", + "symbols": [ + { + "kind": "namespace", + "name": "sap.ui5.tooling.test", + "basename": "test", + "resource": "sap/ui5/tooling/test/library.js", + "module": "sap/ui5/tooling/test/library", + "export": "", + "static": true, "visibility": "public", - "parameters": [ + "since": "1.0.0", + "description": "

UI5 Tooling Test Library

", + "displayName": "sap.ui5.tooling.test", + "nodes": [ { - "name": "sId", - "optional": true, - "description": "

id for the new control, generated automatically if no id is given

", - "phoneName": "sId", - "depth": 0, - "types": [ - { - "name": "string", - "linkEnabled": false - } - ], - "defaultValue": "" + "name": "sap.ui5.tooling.test.TestControl", + "description": "

This control is just for UI5 Tooling testing purposes.

", + "href": "api/sap.ui5.tooling.test.TestControl", + "deprecated": true }, { - "name": "mSettings", - "optional": true, - "description": "

initial settings for the new control

", - "phoneName": "mSettings", - "depth": 0, - "types": [ - { - "name": "object", - "linkEnabled": false - } - ], - "defaultValue": "" + "name": "sap.ui5.tooling.test.TestEnum", + "description": "

Defines colors

", + "href": "api/sap.ui5.tooling.test.TestEnum" } ], - "description": "

Constructor for a new TestControl.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.

", - "references": [], - "codeExample": "
new sap.ui5.tooling.test.TestControl(sId?, mSettings?)
" + "title": "namespace sap.ui5.tooling.test", + "subTitle": "Deprecated in version: 2.0.0", + "deprecatedText": "Deprecated as of version 2.0.0" }, - "events": [ - { - "name": "change", - "visibility": "public", + { + "kind": "class", + "name": "sap.ui5.tooling.test.TestControl", + "basename": "TestControl", + "resource": "sap/ui5/tooling/test/TestControl.js", + "module": "sap/ui5/tooling/test/TestControl", + "export": "", + "static": true, + "visibility": "public", + "extends": "sap.ui.core.Control", + "description": "

This control is just for UI5 Tooling testing purposes.

", + "experimental": { "since": "1.4", - "parameters": [ + "text": "The API may change. Use with care." + }, + "ui5-metadata": { + "stereotype": "control", + "specialSettings": [ { - "name": "oControlEvent", - "type": "sap.ui.base.Event", - "linkEnabled": true - }, + "name": "specialControlData", + "type": "any", + "visibility": "public", + "description": "" + } + ], + "properties": [ { - "name": "getSource", - "type": "sap.ui.base.EventProvider", - "optional": false, - "depth": 1, - "phoneName": "oControlEvent.getSource", + "name": "color", + "type": "sap.ui5.tooling.test.TestEnum", + "defaultValue": "Red", + "group": "Misc", + "visibility": "public", + "description": "

Property with an Enum

", + "methods": [ + "getColor", + "setColor" + ], "linkEnabled": true }, { - "name": "getParameters", - "type": "object", - "optional": false, - "depth": 1, - "phoneName": "oControlEvent.getParameters" - }, - { - "name": "item", - "type": "sap.ui.core.Control", - "optional": false, - "description": "

Reference to the item

", - "depth": 2, - "phoneName": "oControlEvent.getParameters.item", - "linkEnabled": true + "name": "value", + "type": "string", + "defaultValue": "empty string", + "group": "Misc", + "visibility": "public", + "description": "

Property with type string

", + "methods": [ + "getValue", + "setValue" + ], + "deprecatedText": "Deprecated as of version 2.0" } ], - "description": "

Fires when an item is changed.

Since: 1.4.

" - }, - { - "name": "press", - "visibility": "public", - "parameters": [ - { - "name": "oControlEvent", - "type": "sap.ui.base.Event", - "linkEnabled": true - }, + "aggregations": [ { - "name": "getSource", - "type": "sap.ui.base.EventProvider", - "optional": false, - "depth": 1, - "phoneName": "oControlEvent.getSource", + "name": "items", + "singularName": "item", + "type": "sap.ui.core.Control", + "cardinality": "0..n", + "visibility": "public", + "description": "

Items to be rendered

", + "methods": [ + "getItems", + "destroyItems", + "insertItem", + "addItem", + "removeItem", + "indexOfItem", + "removeAllItems" + ], "linkEnabled": true - }, - { - "name": "getParameters", - "type": "object", - "optional": false, - "depth": 1, - "phoneName": "oControlEvent.getParameters" } ], - "description": "

Event is fired when the user clicks the control.

", - "deprecated": { - "since": "2.0" - }, - "deprecatedText": "Deprecated as of version 2.0" - } - ], - "methods": [ - { - "name": "addItem", - "visibility": "public", - "returnValue": { - "type": "this", - "description": "

Reference to this in order to allow method chaining

", - "types": [ - { - "value": "this" - } - ] - }, - "parameters": [ + "associations": [ { - "name": "oItem", - "optional": false, - "description": "

The item to add; if empty, nothing is inserted

", - "types": [ - { - "value": "sap.ui.core.Control", - "linkEnabled": true, - "href": "api/sap.ui.core.Control" - } + "name": "selectedItem", + "singularName": "selectedItem", + "type": "sap.ui.core.Control", + "cardinality": "0..1", + "visibility": "public", + "description": "

Selected item

", + "methods": [ + "getSelectedItem", + "setSelectedItem" ], - "defaultValue": "" + "linkEnabled": true } - ], - "description": "

Adds some item to the aggregation items.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/addItem", - "code": "
addItem(oItem) : this
" + ] }, - { - "name": "attachChange", + "constructor": { "visibility": "public", - "since": "1.4", - "returnValue": { - "type": "this", - "description": "

Reference to this in order to allow method chaining

", - "types": [ - { - "value": "this" - } - ] - }, "parameters": [ { - "name": "oData", + "name": "sId", "optional": true, - "description": "

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

", - "types": [ - { - "value": "object" - } - ], - "defaultValue": "" - }, - { - "name": "fnFunction", - "optional": false, - "description": "

The function to be called when the event occurs

", + "description": "

id for the new control, generated automatically if no id is given

", + "phoneName": "sId", + "depth": 0, "types": [ { - "value": "function(sap.ui.base.Event) : void" + "name": "string", + "linkEnabled": false } ], "defaultValue": "" }, { - "name": "oListener", + "name": "mSettings", "optional": true, - "description": "

Context object to call the event handler with. Defaults to this sap.ui5.tooling.test.TestControl itself

", + "description": "

initial settings for the new control

", + "phoneName": "mSettings", + "depth": 0, "types": [ { - "value": "object" + "name": "object", + "linkEnabled": false } ], "defaultValue": "" } ], - "description": "

Attaches event handler fnFunction to the change event of this sap.ui5.tooling.test.TestControl.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui5.tooling.test.TestControl itself.

Fires when an item is changed.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/attachChange", - "code": "
attachChange(oData?, fnFunction, oListener?) : this
" + "throws": [ + { + "type": "Error", + "description": "

In case something bad happens

", + "linkEnabled": false + } + ], + "description": "

Constructor for a new TestControl.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.

", + "examples": [ + { + "data": "

Example:

new TestControl();

" + } + ], + "references": [], + "codeExample": "
new sap.ui5.tooling.test.TestControl(sId?, mSettings?)
" }, - { - "name": "attachPress", - "visibility": "public", - "returnValue": { - "type": "this", - "description": "

Reference to this in order to allow method chaining

", - "types": [ + "events": [ + { + "name": "change", + "visibility": "public", + "since": "1.4", + "parameters": [ + { + "name": "oControlEvent", + "type": "sap.ui.base.Event", + "linkEnabled": true + }, { - "value": "this" + "name": "getSource", + "type": "sap.ui.base.EventProvider", + "optional": false, + "depth": 1, + "phoneName": "oControlEvent.getSource", + "linkEnabled": true + }, + { + "name": "getParameters", + "type": "object", + "optional": false, + "depth": 1, + "phoneName": "oControlEvent.getParameters" + }, + { + "name": "item", + "type": "sap.ui.core.Control", + "optional": false, + "description": "

Reference to the item

Since: 1.4.

", + "since": "1.4", + "depth": 2, + "phoneName": "oControlEvent.getParameters.item", + "linkEnabled": true + }, + { + "name": "pressed", + "type": "boolean", + "optional": false, + "description": "

Whether pressed

", + "deprecated": {}, + "depth": 2, + "phoneName": "oControlEvent.getParameters.pressed", + "deprecatedText": "Deprecated" } - ] + ], + "description": "

Fires when an item is changed.

Since: 1.4.

" }, - "parameters": [ - { - "name": "oData", - "optional": true, - "description": "

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

", - "types": [ - { - "value": "object" - } - ], - "defaultValue": "" + { + "name": "press", + "visibility": "public", + "parameters": [ + { + "name": "oControlEvent", + "type": "sap.ui.base.Event", + "linkEnabled": true + }, + { + "name": "getSource", + "type": "sap.ui.base.EventProvider", + "optional": false, + "depth": 1, + "phoneName": "oControlEvent.getSource", + "linkEnabled": true + }, + { + "name": "getParameters", + "type": "object", + "optional": false, + "depth": 1, + "phoneName": "oControlEvent.getParameters" + } + ], + "description": "

Event is fired when the user clicks the control.

", + "deprecated": { + "since": "2.0" }, - { - "name": "fnFunction", - "optional": false, - "description": "

The function to be called when the event occurs

", + "deprecatedText": "Deprecated as of version 2.0" + } + ], + "methods": [ + { + "name": "addItem", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", "types": [ { - "value": "function(sap.ui.base.Event) : void" + "value": "this" } - ], - "defaultValue": "" + ] }, - { - "name": "oListener", - "optional": true, - "description": "

Context object to call the event handler with. Defaults to this sap.ui5.tooling.test.TestControl itself

", - "types": [ - { - "value": "object" - } - ], - "defaultValue": "" - } - ], - "description": "

Attaches event handler fnFunction to the press event of this sap.ui5.tooling.test.TestControl.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui5.tooling.test.TestControl itself.

Event is fired when the user clicks the control.

", - "deprecated": { - "since": "2.0" - }, - "href": "api/sap.ui5.tooling.test.TestControl#methods/attachPress", - "deprecatedText": "Deprecated as of version 2.0", - "code": "
attachPress(oData?, fnFunction, oListener?) : this
" - }, - { - "name": "destroyItems", - "visibility": "public", - "returnValue": { - "type": "this", - "description": "

Reference to this in order to allow method chaining

", - "types": [ - { - "value": "this" - } - ] - }, - "description": "

Destroys all the items in the aggregation items.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/destroyItems", - "code": "
destroyItems() : this
" - }, - { - "name": "detachChange", - "visibility": "public", - "since": "1.4", - "returnValue": { - "type": "this", - "description": "

Reference to this in order to allow method chaining

", - "types": [ + "parameters": [ { - "value": "this" + "name": "oItem", + "optional": false, + "description": "

The item to add; if empty, nothing is inserted

", + "types": [ + { + "value": "sap.ui.core.Control", + "linkEnabled": true, + "href": "api/sap.ui.core.Control" + } + ], + "defaultValue": "" } - ] + ], + "description": "

Adds some item to the aggregation items.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/addItem", + "code": "
addItem(oItem) : this
" }, - "parameters": [ - { - "name": "fnFunction", - "optional": false, - "description": "

The function to be called, when the event occurs

", + { + "name": "attachChange", + "visibility": "public", + "since": "1.4", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", "types": [ { - "value": "function(sap.ui.base.Event) : void" + "value": "this" } - ], - "defaultValue": "" + ] }, - { - "name": "oListener", - "optional": true, - "description": "

Context object on which the given function had to be called

", - "types": [ - { - "value": "object" - } - ], - "defaultValue": "" - } - ], - "description": "

Detaches event handler fnFunction from the change event of this sap.ui5.tooling.test.TestControl.

The passed function and listener object must match the ones used for event registration.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/detachChange", - "code": "
detachChange(fnFunction, oListener?) : this
" - }, - { - "name": "detachPress", - "visibility": "public", - "returnValue": { - "type": "this", - "description": "

Reference to this in order to allow method chaining

", - "types": [ + "parameters": [ + { + "name": "oData", + "optional": true, + "description": "

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" + }, { - "value": "this" + "name": "fnFunction", + "optional": false, + "description": "

The function to be called when the event occurs

", + "types": [ + { + "value": "function(sap.ui.base.Event) : void" + } + ], + "defaultValue": "" + }, + { + "name": "oListener", + "optional": true, + "description": "

Context object to call the event handler with. Defaults to this sap.ui5.tooling.test.TestControl itself

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" } - ] + ], + "description": "

Attaches event handler fnFunction to the change event of this sap.ui5.tooling.test.TestControl.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui5.tooling.test.TestControl itself.

Fires when an item is changed.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/attachChange", + "code": "
attachChange(oData?, fnFunction, oListener?) : this
" }, - "parameters": [ - { - "name": "fnFunction", - "optional": false, - "description": "

The function to be called, when the event occurs

", + { + "name": "attachPress", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", "types": [ { - "value": "function(sap.ui.base.Event) : void" + "value": "this" } - ], - "defaultValue": "" + ] }, - { - "name": "oListener", - "optional": true, - "description": "

Context object on which the given function had to be called

", - "types": [ - { - "value": "object" - } - ], - "defaultValue": "" - } - ], - "description": "

Detaches event handler fnFunction from the press event of this sap.ui5.tooling.test.TestControl.

The passed function and listener object must match the ones used for event registration.

", - "deprecated": { - "since": "2.0" - }, - "href": "api/sap.ui5.tooling.test.TestControl#methods/detachPress", - "deprecatedText": "Deprecated as of version 2.0", - "code": "
detachPress(fnFunction, oListener?) : this
" - }, - { - "name": "sap.ui5.tooling.test.TestControl.extend", - "visibility": "public", - "static": true, - "returnValue": { - "type": "function", - "description": "

Created class / constructor function

", - "types": [ + "parameters": [ { - "value": "function" + "name": "oData", + "optional": true, + "description": "

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" + }, + { + "name": "fnFunction", + "optional": false, + "description": "

The function to be called when the event occurs

", + "types": [ + { + "value": "function(sap.ui.base.Event) : void" + } + ], + "defaultValue": "" + }, + { + "name": "oListener", + "optional": true, + "description": "

Context object to call the event handler with. Defaults to this sap.ui5.tooling.test.TestControl itself

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" } - ] + ], + "description": "

Attaches event handler fnFunction to the press event of this sap.ui5.tooling.test.TestControl.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui5.tooling.test.TestControl itself.

Event is fired when the user clicks the control.

", + "deprecated": { + "since": "2.0" + }, + "href": "api/sap.ui5.tooling.test.TestControl#methods/attachPress", + "deprecatedText": "Deprecated as of version 2.0", + "code": "
attachPress(oData?, fnFunction, oListener?) : this
" }, - "parameters": [ - { - "name": "sClassName", - "optional": false, - "description": "

Name of the class being created

", + { + "name": "destroyItems", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", "types": [ { - "value": "string" + "value": "this" } - ], - "defaultValue": "" + ] }, - { - "name": "oClassInfo", - "optional": true, - "description": "

Object literal with information about the class

", + "description": "

Destroys all the items in the aggregation items.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/destroyItems", + "code": "
destroyItems() : this
" + }, + { + "name": "detachChange", + "visibility": "public", + "since": "1.4", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", "types": [ { - "value": "object" + "value": "this" } - ], - "defaultValue": "" + ] }, - { - "name": "FNMetaImpl", - "optional": true, - "description": "

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

", - "types": [ - { - "value": "function" - } - ], - "defaultValue": "" - } - ], - "description": "

Creates a new subclass of class sap.ui5.tooling.test.TestControl with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/sap.ui5.tooling.test.TestControl.extend", - "code": "
sap.ui5.tooling.test.TestControl.extend(sClassName, oClassInfo?, FNMetaImpl?) : function
" - }, - { - "name": "fancyFunction", - "visibility": "public", - "throws": [ - { - "type": "Error", - "description": "

In case something bad happens

", - "linkEnabled": false - } - ], - "description": "

Some fancy function

", - "deprecated": { - "since": "2.0" - }, - "href": "api/sap.ui5.tooling.test.TestControl#methods/fancyFunction", - "deprecatedText": "Deprecated as of version 2.0", - "code": "
fancyFunction() : void
" - }, - { - "name": "fireChange", - "visibility": "protected", - "since": "1.4", - "returnValue": { - "type": "this", - "description": "

Reference to this in order to allow method chaining

", - "types": [ + "parameters": [ + { + "name": "fnFunction", + "optional": false, + "description": "

The function to be called, when the event occurs

", + "types": [ + { + "value": "function(sap.ui.base.Event) : void" + } + ], + "defaultValue": "" + }, { - "value": "this" + "name": "oListener", + "optional": true, + "description": "

Context object on which the given function had to be called

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" } - ] + ], + "description": "

Detaches event handler fnFunction from the change event of this sap.ui5.tooling.test.TestControl.

The passed function and listener object must match the ones used for event registration.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/detachChange", + "code": "
detachChange(fnFunction, oListener?) : this
" }, - "parameters": [ - { - "name": "mParameters", - "optional": true, - "description": "

Parameters to pass along with the event

", + { + "name": "detachPress", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", "types": [ { - "value": "object" + "value": "this" } - ], - "defaultValue": "" + ] }, - { - "name": "item", - "optional": true, - "description": "

Reference to the item

", - "depth": 1, - "types": [ - { - "value": "sap.ui.core.Control", - "linkEnabled": true, - "href": "api/sap.ui.core.Control" - } - ], - "phoneName": "mParameters.item", - "defaultValue": "" - } - ], - "description": "

Fires event change to attached listeners.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/fireChange", - "code": "
fireChange(mParameters?) : this
" - }, - { - "name": "firePress", - "visibility": "protected", - "returnValue": { - "type": "this", - "description": "

Reference to this in order to allow method chaining

", - "types": [ + "parameters": [ { - "value": "this" + "name": "fnFunction", + "optional": false, + "description": "

The function to be called, when the event occurs

", + "types": [ + { + "value": "function(sap.ui.base.Event) : void" + } + ], + "defaultValue": "" + }, + { + "name": "oListener", + "optional": true, + "description": "

Context object on which the given function had to be called

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" } - ] + ], + "description": "

Detaches event handler fnFunction from the press event of this sap.ui5.tooling.test.TestControl.

The passed function and listener object must match the ones used for event registration.

", + "deprecated": { + "since": "2.0" + }, + "href": "api/sap.ui5.tooling.test.TestControl#methods/detachPress", + "deprecatedText": "Deprecated as of version 2.0", + "code": "
detachPress(fnFunction, oListener?) : this
" }, - "parameters": [ - { - "name": "mParameters", - "optional": true, - "description": "

Parameters to pass along with the event

", + { + "name": "sap.ui5.tooling.test.TestControl.extend", + "visibility": "public", + "static": true, + "returnValue": { + "type": "function", + "description": "

Created class / constructor function

", "types": [ { - "value": "object" + "value": "function" } - ], - "defaultValue": "" - } - ], - "description": "

Fires event press to attached listeners.

", - "deprecated": { - "since": "2.0" - }, - "href": "api/sap.ui5.tooling.test.TestControl#methods/firePress", - "deprecatedText": "Deprecated as of version 2.0", - "code": "
firePress(mParameters?) : this
" - }, - { - "name": "getColor", - "visibility": "public", - "returnValue": { - "type": "sap.ui5.tooling.test.TestEnum", - "description": "

Value of property color

", - "types": [ + ] + }, + "parameters": [ { - "value": "sap.ui5.tooling.test.TestEnum" - } - ] - }, - "description": "

Gets current value of property color.

Property with an Enum

Default value is Red.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/getColor", - "code": "
getColor() : sap.ui5.tooling.test.TestEnum
" - }, - { - "name": "getItems", - "visibility": "public", - "returnValue": { - "type": "sap.ui.core.Control[]", - "types": [ + "name": "sClassName", + "optional": false, + "description": "

Name of the class being created

", + "types": [ + { + "value": "string" + } + ], + "defaultValue": "" + }, + { + "name": "oClassInfo", + "optional": true, + "description": "

Object literal with information about the class

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" + }, { - "value": "sap.ui.core.Control[]" + "name": "FNMetaImpl", + "optional": true, + "description": "

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

", + "types": [ + { + "value": "function" + } + ], + "defaultValue": "" } ], - "description": "" + "description": "

Creates a new subclass of class sap.ui5.tooling.test.TestControl with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.core.Control.extend.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/sap.ui5.tooling.test.TestControl.extend", + "code": "
sap.ui5.tooling.test.TestControl.extend(sClassName, oClassInfo?, FNMetaImpl?) : function
" }, - "description": "

Gets content of aggregation items.

Items to be rendered

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/getItems", - "code": "
getItems() : sap.ui.core.Control[]
" - }, - { - "name": "sap.ui5.tooling.test.TestControl.getMetadata", - "visibility": "public", - "static": true, - "returnValue": { - "type": "sap.ui.core.ElementMetadata", - "description": "

Metadata object describing this class

", - "types": [ + { + "name": "fancyFunction", + "visibility": "public", + "throws": [ { - "value": "sap.ui.core.ElementMetadata", - "href": "api/sap.ui.core.ElementMetadata", - "linkEnabled": true + "type": "Error", + "description": "

In case something bad happens

", + "linkEnabled": false } - ] + ], + "description": "

Some fancy function.

Some links: OpenUI5\n\t\t\t demo:foo\n\t\t\t sap.ui.core.Control.prototype.placeAt sap.m.Button#event:press sap.m.Button#setText Flexible Column Layout Link text TextArrangement

", + "deprecated": { + "since": "2.0" + }, + "href": "api/sap.ui5.tooling.test.TestControl#methods/fancyFunction", + "deprecatedText": "Deprecated as of version 2.0", + "code": "
fancyFunction() : void
" }, - "description": "

Returns a metadata object for class sap.ui5.tooling.test.TestControl.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/sap.ui5.tooling.test.TestControl.getMetadata", - "code": "
sap.ui5.tooling.test.TestControl.getMetadata() : sap.ui.core.ElementMetadata
" - }, - { - "name": "getSelectedItem", - "visibility": "public", - "returnValue": { - "type": "sap.ui.core.ID", - "types": [ + { + "name": "fireChange", + "visibility": "protected", + "since": "1.4", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", + "types": [ + { + "value": "this" + } + ] + }, + "parameters": [ { - "value": "sap.ui.core.ID", - "href": "api/sap.ui.core.ID", - "linkEnabled": true + "name": "mParameters", + "optional": true, + "description": "

Parameters to pass along with the event

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" + }, + { + "name": "item", + "optional": true, + "description": "

Reference to the item

", + "depth": 1, + "types": [ + { + "value": "sap.ui.core.Control", + "linkEnabled": true, + "href": "api/sap.ui.core.Control" + } + ], + "phoneName": "mParameters.item", + "defaultValue": "" + }, + { + "name": "pressed", + "optional": true, + "description": "

Whether pressed

", + "depth": 1, + "types": [ + { + "value": "boolean" + } + ], + "phoneName": "mParameters.pressed", + "defaultValue": "" } ], - "description": "" + "description": "

Fires event change to attached listeners.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/fireChange", + "code": "
fireChange(mParameters?) : this
" }, - "description": "

ID of the element which is the current target of the association selectedItem, or null.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/getSelectedItem", - "code": "
getSelectedItem() : sap.ui.core.ID
" - }, - { - "name": "getValue", - "visibility": "public", - "returnValue": { - "type": "int", - "description": "

Value of property value

", - "types": [ + { + "name": "firePress", + "visibility": "protected", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", + "types": [ + { + "value": "this" + } + ] + }, + "parameters": [ { - "value": "int" + "name": "mParameters", + "optional": true, + "description": "

Parameters to pass along with the event

", + "types": [ + { + "value": "object" + } + ], + "defaultValue": "" } - ] + ], + "description": "

Fires event press to attached listeners.

", + "deprecated": { + "since": "2.0" + }, + "href": "api/sap.ui5.tooling.test.TestControl#methods/firePress", + "deprecatedText": "Deprecated as of version 2.0", + "code": "
firePress(mParameters?) : this
" }, - "description": "

Gets current value of property value.

Property with type int

Default value is 0.

", - "deprecated": { - "since": "2.0" + { + "name": "getColor", + "visibility": "public", + "returnValue": { + "type": "sap.ui5.tooling.test.TestEnum", + "description": "

Value of property color

", + "types": [ + { + "value": "sap.ui5.tooling.test.TestEnum" + } + ] + }, + "description": "

Gets current value of property color.

Property with an Enum

Default value is Red.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/getColor", + "code": "
getColor() : sap.ui5.tooling.test.TestEnum
" }, - "href": "api/sap.ui5.tooling.test.TestControl#methods/getValue", - "deprecatedText": "Deprecated as of version 2.0", - "code": "
getValue() : int
" - }, - { - "name": "indexOfItem", - "visibility": "public", - "returnValue": { - "type": "int", - "description": "

The index of the provided control in the aggregation if found, or -1 otherwise

", - "types": [ - { - "value": "int" - } - ] + { + "name": "getItems", + "visibility": "public", + "returnValue": { + "type": "sap.ui.core.Control[]", + "types": [ + { + "value": "sap.ui.core.Control[]" + } + ], + "description": "" + }, + "description": "

Gets content of aggregation items.

Items to be rendered

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/getItems", + "code": "
getItems() : sap.ui.core.Control[]
" }, - "parameters": [ - { - "name": "oItem", - "optional": false, - "description": "

The item whose index is looked for

", + { + "name": "sap.ui5.tooling.test.TestControl.getMetadata", + "visibility": "public", + "static": true, + "returnValue": { + "type": "sap.ui.core.ElementMetadata", + "description": "

Metadata object describing this class

", "types": [ { - "value": "sap.ui.core.Control", - "linkEnabled": true, - "href": "api/sap.ui.core.Control" + "value": "sap.ui.core.ElementMetadata", + "href": "api/sap.ui.core.ElementMetadata", + "linkEnabled": true + } + ] + }, + "description": "

Returns a metadata object for class sap.ui5.tooling.test.TestControl.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/sap.ui5.tooling.test.TestControl.getMetadata", + "code": "
sap.ui5.tooling.test.TestControl.getMetadata() : sap.ui.core.ElementMetadata
" + }, + { + "name": "getSelectedItem", + "visibility": "public", + "returnValue": { + "type": "sap.ui.core.ID", + "types": [ + { + "value": "sap.ui.core.ID", + "href": "api/sap.ui.core.ID", + "linkEnabled": true } ], - "defaultValue": "" - } - ], - "description": "

Checks for the provided sap.ui.core.Control in the aggregation items. and returns its index if found or -1 otherwise.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/indexOfItem", - "code": "
indexOfItem(oItem) : int
" - }, - { - "name": "insertItem", - "visibility": "public", - "returnValue": { - "type": "this", - "description": "

Reference to this in order to allow method chaining

", - "types": [ - { - "value": "this" - } - ] + "description": "" + }, + "description": "

ID of the element which is the current target of the association selectedItem, or null.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/getSelectedItem", + "code": "
getSelectedItem() : sap.ui.core.ID
" }, - "parameters": [ - { - "name": "oItem", - "optional": false, - "description": "

The item to insert; if empty, nothing is inserted

", + { + "name": "getValue", + "visibility": "public", + "returnValue": { + "type": "string", + "description": "

Value of property value

", "types": [ { - "value": "sap.ui.core.Control", - "linkEnabled": true, - "href": "api/sap.ui.core.Control" + "value": "string" } - ], - "defaultValue": "" + ] }, - { - "name": "iIndex", - "optional": false, - "description": "

The 0-based index the item should be inserted at; for a negative value of iIndex, the item is inserted at position 0; for a value greater than the current size of the aggregation, the item is inserted at the last position

", + "description": "

Gets current value of property value.

Property with type string

Default value is empty string.

", + "deprecated": { + "since": "2.0" + }, + "href": "api/sap.ui5.tooling.test.TestControl#methods/getValue", + "deprecatedText": "Deprecated as of version 2.0", + "code": "
getValue() : string
" + }, + { + "name": "indexOfItem", + "visibility": "public", + "returnValue": { + "type": "int", + "description": "

The index of the provided control in the aggregation if found, or -1 otherwise

", "types": [ { "value": "int" } - ], - "defaultValue": "" - } - ], - "description": "

Inserts a item into the aggregation items.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/insertItem", - "code": "
insertItem(oItem, iIndex) : this
" - }, - { - "name": "removeAllItems", - "visibility": "public", - "returnValue": { - "type": "sap.ui.core.Control[]", - "description": "

An array of the removed elements (might be empty)

", - "types": [ + ] + }, + "parameters": [ { - "value": "sap.ui.core.Control[]" + "name": "oItem", + "optional": false, + "description": "

The item whose index is looked for

", + "types": [ + { + "value": "sap.ui.core.Control", + "linkEnabled": true, + "href": "api/sap.ui.core.Control" + } + ], + "defaultValue": "" } - ] + ], + "description": "

Checks for the provided sap.ui.core.Control in the aggregation items. and returns its index if found or -1 otherwise.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/indexOfItem", + "code": "
indexOfItem(oItem) : int
" }, - "description": "

Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/removeAllItems", - "code": "
removeAllItems() : sap.ui.core.Control[]
" - }, - { - "name": "removeItem", - "visibility": "public", - "returnValue": { - "type": "sap.ui.core.Control|null", - "description": "

The removed item or null

", - "types": [ + { + "name": "insertItem", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", + "types": [ + { + "value": "this" + } + ] + }, + "parameters": [ { - "value": "sap.ui.core.Control", - "href": "api/sap.ui.core.Control", - "linkEnabled": true + "name": "oItem", + "optional": false, + "description": "

The item to insert; if empty, nothing is inserted

", + "types": [ + { + "value": "sap.ui.core.Control", + "linkEnabled": true, + "href": "api/sap.ui.core.Control" + } + ], + "defaultValue": "" }, { - "value": "null" + "name": "iIndex", + "optional": false, + "description": "

The 0-based index the item should be inserted at; for a negative value of iIndex, the item is inserted at position 0; for a value greater than the current size of the aggregation, the item is inserted at the last position

", + "types": [ + { + "value": "int" + } + ], + "defaultValue": "" } - ] + ], + "description": "

Inserts a item into the aggregation items.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/insertItem", + "code": "
insertItem(oItem, iIndex) : this
" }, - "parameters": [ - { - "name": "vItem", - "optional": false, - "description": "

The item to remove or its index or id

", + { + "name": "removeAllItems", + "visibility": "public", + "returnValue": { + "type": "sap.ui.core.Control[]", + "description": "

An array of the removed elements (might be empty)

", "types": [ { - "value": "int" - }, + "value": "sap.ui.core.Control[]" + } + ] + }, + "description": "

Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/removeAllItems", + "code": "
removeAllItems() : sap.ui.core.Control[]
" + }, + { + "name": "removeItem", + "visibility": "public", + "returnValue": { + "type": "sap.ui.core.Control|null", + "description": "

The removed item or null

", + "types": [ { - "value": "string" + "value": "sap.ui.core.Control", + "href": "api/sap.ui.core.Control", + "linkEnabled": true }, { - "value": "sap.ui.core.Control", - "linkEnabled": true, - "href": "api/sap.ui.core.Control" + "value": "null" } - ], - "defaultValue": "" - } - ], - "description": "

Removes a item from the aggregation items.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/removeItem", - "code": "
removeItem(vItem) : sap.ui.core.Control|null
" - }, - { - "name": "setColor", - "visibility": "public", - "returnValue": { - "type": "this", - "description": "

Reference to this in order to allow method chaining

", - "types": [ + ] + }, + "parameters": [ { - "value": "this" + "name": "vItem", + "optional": false, + "description": "

The item to remove or its index or id

", + "types": [ + { + "value": "int" + }, + { + "value": "string" + }, + { + "value": "sap.ui.core.Control", + "linkEnabled": true, + "href": "api/sap.ui.core.Control" + } + ], + "defaultValue": "" } - ] + ], + "description": "

Removes a item from the aggregation items.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/removeItem", + "code": "
removeItem(vItem) : sap.ui.core.Control|null
" }, - "parameters": [ - { - "name": "sColor", - "optional": true, - "defaultValue": "Red", - "description": "

New value for property color

", + { + "name": "setColor", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", "types": [ { - "value": "sap.ui5.tooling.test.TestEnum" + "value": "this" } ] - } - ], - "description": "

Sets a new value for property color.

Property with an Enum

When called with a value of null or undefined, the default value of the property will be restored.

Default value is Red.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/setColor", - "code": "
setColor(sColor?) : this
" - }, - { - "name": "setSelectedItem", - "visibility": "public", - "returnValue": { - "type": "this", - "description": "

Reference to this in order to allow method chaining

", - "types": [ + }, + "parameters": [ { - "value": "this" + "name": "sColor", + "optional": true, + "defaultValue": "Red", + "description": "

New value for property color

", + "types": [ + { + "value": "sap.ui5.tooling.test.TestEnum" + } + ] } - ] + ], + "description": "

Sets a new value for property color.

Property with an Enum

When called with a value of null or undefined, the default value of the property will be restored.

Default value is Red.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/setColor", + "code": "
setColor(sColor?) : this
" }, - "parameters": [ - { - "name": "oSelectedItem", - "optional": false, - "description": "

ID of an element which becomes the new target of this selectedItem association; alternatively, an element instance may be given

", + { + "name": "setSelectedItem", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", "types": [ { - "value": "sap.ui.core.ID", - "linkEnabled": true, - "href": "api/sap.ui.core.ID" - }, - { - "value": "sap.ui.core.Control", - "linkEnabled": true, - "href": "api/sap.ui.core.Control" + "value": "this" } - ], - "defaultValue": "" - } - ], - "description": "

Sets the associated selectedItem.

", - "href": "api/sap.ui5.tooling.test.TestControl#methods/setSelectedItem", - "code": "
setSelectedItem(oSelectedItem) : this
" - }, - { - "name": "setValue", - "visibility": "public", - "returnValue": { - "type": "this", - "description": "

Reference to this in order to allow method chaining

", - "types": [ + ] + }, + "parameters": [ { - "value": "this" + "name": "oSelectedItem", + "optional": false, + "description": "

ID of an element which becomes the new target of this selectedItem association; alternatively, an element instance may be given

", + "types": [ + { + "value": "sap.ui.core.ID", + "linkEnabled": true, + "href": "api/sap.ui.core.ID" + }, + { + "value": "sap.ui.core.Control", + "linkEnabled": true, + "href": "api/sap.ui.core.Control" + } + ], + "defaultValue": "" } - ] + ], + "description": "

Sets the associated selectedItem.

", + "href": "api/sap.ui5.tooling.test.TestControl#methods/setSelectedItem", + "code": "
setSelectedItem(oSelectedItem) : this
" }, - "parameters": [ - { - "name": "iValue", - "optional": true, - "defaultValue": 0, - "description": "

New value for property value

", + { + "name": "setValue", + "visibility": "public", + "returnValue": { + "type": "this", + "description": "

Reference to this in order to allow method chaining

", "types": [ { - "value": "int" + "value": "this" } ] - } - ], - "description": "

Sets a new value for property value.

Property with type int

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 0.

", - "deprecated": { - "since": "2.0" - }, - "href": "api/sap.ui5.tooling.test.TestControl#methods/setValue", - "deprecatedText": "Deprecated as of version 2.0", - "code": "
setValue(iValue?) : this
" - } - ], - "displayName": "sap.ui5.tooling.test.TestControl", - "title": "class sap.ui5.tooling.test.TestControl", - "subTitle": "Deprecated in version: 2.0", - "deprecatedText": "Deprecated as of version 2.0. there's no replacement for this functionality" - }, - { - "kind": "enum", - "name": "sap.ui5.tooling.test.TestEnum", - "basename": "TestEnum", - "resource": "sap/ui5/tooling/test/library.js", - "module": "sap/ui5/tooling/test/library", - "export": "TestEnum", - "static": true, - "visibility": "public", - "description": "

Defines colors

", - "ui5-metadata": { - "stereotype": "enum" + }, + "parameters": [ + { + "name": "sValue", + "optional": true, + "defaultValue": "\"\"", + "description": "

New value for property value

", + "types": [ + { + "value": "string" + } + ] + } + ], + "description": "

Sets a new value for property value.

Property with type string

When called with a value of null or undefined, the default value of the property will be restored.

Default value is empty string.

", + "deprecated": { + "since": "2.0" + }, + "href": "api/sap.ui5.tooling.test.TestControl#methods/setValue", + "deprecatedText": "Deprecated as of version 2.0", + "code": "
setValue(sValue?) : this
" + } + ], + "displayName": "sap.ui5.tooling.test.TestControl", + "title": "class sap.ui5.tooling.test.TestControl", + "subTitle": "Deprecated in version: 2.0", + "deprecatedText": "Deprecated as of version 2.0. there's no replacement for this functionality" }, - "properties": [ - { - "name": "sap.ui5.tooling.test.TestEnum.Blue", - "visibility": "public", - "description": "

Yellow

" + { + "kind": "enum", + "name": "sap.ui5.tooling.test.TestEnum", + "basename": "TestEnum", + "resource": "sap/ui5/tooling/test/library.js", + "module": "sap/ui5/tooling/test/library", + "export": "TestEnum", + "static": true, + "visibility": "public", + "description": "

Defines colors

", + "ui5-metadata": { + "stereotype": "enum" }, - { - "name": "sap.ui5.tooling.test.TestEnum.Red", - "visibility": "public", - "description": "

Red

" - } - ], - "displayName": "sap.ui5.tooling.test.TestEnum", - "title": "enum sap.ui5.tooling.test.TestEnum", - "subTitle": "" - }, - { - "name": "sap", - "displayName": "sap", - "kind": "namespace", - "nodes": [ - { - "name": "sap.ui5", - "description": "", - "href": "api/sap.ui5" - } - ], - "title": "namespace sap", - "subTitle": "" - }, - { - "name": "sap.ui5", - "displayName": "sap.ui5", - "kind": "namespace", - "nodes": [ - { - "name": "sap.ui5.tooling", - "description": "", - "href": "api/sap.ui5.tooling" - } - ], - "title": "namespace sap.ui5", - "subTitle": "" - }, - { - "name": "sap.ui5.tooling", - "displayName": "sap.ui5.tooling", - "kind": "namespace", - "nodes": [ - { - "name": "sap.ui5.tooling.test", - "description": "

UI5 Tooling Test Library

", - "href": "api/sap.ui5.tooling.test", - "deprecated": true - } - ], - "title": "namespace sap.ui5.tooling", - "subTitle": "" - } - ] - }); + "properties": [ + { + "name": "sap.ui5.tooling.test.TestEnum.Blue", + "visibility": "public", + "description": "

Yellow

" + }, + { + "name": "sap.ui5.tooling.test.TestEnum.Red", + "visibility": "public", + "description": "

Red

" + } + ], + "displayName": "sap.ui5.tooling.test.TestEnum", + "title": "enum sap.ui5.tooling.test.TestEnum", + "subTitle": "" + }, + { + "name": "sap", + "displayName": "sap", + "kind": "namespace", + "nodes": [ + { + "name": "sap.ui5", + "description": "", + "href": "api/sap.ui5" + } + ], + "title": "namespace sap", + "subTitle": "" + }, + { + "name": "sap.ui5", + "displayName": "sap.ui5", + "kind": "namespace", + "nodes": [ + { + "name": "sap.ui5.tooling", + "description": "", + "href": "api/sap.ui5.tooling" + } + ], + "title": "namespace sap.ui5", + "subTitle": "" + }, + { + "name": "sap.ui5.tooling", + "displayName": "sap.ui5.tooling", + "kind": "namespace", + "nodes": [ + { + "name": "sap.ui5.tooling.test", + "description": "

UI5 Tooling Test Library

", + "href": "api/sap.ui5.tooling.test", + "deprecated": true + } + ], + "title": "namespace sap.ui5.tooling", + "subTitle": "" + } + ] + } + ); }); test(".library with docuindex.json reference", async (t) => {