EMMA Coverage Report (generated Mon Oct 04 21:03:19 MDT 2004)
[all classes][biz.xsoftware.buildtemplate]

COVERAGE SUMMARY FOR SOURCE FILE [VersionImpl.java]

nameclass, %method, %block, %line, %
VersionImpl.java100% (1/1)50%  (1/2)58%  (28/48)58%  (7/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class VersionImpl100% (1/1)50%  (1/2)58%  (28/48)58%  (7/12)
getVersion (): String 0%   (0/1)0%   (0/15)0%   (0/4)
VersionImpl (): void 100% (1/1)85%  (28/33)88%  (7/8)

1/*
2 * Created on Jul 9, 2004
3 *
4 * To change the template for this generated file go to
5 * Window - Preferences - Java - Code Generation - Code and Comments
6 */
7package biz.xsoftware.buildtemplate;
8 
9/**
10 * Miscellaneous class that just prints the version of the mock object jar
11 * getting it from the manifest file.
12 * 
13 * @author Dean Hiller
14 */
15public class VersionImpl implements Version {
16 
17        private Package thePackage;
18                
19        /**
20         * Constructor that takes a class to get the version information
21         * from out of the manifest.  Uses the class's package to retrieve
22         * the manifest version info.
23         * @param c The Class on whose package to use to get version info.
24         */
25        public VersionImpl() {
26                String name = VersionImpl.class.getName();
27                int index = name.lastIndexOf(".");
28                
29                if(index < 0)
30                        throw new RuntimeException("This class is the default package and can't be to use this feature");
31                
32                String packageName = name.substring(0, index);
33                thePackage = Package.getPackage(packageName);
34        }
35        
36        public String getVersion() {
37                String version = thePackage.getImplementationVersion();
38                int index = version.indexOf(" ");
39                version = version.substring(0, index);
40                return version;
41        }        
42}

[all classes][biz.xsoftware.buildtemplate]
EMMA 2.0.4217 (C) Vladimir Roubtsov