[jboss-cvs] JBossAS SVN: r99590 - in projects/ejb3/components/nointerface/trunk: impl and 11 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jan 19 06:13:18 EST 2010
Author: jaikiran
Date: 2010-01-19 06:13:18 -0500 (Tue, 19 Jan 2010)
New Revision: 99590
Added:
projects/ejb3/components/nointerface/trunk/build/pom.xml
projects/ejb3/components/nointerface/trunk/impl/pom.xml
projects/ejb3/components/nointerface/trunk/impl/src/
projects/ejb3/components/nointerface/trunk/impl/src/main/
projects/ejb3/components/nointerface/trunk/impl/src/main/java/
projects/ejb3/components/nointerface/trunk/impl/src/main/java/org/
projects/ejb3/components/nointerface/trunk/impl/src/main/java/org/jboss/
projects/ejb3/components/nointerface/trunk/impl/src/main/java/org/jboss/ejb3/
projects/ejb3/components/nointerface/trunk/impl/src/main/java/org/jboss/ejb3/nointerface/
projects/ejb3/components/nointerface/trunk/impl/src/main/java/org/jboss/ejb3/nointerface/impl/
projects/ejb3/components/nointerface/trunk/impl/src/main/java/org/jboss/ejb3/nointerface/impl/deployers/
projects/ejb3/components/nointerface/trunk/impl/src/main/java/org/jboss/ejb3/nointerface/impl/invocationhandler/
projects/ejb3/components/nointerface/trunk/impl/src/main/java/org/jboss/ejb3/nointerface/impl/jndi/
projects/ejb3/components/nointerface/trunk/impl/src/main/java/org/jboss/ejb3/nointerface/impl/metadata/
projects/ejb3/components/nointerface/trunk/impl/src/main/java/org/jboss/ejb3/nointerface/impl/objectfactory/
projects/ejb3/components/nointerface/trunk/impl/src/main/java/org/jboss/ejb3/nointerface/impl/view/
projects/ejb3/components/nointerface/trunk/impl/src/test/
projects/ejb3/components/nointerface/trunk/impl/src/test/java/
projects/ejb3/components/nointerface/trunk/impl/src/test/java/org/jboss/ejb3/nointerface/test/factory/unit/NoInterfaceViewFactoryTestCase.java
projects/ejb3/components/nointerface/trunk/impl/src/test/resources/
Removed:
projects/ejb3/components/nointerface/trunk/impl/src/test/java/org/jboss/ejb3/nointerface/test/factory/unit/NoInterfaceViewFactoryTestCase.java
Modified:
projects/ejb3/components/nointerface/trunk/spi/pom.xml
Log:
EJBTHREE-1989 Moved code to impl module of nointerface from the earlier EJB3Trunk/nointerface location
Added: projects/ejb3/components/nointerface/trunk/build/pom.xml
===================================================================
--- projects/ejb3/components/nointerface/trunk/build/pom.xml (rev 0)
+++ projects/ejb3/components/nointerface/trunk/build/pom.xml 2010-01-19 11:13:18 UTC (rev 99590)
@@ -0,0 +1,207 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ vi:ts=2:sw=2:expandtab:
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-parent</artifactId>
+ <version>4</version>
+ </parent>
+
+ <!-- Model Version -->
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- Artifact Configuration -->
+ <groupId>org.jboss.ejb3.nointerface</groupId>
+ <artifactId>jboss-ejb3-nointerface-build</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <name>JBoss EJB3.1 no-interface build</name>
+ <description>Centralized Build Configuration for EJB 3.1+ no-interface support</description>
+ <packaging>pom</packaging>
+
+ <!-- Properties -->
+ <properties>
+
+ <!-- Versioning -->
+ <version.junit_junit>4.6</version.junit_junit>
+ <version.jboss.logging.spi>2.0.5.GA</version.jboss.logging.spi>
+ <version.jboss.logging.log4j>2.0.5.GA</version.jboss.logging.log4j>
+ </properties>
+
+ <!-- SCM -->
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/components/nointerface</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/ejb3/components/nointerface</developerConnection>
+ <url>http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/components/nointerface</url>
+ </scm>
+
+ <!-- Issues -->
+ <issueManagement>
+ <system>jira</system>
+ <url>http://jira.jboss.com/jira/browse/EJBTHREE</url>
+ </issueManagement>
+
+ <!-- Build -->
+ <build>
+
+ <plugins>
+
+ <!-- Compiler / JDK6 required for EJB 3.1 -->
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ <showDeprecation>false</showDeprecation>
+ <showWarnings>true</showWarnings>
+ <optimize>true</optimize>
+ <compilerVersion>1.6</compilerVersion>
+ <fork>true</fork>
+ <argLine>-Xmx512M</argLine>
+ <executable>${JAVA_HOME}/bin/javac</executable>
+ </configuration>
+ </plugin>
+
+ <!-- Surefire -->
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <trimStackTrace>false</trimStackTrace>
+ <printSummary>true</printSummary>
+ <includes>
+ <include>**/*TestCase.java</include>
+ <include>**/*TestSuite.java</include>
+ </includes>
+ <forkMode>always</forkMode>
+ <reportFormat>xml</reportFormat>
+ </configuration>
+ </plugin>
+
+ <!-- Maven Release Plugin Configuration -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <configuration>
+ <tagBase>https://svn.jboss.org/repos/jbossas/projects/ejb3/tags</tagBase>
+ </configuration>
+ </plugin>
+
+ <!-- Enforce Maven Environment -->
+ <plugin>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>enforce-maven-environment</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <rules>
+ <requireJavaVersion>
+ <version>1.6</version> <!-- Must be JDK6 -->
+ </requireJavaVersion>
+ <requireProperty>
+ <property>env.JAVA_HOME</property>
+ <message>"JAVA_HOME needs to be set to compile"</message>
+ </requireProperty>
+ </rules>
+ </configuration>
+ </plugin>
+ </plugins>
+
+ </build>
+
+ <!-- Dependency Management -->
+ <dependencyManagement>
+ <dependencies>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${version.junit_junit}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ <version>${version.jboss.logging.log4j}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ <version>${version.jboss.logging.spi}</version>
+ </dependency>
+
+
+ </dependencies>
+ </dependencyManagement>
+
+ <!-- Reporting -->
+ <reporting>
+ <plugins>
+
+ <!-- Cobertura (Code Coverage) -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <configuration>
+ <formats>
+ <format>html</format>
+ <format>xml</format>
+ </formats>
+ </configuration>
+ </plugin>
+
+ <!-- FindBugs -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ <configuration>
+ <xmlOutput>true</xmlOutput>
+ <findbugsXmlOutputDirectory>target/site</findbugsXmlOutputDirectory>
+ </configuration>
+ </plugin>
+
+ <!-- JavaDoc / APIViz -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <doclet>org.jboss.apiviz.APIviz</doclet>
+ <docletArtifact>
+ <groupId>org.jboss.apiviz</groupId>
+ <artifactId>apiviz</artifactId>
+ <version>1.3.0.GA</version>
+ </docletArtifact>
+ <useStandardDocletOptions>true</useStandardDocletOptions>
+ <charset>UTF-8</charset>
+ <encoding>UTF-8</encoding>
+ <docencoding>UTF-8</docencoding>
+ <breakiterator>true</breakiterator>
+ <version>true</version>
+ <author>true</author>
+ <keywords>true</keywords>
+ <additionalparam>
+ -sourceclasspath ${project.build.outputDirectory}
+ </additionalparam>
+ </configuration>
+ </plugin>
+
+
+ </plugins>
+ </reporting>
+
+</project>
+
Added: projects/ejb3/components/nointerface/trunk/impl/pom.xml
===================================================================
--- projects/ejb3/components/nointerface/trunk/impl/pom.xml (rev 0)
+++ projects/ejb3/components/nointerface/trunk/impl/pom.xml 2010-01-19 11:13:18 UTC (rev 99590)
@@ -0,0 +1,258 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.ejb3.nointerface</groupId>
+ <artifactId>jboss-ejb3-nointerface-build</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <!-- POM Model Version -->
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- Artifact Information -->
+ <groupId>org.jboss.ejb3.nointerface</groupId>
+ <artifactId>jboss-ejb3-nointerface-impl</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0.0-SNAPSHOT</version>
+ <name>JBoss EJB 3.1 Implementation of the no-interface view</name>
+ <url>http://labs.jboss.com/jbossejb3</url>
+ <description>A JBossMC based no-interface implementation for EJB3.1 beans (As defined by section 3.4.4 in EJB3.1 spec)</description>
+
+ <properties>
+ <version.nointerface.spi>1.0.0-SNAPSHOT</version.nointerface.spi>
+ <version.org.jboss.deployers>2.0.8.GA</version.org.jboss.deployers>
+ <version.org.jboss.ejb3_deployers>1.1.0</version.org.jboss.ejb3_deployers>
+ <version.org.jboss.microcontainer>2.0.8.GA</version.org.jboss.microcontainer>
+ <version.org.jboss_jbossxb>2.0.1.GA</version.org.jboss_jbossxb>
+ <version.javassist>3.7.1.GA</version.javassist>
+ <version.org.jboss.ejb3_jboss-ejb3-test>1.0.0</version.org.jboss.ejb3_jboss-ejb3-test>
+ <version.metadata_ejb>2.0.0-alpha-5</version.metadata_ejb>
+ <version.metadata_ear>2.0.0.Alpha</version.metadata_ear>
+ </properties>
+
+ <build>
+
+
+ <plugins>
+ <!-- We have a dependency on @LocalBean which comes from ejb3-api (=JDK6) -->
+ <plugin>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>enforce-jdk6</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireProperty>
+ <property>env.JDK6_HOME</property>
+ <message>JDK6_HOME is not set</message>
+ </requireProperty>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+
+ <!-- Use Java6 -->
+ <forkMode>once</forkMode>
+ <jvm>${JDK6_HOME}/bin/java</jvm>
+ <argLine>-Dxb.builder.useUnorderedSequence=true</argLine>
+ </configuration>
+ </plugin>
+
+
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ <executable>${JDK6_HOME}/bin/javac</executable>
+ </configuration>
+ </plugin>
+
+ <!-- Code coverage tool -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <!-- version 2.0 is intentional since other (later) version
+ seems to generate reports showing 0% coverage for all -->
+ <version>2.0</version>
+ </plugin>
+
+ </plugins>
+
+ </build>
+
+
+ <!-- Dependencies -->
+ <dependencies>
+
+ <!-- nointerface spi -->
+ <dependency>
+ <groupId>org.jboss.ejb3.nointerface</groupId>
+ <artifactId>jboss-ejb3-nointerface-spi</artifactId>
+ <version>${version.nointerface.spi}</version>
+ </dependency>
+
+
+
+
+ <!-- MC -->
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ <version>${version.org.jboss.microcontainer}</version>
+ </dependency>
+
+
+ <!-- Javassist -->
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>${version.javassist}</version>
+ </dependency>
+
+ <!-- JBoss logging -->
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </dependency>
+
+ <!-- JBoss Metadata -->
+ <dependency>
+ <groupId>org.jboss.metadata</groupId>
+ <artifactId>jboss-metadata-ejb</artifactId>
+ <version>${version.metadata_ejb}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossxb</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-mdr</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-reflect</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ </exclusion>
+
+ </exclusions>
+ </dependency>
+
+ <!-- JBoss EAR metadata
+ TODO: Try to avoid this. This is only needed (currently)
+ in the EJB3NoInterfaceDeployer which uses JBossAppMetaData to
+ check whether a deployment is an ear file
+ -->
+ <dependency>
+ <groupId>org.jboss.metadata</groupId>
+ <artifactId>jboss-metadata-ear</artifactId>
+ <version>${version.metadata_ear}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossxb</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-mdr</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-reflect</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ </exclusion>
+
+ </exclusions>
+ </dependency>
+
+ <!-- JBoss deployers -->
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ <version>${version.org.jboss.deployers}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-impl</artifactId>
+ <version>${version.org.jboss.deployers}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs</artifactId>
+ <version>${version.org.jboss.deployers}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-structure-spi</artifactId>
+ <version>${version.org.jboss.deployers}</version>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-endpoint</artifactId>
+ <version>0.1.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-deployers</artifactId>
+ <version>${version.org.jboss.ejb3_deployers}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.metadata</groupId>
+ <artifactId>jboss-metadata</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+
+ <!-- The EJB3.1 API support (ex: @LocalBean) -->
+ <dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-ejb-api_3.1</artifactId>
+ <version>1.0-alpha-1</version>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.jboss.naming</groupId>
+ <artifactId>jnp-client</artifactId>
+ <version>5.0.0.GA</version>
+ </dependency>
+
+ <!-- JUnit support -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Test support from jboss-ejb3-test -->
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-test</artifactId>
+ <version>${version.org.jboss.ejb3_jboss-ejb3-test}</version>
+ <scope>test</scope>
+ </dependency>
+
+
+ </dependencies>
+</project>
\ No newline at end of file
Copied: projects/ejb3/components/nointerface/trunk/impl/src/main/java/org/jboss/ejb3/nointerface/impl/deployers (from rev 99550, projects/ejb3/trunk/nointerface/src/main/java/org/jboss/ejb3/nointerface/impl/deployers)
Copied: projects/ejb3/components/nointerface/trunk/impl/src/main/java/org/jboss/ejb3/nointerface/impl/invocationhandler (from rev 99550, projects/ejb3/trunk/nointerface/src/main/java/org/jboss/ejb3/nointerface/impl/invocationhandler)
Copied: projects/ejb3/components/nointerface/trunk/impl/src/main/java/org/jboss/ejb3/nointerface/impl/jndi (from rev 99550, projects/ejb3/trunk/nointerface/src/main/java/org/jboss/ejb3/nointerface/impl/jndi)
Copied: projects/ejb3/components/nointerface/trunk/impl/src/main/java/org/jboss/ejb3/nointerface/impl/metadata (from rev 99550, projects/ejb3/trunk/nointerface/src/main/java/org/jboss/ejb3/nointerface/impl/metadata)
Copied: projects/ejb3/components/nointerface/trunk/impl/src/main/java/org/jboss/ejb3/nointerface/impl/objectfactory (from rev 99550, projects/ejb3/trunk/nointerface/src/main/java/org/jboss/ejb3/nointerface/impl/objectfactory)
Copied: projects/ejb3/components/nointerface/trunk/impl/src/main/java/org/jboss/ejb3/nointerface/impl/view (from rev 99550, projects/ejb3/trunk/nointerface/src/main/java/org/jboss/ejb3/nointerface/impl/view)
Copied: projects/ejb3/components/nointerface/trunk/impl/src/test/java (from rev 99536, projects/ejb3/trunk/nointerface/src/test/java)
Deleted: projects/ejb3/components/nointerface/trunk/impl/src/test/java/org/jboss/ejb3/nointerface/test/factory/unit/NoInterfaceViewFactoryTestCase.java
===================================================================
--- projects/ejb3/trunk/nointerface/src/test/java/org/jboss/ejb3/nointerface/test/factory/unit/NoInterfaceViewFactoryTestCase.java 2010-01-18 10:24:17 UTC (rev 99536)
+++ projects/ejb3/components/nointerface/trunk/impl/src/test/java/org/jboss/ejb3/nointerface/test/factory/unit/NoInterfaceViewFactoryTestCase.java 2010-01-19 11:13:18 UTC (rev 99590)
@@ -1,256 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.ejb3.nointerface.test.factory.unit;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-
-import org.jboss.ejb3.nointerface.factory.NoInterfaceEJBViewFactoryBase;
-import org.jboss.ejb3.nointerface.factory.NoInterfaceViewFactory;
-import org.jboss.ejb3.nointerface.test.viewcreator.SimpleSFSBeanWithoutInterfaces;
-import org.jboss.ejb3.nointerface.test.viewcreator.SimpleSLSBWithoutInterface;
-import org.jboss.logging.Logger;
-import org.junit.Test;
-
-/**
- * NoInterfaceBeansTestCase
- *
- * Tests the no-inteface view for beans.
- *
- * @author Jaikiran Pai
- * @version $Revision: $
- */
-public class NoInterfaceViewFactoryTestCase
-{
-
- /**
- * Logger
- */
- private static Logger logger = Logger.getLogger(NoInterfaceViewFactoryTestCase.class);
-
- private class DummyInvocationHandler implements InvocationHandler
- {
-
- private Object target;
-
- public DummyInvocationHandler(Object target)
- {
- if (target == null)
- {
- throw new IllegalArgumentException("Target object cannot be null, for invocation handler");
- }
- this.target = target;
- }
-
- /**
- * @see java.lang.reflect.InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
- */
- @Override
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- {
- // just pass on the call to the target
- return method.invoke(target, args);
- }
-
- }
-
- /**
- * Test to ensure that the no-interface view instance does NOT consider
- * a final method on the bean while creating the view
- *
- * @throws Exception
- */
- @Test
- public void testFinalMethodsAreNotConsideredInView() throws Exception
- {
- NoInterfaceViewFactory noInterfaceBeanFactory = new NoInterfaceEJBViewFactoryBase();
- SimpleSLSBWithoutInterface beanInstance = new SimpleSLSBWithoutInterface();
- Object proxy = noInterfaceBeanFactory.createView(new DummyInvocationHandler(beanInstance), beanInstance.getClass());
- // ensure that the returned object is not null and is of expected type
- assertNotNull("No-interface view factory returned a null view for " + beanInstance.getClass(), proxy);
- assertTrue("No-interface view factory returend an unexpected object type: " + proxy.getClass(), (proxy instanceof SimpleSLSBWithoutInterface));
-
- SimpleSLSBWithoutInterface noInterfaceView = (SimpleSLSBWithoutInterface) proxy;
-
- // Nothing fancy to test - just ensure that the declared methods in the proxy does
- // NOT contain a "final" method. Just check on method name, should be enough
- Method[] declaredMethods = noInterfaceView.getClass().getDeclaredMethods();
- for (Method declaredMethod : declaredMethods)
- {
- if (declaredMethod.getName().equals("someFinalMethod"))
- {
- fail("No-interface view has overriden a final method. It shouldn't have.");
- }
- }
-
- }
-
- /**
- * Test to ensure that the no-interface view instance does NOT consider
- * a static method on the bean while creating the view
- *
- * @throws Exception
- */
- @Test
- public void testStaticMethodsAreNotConsideredInView() throws Exception
- {
- NoInterfaceViewFactory noInterfaceBeanFactory = new NoInterfaceEJBViewFactoryBase();
- SimpleSFSBeanWithoutInterfaces beanInstance = new SimpleSFSBeanWithoutInterfaces();
- Object proxy = noInterfaceBeanFactory.createView(new DummyInvocationHandler(beanInstance), beanInstance.getClass());
- // ensure that the returned object is not null and is of expected type
- assertNotNull("No-interface view factory returned a null view for " + beanInstance.getClass(), proxy);
- assertTrue("No-interface view factory returend an unexpected object type: " + proxy.getClass(), (proxy instanceof SimpleSFSBeanWithoutInterfaces));
-
- SimpleSFSBeanWithoutInterfaces noInterfaceView = (SimpleSFSBeanWithoutInterfaces) proxy;
-
-
- // Nothing fancy to test - just ensure that the declared methods in the proxy does
- // NOT contain a "static" method. Just check on method name, should be enough
- Method[] declaredMethods = noInterfaceView.getClass().getDeclaredMethods();
- for (Method declaredMethod : declaredMethods)
- {
- if (declaredMethod.getName().equals("someStaticMethod"))
- {
- fail("No-interface view has overriden a static method. It shouldn't have.");
- }
- }
- }
-
-// /**
-// * Test to ensure that a no-interface view is NOT created for session beans
-// * which implement an interface (and do not explicitly mark themselves @LocalBean)
-// *
-// * @throws Exception
-// */
-// @Test
-// public void testBeanWithInterfacesIsNotEligibleForNoInterfaceView() throws Exception
-// {
-// JBossSessionBeanMetaData slsbMetadata = MetaDataHelper
-// .getMetadataFromBeanImplClass(StatelessBeanWithInterfaces.class);
-// String slsbNoInterfaceViewJNDIName = slsbMetadata.getEjbName() + "/no-interface";
-//
-// JBossSessionBeanMetaData sfsbMetadata = MetaDataHelper
-// .getMetadataFromBeanImplClass(StatefulBeanWithInterfaces.class);
-// String sfsbNoInterfaceViewJNDIName = sfsbMetadata.getEjbName() + "/no-interface";
-// String sfsbNoInterfaceViewFactoryJNDIName = sfsbMetadata.getEjbName() + "/no-interface-stateful-proxyfactory";
-//
-// Context ctx = new InitialContext();
-// // we have to ensure that there is NO no-interface view for these beans (because they are not eligible)
-// try
-// {
-// Object obj = ctx.lookup(slsbNoInterfaceViewJNDIName);
-// // this is a failure because there should not be a no-interface view for these beans
-// fail("A SLSB with interfaces was marked as eligible for no-interface view. Shouldn't have been. Found object of type "
-// + obj.getClass() + " in the jndi for jndiname " + slsbNoInterfaceViewJNDIName);
-// }
-// catch (NameNotFoundException nnfe)
-// {
-// // expected
-// }
-//
-// // now for sfsb, test that neither the factory nor the view are NOT bound
-//
-// // test factory binding
-// try
-// {
-// Object obj = ctx.lookup(sfsbNoInterfaceViewFactoryJNDIName);
-// // this is a failure because there should not be a no-interface view for these beans
-// fail("A SFSB factory for no-interface view was created for a bean implementing interfaces. Shouldn't have been. Found object of type "
-// + obj.getClass() + " in the jndi for jndiname " + sfsbNoInterfaceViewFactoryJNDIName);
-// }
-// catch (NameNotFoundException nnfe)
-// {
-// // expected
-// }
-// // sfsb no-interface view
-// try
-// {
-// Object obj = ctx.lookup(sfsbNoInterfaceViewJNDIName);
-// // this is a failure because there should not be a no-interface view for these beans
-// fail("A no-interface view for SFSB was created for a bean implementing interfaces. Shouldn't have been. Found object of type "
-// + obj.getClass() + " in the jndi for jndiname " + sfsbNoInterfaceViewJNDIName);
-// }
-// catch (NameNotFoundException nnfe)
-// {
-// // expected
-// }
-//
-// }
-//
-// /**
-// * Test that sessions are created as expected for stateful session beans
-// *
-// * @throws Exception
-// */
-// @Test
-// public void testSessionCreationForSFSBNoInterfaceViews() throws Exception
-// {
-// JBossSessionBeanMetaData sessionBeanMetadata = MetaDataHelper
-// .getMetadataFromBeanImplClass(SimpleSFSBeanWithoutInterfaces.class);
-// String jndiName = sessionBeanMetadata.getEjbName() + "/no-interface";
-//
-// Context ctx = new InitialContext();
-// // let's assume the lookup returns the correct type.
-// // there are other test cases to ensure it does return the correct type
-// SimpleSFSBeanWithoutInterfaces firstSFSB = (SimpleSFSBeanWithoutInterfaces) ctx.lookup(jndiName);
-// // ensure this is a clean bean
-// int initQty = firstSFSB.getQtyPurchased();
-// assertEquals("SFSB instance is not new", initQty, SimpleSFSBeanWithoutInterfaces.INITIAL_QTY);
-// // now change the state of the sfsb instance
-// firstSFSB.incrementPurchaseQty();
-// int incrementedValueForFirstSFSB = firstSFSB.getQtyPurchased();
-// assertEquals("SFSB instance's value not incremented", incrementedValueForFirstSFSB,
-// SimpleSFSBeanWithoutInterfaces.INITIAL_QTY + 1);
-//
-// // now lookup another bean
-// SimpleSFSBeanWithoutInterfaces secondSFSB = (SimpleSFSBeanWithoutInterfaces) ctx.lookup(jndiName);
-// // ensure this is a clean bean
-// int initQtyForSecondBeanInstance = secondSFSB.getQtyPurchased();
-// assertEquals("Second instance of SFSB is not new", initQtyForSecondBeanInstance,
-// SimpleSFSBeanWithoutInterfaces.INITIAL_QTY);
-// // now change the state of the sfsb instance by some x amount
-// int incrementBy = 10;
-// secondSFSB.incrementPurchaseQty(incrementBy);
-// int incrementedValueForSecondSFSB = secondSFSB.getQtyPurchased();
-// assertEquals("Second SFSB instance's value not incremented", incrementedValueForSecondSFSB,
-// SimpleSFSBeanWithoutInterfaces.INITIAL_QTY + incrementBy);
-//
-// // let's also (again) check that the first SFSB still has it's own values and hasn't been
-// // affected by changes made to second SFSB
-// assertEquals("Value in first SFSB was changed when second SFSB was being modified", incrementedValueForFirstSFSB,
-// SimpleSFSBeanWithoutInterfaces.INITIAL_QTY + 1);
-//
-// // also check equality of two sfsb instances - they should not be equal
-// assertFalse("Both the instances of the SFSB are the same", firstSFSB.equals(secondSFSB));
-//
-// // let's also check whether the bean is equal to itself
-// assertTrue("Incorrect equals implementation - returns false for the same sfsb instance", firstSFSB
-// .equals(firstSFSB));
-// assertTrue("equals returned false for the same sfsb instance", secondSFSB.equals(secondSFSB));
-//
-// }
-
-}
Copied: projects/ejb3/components/nointerface/trunk/impl/src/test/java/org/jboss/ejb3/nointerface/test/factory/unit/NoInterfaceViewFactoryTestCase.java (from rev 99550, projects/ejb3/trunk/nointerface/src/test/java/org/jboss/ejb3/nointerface/test/factory/unit/NoInterfaceViewFactoryTestCase.java)
===================================================================
--- projects/ejb3/components/nointerface/trunk/impl/src/test/java/org/jboss/ejb3/nointerface/test/factory/unit/NoInterfaceViewFactoryTestCase.java (rev 0)
+++ projects/ejb3/components/nointerface/trunk/impl/src/test/java/org/jboss/ejb3/nointerface/test/factory/unit/NoInterfaceViewFactoryTestCase.java 2010-01-19 11:13:18 UTC (rev 99590)
@@ -0,0 +1,256 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.ejb3.nointerface.test.factory.unit;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+
+import org.jboss.ejb3.nointerface.impl.view.factory.JavassistNoInterfaceViewFactory;
+import org.jboss.ejb3.nointerface.spi.view.factory.NoInterfaceViewFactory;
+import org.jboss.ejb3.nointerface.test.viewcreator.SimpleSFSBeanWithoutInterfaces;
+import org.jboss.ejb3.nointerface.test.viewcreator.SimpleSLSBWithoutInterface;
+import org.jboss.logging.Logger;
+import org.junit.Test;
+
+/**
+ * NoInterfaceBeansTestCase
+ *
+ * Tests the no-inteface view for beans.
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public class NoInterfaceViewFactoryTestCase
+{
+
+ /**
+ * Logger
+ */
+ private static Logger logger = Logger.getLogger(NoInterfaceViewFactoryTestCase.class);
+
+ private class DummyInvocationHandler implements InvocationHandler
+ {
+
+ private Object target;
+
+ public DummyInvocationHandler(Object target)
+ {
+ if (target == null)
+ {
+ throw new IllegalArgumentException("Target object cannot be null, for invocation handler");
+ }
+ this.target = target;
+ }
+
+ /**
+ * @see java.lang.reflect.InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
+ */
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ // just pass on the call to the target
+ return method.invoke(target, args);
+ }
+
+ }
+
+ /**
+ * Test to ensure that the no-interface view instance does NOT consider
+ * a final method on the bean while creating the view
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testFinalMethodsAreNotConsideredInView() throws Exception
+ {
+ NoInterfaceViewFactory noInterfaceBeanFactory = new JavassistNoInterfaceViewFactory();
+ SimpleSLSBWithoutInterface beanInstance = new SimpleSLSBWithoutInterface();
+ Object proxy = noInterfaceBeanFactory.createView(new DummyInvocationHandler(beanInstance), beanInstance.getClass());
+ // ensure that the returned object is not null and is of expected type
+ assertNotNull("No-interface view factory returned a null view for " + beanInstance.getClass(), proxy);
+ assertTrue("No-interface view factory returend an unexpected object type: " + proxy.getClass(), (proxy instanceof SimpleSLSBWithoutInterface));
+
+ SimpleSLSBWithoutInterface noInterfaceView = (SimpleSLSBWithoutInterface) proxy;
+
+ // Nothing fancy to test - just ensure that the declared methods in the proxy does
+ // NOT contain a "final" method. Just check on method name, should be enough
+ Method[] declaredMethods = noInterfaceView.getClass().getDeclaredMethods();
+ for (Method declaredMethod : declaredMethods)
+ {
+ if (declaredMethod.getName().equals("someFinalMethod"))
+ {
+ fail("No-interface view has overriden a final method. It shouldn't have.");
+ }
+ }
+
+ }
+
+ /**
+ * Test to ensure that the no-interface view instance does NOT consider
+ * a static method on the bean while creating the view
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testStaticMethodsAreNotConsideredInView() throws Exception
+ {
+ NoInterfaceViewFactory noInterfaceBeanFactory = new JavassistNoInterfaceViewFactory();
+ SimpleSFSBeanWithoutInterfaces beanInstance = new SimpleSFSBeanWithoutInterfaces();
+ Object proxy = noInterfaceBeanFactory.createView(new DummyInvocationHandler(beanInstance), beanInstance.getClass());
+ // ensure that the returned object is not null and is of expected type
+ assertNotNull("No-interface view factory returned a null view for " + beanInstance.getClass(), proxy);
+ assertTrue("No-interface view factory returend an unexpected object type: " + proxy.getClass(), (proxy instanceof SimpleSFSBeanWithoutInterfaces));
+
+ SimpleSFSBeanWithoutInterfaces noInterfaceView = (SimpleSFSBeanWithoutInterfaces) proxy;
+
+
+ // Nothing fancy to test - just ensure that the declared methods in the proxy does
+ // NOT contain a "static" method. Just check on method name, should be enough
+ Method[] declaredMethods = noInterfaceView.getClass().getDeclaredMethods();
+ for (Method declaredMethod : declaredMethods)
+ {
+ if (declaredMethod.getName().equals("someStaticMethod"))
+ {
+ fail("No-interface view has overriden a static method. It shouldn't have.");
+ }
+ }
+ }
+
+// /**
+// * Test to ensure that a no-interface view is NOT created for session beans
+// * which implement an interface (and do not explicitly mark themselves @LocalBean)
+// *
+// * @throws Exception
+// */
+// @Test
+// public void testBeanWithInterfacesIsNotEligibleForNoInterfaceView() throws Exception
+// {
+// JBossSessionBeanMetaData slsbMetadata = MetaDataHelper
+// .getMetadataFromBeanImplClass(StatelessBeanWithInterfaces.class);
+// String slsbNoInterfaceViewJNDIName = slsbMetadata.getEjbName() + "/no-interface";
+//
+// JBossSessionBeanMetaData sfsbMetadata = MetaDataHelper
+// .getMetadataFromBeanImplClass(StatefulBeanWithInterfaces.class);
+// String sfsbNoInterfaceViewJNDIName = sfsbMetadata.getEjbName() + "/no-interface";
+// String sfsbNoInterfaceViewFactoryJNDIName = sfsbMetadata.getEjbName() + "/no-interface-stateful-proxyfactory";
+//
+// Context ctx = new InitialContext();
+// // we have to ensure that there is NO no-interface view for these beans (because they are not eligible)
+// try
+// {
+// Object obj = ctx.lookup(slsbNoInterfaceViewJNDIName);
+// // this is a failure because there should not be a no-interface view for these beans
+// fail("A SLSB with interfaces was marked as eligible for no-interface view. Shouldn't have been. Found object of type "
+// + obj.getClass() + " in the jndi for jndiname " + slsbNoInterfaceViewJNDIName);
+// }
+// catch (NameNotFoundException nnfe)
+// {
+// // expected
+// }
+//
+// // now for sfsb, test that neither the factory nor the view are NOT bound
+//
+// // test factory binding
+// try
+// {
+// Object obj = ctx.lookup(sfsbNoInterfaceViewFactoryJNDIName);
+// // this is a failure because there should not be a no-interface view for these beans
+// fail("A SFSB factory for no-interface view was created for a bean implementing interfaces. Shouldn't have been. Found object of type "
+// + obj.getClass() + " in the jndi for jndiname " + sfsbNoInterfaceViewFactoryJNDIName);
+// }
+// catch (NameNotFoundException nnfe)
+// {
+// // expected
+// }
+// // sfsb no-interface view
+// try
+// {
+// Object obj = ctx.lookup(sfsbNoInterfaceViewJNDIName);
+// // this is a failure because there should not be a no-interface view for these beans
+// fail("A no-interface view for SFSB was created for a bean implementing interfaces. Shouldn't have been. Found object of type "
+// + obj.getClass() + " in the jndi for jndiname " + sfsbNoInterfaceViewJNDIName);
+// }
+// catch (NameNotFoundException nnfe)
+// {
+// // expected
+// }
+//
+// }
+//
+// /**
+// * Test that sessions are created as expected for stateful session beans
+// *
+// * @throws Exception
+// */
+// @Test
+// public void testSessionCreationForSFSBNoInterfaceViews() throws Exception
+// {
+// JBossSessionBeanMetaData sessionBeanMetadata = MetaDataHelper
+// .getMetadataFromBeanImplClass(SimpleSFSBeanWithoutInterfaces.class);
+// String jndiName = sessionBeanMetadata.getEjbName() + "/no-interface";
+//
+// Context ctx = new InitialContext();
+// // let's assume the lookup returns the correct type.
+// // there are other test cases to ensure it does return the correct type
+// SimpleSFSBeanWithoutInterfaces firstSFSB = (SimpleSFSBeanWithoutInterfaces) ctx.lookup(jndiName);
+// // ensure this is a clean bean
+// int initQty = firstSFSB.getQtyPurchased();
+// assertEquals("SFSB instance is not new", initQty, SimpleSFSBeanWithoutInterfaces.INITIAL_QTY);
+// // now change the state of the sfsb instance
+// firstSFSB.incrementPurchaseQty();
+// int incrementedValueForFirstSFSB = firstSFSB.getQtyPurchased();
+// assertEquals("SFSB instance's value not incremented", incrementedValueForFirstSFSB,
+// SimpleSFSBeanWithoutInterfaces.INITIAL_QTY + 1);
+//
+// // now lookup another bean
+// SimpleSFSBeanWithoutInterfaces secondSFSB = (SimpleSFSBeanWithoutInterfaces) ctx.lookup(jndiName);
+// // ensure this is a clean bean
+// int initQtyForSecondBeanInstance = secondSFSB.getQtyPurchased();
+// assertEquals("Second instance of SFSB is not new", initQtyForSecondBeanInstance,
+// SimpleSFSBeanWithoutInterfaces.INITIAL_QTY);
+// // now change the state of the sfsb instance by some x amount
+// int incrementBy = 10;
+// secondSFSB.incrementPurchaseQty(incrementBy);
+// int incrementedValueForSecondSFSB = secondSFSB.getQtyPurchased();
+// assertEquals("Second SFSB instance's value not incremented", incrementedValueForSecondSFSB,
+// SimpleSFSBeanWithoutInterfaces.INITIAL_QTY + incrementBy);
+//
+// // let's also (again) check that the first SFSB still has it's own values and hasn't been
+// // affected by changes made to second SFSB
+// assertEquals("Value in first SFSB was changed when second SFSB was being modified", incrementedValueForFirstSFSB,
+// SimpleSFSBeanWithoutInterfaces.INITIAL_QTY + 1);
+//
+// // also check equality of two sfsb instances - they should not be equal
+// assertFalse("Both the instances of the SFSB are the same", firstSFSB.equals(secondSFSB));
+//
+// // let's also check whether the bean is equal to itself
+// assertTrue("Incorrect equals implementation - returns false for the same sfsb instance", firstSFSB
+// .equals(firstSFSB));
+// assertTrue("equals returned false for the same sfsb instance", secondSFSB.equals(secondSFSB));
+//
+// }
+
+}
Copied: projects/ejb3/components/nointerface/trunk/impl/src/test/resources (from rev 99536, projects/ejb3/trunk/nointerface/src/test/resources)
Modified: projects/ejb3/components/nointerface/trunk/spi/pom.xml
===================================================================
--- projects/ejb3/components/nointerface/trunk/spi/pom.xml 2010-01-19 08:23:26 UTC (rev 99589)
+++ projects/ejb3/components/nointerface/trunk/spi/pom.xml 2010-01-19 11:13:18 UTC (rev 99590)
@@ -1,13 +1,19 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.ejb3.nointerface</groupId>
+ <artifactId>jboss-ejb3-nointerface-build</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
<!-- POM Model Version -->
<modelVersion>4.0.0</modelVersion>
<!-- Artifact Information -->
<groupId>org.jboss.ejb3.nointerface</groupId>
- <artifactId>nointerface-spi</artifactId>
+ <artifactId>jboss-ejb3-nointerface-spi</artifactId>
<packaging>jar</packaging>
<version>1.0.0-SNAPSHOT</version>
<name>JBoss EJB3 No-Interface view SPI</name>
@@ -20,7 +26,6 @@
</properties>
<build>
-
<plugins>
<!-- We have a dependency on @LocalBean which comes from ejb3-api (=JDK6) -->
More information about the jboss-cvs-commits
mailing list