Coverage Test Results


Class sampleproject.util.GlobalProperties

NameProbesExecutedCoverage
GlobalProperties700.00%

Methods

NameProbesExecutedCoverage
<init>()V100.00%
<init>(Ljava/util/Properties;)V100.00%
getGlobalProperties()Lsampleproject/util/GlobalProperties;200.00%
setDefaultProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;100.00%
store(Ljava/io/OutputStream;Ljava/lang/String;)V100.00%
<clinit>()V100.00%

Source

1
/* Created or Modified by J.M. Kruithof jmkf@users.sourceforge.net (c) 2002,
2
 * This software may be based in whole, in part or not at all on software
3
 * contributed to the Apache Software Foundation. It is licensed under exact
4
 * the same license.
5
 * The Apache Software foundation may or may not consider this software
6
 * a voluntary contribution. This is at the opinion of the Apache Software
7
 * foundation.
8
 *
9
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
10
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
11
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
12
 * DISCLAIMED.  IN NO EVENT SHALL THE CONTRIBUTORS OF THIS SOFTWARE
13
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
14
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
15
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
16
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
17
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
18
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
19
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
20
 * SUCH DAMAGE.
21
 *
22
 * Licensed under the following conditions:
23
 */
24
/*
25
 * The Apache Software License, Version 1.1
26
 *
27
 * Copyright (c) 2000 The Apache Software Foundation.  All rights
28
 * reserved.
29
 *
30
 * Redistribution and use in source and binary forms, with or without
31
 * modification, are permitted provided that the following conditions
32
 * are met:
33
 *
34
 * 1. Redistributions of source code must retain the above copyright
35
 *    notice, this list of conditions and the following disclaimer.
36
 *
37
 * 2. Redistributions in binary form must reproduce the above copyright
38
 *    notice, this list of conditions and the following disclaimer in
39
 *    the documentation and/or other materials provided with the
40
 *    distribution.
41
 *
42
 * 3. The end-user documentation included with the redistribution, if
43
 *    any, must include the following acknowlegement:
44
 *       "This product includes software developed by the
45
 *        Apache Software Foundation (http://www.apache.org/)."
46
 *    Alternately, this acknowlegement may appear in the software itself,
47
 *    if and wherever such third-party acknowlegements normally appear.
48
 *
49
 * 4. The names "The Jakarta Project", "Ant", and "Apache Software
50
 *    Foundation" must not be used to endorse or promote products derived
51
 *    from this software without prior written permission. For written
52
 *    permission, please contact apache@apache.org.
53
 *
54
 * 5. Products derived from this software may not be called "Apache"
55
 *    nor may "Apache" appear in their names without prior written
56
 *    permission of the Apache Group.
57
 *
58
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
59
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
60
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
61
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
62
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
63
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
64
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
65
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
66
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
67
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
68
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
69
 * SUCH DAMAGE.
70
 * ====================================================================
71
 *
72
 * This software consists of voluntary contributions made by many
73
 * individuals on behalf of the Apache Software Foundation.  For more
74
 * information on the Apache Software Foundation, please see
75
 * <http://www.apache.org/>.
76
 */
77

78
package sampleproject.util;
79

80
import java.util.Properties;
81

82
/**
83
 *
84
 * @author  jkf
85
 * @version 
86
 */
87
public class GlobalProperties extends Properties {
88

89
    private static GlobalProperties theGlobalProperties = null; 
90
    /** Creates new globalProperties */
91
    private GlobalProperties() {
92
    }
93
    
94
    private GlobalProperties(Properties theDefaults) {
95
        super (theDefaults);
96
    }
97
    
98
    public final static GlobalProperties getGlobalProperties() {
99
        
100
        if (theGlobalProperties == null) {
101
            theGlobalProperties = new GlobalProperties(
102
                                        new Properties(System.getProperties()));
103
        }
104
        
105
        return theGlobalProperties;
106
    }
107

108
    public Object setDefaultProperty(String key, String value) {
109
        return defaults.setProperty(key,value);
110
    }   
111

112
    public void store(java.io.OutputStream out, String header) throws 
113
                                                             java.io.IOException
114
    {
115
        defaults.store(out,header);
116
        super.store(out,header);
117
    }
118
}