1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.extension

File AbstractExtensionScmConnection.java

 

Coverage histogram

../../../img/srcFileCovDistChart8.png
54% of files have more coverage

Code metrics

4
15
6
1
91
49
8
0.53
2.5
6
1.33

Classes

Class Line # Actions
AbstractExtensionScmConnection 31 15 0% 8 6
0.7676%
 

Contributing tests

This file is covered by 10 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.extension;
21   
22    import org.apache.commons.lang3.StringUtils;
23    import org.apache.commons.lang3.builder.HashCodeBuilder;
24   
25    /**
26    * Base class for implementations of {@link ExtensionScmConnection}.
27    *
28    * @version $Id: 6bf72a813c5317da4315eeb8023d049d992f68f5 $
29    * @since 6.3M1
30    */
 
31    public abstract class AbstractExtensionScmConnection implements ExtensionScmConnection
32    {
33    private String system;
34   
35    private String path;
36   
37    /**
38    * @param system the system name
39    * @param path the system specific path
40    */
 
41  48788 toggle public AbstractExtensionScmConnection(String system, String path)
42    {
43  48788 this.system = system;
44  48788 this.path = path;
45    }
46   
 
47  23338 toggle @Override
48    public String getSystem()
49    {
50  23338 return this.system;
51    }
52   
 
53  23338 toggle @Override
54    public String getPath()
55    {
56  23338 return this.path;
57    }
58   
 
59  2 toggle @Override
60    public boolean equals(Object obj)
61    {
62  2 if (obj == this) {
63  0 return true;
64    }
65   
66  2 if (obj instanceof ExtensionScmConnection) {
67  2 ExtensionScmConnection connection = (ExtensionScmConnection) obj;
68  2 return StringUtils.equals(this.system, connection.getSystem())
69    && StringUtils.equals(this.path, connection.getPath());
70    }
71   
72  0 return false;
73    }
74   
 
75  2 toggle @Override
76    public int hashCode()
77    {
78  2 HashCodeBuilder builder = new HashCodeBuilder();
79   
80  2 builder.append(this.system);
81  2 builder.append(this.path);
82   
83  2 return builder.toHashCode();
84    }
85   
 
86  0 toggle @Override
87    public String toString()
88    {
89  0 return getSystem() + ':' + getPath();
90    }
91    }