1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.security.authorization.testwikis.internal.entities

File DefaultTestGroup.java

 

Coverage histogram

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

Code metrics

0
4
3
1
67
25
3
0.75
1.33
3
1

Classes

Class Line # Actions
DefaultTestGroup 36 4 0% 3 2
0.7142857371.4%
 

Contributing tests

This file is covered by 6 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   
21    package org.xwiki.security.authorization.testwikis.internal.entities;
22   
23    import org.xwiki.model.EntityType;
24    import org.xwiki.model.reference.DocumentReference;
25    import org.xwiki.model.reference.EntityReference;
26    import org.xwiki.security.authorization.testwikis.TestEntity;
27    import org.xwiki.security.authorization.testwikis.TestGroup;
28   
29    /**
30    * Entity representing links between groups and users.
31    * Each user keep a collection of these entities for their group membership.
32    *
33    * @version $Id: dd6369229c414832f576e2103dd6969795ac718d $
34    * @since 5.0M2
35    */
 
36    public class DefaultTestGroup extends AbstractTestEntity implements TestGroup
37    {
38    /** The type of reference used by this class. */
39    public static final EntityType TYPE = EntityType.OBJECT;
40   
41    /** The reference to the group this entity link to. */
42    private final DocumentReference groupReference;
43   
44    /**
45    * Create a new link entity for a given group.
46    * @param group serialized reference to the group this entity link to.
47    * @param groupReference reference to the group this entity link to.
48    * @param parent parent entity of this entity.
49    */
 
50  32 toggle public DefaultTestGroup(String group, EntityReference groupReference, TestEntity parent) {
51  32 super(new EntityReference(group, TYPE, parent.getReference()), parent);
52   
53  32 this.groupReference = new DocumentReference(groupReference);
54    }
55   
 
56  0 toggle @Override
57    public EntityType getType()
58    {
59  0 return TYPE;
60    }
61   
 
62  66 toggle @Override
63    public DocumentReference getGroupReference()
64    {
65  66 return groupReference;
66    }
67    }