Application Server Tester

Developer Studio provides an integrated Server Tester to test your applications running on the Application Server. The Server Tester is launched from the Right Mouse Button(RMB) menu on the Application Server node. The Server Tester provides a command window where developers can execute commands against the Service Layer applications using a specific syntax. The syntax is easy to learn since the command window provides extensive code completion functionality which can be activated by pressing Ctrl+Space.

Figure:  RMB Menu on Application Server Node

Syntax

The general syntax for calling a handler's method in the services layer is as follows.

exec HandlerName.HandlerMethod( [Parameters] ).

Note:   Parameters to a method should always be specified in a record format.

Example 1: A simple call to a handler's query method without any condition parameter.

exec MovieBrowser.QueryMovie(FndQueryRecord{})

Example 2: Calling a handler's query method with a condition parameter.

exec MovieBrowser.QueryMovie(FndQueryRecord{Condition = Movie{MovieId = 1};})

Following flags can be set for record attributes.

Depending on the activity handler method you choose to run on Server Tester, the input record state (e.g. 'prepare', 'new', 'modified', 'removed') should be specified.

Example 3: Calling a handler's standard prepare method by setting the record state as 'prepare'.

exec MovieEditor.PrepareMovie(prepare Movie{})

Example 4: Calling a handler's standard save method by setting the record state as 'modified' and relevant attribute(s) as 'DIRTY'.

exec MovieEditor.SaveMovie(modified Movie { MovieId = 1.0, Title = "Inception 3"/DIRTY})

Example 5: Calling a handler's standard save method by setting the record state as 'removed'.

exec MovieEditor.SaveMovie(removed Movie { MovieId = 1.0, ObjVersion = "20110209111437"})

Record status can also be set to aggregates/arrays within the master record.

Example 6: Calling a handler's standard save method which will add detail record to the master.

exec MovieEditor.SaveMovie(modified Movie{Actors = [ new MovieActor{MovieId = 3, ActorId = 1,CharacterName = "Rocky"} ]})

Example 7: Calling a handler method which has array of records as input parameter.(one modified record and one new record)

exec MovieEditor.SaveMovies([modified Movie{MovieId = 3, ActorId = 1,CharacterName = "Rocky" /DIRTY}, new Movie {MovieId = 2 ,Title = "Terminator", ReleaseDate = 1984-10-26 , Genre = "Action"}])

Example 8: Calling a handler's custom method with a parameter view.

exec MovieBrowser.ListMoviesByYear(FndRecord{Year = 2010})

Displaying Results

The results of executed commands will be displayed in a tabbed window below the command window. The result records that are displayed can be copied and used as input records (parameters) for other commands to be executed against the server.

Figure:  Execution Window

Server Tester Toolbar Buttons

Figure:  Server Tester toolbar

Server Tester Navigator is located just below the Project Explorer. All the handlers and their methods will be listed in the Navigator panel. When a handler is expanded, it's handler methods will be listed. Double clicking or using the RMB menu option Create Test Block on a selected handler method will generate appropriate Server Tester commands where the user can enter values for parameters.

Figure:  Server Tester Navigator

RMB menu options in Navigator

Various RMB menu options will be displayed depending on the selected item being a handler or a handler method.

RMB menu option(s) available for handlers are as follows.

RMB menu option(s) available for handler methods are as follows.

Java Source Navigation

Java Source navigation functionality enables the user to navigate to the java implementation source of the relevant handler method. By pressing Ctrl and left mouse button on the handler method will activate the functionality.

Debugging the Services Layer

Services Layer applications can be debugged through Server Tester by executing the server command using the debug button which is available on Server Tester toolbar. Remember to set the required break points in your Java code before invoking the debugger.

Debug Console

Debug console provides lots of information that helps you when debugging. It includes information on Database call traces Server calls, Request data, Response data, Request buffer and Response buffer. It can be launched by pressing in the toolbar.

Figure:  Debug Console


This page is generated from IFS Developer Studio at 2021-08-13 08:49.