Skip to main content

Posts

Showing posts from 2014

Testing your Java code in XPages (part 1)

This topic will lead to a series of articles. It depends how deep I will get, but I will try to stay as much general as possible and avoid solutions that work just in my current case. It's all inspired by nice hack that Maks Zhuk showed in his blogpost http://mzhuk.blogspot.com/2014/02/unit-tests-for-lotus-domino-applications.html . Since I want to automate everything, I'll take it step further with Gradle. XPages run on top of a OSGi runtime and so they use system of features and plugins. This can lead to some dependency troubles when you just want to do plain Java work. Christian Guedemann showed how to make this work nicely with Maven http://guedebyte.wordpress.com/2014/04/07/automated-build-with-jenkins-some-progress/ . Sadly Gradle can't read p2 update sites, which can Maven do using Tycho plugin. Even when you try to Mavenize it in some standard way like using eclipse:to-maven, I couldn't use it afterwards since some plugins contain jars as libs in them (pro...

Building XPages with Jenkins video

Few people told me that all this automated building is definitely nice, but they don't get why they should bother. I decided to record my test Jenkins machine, so it might show them what is this all good for - it's doing work for them (so you can show this to your boss and tell him/her you will be more efficient if you use such tools). Anyway, this video just runs project from previous post using Jenkins. At first I committed my code with an error that is later detected using Selenium test (it returns 300 instead of 200) Then I fixed it (using notepad) and committed again   I did few cuts in the video, because often not much happens. I hope this will bring more XPages projects to Jenkins or any other CI tool. final note - I really haven't touched that machine. No keyboard shortcuts :)

Gradle Domino testing

I mentioned in previous post that once you have db on server, you can easily test your app using Selenium. Here is proof for that: Download following sample project https://bitbucket.org/pradnik/gradledominosample Adjust server names in build.gradle files (for sake of simplicity I just had it there) run gradle buildToServer test And let the magic happen. What it does? Creates local nsf from on disk project Copies nsf to server Runs Selenium test using TestNG on this app App is really simple. Just one calculation using viewScope, but good enough for demonstration.

More Gradle goodness for Domino

I created new release of plugin for integration of headless Domino Designer into Gradle builds. Biggest changes are: Rename to Gradle Domino Plugin (most projects around are named after Domino not Notes, so I wanted to keep it aligned) Added basic error checking and output from HEADLESS.log Task for NSF copying build-in tasks in plugin for building nsf and copying to server  All changes follow Gradle convention over configuration paradigm, so usage is now even easier. Since I renamed the project I also renamed repostiory to https://bitbucket.org/pradnik/gradledominoplugin (sorry for any troubles) .   Access to Domino API One of most important improvements is introduction of DominoAPITask that can wrap any other task that call Domino Java API. For these operation you need to add Notes.jar to your configuration, so it can call required libs. Also you may need to add Notes programm directory to system PATH to find required DLLs. In future I'll probably add OpenN...

Build XPages app from Git with Jenkins

Since introduction of Headless designer tech-preview in Domino Designer 9.0.1 many people started to think about build automation. Now is time to try it with Jenkins - popular free build automation server. I've used Gradle as a build tool, which uses Groovy language. So some G-stuff which all the cool kids use in their projects (I always wonder why so many project names start with G even when they are not in direct relation to Google). *disclaimer* Most of these tools I haven't used in production, so I might break some best practices and take other shortcuts. Also all code is written just as a proof of concept, nothing more. *end of disclaimer* Required tools: Windows machine Java JDK GIT Domino Designer 9.0.1 Jenkins Git repository - bitbucket in my case Jenkins setup I did use Jenkins installation with GIT and Gradle plugin. If you are new to Jenkins, there are many tutorials online how to setup Jenkins. Recent tutorials for Android app builds use Gradle ...