FitNesse: How to test SOAP web service? - soap

I am new to FitNesse acceptance testing. My requirement is to test a SOAP web service with FitNesse. I installed fitnesse-standalone.jar and am able to run simple calculation tests.
I read that by using hsac-fitnesse-fixtures, we can test the SOAP web services.
I‘ve downloaded the hsac-fitnesse-fixtures-2.7.0.jar. I don't where should I place the .jar file in my existing FitNesse software folder? I tried creating a folder with fixtures inside FitnesseRoot and placing the hsac-fitnesse-fixtures-2.7.0.jar inside of it.
I wrote a script, but it's not working:
!define TEST_SYSTEM {slim}
!path C:/Fitnesse/fitnesse-standalone.jar
!path fixtures/*.jar
!path
C:/Fitnesse/FitnesseRoot/fixtures/hsac-fitnesse-fixtures-2.7.0.jar
!path fixtures/*
|Import|
| nl.hsac.fitnesse.fixture.slim|
!|XmlHttpTest |
|script|xml http test |
|post |mypostbody |
|to |myserviceurl |
|check |response|status|200|
|show |response |
What is the working code/script to test SOAP web services using hsac-fitnesse-fixtures?

The easiest way is not separately downloading all components (finesse-standalone, hsac-fitnesse-fixtures, etc) but to downloaded the package containing it all fully setup (the standalone zip in the project) from the project's releases page in GitHub. For the current release it can be found at: https://github.com/fhoeben/hsac-fitnesse-fixtures/releases/download/2.7.1/hsac-fitnesse-fixtures-2.7.1-standalone.zip
The releases page contains (minimal) instructions how to use it:
To get started by running some sample tests (if you have a Java
runtime installed):
just download the standalone.zip,
extract it and
run it (using 'java -jar fitnesse-standalone.jar -p 9090', or on Windows just double clicking the jar to run the application on port 80
instead of 9090) from the directory where the 'standalone.zip' was
extracted and
open a browser to http://localhost:9090/HsacExamples.
A sample similar to what you post in your question can then be found at: http://localhost:9090/HsacExamples.SlimTests.HttpTests.HttpPost1Test
To make a similar test in a Suite (folder) of your own (e.g. SoapTests.FirstCall) you need to set up a couple of FitNesse basics:
in the parent page (e.g. SoapTests). You need to add:
!path fixtures
!path fixtures/*.jar
!pomFile ../pom.xml#compile
!define TEST_SYSTEM {slim}
Add a setup page for the suite (e.g. SoapTests.SuiteSetUp) containing:
|Import |
|nl.hsac.fitnesse.fixture |
|nl.hsac.fitnesse.fixture.slim |

Related

How to avoid mixed output files with MSBuild?

I have a C# big project in Visual Studio 2013 that is formed by:
3 Web projects
2 Windows Services project
14 Dlls projects
2 Test projects
1 Database Project (.sqlproj)
As you can guess the final files are:
3 Web Projects
2 Windows Services
Database
I build it with msbuild.exe invoked from PowerShell.
$msbuild="C:\windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe"
$option0 = 'FOO.sln /t:Clean,Rebuild /p:Configuration=Debug /p:Outdir=$outputdir'
iex "$msbuild $option0" | tee C:\TFS\Oscar\Build\oscar.txt
The project builds and in the output folder I have a nice directory called _PublishedWebsites that contains the three websites, one in each directory. From here it wouldn't be complicated to deploy to servers using PowerShell.
In outputdir I have my FooDB.dacpac so I can easily use sqlpackage to deploy it to SQL Server.
My problem is with Windows Services. Instead of being in a folder they are in output folder, mixed with all DLLs, sqlproj files, test files.
Is there any way of having them in a folder similar to "_PublishedWebsites"?
I can copy all files to each windows service folder on deploy and will work... but feels wrong...
YES! You can actually use MSDeploy which is the underlying technology for WebDeploy to create a similar deployment package for a Windows service or scheduled task.
The basic steps are
extend MSBuild to zip up the files into a package
add pre/post sync commands
create a deploy cmd to execute the package
https://dotnetcatch.com/2016/03/18/deploy-non-web-apps-with-msdeploy/
We've been using the nuget package PublishedApplications in in our Windows Service projects (which are actually just Console Apps using TopShelf ).
As a result, we get a nicely packaged app in the output folder {OutDir}/_PublishedApplications/{appName} (next to {OutDir}/PublishedWebSites) for those services.
I'm still looking for a way to get a similar behavior for *.sqlproj projects ...

Building .car ColdFusion Archive from command-line

The current way I'm packaging my application is to deploy it on a running ColdFusion server, and export is as a .car (Coldfusion ARchive) through the admin console, but this manual process is usually prone to errors.
That's why I'm looking for a tool (or any solution) to build this final .car from the command line (so without requiring a ColdFusion server up and running).
Note: because of the complexity and the size of this legacy application, I cannot work with .war files, and I'm not aware of any other packaging format than .war or .car for ColdFusion applications.
Hi unfortunately Coldfusion is not built to use in this way but you can use API or the admin console.
I invite you to read this page : http://help.adobe.com/en_US/ColdFusion/10.0/Admin/WSc3ff6d0ea77859461172e0811cbf3638e6-7fc5.html for more details.
From coldfusion 9 servers, CAR files are zip files. You can unzip them, edit the files, and zip them back up and deploy them on coldfusion10 servers. The zip contains a folder called "{WorkingDir}" with curly brackets.
Structure looks like
{WorkingDir}
server_settings.xml
archive_settings.xml

Generate code from deployed files

I had mistakely deleted my web services code. I don't have any backup of this code. Tried some file recovery tools but it didn't work. I have deployed the project in glass fish 4.0 server and the application works fine from there. So I am thinking is there any way I can generate the codes of that webservice?
Thank you
If you have the application deployed in your glassfish server then it is possible. You can always find your the .class files of original codes (not the one compiled by SEI) inside your domain folder of glassfish. Then you can use some third party tools to generate java codes from the class files. There are to ways that you can deploy your application in the glass fish server:-
By using the glass fish server web GUI and deploy it.
By using exernal IDE like eclipse where you create the glassfish server and deploy it.
For condition 1, goto :-
glassfish\domains\domain1\applications\__internal
where domain1 is your domain name. By default it is the name of your domain
For condition2, goto:-
glassfish4\glassfish\domains\domain1\eclipseApps
where domain1 is your domain name. By default it is the name of your domain
You can find your java codes inside WEB-INF\classes inside your project name.
Hope this helps.

Unable to create a client stubs for a web service

I am trying to learn web service development using JAX-WS.
I am trying out this tutorial.
I am able to create and run web service correctly and I got WSDL file when I hit the link http://localhost:8080/WS/Greeting?wsdl. However at step 5 of creating client stub using wsimport as follows:
CD %CLIENT_PROJECT_HOME%\src
wsimport –s . http://localhost:8080/WS/Greeting?wsdl
I am getting error as follows:
Let's see this are the options and meanings:
-s: Specifies where to generate the SOURCES
-d: Specifies where to generate the CLASSES
-keep: Says to KEEP the sources
-p: Specifies a package
Now, you were using a "." to specify the source output, that may generate the problem. If your output folder is the current one, specify nothing.
Read here for wsimport documentation and for other tutorial for its usage use this.

Error when attempting to deploy a WAR to Glassfish 3 using an Ant Build Script

I am investigating how to use both Glassfish and Ant buildfiles. I've written a build script (for the first time) which will create a WAR file of my basic Hello World app.
I am then trying to deploy this WAR to Glassfish as part of the build script. I found details of the glassfish-deploy task and have managed to get this included in the build script after including the ant-task jar file in the class path.
However, when I run the script I get the message:
[glassfish-deploy] Install Directory of application server not known. Specify either the installDir attribute or the asinstall.dir property
I've tried to find out what is meant by this, but can find no reference to either the installDir attribute or the asinstall.dir property. I have managed to deploy the created WAR file through Glassfish's admin webpage but I cannot seem to get this Ant script to do it successfully.
Any pointers or guidance would be most helpful.
OKay after a lightbulb moment I managed to resolve this by editing the task in my build script so it is now <glassfish-deploy file="${name}.war" installDir="C:\\glassfish3\\glassfish" force="true"/>
As it appears that the ant script does not know where Glassfish is installed. This resolves the issue and the script runs (and workds) However the next stage is to figure out how to do this without having to hardcode the location into into the build script. Especially if I want to write a script that can deploy the WAR file to a remote server.