Skip to content

Instantly share code, notes, and snippets.

Last active December 18, 2015 02:38
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save corinnekrych/5712058 to your computer and use it in GitHub Desktop.
MarJUG proposal


Server wants to push notification to client. How to provide an unified way of pushing notification? Aerogear Unified push. See spec for explanation.

You want to contribute to this effort? What about writing functional tests! Yes... It's fun it's with Spock.

If you want to try it

Let's setup your environment for pushee (unified push server) + simplePush Note that this is a work in progress.

=> Install pushee and run it

git clone
cd pushee
mvn package jboss-as:deploy
./bin/ -b

=> Register app: send te curl described here

curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"name" : "MyApp", "description" :  "awesome app" }' http://localhost:8080/ag-push/rest/applications

=> Register variant for app id: get id from previous response and send curl

curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"pushNetworkURL" : "http://localhost:7777/endpoint/"}' http://localhost:8080/ag-push/rest/applications/{PUSH_ID}/simplePush 

Keep you variant id, you will use it later! Note that all thoses ids (push app id + variant id) are stored in database. Even restarting your server you won't need to do thoses steps again.

=> Modify HTML page with variant id

vi pushee/src/main/webapp/websocket.html

Enter your variant id

<!-- Config for AeroGear.SimplePush -->
    var AeroGearSimplePush = {
        ariantID: "402881ef3ea36c3e013ea36c8de90001"

=> Rebuid and redeploy

cd pushee
mvn package jboss-as:deploy    

=> Clone SimplePush

git clone

=> SimplePush required vert.x to build

git clone
cd vert.x
./gradlew install

If you run into the same problems I had here is my tip

=> SimplePush required netty-component

git clone
cd netty-subsystem
mvn install

=> Build SimplePush

cd aerogear-simplepush-server
mvn install

=> Launch SimplePush

mvn exec:java -Dexec.args="8888 false 10000 60000"

=> send msg using web interface


Set up test env

=> fork or clone Karels's repo

git clone

Note You should install pushee-integration-tests as a sibling of pushee. Those two need each other.

=> follow requirements section on readme. To sum up you will need to clone and build those

git clone
cd arquillian-testrunner-spock
git checkout spock-0.7-update
mvn install
cd ..
git clone
cd resolver
mvn install

I had to update pon.xml file of shrinkwrap and rolllbact to previous version


=> Once all pre-requisites are done, launch integration test(s)

cd pushee-integration-tests
mvn verify

as you can see there is only one test. Time to contribute!

Write tests

We going to write in-container tests using arquillian + Spock.

If your favorite IDE is Intellij, add the property Configure test... in VM option add:


in working directory set the path to your current module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment