Package org.nanocontainer.aop.defaults

Source Code of org.nanocontainer.aop.defaults.KeyEqualsComponentPointcutTestCase

/*****************************************************************************
* Copyright (c) PicoContainer Organization. All rights reserved.            *
* ------------------------------------------------------------------------- *
* The software in this package is published under the terms of the BSD      *
* style license a copy of which has been included with this distribution in *
* the LICENSE.txt file.                                                     *
*                                                                           *
* Idea by Rachel Davies, Original code by various                           *
*****************************************************************************/
package org.nanocontainer.aop.defaults;

import junit.framework.TestCase;
import org.nanocontainer.aop.ComponentPointcut;

/**
* @author Stephen Molitor
*/
public class KeyEqualsComponentPointcutTestCase extends TestCase {

    public void testPicks() {
        ComponentPointcut pointcutA = new KeyEqualsComponentPointcut("a");
        ComponentPointcut pointcutB = new KeyEqualsComponentPointcut("b");

        assertTrue(pointcutA.picks("a"));
        assertFalse(pointcutA.picks("b"));
        assertFalse(pointcutB.picks("a"));
        assertTrue(pointcutB.picks("b"));
    }

    public void testConstructorChecksForNullComponentKey() {
        try {
            new KeyEqualsComponentPointcut(null);
            fail("NullPointerException should have been raised");
        } catch (NullPointerException e) {
        }
    }

}
TOP

Related Classes of org.nanocontainer.aop.defaults.KeyEqualsComponentPointcutTestCase

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.