EMMA Coverage Report (generated Sat Jul 01 16:38:45 PDT 2006)
[all classes][jade.jademx.unit]

COVERAGE SUMMARY FOR SOURCE FILE [UnitTestNotificationListener.java]

nameclass, %method, %block, %line, %
UnitTestNotificationListener.java100% (1/1)100% (3/3)92%  (57/62)98%  (11.7/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class UnitTestNotificationListener100% (1/1)100% (3/3)92%  (57/62)98%  (11.7/12)
handleNotification (Notification, Object): void 100% (1/1)88%  (36/41)96%  (7.7/8)
UnitTestNotificationListener (): void 100% (1/1)100% (18/18)100% (3/3)
getNotification (): Notification 100% (1/1)100% (3/3)100% (1/1)

1// jademx - JADE management using JMX
2// Copyright 2005 Caboodle Networks, Inc.
3//
4// This library is free software; you can redistribute it and/or
5// modify it under the terms of the GNU Lesser General Public
6// License as published by the Free Software Foundation; either
7// version 2.1 of the License, or (at your option) any later version.
8//
9// This library is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12// Lesser General Public License for more details.
13//
14// You should have received a copy of the GNU Lesser General Public
15// License along with this library; if not, write to the Free Software
16// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
17 
18package jade.jademx.unit;
19 
20import jade.jademx.agent.JademxAgent;
21import jade.util.Logger;
22 
23import javax.management.Notification;
24import javax.management.NotificationListener;
25 
26/** 
27 * a class to listen for unit test notifications.
28 * @author David Bernstein, <a href="http://www.caboodlenetworks.com"
29 *  >Caboodle Networks, Inc.</a>
30 */
31public class UnitTestNotificationListener implements NotificationListener {
32    
33    // use default constructor
34 
35    /** my logger */
36    private final Logger logger = 
37        Logger.getMyLogger(UnitTestNotificationListener.class.getName());
38    
39    /** interesting notification seen, if any */
40    private Notification notification = null;
41 
42    /* (non-Javadoc)
43     * @see javax.management.NotificationListener#handleNotification(
44     * javax.management.Notification, java.lang.Object)
45     */
46    public void handleNotification( 
47            Notification notification, Object handback ) {
48        String nType = notification.getType();
49        logger.log( Logger.FINE, "received notification of type "+nType);
50        if ( JademxAgent.NOTIF_UNIT_TEST_FAILURE_NAME.equals( nType ) ||
51             JademxAgent.NOTIF_UNIT_TEST_SUCCESS_NAME.equals( nType ) ) {
52            synchronized ( this ) {
53                this.notification = notification;
54                notify();
55            }
56        }
57    }
58 
59    /**
60     * @return Returns the notification.
61     */
62    public synchronized Notification getNotification() {
63        return notification;
64    }
65    
66}

[all classes][jade.jademx.unit]
EMMA 2.0.5312 (C) Vladimir Roubtsov