Personal tools
You are here: Home CinnamonClient Java Client Library Safran

Safran

Safran is the Java Client Library for Cinnamon

Checkout

Safran is available from a Subversion repository:

https://cinnamon.svn.sourceforge.net/svnroot/cinnamon/CinnamonClient/Safran

You can check it out with the following command:

 svn co https://cinnamon.svn.sourceforge.net/svnroot/cinnamon/CinnamonClient/Safran/. Safran/.

Configuration

Create a configuration file called config.properties in the Safran/src folder:

server=172.16.131.130
port=8080
path_to_servlet=/cinnamon
server.url=http://172.16.131.130:8080/cinnamon/cinnamon
server.username=admin
server.password=admin

# used by Setup script to determine which database to initialize / use
default_repository=cmn_test
tomcat_manager=tomcat_manager_account_name
tomcat_password=tomcat_manager_password
tomcat_manager_reload=/manager/html/reload

# Set the jdbcDriver to your local database driver type before
# running CustomTableTest
customTableTest.jdbcDriver=org.postgresql.Driver

If you are going to use Eclipse, place this in the Safran/ folder instead.

Please note: Safran is a library, not a full featured client. It supports most of the Cinnamon server commands and is used in testing whether they are fully implemented on the server.

Compile

Copy the Server/build.xml.example to build.xml into the parent folder of Safran.

You can build the client lib with:

ant clean compile.safran dist

Testing

You can run the testsuite inside the Safran folder with the following command:

java -ea -jar testng-5.9-jdk15.jar -testjar safran.jar

Note that the test classes will always reload the servlet to recreate the cmn_test database, which will exhaust the PermGen-Space of the Tomcat JVM after some time. If you encounter this problem, restart Tomcat with

sudo /etc/init.d/tomcat6 restart

Sometimes a second restart is needed if the Cinnamon servlet is not started correctly. Sometimes, the jsvc process refuses to restart for no apparent reason on Ubuntu Linux, so there may be a Java / jsvc process running with 100% CPU which needs to be killed manually.

Document Actions