Standard Library: Unterschied zwischen den Versionen

Aus expecco Wiki (Version 2.x)
Zur Navigation springen Zur Suche springen
(8 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
== Disclaimer ==

The deployed expecco libraries are constantly improved and new actions are added with every release. Therefore, the following list covers only a small subset of the available functions and is no longer maintained. Please take a look at the actual standard library in your expecco IDE.

== Introduction ==
== Introduction ==
The StandardLibrary contains general domain-independent function blocks. These are useful for any kind of test-development.
The StandardLibrary contains general domain-independent function blocks. These are useful for any kind of test-development.


One of the features which make the StandardLibrary very flexible is the dynamic type system of the underlying implementation language. This allows for the blocks to handle a wide range of possible input values. For example, arithmetic blocks ("Arith [ * ]") all allow for Integers, Floats, LargeIntegers, Fractions, FixedPoint-Decimals and Measurement Values to be used as input (where appropriate). And most of the collection blocks ("Collection [ * ]") can deal with Strings, ByteArrays, Buffer-Data, Arrays, OrderedCollections, Tuples, SortedCollections, Sets, HashTables (Dictionaries) and other collection types. Without such a dynamic type system, many more blocks would be needed for a comparable set of functions (see IEC1131, for example, which uses a similar execution model, but a static type system).
One of the features which make the StandardLibrary very flexible is the dynamic type system of the underlying implementation language. This allows for action blocks to handle a wide range of possible input values. For example, arithmetic blocks ("Arith [ * ]") all allow for Integers, Floats, LargeIntegers, Fractions, FixedPoint-Decimals and Measurement Values to be used as input (where appropriate). And most of the collection blocks ("Collection [ * ]") can deal with Strings, ByteArrays, Buffer-Data, Arrays, OrderedCollections, Tuples, SortedCollections, Sets, HashTables (Dictionaries) and other collection types. Without such a dynamic type system, many more blocks would be needed for a comparable set of functions (see IEC1131, for example, which uses a similar execution model, but a static type system).


The automatic type conversion between Integer and LargeInteger (whenever a value cannot be represented within 32bit) and vice versa, and the automatic conversion of a quotient to a Fraction and the reduction back to an Integer avoid rounding errors and loss of precision.
The automatic type conversion between Integer and LargeInteger (whenever a value cannot be represented within 32bit) and vice versa, and the automatic conversion of a quotient to a Fraction and the reduction back to an Integer avoid rounding errors and loss of precision.
Zeile 11: Zeile 15:
Back to [[Online Documentation#Library_and_Plugin_Overview|Online Documentation]]
Back to [[Online Documentation#Library_and_Plugin_Overview|Online Documentation]]
}}
}}

== Library Overview ==

Notice, that we do not provide full descriptions of all library actions here for two reasons: first, it takes a lot of effort to prepare these pages and they still have a tendency to be outdated or new actions were missing.
Therefore, only a few are actually documented here - please take a look at details inside expecco: for one, the information there is always up-to-date, and second, the information there is usually more detailed, and expecco provides nice search functions (both by name and by expected outcome).


== Numbers ==
== Numbers ==
Zeile 24: Zeile 33:
* [[ Arith Product | '''Arith [ Product ]''' ]]<br/> Product of its numeric input values.
* [[ Arith Product | '''Arith [ Product ]''' ]]<br/> Product of its numeric input values.
* [[ Arith Product+ | '''Arith [ Product+ ]''' ]]<br/> Product of its numeric input values (arbitrary number of input pins) (2.3.0).
* [[ Arith Product+ | '''Arith [ Product+ ]''' ]]<br/> Product of its numeric input values (arbitrary number of input pins) (2.3.0).
* [[ Arith Quotient | '''Arith [ Quotient ]''' ]]<br/> Quotient of its numeric input values.
* [[ Arith Quotient | '''Arith [ Quotient ]''' ]]<br/> Quotient of its numeric input values.<br>May fail due to a Division by Zero exception.
* [[ Arith Modulu | '''Arith [ Modulu ]''' ]]<br/> Remainder from dividing its numeric input values.
* [[ Arith Modulu | '''Arith [ Modulu ]''' ]]<br/> Remainder from dividing its numeric input values.<br>May fail due to a Division by Zero exception.
* [[ Arith Square Root | '''Arith [ Square Root ]''' ]]<br/> The square root.
* [[ Arith Square Root | '''Arith [ Square Root ]''' ]]<br/> The square root.<br>May raise a Domain exception (sqrt negative number).
* [[ Arith RaisedTo | '''Arith [ RaisedTo ]''' ]]<br/> Raising x to the n'th power. n max be a fraction (for roots).
* [[ Arith RaisedTo | '''Arith [ RaisedTo ]''' ]]<br/> Raising x to the n'th power. n may be a fraction (for roots).
* [[ Arith Ln | '''Arith [ Ln ]''' ]]<br/> The natural logarithm (base e).
* [[ Arith Ln | '''Arith [ Ln ]''' ]]<br/> The natural logarithm (base e).<br>May raise a Domain exception.
* [[ Arith Lg | '''Arith [ Lg ]''' ]]<br/> The logarithm base 10.
* [[ Arith Lg | '''Arith [ Lg ]''' ]]<br/> The logarithm base 10.<br>May raise a Domain exception.
* [[ Arith Ld | '''Arith [ Ld ]''' ]]<br/> The logarithm base 2. This could also be computed as: ln(input) / ln(2) (1.7.2).
* [[ Arith Ld | '''Arith [ Ld ]''' ]]<br/> The logarithm base 2. This could also be computed as: ln(input) / ln(2) (1.7.2).<br>May raise a Domain exception.
* [[ Arith_Min and Arith_Max | '''Arith [ Min ]''' ]]<br/> Minimum of its numeric input values.
* [[ Arith_Min and Arith_Max | '''Arith [ Min ]''' ]]<br/> Minimum of its numeric input values.
* [[ Arith_Min and Arith_Max | '''Arith [ Max ]''' ]]<br/> Maximum of its numeric input values.
* [[ Arith_Min and Arith_Max | '''Arith [ Max ]''' ]]<br/> Maximum of its numeric input values.
Zeile 255: Zeile 264:
== Event Queues ==
== Event Queues ==


Contains support for asynchronous event handling. A sample suite is found in "demos/d62_Event_Queue_Demos".
Contains support for asynchronous event handling. A sample suite is found in "<code>demos/d62_Event_Queue_Demos.ets</code>".


==== Overview ====
==== Overview ====
Zeile 263: Zeile 272:
Whenever an event arrives, a handler action is selected and invoked to process the event.
Whenever an event arrives, a handler action is selected and invoked to process the event.
Handler actions are registered by eventType, which is a symbolic tag, attached to every event.
Handler actions are registered by eventType, which is a symbolic tag, attached to every event.
Actions themself are defined as an expecco action, which must take a single input pin,
Actions themself are defined as an expecco action (or JavaScript function or Smalltalk block),
the event to be processed.
which must take a single input, the event to be processed.


==== The Global Event Handler ====
==== The Global Event Handler ====
Zeile 271: Zeile 280:
and initialized at the very beginning of a test run (eg. in a testplan's pre-action, or a suite's post-load-action).
and initialized at the very beginning of a test run (eg. in a testplan's pre-action, or a suite's post-load-action).


There, handlers should be registered for individual event types or a handler for #default, to handle any other type of event.
There, individual actions should be registered for individual event types or an action for #default, to handle any other type of event.


==== Sending Events ====
==== Sending Events ====
Zeile 284: Zeile 293:
* [[EventServer Get Global Server | '''EventServer [ Get Global Server ]''' ]]<br/> Retrieve the global event handling server
* [[EventServer Get Global Server | '''EventServer [ Get Global Server ]''' ]]<br/> Retrieve the global event handling server
* [[EventServer Register Handler | '''EventServer [ Register Handler ]''' ]]<br/> Register a handler action in the global event handling server
* [[EventServer Register Handler | '''EventServer [ Register Handler ]''' ]]<br/> Register a handler action in the global event handling server
* [[EventQueue Create & Push Global Event | '''EventQueue [ Create & Push Global Event ]''' ]]<br/> Push an event onto the global event
* [[EventServer Suspend | '''EventServer [ Suspend ]''' ]]<br/> Suspend event processing
* [[EventServer Resume | '''EventServer [ Resume ]''' ]]<br/> Resume event processing
* [[EventServer Flush | '''EventServer [ Flush ]''' ]]<br/> Flush pending events
* [[EventQueue Create & Push Global Event | '''EventQueue [ Create & Push Global Event ]''' ]]<br/> Push an event onto the global event queue
&nbsp;
&nbsp;



Version vom 14. August 2020, 10:34 Uhr

Disclaimer[Bearbeiten]

The deployed expecco libraries are constantly improved and new actions are added with every release. Therefore, the following list covers only a small subset of the available functions and is no longer maintained. Please take a look at the actual standard library in your expecco IDE.

Introduction[Bearbeiten]

The StandardLibrary contains general domain-independent function blocks. These are useful for any kind of test-development.

One of the features which make the StandardLibrary very flexible is the dynamic type system of the underlying implementation language. This allows for action blocks to handle a wide range of possible input values. For example, arithmetic blocks ("Arith [ * ]") all allow for Integers, Floats, LargeIntegers, Fractions, FixedPoint-Decimals and Measurement Values to be used as input (where appropriate). And most of the collection blocks ("Collection [ * ]") can deal with Strings, ByteArrays, Buffer-Data, Arrays, OrderedCollections, Tuples, SortedCollections, Sets, HashTables (Dictionaries) and other collection types. Without such a dynamic type system, many more blocks would be needed for a comparable set of functions (see IEC1131, for example, which uses a similar execution model, but a static type system).

The automatic type conversion between Integer and LargeInteger (whenever a value cannot be represented within 32bit) and vice versa, and the automatic conversion of a quotient to a Fraction and the reduction back to an Integer avoid rounding errors and loss of precision.    

Back to Online Documentation

Library Overview[Bearbeiten]

Notice, that we do not provide full descriptions of all library actions here for two reasons: first, it takes a lot of effort to prepare these pages and they still have a tendency to be outdated or new actions were missing. Therefore, only a few are actually documented here - please take a look at details inside expecco: for one, the information there is always up-to-date, and second, the information there is usually more detailed, and expecco provides nice search functions (both by name and by expected outcome).

Numbers[Bearbeiten]

Arithmetic[Bearbeiten]

Bit Manipulation[Bearbeiten]

Trigonometric[Bearbeiten]

Misc Math[Bearbeiten]

Modulu Arithmetic[Bearbeiten]

Rounding & Truncation[Bearbeiten]

Assertions, Exceptions & Logging[Bearbeiten]

  • FAIL
    Report a Failure. This means, that the system under test failed a test.
  • FAIL2
    Report a Failure. This means, that the system under test failed a test. Optionally decorate the failure-message with pre-/postFix string.
  • ERROR
    Report an Error. This means, that something unexpected (an error) occurred in the expecco test suite itself. The test suite must be fixed.
  • ERROR2
    Report an Error. Optionally decorate the error-message with pre-/postFix string.
  • INCONCLUSIVE
    Report an Inconclusive state. This means, that we cannot tell, what the test result is.
  • INCONCLUSIVE2
    Report an Inconclusive state. Optionally decorate the message with pre-/postFix string.
  • PASS
    Report a Successful Test. This means, that the system under test passed the test.
  • PASS2
    Report a Successful Test. Optionally decorate the pass-message with pre-/postFix string.
  • OK
    Finish the current Activity and mark it as successful.
  • OK2
    Finish the current Activity and mark it as successful. Optionally decorate the success-message with pre-/postFix string.
  • ABORT
    Finish the current Activity and mark it as aborted.
  • HALT
    Stop end enter the debugger, but only if halts are not ignored in the settings.(1.9.1).
  • PAUSE
    Same effect as pressing the "Pause"-button: pauses the executor. Press "Run" or "Single Step", to continue (1.9.1).

Logging & Messages[Bearbeiten]

Adding Log Entries[Bearbeiten]

Info Messages[Bearbeiten]

  • Information Message
    Show a message in the browser's info area (at the bottom). Useful to provide some progress-feedback to the test-operator. Notice: these messages are not persistent in the generated log report. (in contrast to the Log* blocks)
  • Information Message (Warning)
    Show a warning message in the browser's info area (at the bottom). Useful to provide some progress-feedback to the test-operator. Notice: these messages are not persistent in the generated log report. (in contrast to the Log* blocks)
  • Transcriber
    Displays its input string as a line in the Transcript window. If there is no open Transcript window, a new one will be opened. Useful to provide some feedback to the test-operator. Notice: these messages are not persistent in the generated log report. (in contrast to the Log* blocks)
  • Transcriber without CR
    Displays its input string in the Transcript window like the transcriber, but does not generate a newLine at the end. If there is no open Transcript window, a new one will be opened. Useful to provide some feedback to the test-operator. Notice: these messages are not persistent in the generated log report. (in contrast to the Log* blocks)
  • Show Transcript Window
    Ensure that a transcript window is visible. If there is no existing Transcript window, a new one will be opened.
  • Hide Transcript Window
    Ensure that a transcript window is invisible (iconified). If there is no existing Transcript window, this is a NO-Operation.
  • Clear Transcript Window
    Clears the transcript window. If there is no existing Transcript window, this is a NO-Operation (1.9.1).
  • Contents of Transcript
    Retrieves the contents of the transcript window as a collection of line-strings (1.9.1).
  • Log Start of Testcase on Transcript
    Generates a log message about a started testcase on the Transcript.
  • Log Finish of Testcase on Transcript
    Generates a log message about a finished testcase on the Transcript.

Assertions[Bearbeiten]

Collections[Bearbeiten]

Compare[Bearbeiten]

Many compare blocks come in two versions: one which generates a true/false boolean value (the 1-way blocks) and another, which sends the result to one of two (or three) different outputs. The later are very useful to split the flow of control to different followup blocks (although that behaviour could also be simulated by using a 1-way compare followed by a pass-data block from the "misc" section).

Notice: these blocks allow for Numbers, Strings, Collections and some other types to be compared. However, for the order relation compare operations, the types must be compatible; you cannot mix Numbers with Strings or other there.

  • Compare [ 3-Way ]
    Sends a boolean "true" value to one of its three outputs: LESS, EQUAL or GREATER.
  • Compare [ Equal 2-Way ]
    Compare two values for equality; Send the first value to either the triggerYES or the triggerNO output.
  • Compare [ Less 2-Way ]
    If the input at in1 is less than in2, send it to the triggerYES output. Otherwise, send it to triggerNO.
  • Compare [ Equal ]
    Generate a true if in1 is equal to the input value2 in2; otherwise, generate a false.
  • Compare [ Less ]
    Generate a true if in1 is less than the input value2 in2; otherwise, generate a false.
  • Compare [ Greater ]
    Generate a true if in1 is greater than to the input value2 in2; otherwise, generate a false.

Data Generators[Bearbeiten]

Data Types[Bearbeiten]

Additional Datatypes. No description yet.

Event Queues[Bearbeiten]

Contains support for asynchronous event handling. A sample suite is found in "demos/d62_Event_Queue_Demos.ets".

Overview[Bearbeiten]

The general pattern consists of an event handler process, which runs as a separate thread and reads events from a so-called event queue. Whenever an event arrives, a handler action is selected and invoked to process the event. Handler actions are registered by eventType, which is a symbolic tag, attached to every event. Actions themself are defined as an expecco action (or JavaScript function or Smalltalk block), which must take a single input, the event to be processed.

The Global Event Handler[Bearbeiten]

Although there might be any number of active event handler processes running, typical suites use a single common and globally known handler, which is started and initialized at the very beginning of a test run (eg. in a testplan's pre-action, or a suite's post-load-action).

There, individual actions should be registered for individual event types or an action for #default, to handle any other type of event.

Sending Events[Bearbeiten]

Events can be generated either via regular action blocks, or via calls to the Activity API. The API is available both to internal elementary actions (i.e. Smalltalk and JavaScript actions), and to bridged (i.e. Node or Python) actions.

This makes it possible to communicate asynchronously from processes started inside a Node or Python server process. For example, a communication protocol reader, which may push events on incoming messages, to be processed asynchronously by an expecco action (eg. registered event handler action).

 

Files & Directories[Bearbeiten]

Files[Bearbeiten]

Queries[Bearbeiten]

Creation[Bearbeiten]

Directories[Bearbeiten]

GUI-Dialogs[Bearbeiten]

Inspecting & Debugging[Bearbeiten]

  • Inspect
    Open an inspector window to show some datums contents.
  • Show Image
    Open an image viewer to show some image.
  • Edit Image
    Open a bitmap editor to allow some limited image manipulations.
  • Edit Color
    Open a color editor (useful to inspect picked web-page colors).

Support[Bearbeiten]

Images[Bearbeiten]

Logic[Bearbeiten]

Misc[Bearbeiten]

  • START
    Does nothing, can be used with autostart as a trigger.
  • JOIN
    When ALL inputs are available, continue.
  • Data Sink
    Consume (and throw away) any data from the input pin.
  • Data Source
    Pass its input to its output. Can be used to start a dataflow, if the input is frozen and the block is triggered via autoStart or the START node above.
  • Pass Data if True
    Used to conditionally pass data along a connection or to block/throw it away in other situations.
  • Pass Data if False
    Used to conditionally pass data along a connection or to block/throw it away in other situations.
  • Either - Or
    Passes one of two input values to the output (1.9.1).

Expecco Reflection[Bearbeiten]

These provide info about the state of the tool and execution engine.


  • Current Testplan
    This block provides a handle to the currently executing testplan (1.9.1).
  • Current Testcase
    This block provides a handle to the currently executing testcase (1.9.1).

Reporting[Bearbeiten]

  • Report [ Generate ]
    Generates a report in a specified format for the currently running test execution (1.7.2).

Virtual to Concrete Mapping[Bearbeiten]

Resources[Bearbeiten]

Networking & Interfacing[Bearbeiten]

Checksums & Cryptography[Bearbeiten]

FTP[Bearbeiten]

HTTP[Bearbeiten]

Server[Bearbeiten]

IMAP[Bearbeiten]

JSON[Bearbeiten]

SMTP[Bearbeiten]

Source Code Management[Bearbeiten]

OS[Bearbeiten]

String Processing[Bearbeiten]

Comparing & Matching[Bearbeiten]

Copying[Bearbeiten]

Encoding[Bearbeiten]

Padding & Formatting[Bearbeiten]

Queries[Bearbeiten]


Stream Input/Output[Bearbeiten]

File Streams[Bearbeiten]

Stream Reading[Bearbeiten]

Socket Streams[Bearbeiten]

Internal Streams[Bearbeiten]

Stream Writing[Bearbeiten]

Time & Date[Bearbeiten]

  • Date [ GetDaysInYear]
    Get the number of days in the year which is represented by the given timestamp (365 or 366).

Tools[Bearbeiten]

  • Windows [ Open Document ]
    Ask the Windows shell to open a document. Will start the application that is associated with the file type (1.9.1).

Type Conversion[Bearbeiten]

  • Cast [ String To Any ]
    Convert a string-input to an any-output. Actually, no conversion is done here, this is a simple type cast.

Variables[Bearbeiten]


Back to Online Documentation

Go to Release Notes



Copyright © 2014-2024 eXept Software AG