This testsuite will test all JBoss DataGrid S2I application templates which are:
- datagrid65-basic.json
- datagrid65-https.json
- datagrid65-mysql-persistent.json
- datagrid65-mysql.json
- datagrid65-postgresql-persistent.json
- datagrid65-postgresql.json
For all JDG tests some data is added into the cache then it is verified to make sure it was successfully added. The tests are done using the following methods:
The example below shows how an entry is added in the cache then retreived again, example using HotRod:
RemoteCacheManager cacheManager = new RemoteCacheManager(
new ConfigurationBuilder()
.addServer()
.host(host).port(port)
.build()
);
RemoteCache<Object, Object> cache = cacheManager.getCache("default");
cache.put("foo3", "bar3");
assertEquals("bar3", cache.get("foo3"));
The Ce-Testsuite uses the ce-arq which is a API that allow us to test our application templates in a running OpenshiftV3 instance. To run the tests you need:
- Maven 3 or higher
- Java 7 or higher
- Openshift V3 or higher
The CE-Testsuite is divided by profiles, to enable the JDG profile all you need to do is to use the following maven parameter:
-Pjdg
- -Pprofile_name
- -Pjdg
- -Dkubernetes.master=address of your running OSE instance (master note)
- -Dkubernetes.master=https://openshift-master.mydomain.com:8443
- -Dkubernetes.registry.url=the registry address running in your ose instance
- -Dkubernetes.registry.url=openshift-master.mydomain.com:5001
- -Ddocker.url=Docker url address
- -Ddocker.url=https://openshift-master.mydomain.com2375
- -Drouter.hostIP=The OSE router IP
- -Drouter.hostIP=192.168.1.254
- You can change this parameter name in the pom.xml
- -Drouter.hostIP=192.168.1.254
- -Dtest=The test class name, if you want to run only one test, otherwise all tests will be executed
- -Dtest=JdgMysqlTest
- -Dkubernetes.ignore.cleanup=true (default is false), It will ignore the resources cleanup, so you can take a look in the used pods to troubleshooting
All those are java parameters, so use -D.
For this example we'll consider the IP address 192.168.1.254 for required parameters, Example:
$ mvn clean package test -Pjdg -Dkubernetes.master=https://192.168.1.254:8443 -Dkubernetes.registry.url=192.168.1.254:5001 -Ddocker.url=http://192.168.1.254:2375 -Drouter.hostIP=192.168.1.254
Example:
$ mvn clean package test -Pjdg -Dkubernetes.master=https://192.168.1.254:8443 -Dkubernetes.registry.url=192.168.1.254:5001 -Ddocker.url=http://192.168.1.254:2375 -Drouter.hostIP=192.168.1.254 -Dtest=JdgMysqlTest -Dkubernetes.ignore.cleanup=true
This test covers all basic operations to make sure the docker image generated by the used application templates will work as expected, it will do basic operations against the available services, Rest, Memcached and HotRod, which include:
- Add values in the cache
- Retrieve values from cache
- Test with cache persisted on databases (MySQL ans PostgreSQL)
- Test with persistent databases
The tests are also executed using SSL.
Please, feel free to report the issue that you found here.
For feedbacks please send us an email ([email protected]) and let us know what you are thinking.