Update of
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-ejb/src/test/java/org/xdoclet/plugin/ejb/entity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25537
Modified Files:
PrimaryKeyClassPluginTestCase.java
Log Message:
no message
Index: PrimaryKeyClassPluginTestCase.java
===================================================================
RCS file:
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-ejb/src/test/java/org/xdoclet/plugin/ejb/entity/PrimaryKeyClassPluginTestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PrimaryKeyClassPluginTestCase.java 6 Sep 2005 01:49:59 -0000 1.2
--- PrimaryKeyClassPluginTestCase.java 6 Oct 2005 13:44:34 -0000 1.3
***************
*** 1,51 ****
! /*
! * Copyright (c) 2005
! * XDoclet Team
! * All rights reserved.
! */
! package org.xdoclet.plugin.ejb.entity;
!
! import java.io.File;
! import java.io.FileNotFoundException;
! import java.io.IOException;
!
! import java.net.MalformedURLException;
! import java.net.URL;
!
! import org.generama.MetadataProvider;
! import org.generama.Plugin;
! import org.generama.QDoxCapableMetadataProvider;
! import org.generama.VelocityTemplateEngine;
! import org.generama.WriterMapper;
!
! import org.xdoclet.AbstractJavaGeneratingPluginTestCase;
! import org.xdoclet.QDoxMetadataProvider;
!
! import org.xdoclet.plugin.ejb.EjbConfig;
!
! /**
! * @author Diogo Quintela
! * @version $Revision$
! *
! * TODO: Multiple files generation
! */
! public class PrimaryKeyClassPluginTestCase extends
AbstractJavaGeneratingPluginTestCase {
! protected URL getExpected() throws FileNotFoundException,
MalformedURLException {
! String basedir = System.getProperty("xdoclet.ejb.home");
! assertNotNull(basedir);
! return new File(basedir +
"/../testapp-ejb/src/main/java/org/xdoclet/testapp/ejb/util/AccountPK.java").toURL();
! }
!
! protected URL getTestSource() throws FileNotFoundException,
MalformedURLException {
! String basedir = System.getProperty("xdoclet.ejb.home");
! assertNotNull(basedir);
! return new File(basedir +
"/../testapp-ejb/src/main/java/org/xdoclet/testapp/ejb/beans/AccountBean.java").toURL();
! }
!
! protected Plugin createPlugin(MetadataProvider metadataProvider,
WriterMapper writerMapper)
! throws Exception {
! QDoxCapableMetadataProvider qdoxCapableMetadataProvider =
(QDoxCapableMetadataProvider) metadataProvider;
! EjbConfig config = new EjbConfig(qdoxCapableMetadataProvider,
writerMapper);
! return new PrimaryKeyClassPlugin(new VelocityTemplateEngine(),
qdoxCapableMetadataProvider, writerMapper, config);
! }
}
\ No newline at end of file
--- 1,72 ----
! /*
! * Copyright (c) 2005
! * XDoclet Team
! * All rights reserved.
! */
! package org.xdoclet.plugin.ejb.entity;
!
! import java.io.File;
! import java.io.FileNotFoundException;
!
! import java.net.MalformedURLException;
! import java.net.URL;
!
! import org.generama.MetadataProvider;
! import org.generama.Plugin;
! import org.generama.QDoxCapableMetadataProvider;
! import org.generama.VelocityTemplateEngine;
! import org.generama.WriterMapper;
!
! import org.xdoclet.AbstractJavaGeneratingPluginTestCase;
! import org.xdoclet.QDoxMetadataProvider;
!
! import org.xdoclet.plugin.ejb.EjbConfig;
!
! import com.thoughtworks.qdox.model.JavaClass;
!
! /**
! * @author Diogo Quintela
! * @version $Revision$
! *
! * TODO: Multiple files sources to test a single one
! */
! public class PrimaryKeyClassPluginTestCase extends
AbstractJavaGeneratingPluginTestCase {
! protected URL getExpected() throws FileNotFoundException,
MalformedURLException {
! String basedir = System.getProperty("xdoclet.ejb.home");
! assertNotNull(basedir);
! return new File(basedir +
"/../testapp-ejb/src/main/java/org/xdoclet/testapp/ejb/util/CompanyClientPK.java").toURL();
! }
!
! protected MetadataProvider createMetadataProvider() throws Exception {
! String basedir = System.getProperty("xdoclet.ejb.home");
! assertNotNull(basedir);
! return new QDoxMetadataProvider(new File(basedir +
"/../testapp-ejb/src/main/java/"));
! }
!
!
! protected Plugin createPlugin(MetadataProvider metadataProvider,
WriterMapper writerMapper)
! throws Exception {
! QDoxCapableMetadataProvider qdoxCapableMetadataProvider =
(QDoxCapableMetadataProvider) metadataProvider;
! EjbConfig config = new EjbConfig(qdoxCapableMetadataProvider,
writerMapper);
! // Pending GRA-4
! // MergeableVelocityTemplateEngine mergeableVelocityTemplateEngine =
new MergeableVelocityTemplateEngine() {
! VelocityTemplateEngine mergeableVelocityTemplateEngine = new
VelocityTemplateEngine() {
! protected String getScriptPath(String scriptName, Class
pluginClass) {
! pluginClass = PrimaryKeyClassPlugin.class;
! String className = pluginClass.getName();
! int unqualifiedNameStart = className.lastIndexOf('.') + 1;
! scriptName = className.substring(unqualifiedNameStart) +
".vm";
! return super.getScriptPath(scriptName, pluginClass);
! }
! };
! return new PrimaryKeyClassPlugin(mergeableVelocityTemplateEngine,
qdoxCapableMetadataProvider, writerMapper, config) {
! public boolean shouldGenerate(Object metadata) {
! JavaClass javaClass = (JavaClass) metadata;
! // if ("CompanyClientBean".equals(javaClass.getName())) {
! return super.shouldGenerate(javaClass);
! // }
! // return false;
! }
! };
! }
}
\ No newline at end of file
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
xdoclet-plugins-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-commits