You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jg...@apache.org on 2008/11/06 20:03:39 UTC
svn commit: r711945 [2/2] - in /openejb/trunk/sandbox/openejb-eclipse-plugin:
common/src/main/java/org/apache/openejb/plugins/common/
common/src/test/java/org/apache/openejb/plugins/common/
plugins/org.apache.openejb.builder/src/main/java/org/apache/op...
Added: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/java/org/apache/openejb/helper/annotation/tests/ConvertFinderMethodToCodeTest.java
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/java/org/apache/openejb/helper/annotation/tests/ConvertFinderMethodToCodeTest.java?rev=711945&view=auto
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/java/org/apache/openejb/helper/annotation/tests/ConvertFinderMethodToCodeTest.java (added)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/java/org/apache/openejb/helper/annotation/tests/ConvertFinderMethodToCodeTest.java Thu Nov 6 11:03:06 2008
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openejb.helper.annotation.tests;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.persistence.PersistenceUnit;
+
+import org.apache.openejb.devtools.core.JDTFacade;
+import org.apache.openejb.helper.annotation.fixtures.ProjectFixture;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Change;
+
+import junit.framework.TestCase;
+
+public class ConvertFinderMethodToCodeTest extends TestCase {
+ private ProjectFixture fixture;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ fixture = new ProjectFixture();
+ fixture.reset();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ fixture.delete();
+ super.tearDown();
+ }
+
+ public void testShouldConvertEjbFinderMethodToCodeCase1() throws Exception {
+ doTest("ProductManagerBean21-1.txt", "ProductManagerBean30-1.txt", "uk.me.jrg.ejb.ProductManagerBean1");
+ }
+
+ public void testShouldConvertEjbFinderMethodToCodeCase2() throws Exception {
+ doTest("ProductManagerBean21-2.txt", "ProductManagerBean30-2.txt", "uk.me.jrg.ejb.ProductManagerBean2");
+ }
+
+ public void testShouldConvertEjbFinderMethodToCodeCase3() throws Exception {
+ doTest("ProductManagerBean21-3.txt", "ProductManagerBean30-3.txt", "uk.me.jrg.ejb.ProductManagerBean3");
+ }
+
+
+
+ private void doTest(String startFilename, String expectedFilename, String bean) throws CoreException, IOException {
+ fixture.addClassToProject("uk.me.jrg.jee.store.ejb.ProductBean", fixture.getStreamContent(getClass().getResourceAsStream("Ejb21ProductBean.txt"))); //$NON-NLS-1$ //$NON-NLS-2$
+ fixture.addClassToProject("uk.me.jrg.jee.store.ejb.ProductHome", fixture.getStreamContent(getClass().getResourceAsStream("Ejb21ProductHome.txt"))); //$NON-NLS-1$ //$NON-NLS-2$
+ fixture.addClassToProject(bean, fixture.getStreamContent(getClass().getResourceAsStream(startFilename))); //$NON-NLS-1$ //$NON-NLS-2$
+
+ JDTFacade facade = new JDTFacade(fixture.getProject());
+ facade.addField(bean, "entityManagerFactory", "javax.persistence.EntityManagerFactory");
+
+ Map<String, Object> properties = new HashMap<String, Object>();
+ properties.put("name", "TestPU");
+ facade.addFieldAnnotation(bean, "entityManagerFactory", PersistenceUnit.class, properties);
+
+
+ String code = "javax.persistence.EntityManager entityManager = entityManagerFactory.createEntityManager();\r\n" +
+ "javax.persistence.Query query = entityManager.createQuery(\"SELECT p from Product p where p.name = ?1\");\r\n" +
+ "query.getResultList();";
+
+ facade.changeInvocationsTo("uk.me.jrg.jee.store.ejb.ProductHome", "findBy", new String[] { "java.lang.String"}, code); //$NON-NLS-1$
+
+ Change change = facade.getChange();
+ change.perform(new NullProgressMonitor());
+
+ assertEquals(fixture.getStreamContent(getClass().getResourceAsStream(expectedFilename)), fixture.getClassContents(bean)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+}
Added: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Ejb21Product.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Ejb21Product.txt?rev=711945&view=auto
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Ejb21Product.txt (added)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Ejb21Product.txt Thu Nov 6 11:03:06 2008
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ package uk.me.jrg.jee.store.ejb;
+
+import javax.ejb.EJBLocalObject;
+
+public interface Product extends EJBLocalObject {
+ Integer getId();
+
+ void setId(Integer id);
+
+ String getName();
+
+ void setName(String name);
+
+ String getCode();
+
+ void setCode(String code);
+
+ String getDescription();
+
+ void setDescription(String description);
+}
Added: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Ejb21ProductBean.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Ejb21ProductBean.txt?rev=711945&view=auto
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Ejb21ProductBean.txt (added)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Ejb21ProductBean.txt Thu Nov 6 11:03:06 2008
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package uk.me.jrg.jee.store.ejb;
+
+import javax.ejb.*;
+
+public abstract class ProductBean implements EntityBean {
+ public ProductBean() {
+ }
+
+ public void setEntityContext(EntityContext entityContext) throws EJBException {
+ }
+
+ public void unsetEntityContext() throws EJBException {
+ }
+
+ public void ejbRemove() throws RemoveException, EJBException {
+ }
+
+ public void ejbActivate() throws EJBException {
+ }
+
+ public void ejbPassivate() throws EJBException {
+ }
+
+ public void ejbLoad() throws EJBException {
+ }
+
+ public void ejbStore() throws EJBException {
+ }
+
+
+ public abstract Integer getId();
+
+ public abstract void setId(Integer id);
+
+ public abstract String getName();
+
+ public abstract void setName(String name);
+
+ public abstract String getCode();
+
+ public abstract void setCode(String code);
+
+ public abstract String getDescription();
+
+ public abstract void setDescription(String description);
+
+ public Integer ejbCreate(Integer id, String name, String description, String code) throws CreateException {
+ setName(name);
+ setDescription(description);
+ setCode(code);
+ return null;
+ }
+
+ public void ejbPostCreate(Integer id, String name, String description, String code) throws CreateException {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+
+ public Integer ejbCreate(Integer id) throws CreateException {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void ejbPostCreate(Integer id) throws CreateException {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+}
Added: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Ejb21ProductHome.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Ejb21ProductHome.txt?rev=711945&view=auto
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Ejb21ProductHome.txt (added)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Ejb21ProductHome.txt Thu Nov 6 11:03:06 2008
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package uk.me.jrg.jee.store.ejb;
+
+import javax.ejb.EJBLocalHome;
+import javax.ejb.FinderException;
+import javax.ejb.CreateException;
+import java.util.Collection;
+
+public interface ProductHome extends EJBLocalHome {
+ Product findByPrimaryKey(Integer key) throws FinderException;
+ Collection findBy(String name) throws FinderException;
+ Collection findAll() throws FinderException;
+ Product create(Integer id, String name, String description, String code) throws CreateException;
+ Product create(Integer id) throws CreateException;
+}
Added: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Ejb21SessionBean.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Ejb21SessionBean.txt?rev=711945&view=auto
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Ejb21SessionBean.txt (added)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Ejb21SessionBean.txt Thu Nov 6 11:03:06 2008
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package uk.me.jrg.jee.store.ejb;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBException;
+import javax.ejb.SessionContext;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.rmi.PortableRemoteObject;
+
+public class SessionBean implements javax.ejb.SessionBean {
+ public SessionBean() {
+ }
+
+ public void ejbCreate() throws CreateException {
+ }
+
+ public void setSessionContext(SessionContext sessionContext) throws EJBException {
+ }
+
+ public void ejbRemove() throws EJBException {
+ }
+
+ public void ejbActivate() throws EJBException {
+ }
+
+ public void ejbPassivate() throws EJBException {
+ }
+
+ public void addProduct(String productName, String productCode, String description) {
+
+ try {
+ Object obj = new InitialContext().lookup("java:comp/env/ejb/Product");
+ ProductHome productHome = (ProductHome) PortableRemoteObject.narrow(obj, ProductHome.class);
+ Product product = productHome.create(null, productName, description, productCode);
+ } catch (NamingException e) {
+ e.printStackTrace();
+ } catch (CreateException e) {
+ e.printStackTrace();
+ }
+ }
+
+}
Added: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Expected30ProductBean.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Expected30ProductBean.txt?rev=711945&view=auto
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Expected30ProductBean.txt (added)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Expected30ProductBean.txt Thu Nov 6 11:03:06 2008
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package uk.me.jrg.jee.store.ejb;
+
+import javax.ejb.*;
+
+public abstract class ProductBean implements EntityBean {
+ public ProductBean() {
+ }
+
+ public void setEntityContext(EntityContext entityContext) throws EJBException {
+ }
+
+ public void unsetEntityContext() throws EJBException {
+ }
+
+ public void ejbRemove() throws RemoveException, EJBException {
+ }
+
+ public void ejbActivate() throws EJBException {
+ }
+
+ public void ejbPassivate() throws EJBException {
+ }
+
+ public void ejbLoad() throws EJBException {
+ }
+
+ public void ejbStore() throws EJBException {
+ }
+
+
+ public abstract Integer getId();
+
+ public abstract void setId(Integer id);
+
+ public abstract String getName();
+
+ public abstract void setName(String name);
+
+ public abstract String getCode();
+
+ public abstract void setCode(String code);
+
+ public abstract String getDescription();
+
+ public abstract void setDescription(String description);
+
+ public ProductBean(Integer id, String name, String description, String code) throws CreateException {
+ setName(name);
+ setDescription(description);
+ setCode(code);
+ return null;
+ }
+
+ public void ejbPostCreate(Integer id, String name, String description, String code) throws CreateException {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+
+ public Integer ejbCreate(Integer id) throws CreateException {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void ejbPostCreate(Integer id) throws CreateException {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+}
Modified: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult1.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult1.txt?rev=711945&r1=711944&r2=711945&view=diff
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult1.txt (original)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult1.txt Thu Nov 6 11:03:06 2008
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.openejb.test;
import javax.ejb.Stateless;
Modified: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult2.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult2.txt?rev=711945&r1=711944&r2=711945&view=diff
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult2.txt (original)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult2.txt Thu Nov 6 11:03:06 2008
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.openejb.test;
import javax.ejb.Stateless;
Modified: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult3.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult3.txt?rev=711945&r1=711944&r2=711945&view=diff
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult3.txt (original)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult3.txt Thu Nov 6 11:03:06 2008
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.openejb.test;
import javax.ejb.Stateless;
Modified: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult4.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult4.txt?rev=711945&r1=711944&r2=711945&view=diff
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult4.txt (original)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult4.txt Thu Nov 6 11:03:06 2008
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.openejb.test;
import javax.persistence.Entity;
Modified: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult5.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult5.txt?rev=711945&r1=711944&r2=711945&view=diff
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult5.txt (original)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult5.txt Thu Nov 6 11:03:06 2008
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.openejb.test;
import javax.ejb.TransactionManagement;
Modified: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult6.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult6.txt?rev=711945&r1=711944&r2=711945&view=diff
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult6.txt (original)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult6.txt Thu Nov 6 11:03:06 2008
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.openejb.test;
import javax.persistence.ManyToMany;
Modified: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult7.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult7.txt?rev=711945&r1=711944&r2=711945&view=diff
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult7.txt (original)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult7.txt Thu Nov 6 11:03:06 2008
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.openejb.test;
import javax.ejb.Remote;
Modified: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult8.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult8.txt?rev=711945&r1=711944&r2=711945&view=diff
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult8.txt (original)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedResult8.txt Thu Nov 6 11:03:06 2008
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.openejb.test;
import javax.ejb.EJBException;
Added: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedSessionBean.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedSessionBean.txt?rev=711945&view=auto
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedSessionBean.txt (added)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ExpectedSessionBean.txt Thu Nov 6 11:03:06 2008
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package uk.me.jrg.jee.store.ejb;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBException;
+import javax.ejb.SessionContext;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.rmi.PortableRemoteObject;
+
+public class SessionBean implements javax.ejb.SessionBean {
+ public SessionBean() {
+ }
+
+ public void ejbCreate() throws CreateException {
+ }
+
+ public void setSessionContext(SessionContext sessionContext) throws EJBException {
+ }
+
+ public void ejbRemove() throws EJBException {
+ }
+
+ public void ejbActivate() throws EJBException {
+ }
+
+ public void ejbPassivate() throws EJBException {
+ }
+
+ public void addProduct(String productName, String productCode, String description) {
+
+ try {
+ Object obj = new InitialContext().lookup("java:comp/env/ejb/Product");
+ ProductHome productHome = (ProductHome) PortableRemoteObject.narrow(obj, ProductHome.class);
+ uk.me.jrg.jee.store.ejb.ProductBean product = new uk.me.jrg.jee.store.ejb.ProductBean(null, productName,
+ description, productCode);
+ } catch (NamingException e) {
+ e.printStackTrace();
+ } catch (CreateException e) {
+ e.printStackTrace();
+ }
+ }
+
+}
Added: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean21-1.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean21-1.txt?rev=711945&view=auto
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean21-1.txt (added)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean21-1.txt Thu Nov 6 11:03:06 2008
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package uk.me.jrg.ejb;
+
+import uk.me.jrg.jee.store.ejb.ProductHome;
+
+import javax.ejb.*;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.Collection;
+
+public class ProductManagerBean1 implements SessionBean {
+ public ProductManagerBean1() {
+ }
+
+ public void ejbCreate() throws CreateException {
+ }
+
+ public void setSessionContext(SessionContext sessionContext) throws EJBException {
+ }
+
+ public void ejbRemove() throws EJBException {
+ }
+
+ public void ejbActivate() throws EJBException {
+ }
+
+ public void ejbPassivate() throws EJBException {
+ }
+
+ public Collection findProductsByName(String name) {
+ try {
+ InitialContext context = new InitialContext();
+ ProductHome productHome = (ProductHome) context.lookup("ejb/Product");
+ if (productHome != null) {
+ Collection c = productHome.findBy(name);
+ }
+
+ } catch (NamingException e) {
+ e.printStackTrace();
+ } catch (FinderException e) {
+ e.printStackTrace();
+ }
+
+
+ return null;
+ }
+}
Added: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean21-2.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean21-2.txt?rev=711945&view=auto
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean21-2.txt (added)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean21-2.txt Thu Nov 6 11:03:06 2008
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package uk.me.jrg.ejb;
+
+import uk.me.jrg.jee.store.ejb.ProductHome;
+
+import javax.ejb.*;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.Collection;
+
+public class ProductManagerBean2 implements SessionBean {
+ public ProductManagerBean2() {
+ }
+
+ public void ejbCreate() throws CreateException {
+ }
+
+ public void setSessionContext(SessionContext sessionContext) throws EJBException {
+ }
+
+ public void ejbRemove() throws EJBException {
+ }
+
+ public void ejbActivate() throws EJBException {
+ }
+
+ public void ejbPassivate() throws EJBException {
+ }
+
+ public Collection findProductsByName(String name) {
+ try {
+ InitialContext context = new InitialContext();
+ ProductHome productHome = (ProductHome) context.lookup("ejb/Product");
+ if (productHome != null)
+ productHome.findBy(name);
+
+ } catch (NamingException e) {
+ e.printStackTrace();
+ } catch (FinderException e) {
+ e.printStackTrace();
+ }
+
+
+ return null;
+ }
+}
Added: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean21-3.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean21-3.txt?rev=711945&view=auto
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean21-3.txt (added)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean21-3.txt Thu Nov 6 11:03:06 2008
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package uk.me.jrg.ejb;
+
+import uk.me.jrg.jee.store.ejb.ProductHome;
+
+import javax.ejb.*;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.Collection;
+
+public class ProductManagerBean3 implements SessionBean {
+ public ProductManagerBean3() {
+ }
+
+ public void ejbCreate() throws CreateException {
+ }
+
+ public void setSessionContext(SessionContext sessionContext) throws EJBException {
+ }
+
+ public void ejbRemove() throws EJBException {
+ }
+
+ public void ejbActivate() throws EJBException {
+ }
+
+ public void ejbPassivate() throws EJBException {
+ }
+
+ public Collection findProductsByName(String name) {
+ try {
+ InitialContext context = new InitialContext();
+ ProductHome productHome = (ProductHome) context.lookup("ejb/Product");
+ if (productHome != null) {
+ productHome.findBy(name);
+ }
+
+ } catch (NamingException e) {
+ e.printStackTrace();
+ } catch (FinderException e) {
+ e.printStackTrace();
+ }
+
+
+ return null;
+ }
+}
Added: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean30-1.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean30-1.txt?rev=711945&view=auto
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean30-1.txt (added)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean30-1.txt Thu Nov 6 11:03:06 2008
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package uk.me.jrg.ejb;
+
+import uk.me.jrg.jee.store.ejb.ProductHome;
+
+import javax.ejb.*;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.Collection;
+import javax.persistence.PersistenceUnit;
+
+public class ProductManagerBean1 implements SessionBean {
+ public ProductManagerBean1() {
+ }
+
+ public void ejbCreate() throws CreateException {
+ }
+
+ public void setSessionContext(SessionContext sessionContext) throws EJBException {
+ }
+
+ public void ejbRemove() throws EJBException {
+ }
+
+ public void ejbActivate() throws EJBException {
+ }
+
+ public void ejbPassivate() throws EJBException {
+ }
+
+ public Collection findProductsByName(String name) {
+ try {
+ InitialContext context = new InitialContext();
+ ProductHome productHome = (ProductHome) context.lookup("ejb/Product");
+ if (productHome != null) {
+ javax.persistence.EntityManager entityManager = entityManagerFactory
+ .createEntityManager();
+ javax.persistence.Query query = entityManager
+ .createQuery("SELECT p from Product p where p.name = ?1");
+ Collection c = query.getResultList();
+ }
+
+ } catch (NamingException e) {
+ e.printStackTrace();
+ } catch (FinderException e) {
+ e.printStackTrace();
+ }
+
+
+ return null;
+ }
+
+ @PersistenceUnit(name = "TestPU")
+ private javax.persistence.EntityManagerFactory entityManagerFactory;
+}
Added: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean30-2.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean30-2.txt?rev=711945&view=auto
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean30-2.txt (added)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean30-2.txt Thu Nov 6 11:03:06 2008
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package uk.me.jrg.ejb;
+
+import uk.me.jrg.jee.store.ejb.ProductHome;
+
+import javax.ejb.*;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.Collection;
+import javax.persistence.PersistenceUnit;
+
+public class ProductManagerBean2 implements SessionBean {
+ public ProductManagerBean2() {
+ }
+
+ public void ejbCreate() throws CreateException {
+ }
+
+ public void setSessionContext(SessionContext sessionContext) throws EJBException {
+ }
+
+ public void ejbRemove() throws EJBException {
+ }
+
+ public void ejbActivate() throws EJBException {
+ }
+
+ public void ejbPassivate() throws EJBException {
+ }
+
+ public Collection findProductsByName(String name) {
+ try {
+ InitialContext context = new InitialContext();
+ ProductHome productHome = (ProductHome) context.lookup("ejb/Product");
+ if (productHome != null) {
+ javax.persistence.EntityManager entityManager = entityManagerFactory
+ .createEntityManager();
+ javax.persistence.Query query = entityManager
+ .createQuery("SELECT p from Product p where p.name = ?1");
+ query.getResultList();
+ }
+
+ } catch (NamingException e) {
+ e.printStackTrace();
+ } catch (FinderException e) {
+ e.printStackTrace();
+ }
+
+
+ return null;
+ }
+
+ @PersistenceUnit(name = "TestPU")
+ private javax.persistence.EntityManagerFactory entityManagerFactory;
+}
Added: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean30-3.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean30-3.txt?rev=711945&view=auto
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean30-3.txt (added)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/ProductManagerBean30-3.txt Thu Nov 6 11:03:06 2008
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package uk.me.jrg.ejb;
+
+import uk.me.jrg.jee.store.ejb.ProductHome;
+
+import javax.ejb.*;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.Collection;
+import javax.persistence.PersistenceUnit;
+
+public class ProductManagerBean3 implements SessionBean {
+ public ProductManagerBean3() {
+ }
+
+ public void ejbCreate() throws CreateException {
+ }
+
+ public void setSessionContext(SessionContext sessionContext) throws EJBException {
+ }
+
+ public void ejbRemove() throws EJBException {
+ }
+
+ public void ejbActivate() throws EJBException {
+ }
+
+ public void ejbPassivate() throws EJBException {
+ }
+
+ public Collection findProductsByName(String name) {
+ try {
+ InitialContext context = new InitialContext();
+ ProductHome productHome = (ProductHome) context.lookup("ejb/Product");
+ if (productHome != null) {
+ javax.persistence.EntityManager entityManager = entityManagerFactory
+ .createEntityManager();
+ javax.persistence.Query query = entityManager
+ .createQuery("SELECT p from Product p where p.name = ?1");
+ query.getResultList();
+ }
+
+ } catch (NamingException e) {
+ e.printStackTrace();
+ } catch (FinderException e) {
+ e.printStackTrace();
+ }
+
+
+ return null;
+ }
+
+ @PersistenceUnit(name = "TestPU")
+ private javax.persistence.EntityManagerFactory entityManagerFactory;
+}
Modified: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test1.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test1.txt?rev=711945&r1=711944&r2=711945&view=diff
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test1.txt (original)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test1.txt Thu Nov 6 11:03:06 2008
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.openejb.test;
public class TestBean1 {
Modified: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test2.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test2.txt?rev=711945&r1=711944&r2=711945&view=diff
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test2.txt (original)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test2.txt Thu Nov 6 11:03:06 2008
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.openejb.test;
import javax.ejb.Stateless;
Modified: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test3.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test3.txt?rev=711945&r1=711944&r2=711945&view=diff
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test3.txt (original)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test3.txt Thu Nov 6 11:03:06 2008
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.openejb.test;
public class TestBean3 {
Modified: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test4.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test4.txt?rev=711945&r1=711944&r2=711945&view=diff
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test4.txt (original)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test4.txt Thu Nov 6 11:03:06 2008
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.openejb.test;
public class TestBean4 {
Modified: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test5.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test5.txt?rev=711945&r1=711944&r2=711945&view=diff
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test5.txt (original)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test5.txt Thu Nov 6 11:03:06 2008
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.openejb.test;
public class TestBean5 {
Modified: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test6.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test6.txt?rev=711945&r1=711944&r2=711945&view=diff
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test6.txt (original)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test6.txt Thu Nov 6 11:03:06 2008
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.openejb.test;
public class TestBean6 {
Modified: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test7.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test7.txt?rev=711945&r1=711944&r2=711945&view=diff
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test7.txt (original)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test7.txt Thu Nov 6 11:03:06 2008
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.openejb.test;
public class TestBean7 {
Modified: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test8.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test8.txt?rev=711945&r1=711944&r2=711945&view=diff
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test8.txt (original)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation.test/src/main/resources/org/apache/openejb/helper/annotation/tests/Test8.txt Thu Nov 6 11:03:06 2008
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.openejb.test;
import javax.ejb.EJBException;
Modified: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation/src/main/java/org/apache/openejb/helper/annotation/wizards/EJBMigrationRefactoring.java
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation/src/main/java/org/apache/openejb/helper/annotation/wizards/EJBMigrationRefactoring.java?rev=711945&r1=711944&r2=711945&view=diff
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation/src/main/java/org/apache/openejb/helper/annotation/wizards/EJBMigrationRefactoring.java (original)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.apache.openejb.helper.annotation/src/main/java/org/apache/openejb/helper/annotation/wizards/EJBMigrationRefactoring.java Thu Nov 6 11:03:06 2008
@@ -21,15 +21,21 @@
import java.util.List;
import org.apache.openejb.devtools.core.JDTFacade;
-import org.apache.openejb.plugins.common.*;
+import org.apache.openejb.plugins.common.Converter;
+import org.apache.openejb.plugins.common.EjbReferencesConverter;
+import org.apache.openejb.plugins.common.EntityBeanConverter;
+import org.apache.openejb.plugins.common.EntityBeanPojoConverter;
+import org.apache.openejb.plugins.common.EntityBeanUsageConverter;
+import org.apache.openejb.plugins.common.OpenEjbXmlConverter;
+import org.apache.openejb.plugins.common.SessionBeanConverter;
+import org.apache.openejb.plugins.common.SessionBeanInterfaceModifier;
+import org.apache.openejb.plugins.common.SessionBeanRemoteAnnotationAdder;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.Refactoring;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
@@ -112,6 +118,7 @@
if (convertEntityBeansToPojos) {
converterList.add(new EntityBeanPojoConverter(jdtFacade));
+ converterList.add(new EntityBeanUsageConverter(jdtFacade));
}
Converter[] converters = converterList.toArray(new Converter[0]);