File: readme.md

package info (click to toggle)
libhibernate-validator-java 4.3.3-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,404 kB
  • sloc: java: 31,882; xml: 6,027; sh: 90; makefile: 28
file content (80 lines) | stat: -rw-r--r-- 3,086 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Performance test for Hibernate Validator

The tests are written as JUnit tests. They can be developed and executed as usual in your IDE. However, they are not
run as unit tests during a _mvn test_. Instead, to execute the performance tests [Apache JMeter](http://jmeter.apache.org/)
and the [chronos-jmeter-maven-plugin](http://mojo.codehaus.org/chronos/chronos-jmeter-maven-plugin) is used.

## Profiles

To allow performance testing of different Hibernate Validator versions there are multiple profiles configured.
Choosing a profile executes the tests against the specified Hibernate Validator version. The defined profiles are:

* hv-4.3 (Hibernate Validator 4.3.0-SNAPSHOT)
* hv-4.2 (Hibernate Validator 4.2.0.Final)
* hv-4.1 (Hibernate Validator 4.1.0.Final)

## Executing the performance tests

Some tips before you start:

* When running the test for the first time (either via the GUI or the command line), the specified JMeter version is
downloaded and extracted into the performance module.
* For JMeter to execute JUnit tests they have to be copied to _\<jmeter_install_dir\>/lib/junit_. This happens automatically
  when _chronos-jmeter:jmetergui_ or _chronos-jmeter:jmeter_ is executed. After the execution the artifacts are removed.
* You need to specify a profile!

### Using the JMeter GUI

To run or configure a test via the GUI you run:

    > mvn chronos-jmeter:jmetergui -P hv-4.3 &

Then open a JMeter test file from _src/jmx_ and run the test.

### Using the maven build

The following command line will run all performance tests found under _src/jmx/_  (_*.jmx_ files):

    > mvn clean package chronos-jmeter:jmeter -P hv-4.3

To generate a report from the test execution run:

    > mvn chronos-jmeter:jmeteroutput chronos-report:report

After the completion of the report generation open:

    > open target/site/performancetest.html

#### Profiling

The pom contains an example on how you can run the tests while attaching a profiler. You will need to uncomment and
adjust the property _profilingOptions_ and make sure it is used in the _chronos-report-maven-plugin_ configuration.

#### Creating reports for all major Validator versions

    > for i in "hv-4.3" "hv-4.2" "hv-4.1"
    > do
    > mvn -P $i clean package chronos-jmeter:jmeter ; mvn chronos-jmeter:jmeteroutput chronos-report:report; open target/site/performancetest.html;
    > done

## Existing tests (work in progress)

At the moment the following tests are defined

### Simple ValidationTest

A simple bean with a random number of failing constraints gets initalized and validated. The test is once executed with
a shared _ValidatorFactory_ and once the factory is recreated on each invocation.

### CascadedValidationTest

Simple bean with cascaded validation ...

### StatisticalValidationTest

A number of _TestEntity_s is created where each entity contains a property for each built-in constraint type and also a reference
to another _TestEntity_. All constraints are evaluated by a single ConstraintValidator implementation which fails a specified
percentage of the validations.