Standard Library

Aus expecco Wiki (Version 2.x)
Wechseln zu: Navigation, Suche

Introduction

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).

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.    

Vorlage:Noprint

Numbers

Arithmetic

Bit Manipulation

Trigonometric

Misc Math

Modulu Arithmetic

Rounding & Truncation

Assertions, Exceptions & Logging

  • 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

Adding Log Entries

Info Messages

  • 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

Collections

Compare

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 releation 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 [ Greater 2-Way ]
    If the input at in1 is greater than in2, send it to the triggerYES output. Otherwise, send it to triggerNO.
  • Compare [ Equal ]
    Generate a true if in1 is qual 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

Data Types

Additional Datatypes. No description yet.


Files & Directories

Files

Queries

Creation

Directories

GUI-Dialogs

Inspecting & Debugging

  • 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

Images

Logic

Misc

  • 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

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

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

Virtual to Concrete Mapping

Resources

Networking & Interfacing

Checksums & Cryptography

FTP

HTTP

Server

IMAP

JSON

SMTP

Source Code Management

OS

String Processing

Comparing & Matching

Copying

Encoding

Padding & Formatting

Queries


Stream Input/Output

File Streams

Stream Reading

Socket Streams

Internal Streams

Stream Writing

Time & Date

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

Tools

  • 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

  • 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


Vorlage:Noprint



Copyright © 2014-2016 eXept Software AG