EMMA Coverage Report (generated Tue Nov 24 15:49:41 EST 2009)
[all classes][com.mycompany]

COVERAGE SUMMARY FOR SOURCE FILE [SimpleComponent.java]

nameclass, %method, %block, %line, %
SimpleComponent.java100% (1/1)100% (4/4)83%  (24/29)92%  (11/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SimpleComponent100% (1/1)100% (4/4)83%  (24/29)92%  (11/12)
prepare (): void 100% (1/1)69%  (11/16)83%  (5/6)
SimpleComponent (): void 100% (1/1)100% (6/6)100% (2/2)
doStartService (): void 100% (1/1)100% (3/3)100% (2/2)
doStopService (): void 100% (1/1)100% (4/4)100% (2/2)

1/**
2 * Copyright 2007 ATG DUST Project
3 * 
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * 
7 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
8 * 
9 * Unless required by applicable law or agreed to in writing, software 
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and limitations under the License.
13 */
14 
15package com.mycompany;
16 
17import atg.nucleus.GenericService;
18import atg.nucleus.Nucleus;
19import atg.nucleus.ServiceException;
20import atg.nucleus.logging.ApplicationLogging;
21 
22/**
23 * This is an example class created for the purpose of demonstrating how to
24 * write test code with DUST.
25 * 
26 * Original file name src/main/java/com/mycompany/ToBeTested.java. Renamed it so
27 * we get consisting test class names.
28 * 
29 * 
30 * 
31 * @author adamb
32 * @author robert
33 * 
34 */
35public class SimpleComponent extends GenericService {
36 
37  public boolean isCleanStart = false;
38 
39  // -------------------------
40  /**
41   * Called when this component is started.
42   */
43  public void doStartService() throws ServiceException {
44    prepare();
45  }
46 
47  // -------------------------
48  /**
49   * Called when this component is shut down.
50   */
51  public void doStopService() throws ServiceException {
52    isCleanStart = false;
53  }
54 
55  // -------------------------
56  /**
57   * Checks that Nucleus is running, if its not, then throw a ServiceException.
58   * If Nucleus is running, the log an info message.
59   * 
60   * @throws ServiceException
61   */
62  public void prepare() throws ServiceException {
63    Nucleus n = Nucleus.getGlobalNucleus();
64    if (n == null) {
65      throw new ServiceException("Nucleus is not running.");
66    }
67    else {
68      ((ApplicationLogging) n).logInfo("Prepared.");
69    }
70    isCleanStart = true;
71  }
72}

[all classes][com.mycompany]
EMMA 2.0.5312 (C) Vladimir Roubtsov