You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by db...@apache.org on 2006/12/07 00:22:24 UTC

svn commit: r483288 - in /incubator/openejb/trunk/openejb3: container/openejb-core/src/main/java/org/apache/openejb/alt/config/ examples/helloworld-stateful-pojo/src/test/java/org/acme/ server/openejb-ejbd/src/test/java/org/apache/openejb/ server/opene...

Author: dblevins
Date: Wed Dec  6 15:22:23 2006
New Revision: 483288

URL: http://svn.apache.org/viewvc?view=rev&rev=483288
Log:
Implemented searching classpath for ejb-jars containing annotated beans and no ejb-jar.xml

Added:
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/ServiceEndpoint.java
Modified:
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/AnnotationDeployer.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/ConfigurationFactory.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/DeploymentLoader.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/EjbJarUtils.java
    incubator/openejb/trunk/openejb3/examples/helloworld-stateful-pojo/src/test/java/org/acme/FriendlyPersonTest.java
    incubator/openejb/trunk/openejb3/server/openejb-ejbd/src/test/java/org/apache/openejb/SomeoneBrokeSurefireAndThisIsADirtyHackForItTest.java
    incubator/openejb/trunk/openejb3/server/openejb-http/src/test/java/org/apache/openejb/server/httpd/SomeoneBrokeSurefireAndThisIsADirtyHackForItTest.java

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/AnnotationDeployer.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/AnnotationDeployer.java?view=diff&rev=483288&r1=483287&r2=483288
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/AnnotationDeployer.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/AnnotationDeployer.java Wed Dec  6 15:22:23 2006
@@ -130,8 +130,9 @@
                 }
             }
 
-            EjbJar ejbJar = ejbModule.getEjbJar();
+            /* 19.2:  ejb-name: Default is the unqualified name of the bean class */
 
