Author: pete.muir(a)jboss.org
Date: 2009-03-15 15:25:33 -0400 (Sun, 15 Mar 2009)
New Revision: 2011
Added:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/AbstractScanner.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEWebBeanDiscovery.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/Scanner.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/URLScanner.java
extensions/trunk/se/test-output/
extensions/trunk/se/test-output/emailable-report.html
extensions/trunk/se/test-output/index.html
extensions/trunk/se/test-output/se-module/
extensions/trunk/se/test-output/se-module/classes.html
extensions/trunk/se/test-output/se-module/groups.html
extensions/trunk/se/test-output/se-module/index.html
extensions/trunk/se/test-output/se-module/main.html
extensions/trunk/se/test-output/se-module/methods-alphabetical.html
extensions/trunk/se/test-output/se-module/methods-not-run.html
extensions/trunk/se/test-output/se-module/methods.html
extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.html
extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.properties
extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.xml
extensions/trunk/se/test-output/se-module/reporter-output.html
extensions/trunk/se/test-output/se-module/testng.xml.html
extensions/trunk/se/test-output/se-module/toc.html
extensions/trunk/se/test-output/testng-results.xml
extensions/trunk/se/test-output/testng.css
Removed:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryException.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryImpl.java
Modified:
extensions/trunk/se/
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/resources/NoNamingContext.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java
Log:
Simplify class discovery
Property changes on: extensions/trunk/se
___________________________________________________________________
Name: svn:ignore
- nbactions.xml
target
.classpath
.project
.settings
+ nbactions.xml
target
.classpath
.project
.settings
temp-testng-customsuite.xml
Modified:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java
===================================================================
---
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java 2009-03-15
18:47:48 UTC (rev 2010)
+++
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java 2009-03-15
19:25:33 UTC (rev 2011)
@@ -26,7 +26,7 @@
import org.jboss.webbeans.context.api.BeanStore;
import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
import org.jboss.webbeans.environment.se.beans.ParametersFactory;
-import org.jboss.webbeans.environment.se.discovery.WebBeanDiscoveryImpl;
+import org.jboss.webbeans.environment.se.discovery.SEWebBeanDiscovery;
import org.jboss.webbeans.environment.se.events.Shutdown;
import org.jboss.webbeans.environment.se.resources.NoNamingContext;
import org.jboss.webbeans.environment.se.util.Reflections;
@@ -71,8 +71,8 @@
private void go()
{
bootstrap.setEnvironment(Environments.SE);
- bootstrap.getServices().add(WebBeanDiscovery.class, new WebBeanDiscoveryImpl());
- bootstrap.getServices().add(NamingContext.class, new NoNamingContext());
+ bootstrap.getServices().add(WebBeanDiscovery.class, new SEWebBeanDiscovery() {});
+ bootstrap.getServices().add(NamingContext.class, new NoNamingContext() {});
bootstrap.setApplicationContext(applicationBeanStore);
bootstrap.initialize();
bootstrap.boot();
Added:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/AbstractScanner.java
===================================================================
---
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/AbstractScanner.java
(rev 0)
+++
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/AbstractScanner.java 2009-03-15
19:25:33 UTC (rev 2011)
@@ -0,0 +1,83 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.webbeans.environment.se.discovery;
+
+import java.net.URL;
+
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+
+/**
+ * Abstract base class for {@link Scanner} providing common functionality
+ *
+ * This class provides file-system orientated scanning
+ *
+ * @author Pete Muir
+ *
+ */
+public abstract class AbstractScanner implements Scanner
+{
+
+ private static final LogProvider log = Logging.getLogProvider(Scanner.class);
+ private final ClassLoader classLoader;
+ private final SEWebBeanDiscovery webBeanDiscovery;
+
+ public AbstractScanner(ClassLoader classLoader, SEWebBeanDiscovery webBeanDiscovery)
+ {
+ this.classLoader = classLoader;
+ this.webBeanDiscovery = webBeanDiscovery;
+ }
+
+ protected void handle(String name, URL url)
+ {
+ if (name.endsWith(".class"))
+ {
+ String className = filenameToClassname(name);
+ try
+ {
+ webBeanDiscovery.getWbClasses().add(getClassLoader().loadClass(className));
+ }
+ catch (NoClassDefFoundError e)
+ {
+ log.error("Error loading " + name, e);
+ }
+ catch (ClassNotFoundException e)
+ {
+ log.error("Error loading " + name, e);
+ }
+ }
+ else if (name.endsWith("beans.xml"))
+ {
+ webBeanDiscovery.getWbUrls().add(url);
+ }
+ }
+
+ public ClassLoader getClassLoader()
+ {
+ return classLoader;
+ }
+
+ /**
+ * Convert a path to a class file to a class name
+ */
+ public static String filenameToClassname(String filename)
+ {
+ return filename.substring( 0, filename.lastIndexOf(".class") )
+ .replace('/', '.').replace('\\', '.');
+ }
+
+}
Copied:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEWebBeanDiscovery.java
(from rev 2010,
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryImpl.java)
===================================================================
---
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEWebBeanDiscovery.java
(rev 0)
+++
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEWebBeanDiscovery.java 2009-03-15
19:25:33 UTC (rev 2011)
@@ -0,0 +1,74 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.webbeans.environment.se.discovery;
+
+import java.net.URL;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.environment.se.util.Reflections;
+
+/**
+ * The means by which Web Beans are discovered on the classpath. This will only
+ * discover simple web beans - there is no EJB/Servlet/JPA integration.
+ *
+ * @author Peter Royle
+ * @author Pete Muir
+ * @author Ales Justin
+ */
+public abstract class SEWebBeanDiscovery implements WebBeanDiscovery
+{
+
+ private final Set<Class<?>> wbClasses;
+ private final Set<URL> wbUrls;
+
+ public SEWebBeanDiscovery()
+ {
+ this.wbClasses = new HashSet<Class<?>>();
+ this.wbUrls = new HashSet<URL>();
+ scan();
+ }
+
+ public Iterable<Class<?>> discoverWebBeanClasses()
+ {
+ return Collections.unmodifiableSet(wbClasses);
+ }
+
+ public Iterable<URL> discoverWebBeansXml()
+ {
+ return Collections.unmodifiableSet(wbUrls);
+ }
+
+ public Set<Class<?>> getWbClasses()
+ {
+ return wbClasses;
+ }
+
+ public Set<URL> getWbUrls()
+ {
+ return wbUrls;
+ }
+
+ private void scan()
+ {
+ Scanner scanner = new URLScanner(Reflections.getClassLoader(), this);
+ scanner.scanResources(new String[] { "beans.xml" });
+ }
+
+}
Added:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/Scanner.java
===================================================================
---
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/Scanner.java
(rev 0)
+++
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/Scanner.java 2009-03-15
19:25:33 UTC (rev 2011)
@@ -0,0 +1,47 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.webbeans.environment.se.discovery;
+
+import java.io.File;
+
+/**
+ * The Scanner is used to find resources to be processed by Seam
+ *
+ * The processing is done by {@link DeploymentHandler}s
+ *
+ * @author Pete Muir
+ *
+ */
+public interface Scanner
+{
+ /**
+ * Recursively scan directories.
+ *
+ * @param directories
+ * An array of the roots of the directory trees to scan
+ */
+ public void scanDirectories(File[] directories);
+
+ /**
+ * Scan for structures which contain any of the given resources in their root
+ *
+ * @param resources
+ * The resources to scan for
+ */
+ public void scanResources(String[] resources);
+
+}
Added:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/URLScanner.java
===================================================================
---
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/URLScanner.java
(rev 0)
+++
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/URLScanner.java 2009-03-15
19:25:33 UTC (rev 2011)
@@ -0,0 +1,199 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed 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.jboss.webbeans.environment.se.discovery;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.net.URLDecoder;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipException;
+import java.util.zip.ZipFile;
+
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+
+/**
+ * Implementation of {@link Scanner} which can scan a {@link URLClassLoader}
+ *
+ * @author Thomas Heute
+ * @author Gavin King
+ * @author Norman Richards
+ * @author Pete Muir
+ *
+ */
+public class URLScanner extends AbstractScanner
+{
+ private static final LogProvider log = Logging.getLogProvider(URLScanner.class);
+
+ public URLScanner(ClassLoader classLoader, SEWebBeanDiscovery webBeanDiscovery)
+ {
+ super(classLoader, webBeanDiscovery);
+ }
+
+ public void scanDirectories(File[] directories)
+ {
+ for (File directory : directories)
+ {
+ handleDirectory(directory, null);
+ }
+ }
+
+ public void scanResources(String[] resources)
+ {
+ Set<String> paths = new HashSet<String>();
+
+ for (String resourceName : resources)
+ {
+ try
+ {
+ Enumeration<URL> urlEnum =
getClassLoader().getResources(resourceName);
+
+ while (urlEnum.hasMoreElements())
+ {
+ String urlPath = urlEnum.nextElement().getFile();
+ urlPath = URLDecoder.decode(urlPath, "UTF-8");
+
+ if (urlPath.startsWith("file:"))
+ {
+ urlPath = urlPath.substring(5);
+ }
+
+ if (urlPath.indexOf('!') > 0)
+ {
+ urlPath = urlPath.substring(0, urlPath.indexOf('!'));
+ }
+ else
+ {
+ File dirOrArchive = new File(urlPath);
+
+ if ((resourceName != null) &&
(resourceName.lastIndexOf('/') > 0))
+ {
+ // for META-INF/components.xml
+ dirOrArchive = dirOrArchive.getParentFile();
+ }
+
+ urlPath = dirOrArchive.getParent();
+ }
+
+ paths.add(urlPath);
+ }
+ }
+ catch (IOException ioe)
+ {
+ log.warn("could not read: " + resourceName, ioe);
+ }
+ }
+
+ handle(paths);
+ }
+
+ protected void handle(Set<String> paths)
+ {
+ for (String urlPath : paths)
+ {
+ try
+ {
+ log.trace("scanning: " + urlPath);
+
+ File file = new File(urlPath);
+
+ if (file.isDirectory())
+ {
+ handleDirectory(file, null);
+ }
+ else
+ {
+ handleArchiveByFile(file);
+ }
+ }
+ catch (IOException ioe)
+ {
+ log.warn("could not read entries", ioe);
+ }
+ }
+ }
+
+ private void handleArchiveByFile(File file) throws IOException
+ {
+ try
+ {
+ log.trace("archive: " + file);
+
+ ZipFile zip = new ZipFile(file);
+ Enumeration<? extends ZipEntry> entries = zip.entries();
+
+ while (entries.hasMoreElements())
+ {
+ ZipEntry entry = entries.nextElement();
+ String name = entry.getName();
+ handle(name, getClassLoader().getResource(name));
+ }
+ }
+ catch (ZipException e)
+ {
+ throw new RuntimeException("Error handling file " + file, e);
+ }
+ }
+
+ private void handleDirectory(File file, String path)
+ {
+ handleDirectory(file, path, new File[0]);
+ }
+
+ private void handleDirectory(File file, String path, File[] excludedDirectories)
+ {
+ for (File excludedDirectory : excludedDirectories)
+ {
+ if (file.equals(excludedDirectory))
+ {
+ log.trace("skipping excluded directory: " + file);
+
+ return;
+ }
+ }
+
+ log.trace("handling directory: " + file);
+
+ for (File child : file.listFiles())
+ {
+ String newPath = (path == null) ? child.getName() : (path + '/' +
child.getName());
+
+ if (child.isDirectory())
+ {
+ handleDirectory(child, newPath, excludedDirectories);
+ }
+ else
+ {
+ try
+ {
+ handle(newPath, child.toURI().toURL());
+ }
+ catch (MalformedURLException e)
+ {
+ log.error("Error loading file " + newPath);
+ }
+ }
+ }
+ }
+
+}
Deleted:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryException.java
===================================================================
---
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryException.java 2009-03-15
18:47:48 UTC (rev 2010)
+++
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryException.java 2009-03-15
19:25:33 UTC (rev 2011)
@@ -1,41 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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.jboss.webbeans.environment.se.discovery;
-
-/**
- * Thrown if there's an error during Web Bean discoery that will stop the
- * manager from starting up.
- *
- * @author Peter Royle
- */
-public class WebBeanDiscoveryException extends RuntimeException
-{
- public WebBeanDiscoveryException(Throwable cause)
- {
- super(cause);
- }
-
- public WebBeanDiscoveryException(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- public WebBeanDiscoveryException(String message)
- {
- super(message);
- }
-}
Deleted:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryImpl.java
===================================================================
---
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryImpl.java 2009-03-15
18:47:48 UTC (rev 2010)
+++
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryImpl.java 2009-03-15
19:25:33 UTC (rev 2011)
@@ -1,101 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed 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.jboss.webbeans.environment.se.discovery;
-
-import java.io.File;
-import java.net.URL;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.log4j.Logger;
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
-import org.jboss.webbeans.ejb.spi.EjbDescriptor;
-import org.jboss.webbeans.environment.se.deployment.ClassDescriptor;
-import org.jboss.webbeans.environment.se.deployment.DeploymentHandler;
-import org.jboss.webbeans.environment.se.deployment.FileDescriptor;
-import org.jboss.webbeans.environment.se.deployment.SimpleWebBeansDeploymentHandler;
-import org.jboss.webbeans.environment.se.deployment.URLScanner;
-import org.jboss.webbeans.environment.se.deployment.WebBeansXmlDeploymentHandler;
-
-/**
- * The means by which Web Beans are discovered on the classpath. This will only
- * discover simple web beans - there is no EJB/Servlet/JPA integration.
- *
- * @author Peter Royle. Adapted from
- * org.jboss.webbeans.integration.jbossas.WebBeansDiscoveryImpl (author
- * unknown)
- */
-public class WebBeanDiscoveryImpl implements WebBeanDiscovery
-{
-
- private Set<Class<?>> wbClasses = new HashSet<Class<?>>();
- private Set<URL> wbUrls = new HashSet<URL>();
- // private StandardDeploymentStrategy deploymentStrategy;
- private SimpleWebBeansDeploymentHandler simpleWebBeansDeploymentHandler = new
SimpleWebBeansDeploymentHandler();
- private WebBeansXmlDeploymentHandler webBeansXmlDeploymentHandler = new
WebBeansXmlDeploymentHandler();
- URLScanner urlScanner;
-
- // The log provider
- private static Logger log = Logger.getLogger(WebBeanDiscoveryImpl.class.getName());
-
- public WebBeanDiscoveryImpl()
- {
- final ClassLoader contextClassLoader =
Thread.currentThread().getContextClassLoader();
- Set<DeploymentHandler> deploymentHandlers = new
HashSet<DeploymentHandler>();
- deploymentHandlers.add(simpleWebBeansDeploymentHandler);
- deploymentHandlers.add(webBeansXmlDeploymentHandler);
-
- urlScanner = new URLScanner(deploymentHandlers, contextClassLoader);
- urlScanner.scanResources(new String[] { "beans.xml" });
- urlScanner.scanDirectories(new File[] {});
-
- findWebBeansXmlUrls();
- findWebBeansAnnotatedClasses();
- }
-
- public Iterable<EjbDescriptor<?>> discoverEjbs()
- {
- return new HashSet<EjbDescriptor<?>>();
- }
-
- public Iterable<Class<?>> discoverWebBeanClasses()
- {
- return wbClasses;
- }
-
- public Iterable<URL> discoverWebBeansXml()
- {
- return wbUrls;
- }
-
- private void findWebBeansAnnotatedClasses() throws WebBeanDiscoveryException
- {
- for (ClassDescriptor classDesc : simpleWebBeansDeploymentHandler.getClasses())
- {
- final Class<?> clazz = classDesc.getClazz();
- wbClasses.add(clazz);
- }
- }
-
- private void findWebBeansXmlUrls()
- {
- for (FileDescriptor fileDesc : webBeansXmlDeploymentHandler.getResources())
- {
- wbUrls.add(fileDesc.getUrl());
- }
- }
-}
Modified:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/resources/NoNamingContext.java
===================================================================
---
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/resources/NoNamingContext.java 2009-03-15
18:47:48 UTC (rev 2010)
+++
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/resources/NoNamingContext.java 2009-03-15
19:25:33 UTC (rev 2011)
@@ -22,7 +22,7 @@
*
* @author Peter Royle
*/
-public class NoNamingContext implements NamingContext
+public abstract class NoNamingContext implements NamingContext
{
public NoNamingContext()
Modified:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java
===================================================================
---
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java 2009-03-15
18:47:48 UTC (rev 2010)
+++
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java 2009-03-15
19:25:33 UTC (rev 2011)
@@ -46,4 +46,16 @@
}
}
+ public static ClassLoader getClassLoader()
+ {
+ if (Thread.currentThread().getContextClassLoader() != null)
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ else
+ {
+ return Reflections.class.getClassLoader();
+ }
+ }
+
}
Added: extensions/trunk/se/test-output/emailable-report.html
===================================================================
--- extensions/trunk/se/test-output/emailable-report.html (rev 0)
+++ extensions/trunk/se/test-output/emailable-report.html 2009-03-15 19:25:33 UTC (rev
2011)
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN
http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>TestNG: Unit Test</title>
+<style type="text/css">
+table caption,table.info_table,table.param,table.passed,table.failed
{margin-bottom:10px;border:1px solid #000099;border-collapse:collapse;empty-cells:show;}
+table.info_table td,table.info_table th,table.param td,table.param th,table.passed
td,table.passed th,table.failed td,table.failed th {
+border:1px solid #000099;padding:.25em .5em .25em .5em
+}
+table.param th {vertical-align:bottom}
+td.numi,th.numi,td.numi_attn {
+text-align:right
+}
+tr.total td {font-weight:bold}
+table caption {
+text-align:center;font-weight:bold;
+}
+table.passed tr.stripe td,table tr.passedodd td {background-color: #00AA00;}
+table.passed td,table tr.passedeven td {background-color: #33FF33;}
+table.passed tr.stripe td,table tr.skippedodd td {background-color: #cccccc;}
+table.passed td,table tr.skippedodd td {background-color: #dddddd;}
+table.failed tr.stripe td,table tr.failedodd td,table.param td.numi_attn
{background-color: #FF3333;}
+table.failed td,table tr.failedeven td,table.param tr.stripe td.numi_attn
{background-color: #DD0000;}
+tr.stripe td,tr.stripe th {background-color: #E6EBF9;}
+p.totop {font-size:85%;text-align:center;border-bottom:2px black solid}
+div.shootout {padding:2em;border:3px #4854A8 solid}
+</style>
+</head>
+<body>
+<table cellspacing=0 cellpadding=0 class="param">
+<tr><th>Test</th><th
class="numi">Methods<br/>Passed</th><th
class="numi">Scenarios<br/>Passed</th><th
class="numi"># skipped</th><th class="numi">#
failed</th><th class="numi">Total<br/>Time</th><th
class="numi">Included<br/>Groups</th><th
class="numi">Excluded<br/>Groups</th></tr>
+<tr><td
style="text-align:left;padding-right:2em">org.jboss.webbeans.environment.se.test.StartMainTest</td><td
class="numi">1</td><td class="numi">1</td><td
class="numi">0</td><td class="numi">0</td><td
class="numi">6.4 seconds</td><td
class="numi"></td><td
class="numi"></td></tr>
+</table>
+<a id="summary"></a>
+<table cellspacing=0 cellpadding=0 class="passed">
+<tr><th>Class</th><th>Method</th><th>#
of<br/>Scenarios</th><th>Time<br/>(Msecs)</th></tr>
+<tr><th
colspan="4">org.jboss.webbeans.environment.se.test.StartMainTest —
passed</th></tr>
+<tr class="passedodd"><td
rowspan="1">org.jboss.webbeans.environment.se.test.StartMainTest<td><a
href="#m1">testMain</a></td><td
class="numi">1</td><td
class="numi">6334</td></tr>
+</table>
+<h1>org.jboss.webbeans.environment.se.test.StartMainTest</h1>
+<a
id="m1"></a><h2>org.jboss.webbeans.environment.se.test.StartMainTest:testMain</h2>
+<p class="totop"><a href="#summary">back to
summary</a></p>
+</body></html>
Property changes on: extensions/trunk/se/test-output/emailable-report.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/index.html
===================================================================
--- extensions/trunk/se/test-output/index.html (rev 0)
+++ extensions/trunk/se/test-output/index.html 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,9 @@
+<html>
+<head><title>Test results</title><link href="./testng.css"
rel="stylesheet" type="text/css" />
+<link href="./my-testng.css" rel="stylesheet"
type="text/css" />
+</head><body>
+<h2><p align='center'>Test results</p></h2>
+<table border='1' width='100%'
class='main-page'><tr><th>Suite</th><th>Passed</th><th>Failed</th><th>Skipped</th><th>testng.xml</th></tr>
+<tr align='center'
class='invocation-passed'><td><em>Total</em></td><td><em>1</em></td><td><em>0</em></td><td><em>0</em></td><td> </td></tr>
+<tr align='center' class='invocation-passed'><td><a
href='se-module/index.html'>se-module</a></td>
+<td>1</td><td>0</td><td>0</td><td><a
href='se-module/testng.xml.html'>Link</a></td></tr></table></body></html>
Property changes on: extensions/trunk/se/test-output/index.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/classes.html
===================================================================
--- extensions/trunk/se/test-output/se-module/classes.html (rev
0)
+++ extensions/trunk/se/test-output/se-module/classes.html 2009-03-15 19:25:33 UTC (rev
2011)
@@ -0,0 +1,28 @@
+<table border='1'>
+<tr>
+<th>Class name</th>
+<th>Method name</th>
+<th>Groups</th>
+</tr><tr>
+<td>org.jboss.webbeans.environment.se.test.StartMainTest</td>
+<td> </td><td> </td></tr>
+<tr>
+<td align='center' colspan='3'>@Test</td>
+</tr>
+<tr>
+<td> </td>
+<td>testMain</td>
+<td> </td></tr>
+<tr>
+<td align='center' colspan='3'>@BeforeClass</td>
+</tr>
+<tr>
+<td align='center' colspan='3'>@BeforeMethod</td>
+</tr>
+<tr>
+<td align='center' colspan='3'>@AfterMethod</td>
+</tr>
+<tr>
+<td align='center' colspan='3'>@AfterClass</td>
+</tr>
+</table>
Property changes on: extensions/trunk/se/test-output/se-module/classes.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/groups.html
===================================================================
--- extensions/trunk/se/test-output/se-module/groups.html (rev 0)
+++ extensions/trunk/se/test-output/se-module/groups.html 2009-03-15 19:25:33 UTC (rev
2011)
@@ -0,0 +1 @@
+<h2>Groups used for this test run</h2>
\ No newline at end of file
Property changes on: extensions/trunk/se/test-output/se-module/groups.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/index.html
===================================================================
--- extensions/trunk/se/test-output/se-module/index.html (rev 0)
+++ extensions/trunk/se/test-output/se-module/index.html 2009-03-15 19:25:33 UTC (rev
2011)
@@ -0,0 +1,6 @@
+<html><head><title>Results for se-module</title></head>
+<frameset cols="26%,74%">
+<frame src="toc.html" name="navFrame">
+<frame src="main.html" name="mainFrame">
+</frameset>
+</html>
Property changes on: extensions/trunk/se/test-output/se-module/index.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/main.html
===================================================================
--- extensions/trunk/se/test-output/se-module/main.html (rev 0)
+++ extensions/trunk/se/test-output/se-module/main.html 2009-03-15 19:25:33 UTC (rev
2011)
@@ -0,0 +1,2 @@
+<html><head><title>Results for se-module</title></head>
+<body>Select a result on the left-hand pane.</body></html>
Property changes on: extensions/trunk/se/test-output/se-module/main.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/methods-alphabetical.html
===================================================================
--- extensions/trunk/se/test-output/se-module/methods-alphabetical.html
(rev 0)
+++ extensions/trunk/se/test-output/se-module/methods-alphabetical.html 2009-03-15
19:25:33 UTC (rev 2011)
@@ -0,0 +1,6 @@
+<h2>Methods run, sorted chronologically</h2><h3>>> means
before, << means
after</h3><p/><br/><em>se-module</em><p/><small><i>(Hover
the method name to see the test class name)</i></small><p/>
+<table border="1">
+<tr><th>Time</th><th>Delta
(ms)</th><th>Suite<br>configuration</th><th>Test<br>configuration</th><th>Class<br>configuration</th><th>Groups<br>configuration</th><th>Method<br>configuration</th><th>Test<br>method</th><th>Thread</th><th>Instances</th></tr>
+<tr bgcolor="c9f997"> <td>09/03/15 19:22:43</td>
<td>0</td>
<td> </td><td> </td><td> </td><td> </td><td> </td><td
title="org.jboss.webbeans.environment.se.test.StartMainTest.testMain()">testMain</td>
+ <td>main@560069853</td> <td></td> </tr>
+</table>
Property changes on: extensions/trunk/se/test-output/se-module/methods-alphabetical.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/methods-not-run.html
===================================================================
--- extensions/trunk/se/test-output/se-module/methods-not-run.html
(rev 0)
+++ extensions/trunk/se/test-output/se-module/methods-not-run.html 2009-03-15 19:25:33 UTC
(rev 2011)
@@ -0,0 +1,2 @@
+<h2>Methods that were not run</h2><table>
+</table>
\ No newline at end of file
Property changes on: extensions/trunk/se/test-output/se-module/methods-not-run.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/methods.html
===================================================================
--- extensions/trunk/se/test-output/se-module/methods.html (rev
0)
+++ extensions/trunk/se/test-output/se-module/methods.html 2009-03-15 19:25:33 UTC (rev
2011)
@@ -0,0 +1,6 @@
+<h2>Methods run, sorted chronologically</h2><h3>>> means
before, << means
after</h3><p/><br/><em>se-module</em><p/><small><i>(Hover
the method name to see the test class name)</i></small><p/>
+<table border="1">
+<tr><th>Time</th><th>Delta
(ms)</th><th>Suite<br>configuration</th><th>Test<br>configuration</th><th>Class<br>configuration</th><th>Groups<br>configuration</th><th>Method<br>configuration</th><th>Test<br>method</th><th>Thread</th><th>Instances</th></tr>
+<tr bgcolor="c9f997"> <td>09/03/15 19:22:43</td>
<td>0</td>
<td> </td><td> </td><td> </td><td> </td><td> </td><td
title="org.jboss.webbeans.environment.se.test.StartMainTest.testMain()">testMain</td>
+ <td>main@560069853</td> <td></td> </tr>
+</table>
Property changes on: extensions/trunk/se/test-output/se-module/methods.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.html
===================================================================
---
extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.html
(rev 0)
+++
extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.html 2009-03-15
19:25:33 UTC (rev 2011)
@@ -0,0 +1,83 @@
+<html>
+<head>
+<title>TestNG: org.jboss.webbeans.environment.se.test.StartMainTest</title>
+<link href="../testng.css" rel="stylesheet"
type="text/css" />
+<link href="../my-testng.css" rel="stylesheet"
type="text/css" />
+
+<style type="text/css">
+.log { display: none;}
+.stack-trace { display: none;}
+</style>
+<script type="text/javascript">
+<!--
+function flip(e) {
+ current = e.style.display;
+ if (current == 'block') {
+ e.style.display = 'none';
+ return 0;
+ }
+ else {
+ e.style.display = 'block';
+ return 1;
+ }
+}
+
+function toggleBox(szDivId, elem, msg1, msg2)
+{
+ var res = -1; if (document.getElementById) {
+ res = flip(document.getElementById(szDivId));
+ }
+ else if (document.all) {
+ // this is the way old msie versions work
+ res = flip(document.all[szDivId]);
+ }
+ if(elem) {
+ if(res == 0) elem.innerHTML = msg1; else elem.innerHTML = msg2;
+ }
+
+}
+
+function toggleAllBoxes() {
+ if (document.getElementsByTagName) {
+ d = document.getElementsByTagName('div');
+ for (i = 0; i < d.length; i++) {
+ if (d[i].className == 'log') {
+ flip(d[i]);
+ }
+ }
+ }
+}
+
+// -->
+</script>
+
+</head>
+<body>
+<h2
align='center'>org.jboss.webbeans.environment.se.test.StartMainTest</h2><table
border='1' align="center">
+<tr>
+<td>Tests passed/Failed/Skipped:</td><td>1/0/0</td>
+</tr><tr>
+<td>Started on:</td><td>Sun Mar 15 19:22:43 GMT 2009</td>
+</tr>
+<tr><td>Total time:</td><td>6 seconds (6376 ms)</td>
+</tr><tr>
+<td>Included groups:</td><td></td>
+</tr><tr>
+<td>Excluded groups:</td><td></td>
+</tr>
+</table><p/>
+<small><i>(Hover the method name to see the test class
name)</i></small><p/>
+<table width='100%' border='1' class='invocation-passed'>
+<tr><td colspan='3' align='center'><b>PASSED
TESTS</b></td></tr>
+<tr><td><b>Test method</b></td>
+<td width="10%"><b>Time (seconds)</b></td>
+<td width="30%"><b>Exception</b></td>
+</tr>
+<tr>
+<td
title='org.jboss.webbeans.environment.se.test.StartMainTest.testMain()'>testMain</td>
+<td>6</td>
+<td></td>
+</tr>
+</table><p>
+</body>
+</html>
\ No newline at end of file
Property changes on:
extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.properties
===================================================================
---
extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.properties
(rev 0)
+++
extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.properties 2009-03-15
19:25:33 UTC (rev 2011)
@@ -0,0 +1 @@
+[SuiteResult org.jboss.webbeans.environment.se.test.StartMainTest]
\ No newline at end of file
Property changes on:
extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.xml
===================================================================
---
extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.xml
(rev 0)
+++
extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.xml 2009-03-15
19:25:33 UTC (rev 2011)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<testsuite name="org.jboss.webbeans.environment.se.test.StartMainTest"
failures="0" tests="1" time="6.376"
errors="0">
+ <properties/>
+ <testcase name="testMain" time="6.334"
classname="org.jboss.webbeans.environment.se.test.StartMainTest"/>
+</testsuite>
Property changes on:
extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/reporter-output.html
===================================================================
--- extensions/trunk/se/test-output/se-module/reporter-output.html
(rev 0)
+++ extensions/trunk/se/test-output/se-module/reporter-output.html 2009-03-15 19:25:33 UTC
(rev 2011)
@@ -0,0 +1 @@
+<h2>Reporter output</h2><table></table>
\ No newline at end of file
Property changes on: extensions/trunk/se/test-output/se-module/reporter-output.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/testng.xml.html
===================================================================
--- extensions/trunk/se/test-output/se-module/testng.xml.html (rev
0)
+++ extensions/trunk/se/test-output/se-module/testng.xml.html 2009-03-15 19:25:33 UTC (rev
2011)
@@ -0,0 +1 @@
+<html><head><title>testng.xml for
se-module</title></head><body><tt><!DOCTYP...!
t><br/></suite><br/></tt></body></html>
\ No newline at end of file
Property changes on: extensions/trunk/se/test-output/se-module/testng.xml.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/toc.html
===================================================================
--- extensions/trunk/se/test-output/se-module/toc.html (rev 0)
+++ extensions/trunk/se/test-output/se-module/toc.html 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,30 @@
+<html>
+<head>
+<title>Results for se-module</title>
+<link href="../testng.css" rel="stylesheet"
type="text/css" />
+<link href="../my-testng.css" rel="stylesheet"
type="text/css" />
+</head>
+<body>
+<h3><p align="center">Results
for<br/><em>se-module</em></p></h3>
+<table border='1' width='100%'>
+<tr valign='top'>
+<td>1 test</td>
+<td><a target='mainFrame' href='classes.html'>1
class</a></td>
+<td>1 method:<br/>
+ <a target='mainFrame'
href='methods.html'>chronological</a><br/>
+ <a target='mainFrame'
href='methods-alphabetical.html'>alphabetical</a><br/>
+ <a target='mainFrame'
href='methods-not-run.html'>not run (0)</a></td>
+</tr>
+<tr>
+<td><a target='mainFrame' href='groups.html'>0
group</a></td>
+<td><a target='mainFrame'
href='reporter-output.html'>reporter output</a></td>
+<td><a target='mainFrame'
href='testng.xml.html'>testng.xml</a></td>
+</tr></table>
+<table width='100%' class='test-passed'>
+<tr><td>
+<table style='width: 100%'><tr><td
valign='top'>org.jboss.webbeans.environment.se.test.StartMainTest
(1/0/0)</td><td valign='top' align='right'>
+ <a href='org.jboss.webbeans.environment.se.test.StartMainTest.html'
target='mainFrame'>Results</a>
+</td></tr></table>
+</td></tr><p/>
+</table>
+</body></html>
\ No newline at end of file
Property changes on: extensions/trunk/se/test-output/se-module/toc.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/testng-results.xml
===================================================================
--- extensions/trunk/se/test-output/testng-results.xml (rev 0)
+++ extensions/trunk/se/test-output/testng-results.xml 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,14 @@
+<testng-results>
+ <reporter-output>
+ </reporter-output>
+ <suite name="se-module">
+ <groups>
+ </groups>
+ <test name="org.jboss.webbeans.environment.se.test.StartMainTest">
+ <class
name="org.jboss.webbeans.environment.se.test.StartMainTest">
+ <test-method status="PASS" signature="testMain()"
name="testMain" duration-ms="6334"
started-at="2009-03-15T19:22:43Z"
finished-at="2009-03-15T19:22:49Z">
+ </test-method>
+ </class>
+ </test>
+ </suite>
+</testng-results>
Property changes on: extensions/trunk/se/test-output/testng-results.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/testng.css
===================================================================
--- extensions/trunk/se/test-output/testng.css (rev 0)
+++ extensions/trunk/se/test-output/testng.css 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,9 @@
+.invocation-failed, .test-failed { background-color: #DD0000; }
+.invocation-percent, .test-percent { background-color: #006600; }
+.invocation-passed, .test-passed { background-color: #00AA00; }
+.invocation-skipped, .test-skipped { background-color: #CCCC00; }
+
+.main-page {
+ font-size: x-large;
+}
+
Property changes on: extensions/trunk/se/test-output/testng.css
___________________________________________________________________
Name: svn:mime-type
+ text/plain