jicarilla-sandbox/platform/container/impl/src/test/org/jicarilla/container/test/factories AbstracFactoryTestCase.java,NONE,1.1 ManualFactoryTestCase.java,NONE,1.1 Type1FactoryTestCase.java,NONE,1.1 Type2FactoryTestCase.java,NONE,1.1 Type35FactoryTestCase.java,NONE,1.1 Type3FactoryTestCase.java,NONE,1.1 AbstractComponentFactoryTestCase.java,1.4,NONE ManualComponentFactoryTestCase.java,1.3,NONE Type1ComponentFactoryTestCase.java,1.4,NONE Type2ComponentFactoryTestCase.java,1.4,NONE Type35ComponentFactoryTestCase.java,1.4,NONE Type3ComponentFactoryTestCase.java,1.4,NONE
Leo Simons <[email protected]>
| Newsgroups | gmane.comp.java.jicarilla.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/jicarilla/jicarilla-sandbox/platform/container/impl/src/test/org/jicarilla/container/test/factories
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16122/container/impl/src/test/org/jicarilla/container/test/factories
Added Files:
AbstracFactoryTestCase.java ManualFactoryTestCase.java
Type1FactoryTestCase.java Type2FactoryTestCase.java
Type35FactoryTestCase.java Type3FactoryTestCase.java
Removed Files:
AbstractComponentFactoryTestCase.java
ManualComponentFactoryTestCase.java
Type1ComponentFactoryTestCase.java
Type2ComponentFactoryTestCase.java
Type35ComponentFactoryTestCase.java
Type3ComponentFactoryTestCase.java
Log Message:
Get rid of a bunch of "Component" parts in classnames. And probably some other misc. updates.
--- NEW FILE: Type1FactoryTestCase.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.factories;
import org.jicarilla.container.factories.Type1Factory;
import org.jicarilla.container.tck.components.type1.avalon.AvalonHomer;
import org.jicarilla.container.test.AbstractSimpson_test_case;
/**
* @author <a href="lsimons at jicarilla dot org">Leo Simons</a>
* @version $Id: Type1FactoryTestCase.java,v 1.1 2004/03/17 14:14:17 lsimons Exp $
*/
public class Type1FactoryTestCase extends AbstractSimpson_test_case
{
public void testEverything() throws Exception
{
Type1Factory f = new Type1Factory(r, AvalonHomer.class.getName());
AvalonHomer homer = (AvalonHomer)f.newInstance();
assertNotNull( homer );
homer = (AvalonHomer)f.newInstance();
assertNotNull( homer );
f.releaseInstance( homer );
f = new Type1Factory(r, this.getClass().getName());
Type1FactoryTestCase test = (Type1FactoryTestCase)f.newInstance();
assertNotNull( test );
f.releaseInstance( test );
}
}
--- NEW FILE: Type35FactoryTestCase.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.factories;
import org.jicarilla.container.factories.Type35Factory;
import org.jicarilla.container.tck.components.type1.avalon.AvalonHomer;
import org.jicarilla.container.tck.components.type3.rich.HomerImpl;
import org.jicarilla.container.test.AbstractSimpson_test_case;
import java.lang.reflect.InvocationTargetException;
/**
* @author <a href="lsimons at jicarilla dot org">Leo Simons</a>
* @version $Id: Type35FactoryTestCase.java,v 1.1 2004/03/17 14:14:17 lsimons Exp $
*/
public class Type35FactoryTestCase extends AbstractSimpson_test_case
{
public void testEverything() throws Exception, InvocationTargetException, ClassNotFoundException, InstantiationException
{
Type35Factory f = new Type35Factory(r, HomerImpl.class.getName());
HomerImpl homer = (HomerImpl)f.newInstance();
assertNotNull( homer );
homer = (HomerImpl)f.newInstance();
assertNotNull( homer );
f = new Type35Factory(r, this.getClass().getName());
Type35FactoryTestCase test = (Type35FactoryTestCase)f.newInstance();
assertNotNull( test );
Type35Factory f2 = new Type35Factory(r, AvalonHomer.class.getName());
AvalonHomer homer2 = (AvalonHomer)f2.newInstance();
assertNotNull( homer2 );
homer2 = (AvalonHomer)f2.newInstance();
assertNotNull( homer2 );
f2.releaseInstance( homer2 );
f2 = new Type35Factory(r, this.getClass().getName());
Type35FactoryTestCase test2 = (Type35FactoryTestCase)f2.newInstance();
assertNotNull( test2 );
f2.releaseInstance( test2 );
f2.releaseInstance( null );
}
}
--- NEW FILE: AbstracFactoryTestCase.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.factories;
import org.jicarilla.container.Resolver;
import org.jicarilla.container.factories.AbstractFactory;
import org.jicarilla.container.test.AbstractSimpson_test_case;
/**
* @author <a href="lsimons at jicarilla dot org">Leo Simons</a>
* @version $Id: AbstracFactoryTestCase.java,v 1.1 2004/03/17 14:14:17 lsimons Exp $
*/
public class AbstracFactoryTestCase extends AbstractSimpson_test_case
{
public void testEverything() throws Exception
{
Factory f = new Factory( r, this.getClass().getName() );
f.releaseInstance(this);
f.releaseInstance(null);
f.releaseInstance(new Object());
Throwable t = null;
try
{
new Factory( null, this.getClass().getName() );
}
catch( AssertionError th )
{
t = th;
}
assertNotNull( t );
t = null;
try
{
new Factory( r, null );
}
catch( AssertionError th )
{
t = th;
}
assertNotNull( t );
}
public final static class Factory extends AbstractFactory
{
public Factory( Resolver resolver, String className )
{
super( resolver, className );
}
protected Object doNewInstance()
{
return null;
}
}
}
--- Type1ComponentFactoryTestCase.java DELETED ---
--- Type3ComponentFactoryTestCase.java DELETED ---
--- NEW FILE: ManualFactoryTestCase.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.factories;
import junit.framework.TestCase;
import org.jicarilla.container.factories.ManualFactory;
import java.lang.reflect.InvocationTargetException;
/**
* @author <a href="lsimons at jicarilla dot org">Leo Simons</a>
* @version $Id: ManualFactoryTestCase.java,v 1.1 2004/03/17 14:14:17 lsimons Exp $
*/
public class ManualFactoryTestCase extends TestCase
{
public void testEverything() throws Exception, InvocationTargetException, ClassNotFoundException, InstantiationException
{
ManualFactory f = new ManualFactory( this );
Object instance = f.newInstance();
assertEquals( this, instance );
instance = f.newInstance();
assertEquals( this, instance );
f.releaseInstance(this);
f.releaseInstance(f);
f.releaseInstance(null);
Throwable t = null;
try
{
new ManualFactory( null );
}
catch( AssertionError th )
{
t = th;
}
assertNotNull( t );
}
}
--- Type2ComponentFactoryTestCase.java DELETED ---
--- AbstractComponentFactoryTestCase.java DELETED ---
--- Type35ComponentFactoryTestCase.java DELETED ---
--- ManualComponentFactoryTestCase.java DELETED ---
--- NEW FILE: Type3FactoryTestCase.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.factories;
import org.jicarilla.container.factories.Type3Factory;
import org.jicarilla.container.tck.components.type3.rich.HomerImpl;
import org.jicarilla.container.test.AbstractSimpson_test_case;
import java.lang.reflect.InvocationTargetException;
/**
* @author <a href="lsimons at jicarilla dot org">Leo Simons</a>
* @version $Id: Type3FactoryTestCase.java,v 1.1 2004/03/17 14:14:17 lsimons Exp $
*/
public class Type3FactoryTestCase extends AbstractSimpson_test_case
{
public void testEverything() throws IllegalAccessException, InvocationTargetException, ClassNotFoundException, InstantiationException
{
Type3Factory f = new Type3Factory(r, HomerImpl.class.getName());
HomerImpl homer = (HomerImpl)f.newInstance();
assertNotNull( homer );
homer = (HomerImpl)f.newInstance();
assertNotNull( homer );
f = new Type3Factory(r, this.getClass().getName());
Type3FactoryTestCase test = (Type3FactoryTestCase)f.newInstance();
assertNotNull( test );
}
}
--- NEW FILE: Type2FactoryTestCase.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.factories;
import org.jicarilla.container.factories.Type2Factory;
import org.jicarilla.container.tck.components.type3.rich.HomerImpl;
import org.jicarilla.container.test.AbstractSimpson_test_case;
/**
* @author <a href="lsimons at jicarilla dot org">Leo Simons</a>
* @version $Id: Type2FactoryTestCase.java,v 1.1 2004/03/17 14:14:17 lsimons Exp $
*/
public class Type2FactoryTestCase extends AbstractSimpson_test_case
{
public void testEverything() throws Exception
{
Type2Factory f = new Type2Factory(r, HomerImpl.class.getName());
HomerImpl homer = (HomerImpl)f.newInstance();
assertNotNull( homer );
homer = (HomerImpl)f.newInstance();
assertNotNull( homer );
f = new Type2Factory(r, this.getClass().getName());
Type2FactoryTestCase test = (Type2FactoryTestCase)f.newInstance();
assertNotNull( test );
}
}
-------------------------------------------------------
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