+            EjbJar ejbJar = ejbModule.getEjbJar();
             List<Class> classes = finder.findAnnotatedClasses(Stateless.class);
             for (Class beanClass : classes) {
                 Stateless stateless = (Stateless) beanClass.getAnnotation(Stateless.class);
@@ -143,8 +144,8 @@
 
             classes = finder.findAnnotatedClasses(Stateful.class);
             for (Class beanClass : classes) {
-                Stateful stateless = (Stateful) beanClass.getAnnotation(Stateful.class);
-                String ejbName = stateless.name().length() == 0 ? beanClass.getName() : stateless.name();
+                Stateful stateful = (Stateful) beanClass.getAnnotation(Stateful.class);
+                String ejbName = stateful.name().length() == 0 ? beanClass.getSimpleName() : stateful.name();
                 if (ejbJar.getEnterpriseBean(ejbName) == null) {
                     ejbJar.addEnterpriseBean(new StatefulBean(ejbName, beanClass.getName()));
                 }
@@ -153,7 +154,7 @@
             classes = finder.findAnnotatedClasses(MessageDriven.class);
             for (Class beanClass : classes) {
                 MessageDriven mdb = (MessageDriven) beanClass.getAnnotation(MessageDriven.class);
-                String ejbName = mdb.name().length() == 0 ? beanClass.getName() : mdb.name();
+                String ejbName = mdb.name().length() == 0 ? beanClass.getSimpleName() : mdb.name();
                 if (ejbJar.getEnterpriseBean(ejbName) == null) {
                     MessageDrivenBean messageBean = new MessageDrivenBean(ejbName);
                     Class interfce = mdb.messageListenerInterface();
@@ -347,30 +348,71 @@
                             }
                         }
 
+                        // Anything declared in the xml is also not eligable
+                        List<String> declared = new ArrayList<String>();
+                        declared.add(sessionBean.getBusinessLocal());
+                        declared.add(sessionBean.getBusinessRemote());
+                        declared.add(sessionBean.getHome());
+                        declared.add(sessionBean.getRemote());
+                        declared.add(sessionBean.getLocalHome());
+                        declared.add(sessionBean.getLocal());
+                        declared.add(sessionBean.getServiceEndpoint());
+
+                        for (Class interfce : copy(interfaces)) {
+                            if (declared.contains(interfce.getName())) {
+                                // Interface type was declared in xml
+                                interfaces.remove(interfce);
+                            }
+                        }
+
+                        List<Class> remotes = new ArrayList<Class>();
                         Remote remote = (Remote) clazz.getAnnotation(Remote.class);
                         if (remote != null) {
                             for (Class interfce : remote.value()) {
-                                sessionBean.setBusinessRemote(interfce.getName()); // TODO: This should be turned back into an array
+                                remotes.add(interfce);
+                                interfaces.remove(interfce);
                             }
-                        } else {
-//                            for (Class interfce : copy(interfaces)) {
-//                                if (interfce.isAnnotationPresent(Remote.class)) {
-//                                    sessionBean.setBusinessRemote(interfce.getName()); // TODO: This should be turned back into an array
-//                                    interfaces.remove(interfce);
-//                                }
-//                            }
                         }
 
-
+                        List<Class> locals = new ArrayList<Class>();
                         Local local = (Local) clazz.getAnnotation(Local.class);
                         if (local != null) {
                             for (Class interfce : local.value()) {
-                                sessionBean.setBusinessLocal(interfce.getName()); // TODO: This should be turned back into an array
+                                locals.add(interfce);
+                                interfaces.remove(interfce);
                             }
-                        } else {
-//                            for (Class interfce : copy(interfaces)) {
-//                                sessionBean.setBusinessLocal(interfce.getName()); // TODO: This should be turned back into an array
-//                            }
+                        }
+
+                        List<Class> endpoints = new ArrayList<Class>();
+                        ServiceEndpoint endpoint = (ServiceEndpoint) clazz.getAnnotation(ServiceEndpoint.class);
+                        if (endpoint != null) {
+                            for (Class interfce : endpoint.value()) {
+                                endpoints.add(interfce);
+                                interfaces.remove(interfce);
+                            }
+                        }
+
+                        for (Class interfce : copy(interfaces)) {
+                            if (interfce.isAnnotationPresent(Remote.class)) {
+                                remotes.add(interfce);
+                                interfaces.remove(interfce);
+                            } else if (interfce.isAnnotationPresent(ServiceEndpoint.class)) {
+                                endpoints.add(interfce);
+                                interfaces.remove(interfce);
+                            } else {
+                                locals.add(interfce);
+                                interfaces.remove(interfce);
+                            }
+                        }
+
+                        for (Class interfce : remotes) {
+                            // TODO: This should be turned back into an array
+                            sessionBean.setBusinessRemote(interfce.getName());
+                        }
+
+                        for (Class interfce : locals) {
+                            // TODO: This should be turned back into an array
+                            sessionBean.setBusinessLocal(interfce.getName());
                         }
                     }
                 }

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/ConfigurationFactory.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/ConfigurationFactory.java?view=diff&rev=483288&r1=483287&r2=483288
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/ConfigurationFactory.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/ConfigurationFactory.java Wed Dec  6 15:22:23 2006
@@ -133,7 +133,7 @@
         List<Deployments> deployments = new ArrayList<Deployments>(Arrays.asList(openejb.getDeployments()));
 
         //// getOption /////////////////////////////////  BEGIN  ////////////////////
-        String flag = props.getProperty("openejb.deployments.classpath", "false").toLowerCase();
+        String flag = props.getProperty("openejb.deployments.classpath", "true").toLowerCase();
         boolean searchClassPath = flag.equals("true");
         //// getOption /////////////////////////////////  END  ////////////////////
 

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/DeploymentLoader.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/DeploymentLoader.java?view=diff&rev=483288&r1=483287&r2=483288
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/DeploymentLoader.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/DeploymentLoader.java Wed Dec  6 15:22:23 2006
@@ -30,6 +30,7 @@
 import org.apache.openejb.util.Logger;
 import org.apache.xbean.finder.ResourceFinder;
 import org.apache.xbean.finder.ClassFinder;
+import org.apache.xbean.finder.UrlSet;
 
 import javax.ejb.Stateless;
 import javax.ejb.Stateful;
@@ -37,7 +38,6 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
-import java.io.FilenameFilter;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.JarURLConnection;
@@ -50,6 +50,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Collections;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
@@ -62,13 +63,14 @@
 
     private static final Map<Class<?>, JaxbUnmarshaller> unmarshallers = new HashMap();
 
