EMMA Coverage Report (generated Tue May 16 15:34:38 CDT 2006)
[all classes][com.mysql.management.util]

COVERAGE SUMMARY FOR SOURCE FILE [Platform.java]

nameclass, %method, %block, %line, %
Platform.java100% (1/1)100% (5/5)100% (74/74)100% (21/21)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Platform100% (1/1)100% (5/5)100% (74/74)100% (21/21)
Platform (PrintWriter): void 100% (1/1)100% (6/6)100% (3/3)
main (String []): void 100% (1/1)100% (9/9)100% (2/2)
platformProps (): List 100% (1/1)100% (26/26)100% (7/7)
report (): void 100% (1/1)100% (5/5)100% (2/2)
report (Collection): void 100% (1/1)100% (28/28)100% (7/7)

1/*
2 Copyright (C) 2004 MySQL AB
3 
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License version 2 as 
6 published by the Free Software Foundation.
7 
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16 
17 */
18package com.mysql.management.util;
19 
20import java.io.PrintWriter;
21import java.util.ArrayList;
22import java.util.Collection;
23import java.util.Iterator;
24import java.util.List;
25 
26/**
27 * @author Eric Herman <eric@mysql.com>
28 * @version $Id: Platform.java,v 1.7 2005/07/27 23:41:27 eherman Exp $
29 */
30public final class Platform {
31    public static final String OS_NAME = "os.name";
32 
33    public static final String OS_ARCH = "os.arch";
34 
35    PrintWriter writer;
36 
37    public Platform(PrintWriter writer) {
38        this.writer = writer;
39    }
40 
41    public void report() {
42        report(platformProps());
43    }
44 
45    void report(Collection propertyKeys) {
46        for (Iterator iter = propertyKeys.iterator(); iter.hasNext();) {
47            String property = (String) iter.next();
48            writer.print(property);
49            writer.print('=');
50            writer.println(System.getProperty(property));
51            writer.flush();
52        }
53    }
54 
55    List platformProps() {
56        List list = new ArrayList();
57        list.add("java.vm.vendor");
58        list.add("java.vm.version");
59        list.add(OS_NAME);
60        list.add(OS_ARCH);
61        list.add("os.version");
62        return list;
63    }
64 
65    public static void main(String[] args) {
66        new Platform(new PrintWriter(System.out)).report();
67    }
68}

[all classes][com.mysql.management.util]
EMMA 2.0.5312 (C) Vladimir Roubtsov