1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.rendering.internal.macro.ctsreport

File Test.java

 

Coverage histogram

../../../../../../img/srcFileCovDistChart1.png
82% of files have more coverage

Code metrics

6
11
4
1
102
56
7
0.64
2.75
4
1.75

Classes

Class Line # Actions
Test 32 11 0% 7 19
0.09523819.5%
 

Contributing tests

This file is covered by 3 tests. .

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.rendering.internal.macro.ctsreport;
21   
22    import org.apache.commons.lang3.builder.EqualsBuilder;
23    import org.apache.commons.lang3.builder.HashCodeBuilder;
24    import org.xwiki.text.XWikiToStringBuilder;
25   
26    /**
27    * Represents a Test (name, syntax extension, cts extension, state).
28    *
29    * @version $Id: fe531063af3ae0f755c45a9da2a9d8b62a14b543 $
30    * @since 4.1M2
31    */
 
32    public class Test implements Comparable<Test>
33    {
34    /**
35    * The location where this tests is found in the CTS classpath (eg "cts/simple/bold/bold1").
36    */
37    public String prefix;
38   
39    /**
40    * Test Syntax file extension. To compute the full Syntax test name, use: prefix + syntaxExtension.
41    */
42    public String syntaxExtension;
43   
44    /**
45    * CTS file extension. To compute the full CTS test name, use: prefix + ctsExtension.
46    */
47    public String ctsExtension;
48   
49    /**
50    * The state of the tests (passing, missing, etc).
51    */
52    public State state;
53   
 
54  0 toggle @Override
55    public String toString()
56    {
57  0 return new XWikiToStringBuilder(this)
58    .append("syntaxExtension", this.syntaxExtension)
59    .append("ctsExtension", this.ctsExtension)
60    .append("status", this.state)
61    .append("prefix", this.prefix)
62    .toString();
63    }
64   
 
65  0 toggle @Override
66    public boolean equals(Object object)
67    {
68  0 if (object == null) {
69  0 return false;
70    }
71  0 if (object == this) {
72  0 return true;
73    }
74  0 if (object.getClass() != getClass()) {
75  0 return false;
76    }
77  0 Test rhs = (Test) object;
78  0 return new EqualsBuilder()
79    .append(this.syntaxExtension, rhs.syntaxExtension)
80    .append(this.ctsExtension, rhs.ctsExtension)
81    .append(this.state, rhs.state)
82    .append(this.prefix, rhs.prefix)
83    .isEquals();
84    }
85   
 
86  0 toggle @Override
87    public int hashCode()
88    {
89  0 return new HashCodeBuilder(3, 17)
90    .append(this.syntaxExtension)
91    .append(this.ctsExtension)
92    .append(this.state)
93    .append(this.prefix)
94    .toHashCode();
95    }
96   
 
97  16 toggle @Override
98    public int compareTo(Test test)
99    {
100  16 return this.prefix.compareTo(test.prefix);
101    }
102    }