[jboss-cvs] JBossAS SVN: r65283 - in trunk/ejb3/src: resources/test/ejbthree958/META-INF and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Sep 11 04:05:05 EDT 2007
Author: ALRubinger
Date: 2007-09-11 04:05:05 -0400 (Tue, 11 Sep 2007)
New Revision: 65283
Removed:
trunk/ejb3/src/resources/test/ejbthree958/META-INF/ejb-jar.xml
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree958/TestStatelessEjbthree958Bean.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree958/TestStatelessEjbthree958Remote.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree958/unit/DefaultToFieldNameForResourceInjectionByNameUnitTestCase.java
Modified:
trunk/ejb3/src/main/org/jboss/injection/ResourceHandler.java
Log:
Reverted fix for incorrect JIRA issue; not a bug. Rolled back and removed unnecessary Unit Tests.
Modified: trunk/ejb3/src/main/org/jboss/injection/ResourceHandler.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/injection/ResourceHandler.java 2007-09-10 22:12:23 UTC (rev 65282)
+++ trunk/ejb3/src/main/org/jboss/injection/ResourceHandler.java 2007-09-11 08:05:05 UTC (rev 65283)
@@ -451,11 +451,8 @@
String encName = ref.name();
if (encName == null || encName.equals(""))
{
- // EJBTHREE-958
- // Default to the name of the field if the "name" attribute of @Resource is not specified
- //encName = InjectionUtil.getEncName(field); // Previously Removed
- //encName = property.getDeclaringClass().getName() + "/" + property.getName(); // ALR Removed for EJBTHREE-958
- encName = property.getName();
+ //encName = InjectionUtil.getEncName(field);
+ encName = property.getDeclaringClass().getName() + "/" + property.getName();
}
if (!encName.startsWith("env/"))
{
Deleted: trunk/ejb3/src/resources/test/ejbthree958/META-INF/ejb-jar.xml
===================================================================
--- trunk/ejb3/src/resources/test/ejbthree958/META-INF/ejb-jar.xml 2007-09-10 22:12:23 UTC (rev 65282)
+++ trunk/ejb3/src/resources/test/ejbthree958/META-INF/ejb-jar.xml 2007-09-11 08:05:05 UTC (rev 65283)
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- we're going to force this down the ejb3 deployer -->
-<ejb-jar
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
- version="3.0">
- <display-name>ejbthree958</display-name>
- <enterprise-beans>
- <session>
- <ejb-name>TestStatelessEjbthree958Bean</ejb-name>
- <env-entry>
- <env-entry-name>testValue</env-entry-name>
- <env-entry-type>java.lang.Integer</env-entry-type>
- <env-entry-value>5</env-entry-value>
- </env-entry>
- </session>
- </enterprise-beans>
-</ejb-jar>
Deleted: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree958/TestStatelessEjbthree958Bean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree958/TestStatelessEjbthree958Bean.java 2007-09-10 22:12:23 UTC (rev 65282)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree958/TestStatelessEjbthree958Bean.java 2007-09-11 08:05:05 UTC (rev 65283)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.test.ejbthree958;
-
-import javax.annotation.Resource;
-import javax.ejb.Stateless;
-
- at Stateless
-public class TestStatelessEjbthree958Bean implements TestStatelessEjbthree958Remote
-{
-
- // Instance Members
- @Resource
- private int testValue;
-
- // Required Implementations
- public int getTestValue()
- {
- return this.testValue;
- }
-
-}
Deleted: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree958/TestStatelessEjbthree958Remote.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree958/TestStatelessEjbthree958Remote.java 2007-09-10 22:12:23 UTC (rev 65282)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree958/TestStatelessEjbthree958Remote.java 2007-09-11 08:05:05 UTC (rev 65283)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.test.ejbthree958;
-
-import javax.ejb.Remote;
-
-import org.jboss.annotation.ejb.RemoteBinding;
-
- at Remote
- at RemoteBinding(jndiBinding = TestStatelessEjbthree958Remote.JNDI_BINDING)
-public interface TestStatelessEjbthree958Remote
-{
- // Class Members
- public static final String JNDI_BINDING = "TestStatelessEjbthree958Bean/remote";
-
- // Contracts
-
- public int getTestValue();
-}
Deleted: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree958/unit/DefaultToFieldNameForResourceInjectionByNameUnitTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree958/unit/DefaultToFieldNameForResourceInjectionByNameUnitTestCase.java 2007-09-10 22:12:23 UTC (rev 65282)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree958/unit/DefaultToFieldNameForResourceInjectionByNameUnitTestCase.java 2007-09-11 08:05:05 UTC (rev 65283)
@@ -1,100 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ejb3.test.ejbthree958.unit;
-
-import junit.framework.Test;
-
-import org.jboss.ejb3.test.ejbthree958.TestStatelessEjbthree958Remote;
-import org.jboss.test.JBossTestCase;
-
-/**
- * Unit test for EJBTHREE-958, ensures that @Resource injections default to
- * encName matching the name of the field to be injected in the case that @Resource.name is not specified
- *
- * @author <a href="mailto:alr at alrubinger.com">ALR</a>
- * @version $Revision: $
- */
-public class DefaultToFieldNameForResourceInjectionByNameUnitTestCase extends JBossTestCase
-{
-
- // Class Members
- private static final String JAR_NAME = "ejbthree958.jar";
-
- private static final int EXPECTED_VALUE = 5;
-
- public DefaultToFieldNameForResourceInjectionByNameUnitTestCase(String name)
- {
- super(name);
- }
-
- public static Test suite() throws Exception
- {
- return getDeploySetup(DefaultToFieldNameForResourceInjectionByNameUnitTestCase.class, null);
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- undeploy(DefaultToFieldNameForResourceInjectionByNameUnitTestCase.JAR_NAME);
- super.tearDown();
- }
-
- /**
- * Deploys the test JAR, invokes upon the test method to
- * ensure that "testValue" is injected from the env-entry properly,
- * defaulting to the name of the field as @Resource.name is not specified
- *
- * @author ALR
- * @throws Exception
- */
- public void testDefaultToFieldNameForResourceName() throws Exception
- {
- try
- {
- // Deploy Test JAR
- redeploy(DefaultToFieldNameForResourceInjectionByNameUnitTestCase.JAR_NAME);
-
- // Lookup EJB, attempt cast
- TestStatelessEjbthree958Remote stateless = (TestStatelessEjbthree958Remote) this.getInitialContext().lookup(
- TestStatelessEjbthree958Remote.JNDI_BINDING);
-
- // Obtain injected value
- int injectedValue = stateless.getTestValue();
-
- // Ensure value from invocation is expected
- JBossTestCase.assertEquals(DefaultToFieldNameForResourceInjectionByNameUnitTestCase.EXPECTED_VALUE,
- injectedValue);
-
- // Log Success
- log.info("Injected Value " + injectedValue + " matches expected value "
- + DefaultToFieldNameForResourceInjectionByNameUnitTestCase.EXPECTED_VALUE);
-
- }
- catch (Exception e)
- {
- // Unexpected error encountered
- log.error(e);
- JBossTestCase.fail("Exception received; " + e);
-
- }
- }
-}
More information about the jboss-cvs-commits
mailing list