-	private static final String OPENEJB_DEPLOYMENTS_CLASSPATH_INCLUDE = "openejb.deployments.classpath.include";
-	private static final String OPENEJB_DEPLOYMENTS_CLASSPATH_EXCLUDE = "openejb.deployments.classpath.exclude";
+	private static final String CLASSPATH_INCLUDE = "openejb.deployments.classpath.include";
+	private static final String CLASSPATH_EXCLUDE = "openejb.deployments.classpath.exclude";
 
-    public static final Logger logger = Logger.getInstance("OpenEJB.startup", DeploymentLoader.class.getPackage().getName());
+    public static Logger logger = Logger.getInstance("OpenEJB.startup", "org.apache.openejb.util.resources");
 
     public DeploymentLoader() {
-
+        // For some reason intellij won't log to the one we configured statically
+        logger = EjbJarUtils.logger;
     }
 
     private void loadFrom(Deployments dep, FileUtils path, List jarList) {
@@ -168,6 +170,7 @@
     }
 
     public List<DeploymentModule> loadDeploymentsList(List<Deployments> deployments, DynamicDeployer deployer) throws OpenEJBException {
+
         if (deployer == null) {
             deployer = new DynamicDeployer() {
                 public EjbModule deploy(EjbModule ejbModule) throws OpenEJBException {
@@ -194,7 +197,6 @@
 
         FileUtils base = SystemInstance.get().getBase();
 
-
         List<String> jarList = new ArrayList(deployments.size());
         try {
             for (Deployments deployment : deployments) {
@@ -212,8 +214,7 @@
                             logger.debug("Searching: " + url.toExternalForm());
                         }
                     }
-                    loadFromClasspath(base, jarList, classLoader, "META-INF/ejb-jar.xml", "ejbs");
-                    loadFromClasspath(base, jarList, deployment.getClasspath(), "META-INF/application.xml", "ear");
+                    loadFromClasspath(base, jarList, deployment.getClasspath());
                 } else {
                     loadFrom(deployment, base, jarList);
                 }
@@ -235,7 +236,6 @@
 
             try {
 
-
                 ClassLoader classLoader = getClassLoader(jarFile);
 
                 URL baseUrl = getFileUrl(jarFile);
@@ -477,11 +477,13 @@
         }
 
         URL manifestUrl = descriptors.get("MANIFEST.MF");
-        InputStream is = manifestUrl.openStream();
-        Manifest manifest = new Manifest(is);
-        String mainClass = manifest.getMainAttributes().getValue(Attributes.Name.MAIN_CLASS);
-        if (mainClass != null){
-            return ClientModule.class;
+        if (manifestUrl != null){
+            InputStream is = manifestUrl.openStream();
+            Manifest manifest = new Manifest(is);
+            String mainClass = manifest.getMainAttributes().getValue(Attributes.Name.MAIN_CLASS);
+            if (mainClass != null){
+                return ClientModule.class;
+            }
         }
 
         ClassFinder classFinder = new ClassFinder(new URLClassLoader(new URL[]{baseUrl},classLoader), baseUrl);
@@ -560,54 +562,95 @@
      *	2- Loading the resource is the default behaviour in case of not defining a value for any class-path pattern
      *	   This appears in step 3 of the above algorithm.
      */
-    private void loadFromClasspath(FileUtils base, List<String> jarList, ClassLoader classLoader, String descriptor, String type) {
+    private void loadFromClasspath(FileUtils base, List<String> jarList, ClassLoader classLoader) {
     	
-    	boolean doLoad = false;
     	Deployments deployment = null;
     	String include = null;
     	String exclude = null;
     	String path = null;
-    	
-    	include = SystemInstance.get().getProperty(OPENEJB_DEPLOYMENTS_CLASSPATH_INCLUDE, "");
-    	exclude = SystemInstance.get().getProperty(OPENEJB_DEPLOYMENTS_CLASSPATH_EXCLUDE, "");
+
+    	include = SystemInstance.get().getProperty(CLASSPATH_INCLUDE, "");
+    	exclude = SystemInstance.get().getProperty(CLASSPATH_EXCLUDE, ".*");
         try {
-            Enumeration resources = classLoader.getResources(descriptor);
-            while (resources.hasMoreElements()) {
-                URL ejbJar = (URL) resources.nextElement();
-                String urlString = ejbJar.toExternalForm();
-                if(urlString.matches(include)) {
-                	doLoad = true;
-                } else if (urlString.matches(exclude)) {
-                    ConfigurationFactory.logger.info("Excluding: " + urlString);
-                    continue;
-                } else if(include.equals("") && exclude.equals("")) {
-                	doLoad = true;
-            	}
-                if(doLoad) {
-	                // path = null;
-	                deployment = new Deployments();
-	                if (ejbJar.getProtocol().equals("jar")) {
-	                    ejbJar = new URL(ejbJar.getFile().replaceFirst("!.*$", ""));
-	                    File file = new File(ejbJar.getFile());
-	                    path = file.getAbsolutePath();
-	                    deployment.setJar(path);
-	                } else if (ejbJar.getProtocol().equals("file")) {
-	                    File file = new File(ejbJar.getFile());
-	                    File metainf = file.getParentFile();
-	                    File ejbPackage = metainf.getParentFile();
-	                    path = ejbPackage.getAbsolutePath();
-	                    deployment.setDir(path);
-	                } else {
-	                    ConfigurationFactory.logger.warning("Not loading " + type + ".  Unknown protocol " + ejbJar.getProtocol());
-	                    continue;
-	                }	
-	                ConfigurationFactory.logger.info("Found " + type + " in classpath: " + path);
-	                loadFrom(deployment, base, jarList);
+            UrlSet urlSet = new UrlSet(classLoader);
+            UrlSet includes = urlSet.matching(include);
+            urlSet = urlSet.exclude(ClassLoader.getSystemClassLoader().getParent());
+            urlSet = urlSet.excludeJavaExtDirs();
+            urlSet = urlSet.excludeJavaEndorsedDirs();
+            urlSet = urlSet.excludeJavaHome();
+            urlSet = urlSet.excludePaths(System.getProperty("sun.boot.class.path",""));
+            urlSet = urlSet.exclude(".*/JavaVM.framework/.*");
+            urlSet = urlSet.exclude(exclude);
+            urlSet = urlSet.include(includes);
+
+            List<URL> urls = urlSet.getUrls();
+            int size = urls.size();
+            if (size == 0 && include.length() > 0){
+                logger.warning("No classpath URLs matched.  Current settings: "+CLASSPATH_EXCLUDE +"='"+exclude+"', "+CLASSPATH_INCLUDE+"='"+include+"'");
+                return;
+            } else if (size == 0) {
+                return;
+            } else if (size < 10) {
+                logger.debug("Inspecting classpath for applications: "+urls.size()+" urls.");
+            } else if (size < 50) {
+                logger.info("Inspecting classpath for applications: "+urls.size()+" urls. Consider adjusting your exclude/include.  Current settings: "+CLASSPATH_EXCLUDE +"='"+exclude+"', "+CLASSPATH_INCLUDE+"='"+include+"'");
+            } else {
+                logger.warning("Inspecting classpath for applications: "+urls.size()+" urls.");
+                logger.warning("ADJUST THE EXCLUDE/INCLUDE!!!.  Current settings: "+CLASSPATH_EXCLUDE +"='"+exclude+"', "+CLASSPATH_INCLUDE+"='"+include+"'");
+            }
+
+            long begin = System.currentTimeMillis();
+            for (URL url : urls) {
+                try {
+                    Class moduleType = discoverModuleType(url, classLoader);
+                    if (AppModule.class.isAssignableFrom(moduleType) || EjbModule.class.isAssignableFrom(moduleType)){
+                        deployment = new Deployments();
+                        if (url.getProtocol().equals("jar")) {
+                            url = new URL(url.getFile().replaceFirst("!.*$", ""));
+                            File file = new File(url.getFile());
+                            path = file.getAbsolutePath();
+                            deployment.setJar(path);
+                        } else if (url.getProtocol().equals("file")) {
+                            File file = new File(url.getFile());
+                            path = file.getAbsolutePath();
+                            deployment.setDir(path);
+                        } else {
+                            logger.warning("Not loading " + moduleType.getSimpleName() + ".  Unknown protocol " + url.getProtocol());
+                            continue;
+                        }
+                        logger.info("Found " + moduleType.getSimpleName() + " in classpath: " + path);
+                        loadFrom(deployment, base, jarList);
+                    }
+                } catch (IOException e) {
+                    logger.warning("Unable to determine the module type of "+ url.toExternalForm()+": Exception: "+ e.getMessage(), e);
+                } catch (UnsupportedOperationException ignore) {
+                }
+            }
+            long end = System.currentTimeMillis();
+            long time = end - begin;
+
+            if (time < 1000) {
+                logger.debug("Searched "+urls.size()+" classpath urls in "+time+" milliseconds.  Average "+(time/urls.size())+" milliseconds per url.");
+            } else if (time < 4000 || urls.size() < 3) {
+                logger.info("Searched "+urls.size()+" classpath urls in "+time+" milliseconds.  Average "+(time/urls.size())+" milliseconds per url.");
+            } else if (time < 10000){
+                logger.warning("Searched "+urls.size()+" classpath urls in "+time+" milliseconds.  Average "+(time/urls.size())+" milliseconds per url.");
+                logger.warning("Consider adjusting your "+CLASSPATH_EXCLUDE +" and "+CLASSPATH_INCLUDE +" settings.  Current settings: exclude='"+exclude+"', include='"+include+"'");
+            } else {
+                logger.fatal("Searched "+urls.size()+" classpath urls in "+time+" milliseconds.  Average "+(time/urls.size())+" milliseconds per url.  TOO LONG!");
+                logger.fatal("ADJUST THE EXCLUDE/INCLUDE!!!.  Current settings: "+CLASSPATH_EXCLUDE +"='"+exclude+"', "+CLASSPATH_INCLUDE+"='"+include+"'");
+                List<String> list = new ArrayList<String>();
+                for (URL url : urls) {
+                    list.add(url.toExternalForm());
+                }
+                Collections.sort(list);
+                for (String url : list) {
+                    logger.info("Matched: "+url);
                 }
             }
         } catch (IOException e1) {
             e1.printStackTrace();
-            ConfigurationFactory.logger.warning("Unable to search classpath for " + type + ": Received Exception: " + e1.getClass().getName() + " " + e1.getMessage(), e1);
+            logger.warning("Unable to search classpath for modules: Received Exception: " + e1.getClass().getName() + " " + e1.getMessage(), e1);
         }
         
     }

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/EjbJarUtils.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/EjbJarUtils.java?view=diff&rev=483288&r1=483287&r2=483288
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/EjbJarUtils.java (original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/EjbJarUtils.java Wed Dec  6 15:22:23 2006
@@ -55,11 +55,13 @@
     }
 
     public EjbJarUtils(String jarLocation) throws OpenEJBException {
+        boolean hasEjbJarXml = false;
         /*[1.1]  Get the jar ***************/
         this.jarLocation = jarLocation;
         EjbJar ejbJar;
         try {
             ejbJar = readEjbJar(jarLocation);
+            hasEjbJarXml = true;
         } catch (OpenEJBException e) {
             logger.warning("No ejb-jar.xml found assuming annotated beans present: module: " + jarLocation);
             ejbJar = new EjbJar();
@@ -70,7 +72,11 @@
             this.openejbJar = readOpenEjbJar(jarLocation);
         } catch (OpenEJBException e) {
             if (e.getCause() instanceof FileNotFoundException){
-                logger.warning(e.getMessage());
+                if (hasEjbJarXml){
+                    logger.warning(e.getMessage());
+                } else {
+                    logger.debug(e.getMessage());
+                }
             } else {
                 logger.warning("Reading openejb-jar.xml.", e);
             }

Added: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/ServiceEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/ServiceEndpoint.java?view=auto&rev=483288
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/ServiceEndpoint.java (added)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/alt/config/ServiceEndpoint.java Wed Dec  6 15:22:23 2006
@@ -0,0 +1,26 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.openejb.alt.config;
+
+/**
+ * This is a completely fake annotation and is only a placeholder for the real annotation
+ * that specifies an interface is a webservice interface
+ * @version $Rev$ $Date$
+ */
+public @interface ServiceEndpoint {
+    java.lang.Class[] value() default {};
+}

Modified: incubator/openejb/trunk/openejb3/examples/helloworld-stateful-pojo/src/test/java/org/acme/FriendlyPersonTest.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/examples/helloworld-stateful-pojo/src/test/java/org/acme/FriendlyPersonTest.java?view=diff&rev=483288&r1=483287&r2=483288
==============================================================================
--- incubator/openejb/trunk/openejb3/examples/helloworld-stateful-pojo/src/test/java/org/acme/FriendlyPersonTest.java (original)
+++ incubator/openejb/trunk/openejb3/examples/helloworld-stateful-pojo/src/test/java/org/acme/FriendlyPersonTest.java Wed Dec  6 15:22:23 2006
@@ -1,19 +1,19 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.acme;
 
 import junit.framework.TestCase;
@@ -24,8 +24,8 @@
 import java.util.Properties;
 
 /**
- * @author <a href="mailto:david.blevins@visi.com">David Blevins</a>
- * 
+ * @author <a href="mailto:david.blevins@visi.com">David Blevins</a>
+ * 
  * @version $Rev$ $Date$
  */
 public class FriendlyPersonTest extends TestCase {
@@ -36,7 +36,7 @@
         properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
 
         // Tells OpenEJB to look for META-INF/ejb-jar.xml files in the classpath
-        properties.setProperty("openejb.deployments.classpath", "true");
+        System.setProperty("openejb.deployments.classpath.include", ".*helloworld-stateful-pojo.*");
 
         initialContext = new InitialContext(properties);
     }

Modified: incubator/openejb/trunk/openejb3/server/openejb-ejbd/src/test/java/org/apache/openejb/SomeoneBrokeSurefireAndThisIsADirtyHackForItTest.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/server/openejb-ejbd/src/test/java/org/apache/openejb/SomeoneBrokeSurefireAndThisIsADirtyHackForItTest.java?view=diff&rev=483288&r1=483287&r2=483288
==============================================================================
--- incubator/openejb/trunk/openejb3/server/openejb-ejbd/src/test/java/org/apache/openejb/SomeoneBrokeSurefireAndThisIsADirtyHackForItTest.java (original)
+++ incubator/openejb/trunk/openejb3/server/openejb-ejbd/src/test/java/org/apache/openejb/SomeoneBrokeSurefireAndThisIsADirtyHackForItTest.java Wed Dec  6 15:22:23 2006
@@ -37,6 +37,7 @@
 public class SomeoneBrokeSurefireAndThisIsADirtyHackForItTest extends TestCase {
     public static Test suite() {
         System.setProperty("openejb.assembler", org.apache.openejb.assembler.classic.Assembler.class.getName());
+        System.setProperty("openejb.deployments.classpath.include", ".*openejb-itests-beans.*");
         return RemoteiTest.suite();
     }
 }

Modified: incubator/openejb/trunk/openejb3/server/openejb-http/src/test/java/org/apache/openejb/server/httpd/SomeoneBrokeSurefireAndThisIsADirtyHackForItTest.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/server/openejb-http/src/test/java/org/apache/openejb/server/httpd/SomeoneBrokeSurefireAndThisIsADirtyHackForItTest.java?view=diff&rev=483288&r1=483287&r2=483288
==============================================================================
--- incubator/openejb/trunk/openejb3/server/openejb-http/src/test/java/org/apache/openejb/server/httpd/SomeoneBrokeSurefireAndThisIsADirtyHackForItTest.java (original)
+++ incubator/openejb/trunk/openejb3/server/openejb-http/src/test/java/org/apache/openejb/server/httpd/SomeoneBrokeSurefireAndThisIsADirtyHackForItTest.java Wed Dec  6 15:22:23 2006
@@ -37,6 +37,7 @@
 public class SomeoneBrokeSurefireAndThisIsADirtyHackForItTest extends TestCase {
     public static Test suite() {
         System.setProperty("openejb.assembler", org.apache.openejb.assembler.classic.Assembler.class.getName());
+        System.setProperty("openejb.deployments.classpath.include", ".*openejb-itests-beans.*");
         return HttpEjbServerTest.suite();
     }
 }