For unit testing, it is possible to run the swDBServer as a commandline with arguments that tell which database it should run against, or you can run StartEmbeddedServer which provides high performance for the testing. StartEmbeddedServer can be run with the in-memory option so that it starts with a completely empty database. You can then write your own code that feeds it with meta-data and data. This works very well for isolated unit tests. Because it is in-memory, it also executes the tests much faster.
Note: The embedded server has no threads. You can do a call and get an event, and write, e.g., a test on it. There is only one connection on the embedded server and it is running on the same process in the calling thread. It will not behave the same as a real server with respect to multiple connections and collaboration, etc. It has no life on its own. |
Prerequisites
- SystemWeaverEmbeddedServer.dll which is available in both a 32-bit (SystemWeaverEmbeddedServer.dll and 64-bit (SystemWeaverEmbeddedServer64.dll) versions. The version should match the version of your testing program.
- If working with Description text, you will also need RVFUtility.dll (32-bit) or RVFUtility64.dll (64-bit) which is needed for conversion between RTF and RVF text formats.
The above mentioned files are included in all standard deliveries. Contact your IT responsible if you would like to obtain them.
Once you have a prepared database with metadata and data, you can run the embedded server against it. When all the tests are finished, you can shut down the server (send close) and discard the database so that the next time you run, you restart with original data.