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

File DefaultTestDefinition.java

 

Coverage histogram

../../../../../../../img/srcFileCovDistChart9.png
38% of files have more coverage

Code metrics

0
6
6
1
79
39
6
1
1
6
1

Classes

Class Line # Actions
DefaultTestDefinition 36 6 0% 6 2
0.833333383.3%
 

Contributing tests

This file is covered by 15 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 java.util.Collection;
24   
25    import org.xwiki.model.EntityType;
26    import org.xwiki.model.reference.WikiReference;
27    import org.xwiki.security.authorization.testwikis.TestWiki;
28    import org.xwiki.security.authorization.testwikis.TestDefinition;
29   
30    /**
31    * Entity representing the root of the hierarchy, and containing wikis.
32    *
33    * @version $Id: 58ed732dd05921d0ba8e7adc95167a44c9e307da $
34    * @since 5.0M2
35    */
 
36    public class DefaultTestDefinition extends AbstractTestEntity implements TestDefinition
37    {
38    /** Entity representing the main wiki. */
39    private TestWiki mainWiki;
40   
41    /**
42    * Set a given wiki as the main wiki.
43    * @param wiki wiki that should be taken for the main wiki.
44    */
 
45  15 toggle void setMainWiki(TestWiki wiki)
46    {
47  15 mainWiki = wiki;
48    }
49   
 
50  0 toggle @Override
51    public EntityType getType()
52    {
53  0 return null;
54    }
55   
 
56  38 toggle @Override
57    public TestWiki getWiki(String name)
58    {
59  38 return getWiki(new WikiReference(name));
60    }
61   
 
62  119 toggle @Override
63    public TestWiki getWiki(WikiReference reference)
64    {
65  119 return (TestWiki) getEntity(reference);
66    }
67   
 
68  1 toggle @Override
69    public Collection<TestWiki> getWikis()
70    {
71  1 return TypeFilteredCollection.getNewInstance(getEntities(), TestWiki.class);
72    }
73   
 
74  173 toggle @Override
75    public TestWiki getMainWiki()
76    {
77  173 return mainWiki;
78    }
79    }