Package org.jasig.portal.container.services.information

Source Code of org.jasig.portal.container.services.information.StaticInformationProviderImplTest

/* Copyright 2005 The JA-SIG Collaborative.  All rights reserved.
*  See license distributed with this file and
*  available online at http://www.uportal.org/license.html
*/

package org.jasig.portal.container.services.information;

import org.apache.pluto.om.common.ObjectID;
import org.jasig.portal.container.om.common.ObjectIDImpl;

import junit.framework.TestCase;

/**
* Testcase for StaticInformationProviderImpl.
* Currently tests some argument checking on the getPortletDefinition() method.
*/
public class StaticInformationProviderImplTest
    extends TestCase {

    /**
     * Test that getPortletDefinition() throws IllegalArgumentException when
     * invoked on a null argument.
     */
    public void testGetPortletDefForNullGuid() {
        StaticInformationProviderImpl impl = new StaticInformationProviderImpl();
       
        try {
            impl.getPortletDefinition(null);
        } catch (IllegalArgumentException iae) {
            // good.  IllegalArgumentException expected
            return;
        }
        fail("Should have thrown IllegalArgumentException.");
    }
   
    /**
     * Test that getPortletDefinition() throws IllegalArgumentException when
     * invoked on a guid that doesn't contain the required '.' character.
     */
    public void testGetPortletDefForNoDotGuid() {
        StaticInformationProviderImpl impl = new StaticInformationProviderImpl();
        ObjectID objectId = ObjectIDImpl.createFromString("foo");
       
        try {
            impl.getPortletDefinition(objectId);
        } catch(IllegalArgumentException iae) {
            // good.  IllegalArgumentException expected
            return;
        }
        fail("Should have thrown IllegalArgumentException.");
    }
   
   
}
TOP

Related Classes of org.jasig.portal.container.services.information.StaticInformationProviderImplTest

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.