xzjia / terasoluna-gfw-functionaltest

Functional test for common libraries

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Functional Test of TERASOLUNA Server Framework for Java (5.x) Common Library

This project provides functional tests of TERASOLUNA Server Framework for Java (5.x) Common Library.

Build Status

How to contribute

Contributing (bug report, pull request, any comments etc.) is welcome !! Please see the contributing guideline for details.

Test case design

Test case scenarios are managed at wiki pages.

Note:

Currently, support language is Japanese only. (Will translate to English as soon as possible)

Tested environments at the time of release

Tested environments are managed at wiki page.

How to perform functional test

Preconditions are as follow:

  • JDK 8 or JDK 7 installed (JAVA_HOME defined as environment variable)
  • Maven installed (Can run mvn command)
  • Firefox(for personal or ESR) installed (ESR is used on our CI environment)

[Step 1] Create database of PostgreSQL (Optional)

If PostgreSQL use as database , you need to create database of PostgreSQL into local machine. (PostgreSQL can download via here site).

Note:

If H2 use as database, you can skip this step.

Download & install

By default, database owner is postgres user, and password of postgres user is 'P0stgres'.

Create database

$ createdb -U postgres terasoluna-gfw-functionaltest --locale=C --encoding=UTF8 --template=template0

[Step 2] Clone a repository

Clone the terasolunaorg/terasoluna-gfw-functionaltest repository into local machine.

$ git clone https://github.com/terasolunaorg/terasoluna-gfw-functionaltest.git

[Step 3] Build artifacts

Build artifacts using maven commands as follows.

Case that use embedded H2 as database

$ cd {your repository directory}
$ git checkout {target branch}
$ mvn -U install -am -pl terasoluna-gfw-functionaltest-web

Case that use PostgreSQL as database

$ cd {your repository directory}
$ git checkout {target branch}
$ mvn -U install -am -pl terasoluna-gfw-functionaltest-web -P tomcat8-postgresql,warpack-env,warpack-jstl,travis

Note:

If you not use default user(postgres) or password(P0stgres), you should modify settings in terasoluna-gfw-functionaltest-env/configs/travis/ContainerConfigXML/context.xml.

[Step 4] Initialize database (Optional)

If PostgreSQL use as database, initialize database before run functional test.

$ mvn -U sql:execute -pl terasoluna-gfw-functionaltest-initdb

Note:

If you not use default user(postgres) or password(P0stgres), you should specify -Ddb.username={your user} or -Ddb.password={your password} or both.

[Step 5] Startup Tomcat8 and deploy war file

Startup Tomcat8 and deploy war file using CARGO maven plugin.

Case that use embedded H2 as database

$ cd {your repository directory}
$ mvn -U cargo:run -pl terasoluna-gfw-functionaltest-web

Case that use PostgreSQL as database (use Tomcat JNDI Resource)

$ cd {your repository directory}
$ mvn -U cargo:run -pl terasoluna-gfw-functionaltest-web -P travis

Note:

Shutdown trigger is "Ctrl + C" on console.

[Step 6] Run functional tests

Run tests using Selenium(WebDriver) on JUnit.

$ cd {your repository directory}
$ mvn -U test -pl terasoluna-gfw-functionaltest-selenium

Note:

If functional test is failed, try again using latest Selenium(specify with -Dselenium.version={latest version}).

Appendix

How to use latest or any branch snapshot of Common Library

If latest or any branch snapshot of Common Library want to use, install latest or any branch snapshot before build and test.

Clone terasoluna-gfw repository into local machine

$ git clone https://github.com/terasolunaorg/terasoluna-gfw.git

Install latest or any branch snapshot of Common Library into local machine

$ cd {your repository directory of terasoluna-gfw}
$ git checkout {target branch}
$ mvn clean install

About

Functional test for common libraries


Languages

Language:Java 98.0%Language:CSS 1.4%Language:FreeMarker 0.4%Language:SQLPL 0.2%Language:PLSQL 0.1%Language:HTML 0.0%