...
To use the interfaces/IDL offered by the server, you need to generate the java stubs on the client side. In this section we are going to cover simple IDL to Java conversions.
A sample Calculator.idl file file for the following exercise is included in <SOAtest installation directory/<version>/eclipse/the <INSTALL>/plugins/com.parasoft.xtestptest.libs.web_<version-date><VERSION>/root/build/examples/CORBACORBA directory. In order to use IDLJ, make sure you have J2SDK installed and set the PATH variable so you can access the J2SDK’s executables from any directory.
To convert IDL to Java using IDLJ, complete the following:
- In
Open a command prompt
, change the current directory to the folder that contains Calculator.idl (In this example C:\Program Files\Parasoft\SOAtest\[SOAtest version number]\eclipse\plugins\and navigate to the <INSTALL>/plugins/com.parasoft.
xtestptest.libs.web_
9.6.0.20130917\root\build\examples\CORBA) - Type: “
idlj –pkgTranslate Persistent examples.CORBA –fall Calculator.idl
” to automatically generate packages with correct paths. <VERSION>/root/build/examples/CORBA directory that contains the Calculator.idl file.
Run the following command to automatically generate packages with correct paths (Windows example):
Code Block language text idlj –pkgTranslate Persistent examples.CORBA –fall Calculator.idl
Run the following command to compile the java files:
Compile the java files by typing: javacCode Block javac ..
/examples/CORBA/*.java.
Now you have the necessary class files needed to communicate with the server. Please continue on to Scenario 2 to interface SOAtest with an existing java client.
...
- Create an external tool by right clicking on the test suite and select Add Test> Standard Test> New Tool> External Tool.
- Select the External tool node and change its name to CORBA Client.
- Click on the Browse button and select the path to the CORBA client executable.
- If CORBA client takes in parameters, add each argument buy by clicking on the ADD button. A new line will get generated, allowing users to input a flag and argument associated with the executable.
- Double-click on the line generated to enter flag and argument. A new dialog box will pop up; change the name and argument accordingly.
- If you wish to use a parameterized value, select Parameterized in the Value drop-down menu and select variable name in the Variable drop-down menu then click OK.
- In the right GUI panel select the Keep output check box to keep the returned values after each test run.
- Right-click the External tool node and select Add Return Value Output> Existing Output> Edit to show the returned values after execution of the test.
- Run the test, if the test succeeds return values should appear in the right GUI panel.
- If the test failed, returning a Null Pointer exception on the edit screen; check the CORBA server and make sure the server is listening on the designated port and that the service is up and running.