[jboss-cvs] jboss-seam-tools/src/java/org/jboss/seam/tools/test ...

Thomas Heute theute at jboss.com
Mon Aug 14 11:57:47 EDT 2006


  User: theute  
  Date: 06/08/14 11:57:47

  Added:       src/java/org/jboss/seam/tools/test  SeamWTPTest.java
  Log:
  Moved to hibernate Tools
  
  (ban cvs imports)
  
  Revision  Changes    Path
  1.1      date: 2006/08/14 15:57:47;  author: theute;  state: Exp;jboss-seam-tools/src/java/org/jboss/seam/tools/test/SeamWTPTest.java
  
  Index: SeamWTPTest.java
  ===================================================================
  /*
    * JBoss, Home of Professional Open Source
    * Copyright 2005, JBoss Inc., and individual contributors as indicated
    * by the @authors tag. See the copyright.txt in the distribution for a
    * full listing of individual contributors.
    *
    * This is free software; you can redistribute it and/or modify it
    * under the terms of the GNU Lesser General Public License as
    * published by the Free Software Foundation; either version 2.1 of
    * the License, or (at your option) any later version.
    *
    * This software is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    * Lesser General Public License for more details.
    *
    * You should have received a copy of the GNU Lesser General Public
    * License along with this software; if not, write to the Free
    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
    */
  package org.jboss.seam.tools.test;
  
  import java.io.File;
  import java.util.ArrayList;
  import java.util.List;
  
  import org.jboss.seam.tools.context.Context;
  import org.jboss.seam.tools.context.EarContext;
  import org.jboss.seam.tools.context.EjbContext;
  //import org.jboss.seam.tools.context.SharedContext;
  import org.jboss.seam.tools.context.WebContext;
  import org.jboss.seam.tools.exporter.wtp.WTPEarProjectExporter;
  import org.jboss.seam.tools.exporter.wtp.WTPEjbProjectExporter;
  import org.jboss.seam.tools.exporter.wtp.WTPSeamExporter;
  import org.jboss.seam.tools.exporter.wtp.WTPWebProjectExporter;
  
  import junit.framework.TestCase;
  
  public class SeamWTPTest extends TestCase {
  
  	public void testExporter()
  	{
  		
  		Context context = new Context();
  		context.setProjectName("myProject");
  		context.setIsolationClassLoadingName("seam.jboss.org:loader=" + "seam-booking");
  		context.setSeamLocation("/home/theute/tmp/jboss-seam-1.0.1.GA");
  		context.setEclipseSupport(true);
  		context.setBasicProject(true);
  		context.setTestSupport(true);
  		context.setSrcPackage("org.jboss.seam");
  		context.setTestPackage("org.jboss.seam.test");
  		context.setFaceletsSupport(false);
  
  		
  		EarContext earContext = new EarContext();
  		earContext.setProjectName("myProject-ear");
  		earContext.setDisplayName("myDisplayName");
  		earContext.setFilename("myProject.ear");
  		earContext.setContentDirectory("EarContent");
  		WTPEarProjectExporter wtpEarExporter = new WTPEarProjectExporter(context);
  		wtpEarExporter.setEarContext(earContext);
  		
  		
  		EjbContext ejbContext = new EjbContext();
  		ejbContext.setFilename("myProject-web.jar");
  		ejbContext.setProjectName("myProject-ejb");
  		ejbContext.setId("myEjbId");
  		ejbContext.setContentDirectory("myEjbModule");
  		ejbContext.setJtaDataSource("bookingDatasource");
  		ejbContext.setPersistenceUnitName("bookingDatabase");
  
  		WTPEjbProjectExporter wtpEjbExporter = new WTPEjbProjectExporter(context);
  		wtpEjbExporter.setEjbContext(ejbContext);
  		List ejbExporters = new ArrayList();
  		ejbExporters.add(wtpEjbExporter);
  		
  		WebContext webContext = new WebContext();
  		webContext.setProjectName("myProject-web");
  		webContext.setFilename("myProject-web.war");
  		webContext.setContextRoot("myProject");
  		webContext.setId("myWebId");
  		webContext.setContentDirectory("myWebContent");
  		webContext.setJsfExtension("jsp");
  		WTPWebProjectExporter wtpWebExporter = new WTPWebProjectExporter(context);
  		wtpWebExporter.setWebContext(webContext);
  		List webExporters = new ArrayList();
  		webExporters.add(wtpWebExporter);
  		
  		
  		WTPSeamExporter seamWTPExporter = new WTPSeamExporter(wtpEarExporter, ejbExporters, webExporters);
  		
  		File output = new File("/tmp/toto");
  		
  		seamWTPExporter.setOutputDirectory(output);
  		seamWTPExporter.start();
  	}
  }
  
  
  



More information about the jboss-cvs-commits mailing list