CVS: Tapestry/junit/src/net/sf/tapestry/junit/load TestComponentClassLoader.java,NONE,1.1.2.1 EnhancedComponent.java,NONE,1.1.2.1 EnhancedComponent.jwc,NONE,1.1.2.1

Mind Bridge <[email protected]>
Newsgroups gmane.comp.java.tapestry.cvs
Message-ID <[email protected]>
Update of /cvsroot/tapestry/Tapestry/junit/src/net/sf/tapestry/junit/load
In directory sc8-pr-cvs1:/tmp/cvs-serv13678/junit/src/net/sf/tapestry/junit/load

Added Files:
      Tag: mb-2-3
	TestComponentClassLoader.java EnhancedComponent.java 
	EnhancedComponent.jwc 
Log Message:


--- NEW FILE: TestComponentClassLoader.java ---
package net.sf.tapestry.junit.load;

import net.sf.tapestry.DefaultResourceResolver;
import net.sf.tapestry.IResourceResolver;
import net.sf.tapestry.junit.TapestryTestCase;
import net.sf.tapestry.pageload.ComponentClassLoader;
import net.sf.tapestry.parse.SpecificationParser;
import net.sf.tapestry.spec.ComponentSpecification;

/**
 * @author mindbridge
 *
 */
public class TestComponentClassLoader extends TapestryTestCase
{
    
    public TestComponentClassLoader(String name)
    {
        super(name);
    }

    
    public static void main(String[] args)
    {
        try
        {
            IResourceResolver res = new DefaultResourceResolver();
            ComponentClassLoader loader = new ComponentClassLoader(res);

            String resPath =
                "net/sf/tapestry/junit/load/EnhancedComponent.jwc";
            SpecificationParser parser = new SpecificationParser();
            ComponentSpecification spec =
                parser.parseComponentSpecification(
                    res.getResource(resPath).openStream(),
                    resPath);

            Class newClass = loader.findComponentClass(spec);
            EnhancedComponent testObj = (EnhancedComponent) newClass.newInstance();
            testObj.getCachedParameterString();

            System.out.println("Done");
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        
    }

}

--- NEW FILE: EnhancedComponent.java ---
package net.sf.tapestry.junit.load;

import net.sf.tapestry.BaseComponent;

/**
 * @author mindbridge
 *
 */
public abstract class EnhancedComponent extends BaseComponent
{
    public abstract Object getCachedParameterString();
    //public abstract void setCachedParameterString(Object value);
}

--- NEW FILE: EnhancedComponent.jwc ---
<?xml version="1.0" encoding="UTF-8"?>
<!--  $Id: EnhancedComponent.jwc,v 1.1.2.1 2002/12/23 13:06:24 mindbridge Exp $ -->
<!DOCTYPE component-specification PUBLIC 
	"-//Howard Lewis Ship//Tapestry Specification 1.3//EN" 
	"http://tapestry.sf.net/dtd/Tapestry_1_3.dtd">
	
<component-specification class="net.sf.tapestry.junit.load.EnhancedComponent" 
	allow-body="yes" allow-informal-parameters="yes">
	
	<parameter name="cachedParameterString" 
		java-type="java.lang.String" 
		required="no"
		direction="cached"/>
  
</component-specification>



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
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.