Index: component-matrix/pom.xml
===================================================================
--- component-matrix/pom.xml (revision 113571)
+++ component-matrix/pom.xml (working copy)
@@ -1418,7 +1418,7 @@
javassist
javassist
- 3.12.0.GA
+ 3.12.0.SP1-SNAPSHOT
Index: testsuite/src/resources/jpa/jbpapp9336/META-INF/persistence.xml
===================================================================
--- testsuite/src/resources/jpa/jbpapp9336/META-INF/persistence.xml (revision 0)
+++ testsuite/src/resources/jpa/jbpapp9336/META-INF/persistence.xml (working copy)
@@ -0,0 +1,21 @@
+
+
+
+
+ Persistence unit used for JBPAPP-9336 test case.
+
+
+ java:/DefaultDS
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: testsuite/src/main/org/jboss/test/jpa/jbpapp9336/EntityWithHandlerAttribute.java
===================================================================
--- testsuite/src/main/org/jboss/test/jpa/jbpapp9336/EntityWithHandlerAttribute.java (revision 0)
+++ testsuite/src/main/org/jboss/test/jpa/jbpapp9336/EntityWithHandlerAttribute.java (working copy)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.test.jpa.jbpapp9336;
+
+import java.io.Serializable;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+/**
+ * @author Navin Surtani (navssurtani)
+ *
+ * Class that is a JPA Entity that will contain an attribute named 'handler' in order to test the functionality for Javassist upgrade from
+ * 3.12.0.GA to the SP.
+ */
+
+@Entity
+public class EntityWithHandlerAttribute implements Serializable {
+
+ private Long id;
+ private String handler;
+
+ /**
+ *
+ * @return - the id of the instance.
+ */
+ @Id
+ @GeneratedValue (strategy=GenerationType.AUTO)
+ public Long getId() {
+ return this.id;
+ }
+ /**
+ *
+ * @return - the handler.
+ */
+ public String getHandler() {
+ return this.handler;
+ }
+
+ public void setId(Long id){
+ this.id = id;
+ }
+
+ public void setHandler(String handler){
+ this.handler = handler;
+ }
+
+
+}
Index: testsuite/src/main/org/jboss/test/jpa/jbpapp9336/HandlerTest.java
===================================================================
--- testsuite/src/main/org/jboss/test/jpa/jbpapp9336/HandlerTest.java (revision 0)
+++ testsuite/src/main/org/jboss/test/jpa/jbpapp9336/HandlerTest.java (working copy)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.test.jpa.jbpapp9336;
+
+/**
+ * @author Navin Surtani (navssurtani)
+ *
+ * Interface designed to access the SLSB {@link HandlerTestBean}
+ */
+
+public interface HandlerTest {
+
+ /**
+ * Method that will be used to create and EWHA.
+ *
+ * @param handler
+ * @return - the newly created EWHA.
+ */
+
+ public EntityWithHandlerAttribute createEntityWithHandlerAttribute(String handler);
+
+ /**
+ * Call using the id of the EWHA to actually get hold of the EWHA instance.
+ *
+ * @param id
+ * @return - the EWHA.
+ */
+ public EntityWithHandlerAttribute loadEntityWithHandlerAttribute(Long id);
+}
Index: testsuite/src/main/org/jboss/test/jpa/jbpapp9336/unit/UseGetHandlerTestCase.java
===================================================================
--- testsuite/src/main/org/jboss/test/jpa/jbpapp9336/unit/UseGetHandlerTestCase.java (revision 0)
+++ testsuite/src/main/org/jboss/test/jpa/jbpapp9336/unit/UseGetHandlerTestCase.java (working copy)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.test.jpa.jbpapp9336.unit;
+
+
+import junit.framework.Test;
+
+import org.jboss.test.JBossTestCase;
+import org.jboss.test.jpa.jbpapp9336.EntityWithHandlerAttribute;
+import org.jboss.test.jpa.jbpapp9336.HandlerTest;
+import org.jboss.test.jpa.jbpapp9336.HandlerTestBean;
+
+/**
+ * @author Navin Surtani (navssurtani)
+ *
+ * Test class used to validate an upgrade for JBPAPP-9336.
+ *
+ * Because of the fact that upgrading the Javassist dependency within EAP 5.x to 3.16 causes a build failure due to AOP,
+ * a service pack for Javassist 3.12 was created. This test is used in order to validate that the upgrade works fine in
+ * conjunction with the bug caused within Hibernate for HHH-5731.
+ */
+public class UseGetHandlerTestCase extends JBossTestCase{
+
+ private static final String DEPLOYMENT_NAME = "jbpapp-9336.jar";
+
+
+ public UseGetHandlerTestCase(String name) {
+ super(name);
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(UseGetHandlerTestCase.class, DEPLOYMENT_NAME);
+ }
+
+ public void testGetHandler() throws Exception {
+
+ HandlerTest handlerTest = (HandlerTest) this.getInitialContext().lookup("HandlerTestBean/remote");
+
+ // Create a few ewha (s).
+ EntityWithHandlerAttribute entityOne = handlerTest.createEntityWithHandlerAttribute("handler-one");
+ EntityWithHandlerAttribute entityTwo = handlerTest.createEntityWithHandlerAttribute("handler-two");
+
+ // Obtain the id's of these ewha instances:
+ Long idOne = entityOne.getId();
+ Long idTwo = entityTwo.getId();
+
+ // Now try and obtain these guys using the id's.
+ System.out.println(handlerTest.loadEntityWithHandlerAttribute(idOne).getHandler());
+ System.out.println(handlerTest.loadEntityWithHandlerAttribute(idTwo).getHandler());
+ assert handlerTest.loadEntityWithHandlerAttribute(idOne).getHandler().equals("handler-one");
+ assert handlerTest.loadEntityWithHandlerAttribute(idTwo).getHandler().equals("handler-two");
+
+ }
+
+
+
+}
Index: testsuite/src/main/org/jboss/test/jpa/jbpapp9336/HandlerTestBean.java
===================================================================
--- testsuite/src/main/org/jboss/test/jpa/jbpapp9336/HandlerTestBean.java (revision 0)
+++ testsuite/src/main/org/jboss/test/jpa/jbpapp9336/HandlerTestBean.java (working copy)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., 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.test.jpa.jbpapp9336;
+
+import javax.ejb.Stateless;
+import javax.ejb.Remote;
+import javax.persistence.Entity;
+import javax.persistence.EntityManager;
+import javax.persistence.Id;
+import javax.persistence.PersistenceContext;
+import javax.transaction.TransactionManager;
+
+import org.hibernate.Session;
+import org.jboss.ejb3.annotation.JndiInject;
+
+/**
+ * @author Navin Surtani (navssurtani)
+ *
+ * StateLess Session Bean (SLSB) implementation of {@link HandlerTest} that will provide the actual required functionality for the testing purposes of JBPAPP-9336.
+ */
+
+@Stateless
+@Remote(HandlerTest.class)
+
+public class HandlerTestBean implements HandlerTest {
+
+ private @PersistenceContext EntityManager em;
+ private @JndiInject(jndiName="java:/TransactionManager") TransactionManager tm;
+
+ public EntityWithHandlerAttribute createEntityWithHandlerAttribute(String handler) {
+
+ // Create a new instance of EWHA using the constructor and persist it using the EntityManager.
+
+ EntityWithHandlerAttribute ewha = new EntityWithHandlerAttribute();
+ ewha.setHandler(handler);
+ em.persist(ewha);
+ return ewha;
+ }
+
+ public EntityWithHandlerAttribute loadEntityWithHandlerAttribute(Long id) {
+
+ // Simply use the EntityManager to make a find call using the id passed as a parameter. We already know the
+ // class type that we are looking for which is an EWHA.
+
+ return em.find(EntityWithHandlerAttribute.class, id);
+ }
+
+
+}
Index: testsuite/imports/sections/jpa.xml
===================================================================
--- testsuite/imports/sections/jpa.xml (revision 113571)
+++ testsuite/imports/sections/jpa.xml (working copy)
@@ -62,8 +62,16 @@
+
+
+
+
+
+
+
+
+
-
Index: testsuite/build.xml
===================================================================
--- testsuite/build.xml (revision 113571)
+++ testsuite/build.xml (working copy)
@@ -2820,6 +2820,7 @@
+