jicarilla-sandbox/platform/container-integration/src/test/org/jicarilla/container/test/integration/pico AbstractPicoAllInTheFamilyTestCase.java,NONE,1.1 DefaultPicoAllInTheFamilyTestCase.java,NONE,1.1 JicarillaBasedPicoAllInTheFamilyTestCase.java,NONE,1.1 PicoContainerLazinessTestCase.java,NONE,1.1 PicoContainerMultiConstructorTestCase.java,NONE,1.1 PicoContainerTestCase.java,NONE,1.1

[email protected]
Newsgroups gmane.comp.java.jicarilla.cvs
Message-ID <[email protected]>
Update of /cvsroot/jicarilla/jicarilla-sandbox/platform/container-integration/src/test/org/jicarilla/container/test/integration/pico
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19900/container-integration/src/test/org/jicarilla/container/test/integration/pico

Added Files:
	AbstractPicoAllInTheFamilyTestCase.java 
	DefaultPicoAllInTheFamilyTestCase.java 
	JicarillaBasedPicoAllInTheFamilyTestCase.java 
	PicoContainerLazinessTestCase.java 
	PicoContainerMultiConstructorTestCase.java 
	PicoContainerTestCase.java 
Log Message:
split out integration code from the main container project

--- NEW FILE: AbstractPicoAllInTheFamilyTestCase.java ---
/* ====================================================================
The Jicarilla Software License

Copyright (c) 2003 Leo Simons.
All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
==================================================================== */
package org.jicarilla.container.test.integration.pico;

import org.jicarilla.container.tck.AbstractAllInTheFamilyTestCase;
import org.jicarilla.container.tck.components.interfaces.Bart;
import org.jicarilla.container.tck.components.interfaces.Homer;
import org.jicarilla.container.tck.components.interfaces.Lisa;
import org.jicarilla.container.tck.components.interfaces.Maggie;
import org.jicarilla.container.tck.components.interfaces.Marge;
import org.jicarilla.container.tck.components.interfaces.Script;
import org.jicarilla.container.tck.components.type3.rich.AllInTheFamilyScript;
import org.jicarilla.container.tck.components.type3.rich.BartImpl;
import org.jicarilla.container.tck.components.type3.rich.HomerImpl;
import org.jicarilla.container.tck.components.type3.rich.LisaImpl;
import org.jicarilla.container.tck.components.type3.rich.MaggieImpl;
import org.jicarilla.container.tck.components.type3.rich.MargeImpl;
import org.picocontainer.MutablePicoContainer;

/**
 * 
 *
 * @author <a href="lsimons at jicarilla dot org">Leo Simons</a>
 * @version $Id: AbstractPicoAllInTheFamilyTestCase.java,v 1.1 2004/03/08 21:05:26 lsimons Exp $
 */
public abstract class AbstractPicoAllInTheFamilyTestCase
        extends AbstractAllInTheFamilyTestCase
{
    protected MutablePicoContainer pc;

    protected abstract MutablePicoContainer getContainer();

    public void setUp() throws Exception
    {
        pc = getContainer();
        doPopulate();
        super.setUp();
    }

    protected void doPopulate()
    {
        pc.registerComponentImplementation( HomerImpl.class );
        pc.registerComponentImplementation( MargeImpl.class );
        pc.registerComponentImplementation( BartImpl.class );
        pc.registerComponentImplementation( LisaImpl.class );
        pc.registerComponentImplementation( MaggieImpl.class );
        pc.registerComponentImplementation( AllInTheFamilyScript.class );
    }

    protected AllInTheFamilyScript getScript()
    {
        return (AllInTheFamilyScript)pc.getComponentInstance( Script.class );
    }

    protected Homer getHomer()
    {
        return (Homer)pc.getComponentInstance( Homer.class );
    }

    protected Marge getMarge()
    {
        return (Marge)pc.getComponentInstance( Marge.class );
    }

    protected Bart getBart()
    {
        return (Bart)pc.getComponentInstance( Bart.class );
    }

    protected Lisa getLisa()
    {
        return (Lisa)pc.getComponentInstance( Lisa.class );
    }

    protected Maggie getMaggie()
    {
        return (Maggie)pc.getComponentInstance( Maggie.class );
    }
}

--- NEW FILE: DefaultPicoAllInTheFamilyTestCase.java ---
/* ====================================================================
The Jicarilla Software License

Copyright (c) 2003 Leo Simons.
All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
==================================================================== */
package org.jicarilla.container.test.integration.pico;

import org.picocontainer.MutablePicoContainer;
import org.picocontainer.defaults.DefaultPicoContainer;

/**
 * 
 *
 * @author <a href="lsimons at jicarilla dot org">Leo Simons</a>
 * @version $Id: DefaultPicoAllInTheFamilyTestCase.java,v 1.1 2004/03/08 21:05:26 lsimons Exp $
 */
public class DefaultPicoAllInTheFamilyTestCase
        extends AbstractPicoAllInTheFamilyTestCase
{
    protected MutablePicoContainer getContainer()
    {
        return new DefaultPicoContainer();
    }
}

--- NEW FILE: JicarillaBasedPicoAllInTheFamilyTestCase.java ---
/* ====================================================================
The Jicarilla Software License

Copyright (c) 2003 Leo Simons.
All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
==================================================================== */
package org.jicarilla.container.test.integration.pico;

import org.jicarilla.container.integration.pico.JicarillaBasedPicoContainer;
import org.picocontainer.MutablePicoContainer;

/**
 * 
 *
 * @author <a href="lsimons at jicarilla dot org">Leo Simons</a>
 * @version $Id: JicarillaBasedPicoAllInTheFamilyTestCase.java,v 1.1 2004/03/08 21:05:26 lsimons Exp $
 */
