Package org.jboss.seam.mock

Source Code of org.jboss.seam.mock.EmbeddedBootstrap

package org.jboss.seam.mock;

import org.jboss.embedded.Bootstrap;

public class EmbeddedBootstrap
{
    public void startAndDeployResources()
        throws Exception
    {
       Bootstrap bootstrap = Bootstrap.getInstance();
       bootstrap.bootstrap();

       if (resourceExists("seam.properties")) {
           bootstrap.deployResourceBases("seam.properties");
       }
       if (resourceExists("META-INF/components.xml")) {
           bootstrap.deployResourceBases("META-INF/components.xml");
       }
       if (resourceExists("META-INF/seam.properties")) {
           bootstrap.deployResourceBases("META-INF/seam.properties");
       }
   }

   private boolean resourceExists(String name)
   {
      return Thread.currentThread().getContextClassLoader().getResource(name)!=null;
   }
}
TOP

Related Classes of org.jboss.seam.mock.EmbeddedBootstrap

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.