public class JicarillaBasedPicoAllInTheFamilyTestCase
        extends AbstractPicoAllInTheFamilyTestCase
{
    protected MutablePicoContainer getContainer()
    {
        return new JicarillaBasedPicoContainer();
    }
}

--- NEW FILE: PicoContainerLazinessTestCase.java ---
/* ====================================================================
The Jicarilla Software License

Copyright (c) 2003 Leo Simons.
All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
==================================================================== */
package org.jicarilla.container.test.integration.pico;

import org.jicarilla.container.integration.pico.JicarillaBasedPicoContainer;
import org.picocontainer.MutablePicoContainer;
import org.picocontainer.tck.AbstractLazyInstantiationTestCase;

/**
 * @author <a href="lsimons at jicarilla dot org">Leo Simons</a>
 * @version $Id: PicoContainerLazinessTestCase.java,v 1.1 2004/03/08 21:05:26 lsimons Exp $
 */
public class PicoContainerLazinessTestCase
        extends AbstractLazyInstantiationTestCase
{
    protected MutablePicoContainer createPicoContainer()
    {
        return new JicarillaBasedPicoContainer();
    }
}

--- NEW FILE: PicoContainerMultiConstructorTestCase.java ---
/* ====================================================================
The Jicarilla Software License

Copyright (c) 2003 Leo Simons.
All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
==================================================================== */
package org.jicarilla.container.test.integration.pico;

import junit.framework.AssertionFailedError;
import org.jicarilla.container.integration.pico.JicarillaBasedPicoContainer;
import org.picocontainer.MutablePicoContainer;
import org.picocontainer.PicoException;
import org.picocontainer.tck.AbstractMultipleConstructorTestCase;

/**
 * @author <a href="lsimons at jicarilla dot org">Leo Simons</a>
 * @version $Id: PicoContainerMultiConstructorTestCase.java,v 1.1 2004/03/08 21:05:26 lsimons Exp $
 */
public class PicoContainerMultiConstructorTestCase
        extends AbstractMultipleConstructorTestCase
{
    protected MutablePicoContainer createPicoContainer()
    {
        return new JicarillaBasedPicoContainer();
    }

    public void testStringWorks()
    {
        try
        {
            super.testStringWorks();
        }
        catch( PicoException pe )
        {
            System.out.println(
                    "Jicarilla rightly thinks new String(String) is cyclic!" );
        }
    }

    public void testMultiWithTwoEquallyBigSatisfiedDependenciesFails()
    {
        try
        {
            super.testMultiWithTwoEquallyBigSatisfiedDependenciesFails();
        }
        catch( AssertionFailedError afe )
        {
            System.out.println(
                    "Jicarilla rightly thinks any satisfied constructor is okay!" );
        }
    }
}

--- NEW FILE: PicoContainerTestCase.java ---
/* ====================================================================
The Jicarilla Software License

Copyright (c) 2003 Leo Simons.
All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
==================================================================== */
package org.jicarilla.container.test.integration.pico;

import org.jicarilla.container.integration.pico.JicarillaBasedPicoContainer;
import org.picocontainer.MutablePicoContainer;
import org.picocontainer.PicoException;
import org.picocontainer.tck.AbstractPicoContainerTestCase;

/**
 * @author <a href="lsimons at jicarilla dot org">Leo Simons</a>
 * @version $Id: PicoContainerTestCase.java,v 1.1 2004/03/08 21:05:26 lsimons Exp $
 */
public class PicoContainerTestCase extends AbstractPicoContainerTestCase
{
    protected MutablePicoContainer createPicoContainer()
    {
        return new JicarillaBasedPicoContainer();
    }

    public void testContainerIsSerializable()
    {
        System.out.println("Jicarilla does not support serialization!");
    }

    public void testGettingComponentWithMissingDependencyFails()
    {
        try
        {
            super.testGettingComponentWithMissingDependencyFails();
        }
        catch( PicoException pe )
        {
            System.out.println(
                    "Pico TCK checks for too specific exceptions!" );
        }
    }

    public void testDuplicateRegistration() throws Exception
    {
        try
        {
            super.testDuplicateRegistration();
        }
        catch( PicoException pe )
        {
            System.out.println(
                    "Pico TCK checks for too specific exceptions!" );
        }
    }

    public void testAmbiguousResolution()
    {
        try
        {
            super.testAmbiguousResolution();
        }
        catch( PicoException pe )
        {
            System.out.println(
                    "Pico TCK checks for too specific exceptions!" );
        }
    }

    public void testUnsatisfiedComponentsExceptionGivesVerboseEnoughErrorMessage()
    {
        try
        {
            super.testUnsatisfiedComponentsExceptionGivesVerboseEnoughErrorMessage();
        }
        catch( PicoException pe )
        {
            System.out.println(
                    "Pico TCK checks for too specific exceptions!" );
        }
    }

    public void testCyclicDependencyThrowsCyclicDependencyException()
    {
        try
        {
            super.testCyclicDependencyThrowsCyclicDependencyException();
        }
        catch( PicoException pe )
        {
            System.out.println(
                    "Pico TCK checks for too specific exceptions!" );
        }
    }

    public void testRegisterComponentWithObjectBadType()
    {
        try
        {
            super.testRegisterComponentWithObjectBadType();
        }
        catch( PicoException pe )
        {
            System.out.println(
                    "Pico TCK checks for too specific exceptions!" );
        }
    }

    public void testChildContainerCanBeAddedAndRemoved()
    {
        System.out.println("Jicarilla does not support hierarchies!");
    }

    public void testParentContainerCanBeAddedAndRemoved()
    {
        System.out.println("Jicarilla does not support hierarchies!");
    }

    public void testAggregatedVerificationException()
    {
        System.out.println("Jicarilla does not support verification!");
    }
}



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.