diff --git a/jonas_tests/.classpath b/jonas_tests/.classpath new file mode 100644 index 0000000000000000000000000000000000000000..02a8203c7575681ea757a3419cb73e7d38cbe5cc --- /dev/null +++ b/jonas_tests/.classpath @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/jonas_tests/.cvsignore b/jonas_tests/.cvsignore new file mode 100644 index 0000000000000000000000000000000000000000..a84348e8c9aae10ea50cd8e676f830ea41e5f419 --- /dev/null +++ b/jonas_tests/.cvsignore @@ -0,0 +1,4 @@ +output_eclipse +report +handleSimple.ser +homehandleSimple.ser diff --git a/jonas_tests/.project b/jonas_tests/.project new file mode 100644 index 0000000000000000000000000000000000000000..2c6274e2bbd242d2877e7e255be63397af362c5c --- /dev/null +++ b/jonas_tests/.project @@ -0,0 +1,18 @@ + + + jonas48_tests + + + jonas48 + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/jonas_tests/README b/jonas_tests/README new file mode 100644 index 0000000000000000000000000000000000000000..61c83b56958cd483513d5065f88b64de305ad777 --- /dev/null +++ b/jonas_tests/README @@ -0,0 +1,23 @@ +Running junit tests: +-------------------- +1) run the JOnAS Server: + jonas start + +2) run the conformance tests : + cd conformance + ant report + +A report is produced in report/html +You need the following jars (usually put in $ANT_HOME/lib) : +xalan.jar +junit.jar +bcel-5.1.jar + +-> More details about the tests in ./doc/index.html + +It is also possible to use the script junit.sh (junit.bat on windows) : + customize the path for TEST_BASE + chmod +x junit.sh + junit.sh conf ... + + \ No newline at end of file diff --git a/jonas_tests/applications/.cvsignore b/jonas_tests/applications/.cvsignore new file mode 100644 index 0000000000000000000000000000000000000000..90b07e9d451ae3e41ec1b5d74e12fb4375a9f3cf --- /dev/null +++ b/jonas_tests/applications/.cvsignore @@ -0,0 +1 @@ +classes diff --git a/jonas_tests/applications/build.xml b/jonas_tests/applications/build.xml new file mode 100644 index 0000000000000000000000000000000000000000..ccd16b782572f58d87eb348dc8859505e151f046 --- /dev/null +++ b/jonas_tests/applications/build.xml @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jonas_tests/applications/src/org/objectweb/jonas/applications/clients/apps/mejb/F_MonitoringEndpoint.java b/jonas_tests/applications/src/org/objectweb/jonas/applications/clients/apps/mejb/F_MonitoringEndpoint.java new file mode 100644 index 0000000000000000000000000000000000000000..e0ed82d51467af7233a9cfc01b231cf20c0da471 --- /dev/null +++ b/jonas_tests/applications/src/org/objectweb/jonas/applications/clients/apps/mejb/F_MonitoringEndpoint.java @@ -0,0 +1,174 @@ +/** + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 2005 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 1any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * Initial developer: Matt Wringe + * -------------------------------------------------------------------------- + * $Id: + * -------------------------------------------------------------------------- + */ +package org.objectweb.jonas.applications.clients.apps.mejb; + +import java.net.URL; +import javax.xml.namespace.QName; +import junit.framework.TestSuite; +import junit.textui.TestRunner; +import org.apache.axis.client.Call; +import org.apache.axis.client.Service; +import org.objectweb.jonas.applications.util.JApplicationsTestCase; + +/** + * Class used to test that the monitoring endpoint (contained in + * mejb.ear) is working properly. + * @author Matt Wringe + */ +public class F_MonitoringEndpoint extends JApplicationsTestCase{ + + + /** + * URL of the monitoring endpoint + */ + private static final String URL_ENDPOINT = "/mejb/ManagementEndpoint/ManagementEndpoint"; + + /** + * The namespace of the monitoring endpoint. + */ + private static final String NAMESPACE = "http://mejb.jonas.objectweb.org"; + + /** + * Call object used to invoke methods in the monitoring endpoint + */ + private static Call call; + + /** + * the username to be used with the application + */ + private static final String USERNAME = "jonas"; + + /** + * the password to be used with the application + */ + private static final String PASSWORD = "jonas"; + + /** + * Main method + * @param args the arguments + */ + public static void main(String[] args) { + String testtorun = null; + for (int argn = 0; argn < args.length; argn++) { + String sArg = args[argn]; + if (sArg.equals("-n")) { + testtorun = args[++argn]; + } + } + if (testtorun == null) { + TestRunner.run(suite()); + } else { + TestRunner.run(new F_MonitoringEndpoint(testtorun)); + } + } + + /** + * Constructor with a specified name + * @param s name + */ + public F_MonitoringEndpoint(String s) { + super (s, URL_ENDPOINT, USERNAME, PASSWORD); + } + + /** + * Get a new TestSuite for this class + * @return a new TestSuite for this class + */ + public static TestSuite suite() { + return new TestSuite(F_MonitoringEndpoint.class); + } + + /** + * Initial setup for the test + * @throws Exception If any exception occurs. + */ + protected void setUp() throws Exception { + super.setUp(); + useEar("mejb"); + Service service = new Service(); + call = (Call) service.createCall(); + call.setUsername(USERNAME); + call.setPassword(PASSWORD); + call.setTargetEndpointAddress (new URL(getAbsoluteUrl(URL_ENDPOINT))); + } + + /** + * Tests that the endpoint can get the mbean count for the current server + * @throws Exception If any exception occurs + */ + public void testGetMBeanCount() throws Exception { + call.setOperationName (new QName(NAMESPACE, "getMBeanCount")); + Integer res = (Integer) call.invoke (new Object[]{}); + if (res.intValue() <= 0) { + fail ("Could not get any mbeans"); + } + } + + /** + * Tests if the endpoint can get the list of servers. + * @throws Exception If any exception occurs. + */ + public void testGetServers() throws Exception { + call.setOperationName (new QName(NAMESPACE, "getServers")); + String[] res = (String[]) call.invoke (new Object[]{}); + if (res.length < 1) { + fail ("No servers found in the domain"); + } + } + + /** + * Test if the endopoint can get current domain. + * Assumes the sever is started in domain 'jonas' + * @throws Exception If any exception occurs. + */ + public void testDefaultDomain() throws Exception { + //Assumes server is started in domain jonas + call.setOperationName (new QName(NAMESPACE, "getDefaultDomain")); + String res = (String) call.invoke (new Object[]{}); + if (!res.equals("jonas")) { + fail ("The domain name gotten through the endpoint does not match the actual domain name. Expected :jonas, received :" + res); + } + } + + /** + * Test if the endpoint can get the server name from the J2EEServer mbean. + * Assumes that the server's name is 'jonas' and started in domain 'jonas' + * @throws Exception If any exception occurs. + */ + public void testGetAttribute() throws Exception { + //Assumes that the server started is named jonas and is started in domain jonas + String serverName = "jonas"; + String domainName = "jonas"; + String objectName = domainName + ":j2eeType=J2EEServer,name=" + serverName; + + call.setOperationName (new QName(NAMESPACE, "getAttribute")); + String[] res = (String[]) call.invoke (new Object[]{serverName, objectName, "serverName"}); + if (!res[0].equals(serverName)) { + fail ("The attribute value received does not match its acual value. Expected :" + + serverName + ", received:" + res[0]); + } + } +} diff --git a/jonas_tests/applications/src/org/objectweb/jonas/applications/util/JApplicationsTestCase.java b/jonas_tests/applications/src/org/objectweb/jonas/applications/util/JApplicationsTestCase.java new file mode 100644 index 0000000000000000000000000000000000000000..f9e19793f9f4e359ead88cdcd9a1161029586531 --- /dev/null +++ b/jonas_tests/applications/src/org/objectweb/jonas/applications/util/JApplicationsTestCase.java @@ -0,0 +1,312 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 2005 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 1any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * Initial developer: Matt Wringe + * -------------------------------------------------------------------------- + * $Id: + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.applications.util; + +import java.io.File; +import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; + +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import javax.rmi.PortableRemoteObject; + +import junit.framework.TestCase; + +import org.objectweb.jonas.adm.AdmInterface; + +import com.meterware.httpunit.WebConversation; + +/** + * Define a class to add useful methods for test the examples + * - Deploy ear, war and beans + * - Retrieve initial context + * @author Florent Benoit + */ +public class JApplicationsTestCase extends TestCase { + + /** + * Name of the JOnAS server used for tests + */ + private static String jonasName = "jonas"; + + /** + * Initial context used for lookup + */ + private static Context ictx = null; + + /** + * JOnAS admin used for communicate via JMX to JOnAS + */ + private static AdmInterface admI = null; + + /** + * Conversation used for HttpUnit + */ + protected WebConversation wc = null; + + /** + * URL used for the constructor + */ + protected String url = null; + + /** + * Prefix for build URLs + */ + private String prefixUrl = null; + + /** + * Add to the specified url the prefix + * @param url relative URL + * @return absolute path of URL + */ + protected String getAbsoluteUrl (String url) { + return (this.prefixUrl + url); + } + + /** + * Initialize the port used by tests and the prefix + */ + private void init() { + String port = System.getProperty("http.port"); + if (port == null) { + port = "9000"; + } + + prefixUrl = "http://localhost:" + port; + } + + /** + * Constructor with a specified name + * @param s the name + */ + public JApplicationsTestCase(String s) { + super(s); + init(); + } + /** + * Constructor with a specified name and url + * @param s the name + * @param url the url which can be used + */ + public JApplicationsTestCase(String s, String url) { + super(s); + wc = new WebConversation(); + init(); + this.url = getAbsoluteUrl(url); + } + + /** + * Constructor with a specific name and url + * This constructor is to be used when Basic Authentication + * is required. + * + * @param s the name + * @param url the url which can be used + * @param username the username + * @param password the password + */ + public JApplicationsTestCase(String s, String url, String username, String password) { + super(s); + wc = new WebConversation(); + wc.setAuthorization(username, password); + init(); + this.url = getAbsoluteUrl(url); + } + + /** + * Get initialContext + * @return the initialContext + * @throws NamingException if the initial context can't be retrieved + */ + private Context getInitialContext() throws NamingException { + return new InitialContext(); + } + + /** + * Common setUp routine, used for every test. + * @throws Exception if an error occurs + */ + protected void setUp() throws Exception { + try { + // get InitialContext + if (ictx == null) { + ictx = getInitialContext(); + } + if (admI == null) { + admI = (AdmInterface) PortableRemoteObject.narrow(ictx.lookup(jonasName + "_Adm"), AdmInterface.class); + } + + + } catch (NamingException e) { + System.err.println("Cannot setup test: " + e); + e.printStackTrace(); + } + } + + + /** + * Load an ear file in the jonas server + * @param filename ear file, without ".ear" extension + * @throws Exception if an error occurs + */ + public void useEar(String filename) throws Exception { + + try { + // Load ear in JOnAS if not already loaded. + if (ictx == null) { + ictx = getInitialContext(); + } + + if (admI == null) { + admI = (AdmInterface) ictx.lookup(jonasName + "_Adm"); + } + + //Test in both directories (apps/ and apps/autoload) + String appsFileName = filename + ".ear"; + String autoloadAppsFileName = "autoload" + File.separator + filename + ".ear"; + if (!admI.isEarLoaded(appsFileName) && !admI.isEarLoaded(autoloadAppsFileName)) { + //if the file was in autoload, it was loaded + admI.addEar(appsFileName); + } + + } catch (Exception e) { + throw new Exception("Cannot load Ear : " + e.getMessage()); + } + } + + /** + * Load a war file in the jonas server + * @param filename war file, without ".war" extension + * @throws Exception if an error occurs + */ + public void useWar(String filename) throws Exception { + + try { + // Load war in JOnAS if not already loaded. + if (ictx == null) { + ictx = getInitialContext(); + } + + if (admI == null) { + admI = (AdmInterface) ictx.lookup(jonasName + "_Adm"); + } + + //Test in both directories (apps/ and apps/autoload) + String webappsFileName = filename + ".war"; + String autoloadWebappsFileName = "autoload" + File.separator + filename + ".war"; + if (!admI.isWarLoaded(webappsFileName) && !admI.isWarLoaded(autoloadWebappsFileName)) { + //if the file was in autoload, it was loaded + admI.addWar(webappsFileName); + } + + } catch (Exception e) { + throw new Exception("Cannot load War : " + e.getMessage()); + } + } + + /** + * Load a bean jar file in the jonas server + * @param filename jar file, without ".jar" extension + * @throws Exception if an error occurs + */ + public void useBeans(String filename) throws Exception { + try { + // Load bean in EJBServer if not already loaded. + if (ictx == null) { + ictx = getInitialContext(); + } + if (admI == null) { + admI = (AdmInterface) ictx.lookup(jonasName + "_Adm"); + } + if (!admI.isLoaded(filename + ".jar")) { + admI.addBeans(filename + ".jar"); + } + } catch (Exception e) { + throw new Exception("Cannot load Bean : " + e.getMessage()); + } + } + + + /** + * Unload a bean jar file in the jonas server + * @param filename jar file, without ".jar" extension + * @throws Exception if an error occurs + */ + public void unUseBeans(String filename) throws Exception { + try { + // Load bean in EJBServer if not already loaded. + if (ictx == null) { + ictx = getInitialContext(); + } + if (admI == null) { + admI = (AdmInterface) ictx.lookup(jonasName + "_Adm"); + } + if (admI.isLoaded(filename + ".jar")) { + admI.removeBeans(filename + ".jar"); + } + } catch (Exception e) { + throw new Exception("Cannot unload Bean : " + e.getMessage()); + } + } + + + /** + * Call the main method of a specific class with empty args + * @param classToLoad name of class which contains the main method + * @throws Exception if it fails + */ + protected void callMainMethod(String classToLoad) throws Exception { + callMainMethod(classToLoad, new String[]{}); + } + + + /** + * Call the main method of a specific class and the specific args + * @param classToLoad name of class which contains the main method + * @param args args to give to the main method + * @throws Exception if it fails + */ + protected void callMainMethod(String classToLoad, String[] args) throws Exception { + //Build classloader + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + URL[] urls = new URL[1]; + urls[0] = new File(System.getProperty("jonas.root") + File.separator + "examples" + File.separator + "classes").toURL(); + URLClassLoader loader = new URLClassLoader(urls); + Thread.currentThread().setContextClassLoader(loader); + Class clazz = loader.loadClass(classToLoad); + Class[] argList = new Class[] {args.getClass()}; + Method meth = clazz.getMethod("main", argList); + Object appli = meth.invoke(null, new Object[]{args}); + } + + + + + +} diff --git a/jonas_tests/build.dtd b/jonas_tests/build.dtd new file mode 100644 index 0000000000000000000000000000000000000000..03e8af756a005ae7ebf9081c84244904dbabe9c4 --- /dev/null +++ b/jonas_tests/build.dtd @@ -0,0 +1,2585 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jonas_tests/build.properties b/jonas_tests/build.properties new file mode 100644 index 0000000000000000000000000000000000000000..c7dd9c1f799dd00978539d7b9ebdbf27ff538f01 --- /dev/null +++ b/jonas_tests/build.properties @@ -0,0 +1,48 @@ +# --------------------------------------------------------------------------- +# JOnAS: Java(TM) Open Application Server +# Copyright (C) 1999 Bull S.A. +# Contact: jonas-team@objectweb.org +# +# This library 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 any later version. +# +# This library 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 library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA +# +# Initial developer(s): Philippe Durieux +# Contributor(s): ______________________________________. +# +# --------------------------------------------------------------------------- +# $Id$ +# --------------------------------------------------------------------------- + +# Properties defined in this file could be customized + +# To use the jike compiler +#build.compiler jikes +build.compiler.emacs true + +# options for java compiler +opt.javac.debug on +opt.javac.optimize off + +# To use the jike compiler +#build.compiler jikes + +# +# genic args +#verbose=true + +# protocols for Carol (jrmp,iiop,cmi) +protocols.names=jrmp,iiop,cmi + + diff --git a/jonas_tests/build.xml b/jonas_tests/build.xml new file mode 100644 index 0000000000000000000000000000000000000000..b3183034adf08484c51b42089c748c62d18ce1d9 --- /dev/null +++ b/jonas_tests/build.xml @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JOnAS Tests Java Documentation]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${environment.html} + + ${suiteslist.html} + <a name="conformance"></a><h2>JOnAS Junit Test Suite - conformance</h2> + ${conformance.html} + <a name="examples"></a><h2>JOnAS Junit Test Suite - examples</h2> + + ${examples.html} +<a name="webservices"></a><h2>JOnAS Junit Test Suite - webservices</h2> + + ${ws.html} + <a name="jonasadmin"></a><h2>JOnAS Junit Test Suite - jonasAdmin</h2> + + ${jonasadmin.html} + <a name="applications"></a><h2>JOnAS Junit Test Suite - applications</h2> + + ${applications.html} + + ${cluster.html} + + ${footer.html} + + + + + diff --git a/jonas_tests/cluster/build.xml b/jonas_tests/cluster/build.xml new file mode 100644 index 0000000000000000000000000000000000000000..d1942ffe4282b068c7f9d0ef39c82f4a03b23e3a --- /dev/null +++ b/jonas_tests/cluster/build.xml @@ -0,0 +1,600 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jonas_tests/cluster/src/org/objectweb/jonas/cluster/test/ClientTest.java b/jonas_tests/cluster/src/org/objectweb/jonas/cluster/test/ClientTest.java new file mode 100644 index 0000000000000000000000000000000000000000..29bc0fc5b93dc07169f9caa04940d1fbe9713dbe --- /dev/null +++ b/jonas_tests/cluster/src/org/objectweb/jonas/cluster/test/ClientTest.java @@ -0,0 +1,94 @@ +/** + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 2005 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 1any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.cluster.test; + +import org.objectweb.sampleCluster2.client.ClientFOSFSB; +import org.objectweb.sampleCluster2.client.ClientLBHome; +import org.objectweb.sampleCluster2.client.ClientLBLookup; +import org.objectweb.sampleCluster2.client.ClientLBRemote; + +import junit.framework.TestCase; +import junit.framework.TestSuite; +/** + * + * @author Nicolas Duvauchel + * + */ +public class ClientTest extends TestCase { + + public static void main(String args[]) { + junit.textui.TestRunner.run(suite()); + } + + public static TestSuite suite() { + return new TestSuite(ClientTest.class); + } + + public ClientTest(String s) { + super(s); + } + + protected void setUp() throws Exception { + } + + public void testLBHome() throws Exception { + System.out.println("testLBHome"); + String[] args = null; + int result = ClientLBHome.main(args); + System.out.println("fin testLBHome"); + if (result != 0) { + fail("on test LB Home"); + } + } + + public void testFOSFSB() throws Exception { + System.out.println("testFOSFSB"); + String[] args = null; + int result = ClientFOSFSB.main(args); + if (result != 0) { + fail("on test LB Home"); + } + } + + public void testLBLookup() throws Exception { + System.out.println("testLBLookup"); + String[] args = null; + int result = ClientLBLookup.main(args); + if (result != 0) { + fail("on test LB Home"); + } + } + + public void testLBRemote() throws Exception { + System.out.println("testLBRemote"); + String[] args = null; + int result = ClientLBRemote.main(args); + if (result != 0) { + fail("on test LB Home"); + } + } + +} diff --git a/jonas_tests/cluster/src/org/objectweb/jonas/cluster/test/SampleCluster2Test.java b/jonas_tests/cluster/src/org/objectweb/jonas/cluster/test/SampleCluster2Test.java new file mode 100644 index 0000000000000000000000000000000000000000..48d4927255eb8f3aeb4730e03e19f03483ebf267 --- /dev/null +++ b/jonas_tests/cluster/src/org/objectweb/jonas/cluster/test/SampleCluster2Test.java @@ -0,0 +1,161 @@ +/** + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 2005 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 1any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.cluster.test; + +import java.io.IOException; +import java.net.MalformedURLException; + +import org.xml.sax.SAXException; + +import com.meterware.httpunit.GetMethodWebRequest; +import com.meterware.httpunit.WebConversation; +import com.meterware.httpunit.WebRequest; +import com.meterware.httpunit.WebResponse; + +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * the aim of this class is to check the different calls made in sampleCluster2 + * example. + * @author Nicolas Duvauchel + */ +public class SampleCluster2Test extends TestCase { + + /** + * the link with the web page + */ + private static WebConversation conversation = null; + + /** + * @param args + */ + public static void main(String args[]) { + junit.textui.TestRunner.run(suite()); + } + + /** + * @return the test suite + */ + public static TestSuite suite() { + return new TestSuite(SampleCluster2Test.class); + } + + /** + * @param s + */ + public SampleCluster2Test(String s) { + super(s); + } + + /** + * set up parameters for the tests + */ + protected void setUp() throws Exception { + if (conversation == null) { + System.out.println("setting up conversation."); + conversation = new WebConversation(); + } + } + + /** + * test if the page is accessible + * @throws Exception + */ + public void testReachable() throws Exception { + + try { + WebRequest request = new GetMethodWebRequest("http://localhost/sampleCluster2"); + + WebResponse response = conversation.getResponse(request); + System.out.println(response.getText()); + } catch (Exception e) { + fail("on test Reachable: " + e); + } + + } + + /** + * test and create a session + * @throws Exception + */ + public void testSession() throws Exception { + try { + WebRequest request = new GetMethodWebRequest("http://localhost/sampleCluster2/servlet/session"); + + WebResponse response = conversation.getResponse(request); + System.out.println(response.getText()); + } catch (Exception e) { + fail("on test Session: " + e); + } + } + + /** + * test and check the session + * @throws Exception + */ + public void testCheck() throws Exception { + try { + WebRequest request = new GetMethodWebRequest("http://localhost/sampleCluster2/servlet/check"); + + WebResponse response = conversation.getResponse(request); + System.out.println(response.getText()); + } catch (Exception e) { + fail("on test Check: " + e); + } + } + + /** + * test and release the session + * @throws Exception + */ + public void testRelease() throws Exception { + try { + WebRequest request = new GetMethodWebRequest("http://localhost/sampleCluster2/servlet/release"); + + WebResponse response = conversation.getResponse(request); + System.out.println(response.getText()); + } catch (Exception e) { + fail("on test Release: " + e); + } + } + + /** + * test the exception + * @throws Exception + */ + public void testException() throws Exception { + try { + WebRequest request = new GetMethodWebRequest("http://localhost/sampleCluster2/servlet/exception"); + + WebResponse response = conversation.getResponse(request); + System.out.println(response.getText()); + } catch (Exception e) { + fail("on test Exception: " + e); + } + } + +} diff --git a/jonas_tests/conformance/.cvsignore b/jonas_tests/conformance/.cvsignore new file mode 100644 index 0000000000000000000000000000000000000000..c401f152473649e23d016eef352c8bdea5adcac4 --- /dev/null +++ b/jonas_tests/conformance/.cvsignore @@ -0,0 +1,2 @@ +classes +report diff --git a/jonas_tests/conformance/build.xml b/jonas_tests/conformance/build.xml new file mode 100644 index 0000000000000000000000000000000000000000..f1cb472e783231eefc73aabdd238522c11f38b36 --- /dev/null +++ b/jonas_tests/conformance/build.xml @@ -0,0 +1,494 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jonas_tests/conformance/build_hotdeploy.xml b/jonas_tests/conformance/build_hotdeploy.xml new file mode 100644 index 0000000000000000000000000000000000000000..9eaec50297d1d202429757f0ffc3da9120616519 --- /dev/null +++ b/jonas_tests/conformance/build_hotdeploy.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jonas_tests/conformance/jonas.properties b/jonas_tests/conformance/jonas.properties new file mode 100644 index 0000000000000000000000000000000000000000..35e2ac1ec75f087bf31b4f67a563c2900323b966 --- /dev/null +++ b/jonas_tests/conformance/jonas.properties @@ -0,0 +1,2 @@ +#jonas.services jmx,security,jtm,dbm,jms,ejb,web +jonas.services registry,jmx,jtm,dbm,security,jms,resource,ejb,web,ear diff --git a/jonas_tests/conformance/src/hotdeploy1/Helper.java b/jonas_tests/conformance/src/hotdeploy1/Helper.java new file mode 100644 index 0000000000000000000000000000000000000000..ace70391a73b9b2b418eca04f2ceb0ca6adf5e46 --- /dev/null +++ b/jonas_tests/conformance/src/hotdeploy1/Helper.java @@ -0,0 +1,5 @@ +package org.objectweb.jonas.jtests.beans.hotdeploy; + +public class Helper { + public static final int VERSION_NUMBER = 1; +} diff --git a/jonas_tests/conformance/src/hotdeploy1/HotDeploy.java b/jonas_tests/conformance/src/hotdeploy1/HotDeploy.java new file mode 100644 index 0000000000000000000000000000000000000000..b0cd7f6a40e6ffebfbf1cfab2d338ef6a182ce82 --- /dev/null +++ b/jonas_tests/conformance/src/hotdeploy1/HotDeploy.java @@ -0,0 +1,15 @@ +// HotDeploy.java + +package org.objectweb.jonas.jtests.beans.hotdeploy; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * HotDeploy remote interface + */ +public interface HotDeploy extends EJBObject { + public String getEnvString() throws RemoteException; + public int getVersionNumber() throws RemoteException; + public int getHelperClassVersionNumber() throws RemoteException; +} diff --git a/jonas_tests/conformance/src/hotdeploy1/HotDeployHome.java b/jonas_tests/conformance/src/hotdeploy1/HotDeployHome.java new file mode 100644 index 0000000000000000000000000000000000000000..6c5b73c1735a651fa75ca5f42733f90007e4ac63 --- /dev/null +++ b/jonas_tests/conformance/src/hotdeploy1/HotDeployHome.java @@ -0,0 +1,16 @@ +// HotDeployHome.java + +package org.objectweb.jonas.jtests.beans.hotdeploy; + +import java.rmi.RemoteException; +import java.util.Collection; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + +/** + * Home interface for the bean HotDeploy + */ +public interface HotDeployHome extends EJBHome { + HotDeploy create() throws CreateException, RemoteException; +} diff --git a/jonas_tests/conformance/src/hotdeploy1/HotDeploySLR.java b/jonas_tests/conformance/src/hotdeploy1/HotDeploySLR.java new file mode 100644 index 0000000000000000000000000000000000000000..b9d7e1f94275aadb8cc7e7611b51881ba117dfb7 --- /dev/null +++ b/jonas_tests/conformance/src/hotdeploy1/HotDeploySLR.java @@ -0,0 +1,97 @@ +// HotDeploySLR.java +// Stateless Session bean + +package org.objectweb.jonas.jtests.beans.hotdeploy; + +import java.rmi.RemoteException; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Statement; +import javax.ejb.CreateException; +import javax.ejb.EJBException; +import javax.ejb.RemoveException; +import javax.ejb.EJBObject; +import javax.ejb.SessionBean; +import javax.ejb.SessionContext; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import javax.sql.DataSource; + +import org.objectweb.jonas.common.Log; +import org.objectweb.util.monolog.api.Logger; +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * + */ +public class HotDeploySLR implements SessionBean { + + static private Logger logger = null; + SessionContext ejbContext; + private static final int VERSION_NUMBER = 1; + + // ------------------------------------------------------------------ + // SessionBean implementation + // ------------------------------------------------------------------ + + + public void setSessionContext(SessionContext ctx) { + if (logger == null) { + logger = Log.getLogger("org.objectweb.jonas_tests"); + } + logger.log(BasicLevel.DEBUG, ""); + ejbContext = ctx; + } + + + public void ejbRemove() { + logger.log(BasicLevel.DEBUG, ""); + } + + + public void ejbCreate() throws CreateException { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbPassivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbActivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + // ------------------------------------------------------------------ + // HotDeploy implementation + // ------------------------------------------------------------------ + /** + * method1 + */ + public String getEnvString() { + logger.log(BasicLevel.DEBUG, "getEnvString"); + String value = ""; + try { + InitialContext ictx = new InitialContext(); + value = (String) ictx.lookup("java:comp/env/name"); + // value should be the one defined in ejb-jar.xml + } catch (NamingException e) { + throw new EJBException(e); + } + + return value; + } + + public int getVersionNumber() { + logger.log(BasicLevel.DEBUG, "getVersionNumber = " + VERSION_NUMBER); + return VERSION_NUMBER; + } + + public int getHelperClassVersionNumber() { + logger.log(BasicLevel.DEBUG, "getHelperClassVersionNumber = " + Helper.VERSION_NUMBER); + return Helper.VERSION_NUMBER; + } + +} + diff --git a/jonas_tests/conformance/src/hotdeploy1/hotdeploy.xml b/jonas_tests/conformance/src/hotdeploy1/hotdeploy.xml new file mode 100644 index 0000000000000000000000000000000000000000..08a24bfa133c4933913b3a957edeba1d4299f0b9 --- /dev/null +++ b/jonas_tests/conformance/src/hotdeploy1/hotdeploy.xml @@ -0,0 +1,41 @@ + + + + + + Describe here the content of this file + hotdeploy + + + + Describe here the session bean HotDeploy + hotdeploy/HotDeploySLR + HotDeploySLR + org.objectweb.jonas.jtests.beans.hotdeploy.HotDeployHome + org.objectweb.jonas.jtests.beans.hotdeploy.HotDeploy + org.objectweb.jonas.jtests.beans.hotdeploy.HotDeploySLR + Stateless + Container + + name + java.lang.String + value1 + + + + + + + + + HotDeploySLR + * + + Supports + + + + + diff --git a/jonas_tests/conformance/src/hotdeploy1/jonas-hotdeploy.xml b/jonas_tests/conformance/src/hotdeploy1/jonas-hotdeploy.xml new file mode 100644 index 0000000000000000000000000000000000000000..e3e6f6f017a99303b1932c570fd866078994b35e --- /dev/null +++ b/jonas_tests/conformance/src/hotdeploy1/jonas-hotdeploy.xml @@ -0,0 +1,12 @@ + + + + + + HotDeploySLR + HotDeployHome + + + diff --git a/jonas_tests/conformance/src/hotdeploy2/Helper.java b/jonas_tests/conformance/src/hotdeploy2/Helper.java new file mode 100644 index 0000000000000000000000000000000000000000..93ce25022f428223fad6b0089f2d232742d08246 --- /dev/null +++ b/jonas_tests/conformance/src/hotdeploy2/Helper.java @@ -0,0 +1,5 @@ +package org.objectweb.jonas.jtests.beans.hotdeploy; + +public class Helper { + public static final int VERSION_NUMBER = 2; +} diff --git a/jonas_tests/conformance/src/hotdeploy2/HotDeploy.java b/jonas_tests/conformance/src/hotdeploy2/HotDeploy.java new file mode 100644 index 0000000000000000000000000000000000000000..b0cd7f6a40e6ffebfbf1cfab2d338ef6a182ce82 --- /dev/null +++ b/jonas_tests/conformance/src/hotdeploy2/HotDeploy.java @@ -0,0 +1,15 @@ +// HotDeploy.java + +package org.objectweb.jonas.jtests.beans.hotdeploy; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * HotDeploy remote interface + */ +public interface HotDeploy extends EJBObject { + public String getEnvString() throws RemoteException; + public int getVersionNumber() throws RemoteException; + public int getHelperClassVersionNumber() throws RemoteException; +} diff --git a/jonas_tests/conformance/src/hotdeploy2/HotDeployHome.java b/jonas_tests/conformance/src/hotdeploy2/HotDeployHome.java new file mode 100644 index 0000000000000000000000000000000000000000..6c5b73c1735a651fa75ca5f42733f90007e4ac63 --- /dev/null +++ b/jonas_tests/conformance/src/hotdeploy2/HotDeployHome.java @@ -0,0 +1,16 @@ +// HotDeployHome.java + +package org.objectweb.jonas.jtests.beans.hotdeploy; + +import java.rmi.RemoteException; +import java.util.Collection; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + +/** + * Home interface for the bean HotDeploy + */ +public interface HotDeployHome extends EJBHome { + HotDeploy create() throws CreateException, RemoteException; +} diff --git a/jonas_tests/conformance/src/hotdeploy2/HotDeploySLR.java b/jonas_tests/conformance/src/hotdeploy2/HotDeploySLR.java new file mode 100644 index 0000000000000000000000000000000000000000..2125af0eca9b80c094c64d50e64ccfee92f6da47 --- /dev/null +++ b/jonas_tests/conformance/src/hotdeploy2/HotDeploySLR.java @@ -0,0 +1,97 @@ +// HotDeploySLR.java +// Stateless Session bean + +package org.objectweb.jonas.jtests.beans.hotdeploy; + +import java.rmi.RemoteException; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Statement; +import javax.ejb.CreateException; +import javax.ejb.EJBException; +import javax.ejb.RemoveException; +import javax.ejb.EJBObject; +import javax.ejb.SessionBean; +import javax.ejb.SessionContext; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import javax.sql.DataSource; + +import org.objectweb.jonas.common.Log; +import org.objectweb.util.monolog.api.Logger; +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * + */ +public class HotDeploySLR implements SessionBean { + + static private Logger logger = null; + SessionContext ejbContext; + private static final int VERSION_NUMBER = 2; + + // ------------------------------------------------------------------ + // SessionBean implementation + // ------------------------------------------------------------------ + + + public void setSessionContext(SessionContext ctx) { + if (logger == null) { + logger = Log.getLogger("org.objectweb.jonas_tests"); + } + logger.log(BasicLevel.DEBUG, ""); + ejbContext = ctx; + } + + + public void ejbRemove() { + logger.log(BasicLevel.DEBUG, ""); + } + + + public void ejbCreate() throws CreateException { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbPassivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbActivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + // ------------------------------------------------------------------ + // HotDeploy implementation + // ------------------------------------------------------------------ + /** + * method1 + */ + public String getEnvString() { + logger.log(BasicLevel.DEBUG, "getEnvString"); + String value = ""; + try { + InitialContext ictx = new InitialContext(); + value = (String) ictx.lookup("java:comp/env/name"); + // value should be the one defined in ejb-jar.xml + } catch (NamingException e) { + throw new EJBException(e); + } + + return value; + } + + public int getVersionNumber() { + logger.log(BasicLevel.DEBUG, "getVersionNumber = " + VERSION_NUMBER); + return VERSION_NUMBER; + } + + public int getHelperClassVersionNumber() { + logger.log(BasicLevel.DEBUG, "getHelperClassVersionNumber = " + Helper.VERSION_NUMBER); + return Helper.VERSION_NUMBER; + } + +} + diff --git a/jonas_tests/conformance/src/hotdeploy2/hotdeploy.xml b/jonas_tests/conformance/src/hotdeploy2/hotdeploy.xml new file mode 100644 index 0000000000000000000000000000000000000000..3fbe747f29ee40de695278983958c2f8de1ad59f --- /dev/null +++ b/jonas_tests/conformance/src/hotdeploy2/hotdeploy.xml @@ -0,0 +1,41 @@ + + + + + + Describe here the content of this file + hotdeploy + + + + Describe here the session bean HotDeploy + hotdeploy/HotDeploySLR + HotDeploySLR + org.objectweb.jonas.jtests.beans.hotdeploy.HotDeployHome + org.objectweb.jonas.jtests.beans.hotdeploy.HotDeploy + org.objectweb.jonas.jtests.beans.hotdeploy.HotDeploySLR + Stateless + Container + + name + java.lang.String + value2 + + + + + + + + + HotDeploySLR + * + + Supports + + + + + diff --git a/jonas_tests/conformance/src/hotdeploy2/jonas-hotdeploy.xml b/jonas_tests/conformance/src/hotdeploy2/jonas-hotdeploy.xml new file mode 100644 index 0000000000000000000000000000000000000000..e3e6f6f017a99303b1932c570fd866078994b35e --- /dev/null +++ b/jonas_tests/conformance/src/hotdeploy2/jonas-hotdeploy.xml @@ -0,0 +1,12 @@ + + + + + + HotDeploySLR + HotDeployHome + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/Personne.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/Personne.java new file mode 100644 index 0000000000000000000000000000000000000000..78d3aa04476b4dc49d04f52bedc2f3f9386bf44e --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/Personne.java @@ -0,0 +1,51 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Personne.java + +package org.objectweb.jonas.jtests.beans.annuaire; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Personne remote interface + */ +public interface Personne extends EJBObject { + public String getNumero() throws RemoteException; + public void setNumero(String s) throws RemoteException; + public void setNom(String s) throws RemoteException; + public String getNom() throws RemoteException; + public boolean isDirty() throws RemoteException; + public void reset() throws RemoteException; + public boolean isModifiedCalled() throws RemoteException; + public boolean ejbStoreCalled() throws RemoteException; + public String getNumeroNTX() throws RemoteException; + public void setNumeroNTX(String s) throws RemoteException; + public int setTimer(int dur, int period) throws RemoteException; + public void cancelTimer(int id) throws RemoteException; + public long getTimeRemaining(int id) throws RemoteException; + public int getTimerCount() throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/PersonneEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/PersonneEC.java new file mode 100644 index 0000000000000000000000000000000000000000..b47aeaa6a59698dbdc9ed86f61562adcd1b6292b --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/PersonneEC.java @@ -0,0 +1,175 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// PersonneEC.java + +package org.objectweb.jonas.jtests.beans.annuaire; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * This is an entity bean with "container managed persistence version 1.x". + * This class extends the similar entity bean with "CMP version 2.x", + * and implements methods specifics to this bean. + * @author Philippe Durieux, Helene Joanin (jonas team) + */ +public class PersonneEC extends PersonneEC2 implements EntityBean { + + boolean dirty = false; + boolean isModifiedCalled = false; + boolean ejbStoreCalled = false; + + // ------------------------------------------------------------------ + // State of the bean. + // They must be public for Container Managed Persistance. + // ------------------------------------------------------------------ + public String nom; + public String numero; + public int timerIdent; + public int timerCount; + + // ------------------------------------------------------------------ + // Accessors and setters implementation + // ------------------------------------------------------------------ + + /** + * getNumero / Tx Attribute = Required + */ + public String getNumero() { + logger.log(BasicLevel.DEBUG, ""); + return numero; + } + + /** + * setNumero / Tx Attribute = Required + */ + public void setNumero(String s) { + logger.log(BasicLevel.DEBUG, ""); + numero = s; + dirty = true; + } + + /** + * setNumero / Tx Attribute = Supports + */ + public void setNumeroNTX(String s) { + logger.log(BasicLevel.DEBUG, ""); + super.setNumeroNTX(s); + dirty = true; + } + + /** + * setNom - Attention: on modifie la PK!!! + */ + public void setNom(String s) { + logger.log(BasicLevel.DEBUG, ""); + nom = s; + dirty = true; + } + + /** + * getNom + */ + public String getNom() { + logger.log(BasicLevel.DEBUG, ""); + return nom; + } + + public int getTimerIdent() { + logger.log(BasicLevel.DEBUG, ""); + return timerIdent; + } + + public void setTimerIdent(int id) { + logger.log(BasicLevel.DEBUG, ""); + dirty = true; + timerIdent = id; + } + + public int getTimerCount() { + logger.log(BasicLevel.DEBUG, ""); + return timerCount; + } + + public void setTimerCount(int cnt) { + logger.log(BasicLevel.DEBUG, ""); + dirty = true; + timerCount = cnt; + } + + + // ------------------------------------------------------------------ + // isModified method + // ------------------------------------------------------------------ + public boolean isModified() { + isModifiedCalled = true; + return dirty; + } + + // ------------------------------------------------------------------ + // EntityBean implementation + // ------------------------------------------------------------------ + + public void ejbLoad() { + logger.log(BasicLevel.DEBUG, ""); + super.ejbLoad(); + dirty = false; + } + + public void ejbStore() { + logger.log(BasicLevel.DEBUG, ""); + ejbStoreCalled = true; + super.ejbStore(); + dirty = false; + } + + // ------------------------------------------------------------------ + // Personne implementation + // ------------------------------------------------------------------ + + public boolean isDirty() { + logger.log(BasicLevel.DEBUG, "PersonneEC "+nom+" isDirty ="+dirty+" "+numero); + return dirty; + } + + public void reset() { + logger.log(BasicLevel.DEBUG, "PersonneEC "+nom+" reset "+numero); + isModifiedCalled = false; + ejbStoreCalled = false; + } + + public boolean isModifiedCalled() { + logger.log(BasicLevel.DEBUG, "PersonneEC "+nom+" isModifiedCalled ="+isModifiedCalled+" "+numero); + return isModifiedCalled; + } + + public boolean ejbStoreCalled() { + logger.log(BasicLevel.DEBUG, "PersonneEC "+nom+" ejbStoreCalled ="+ejbStoreCalled+" "+numero); + return ejbStoreCalled; + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/PersonneEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/PersonneEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..f9c3824903effdb841715ab8a1646c0f0c742b62 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/PersonneEC2.java @@ -0,0 +1,314 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// PersonneEC2.java + +package org.objectweb.jonas.jtests.beans.annuaire; + +import java.rmi.RemoteException; +import java.util.Collection; +import java.util.Iterator; + +import javax.ejb.CreateException; +import javax.ejb.DuplicateKeyException; +import javax.ejb.EntityBean; +import javax.ejb.EntityContext; +import javax.ejb.RemoveException; +import javax.ejb.TimedObject; +import javax.ejb.Timer; +import javax.ejb.TimerService; + +import org.objectweb.jonas.common.Log; +import org.objectweb.util.monolog.api.BasicLevel; +import org.objectweb.util.monolog.api.Logger; + +/** + * This is an entity bean with "container managed persistence version 2.x". + * @author Philippe Durieux, Helene Joanin (jonas team) + */ +public abstract class PersonneEC2 implements EntityBean, TimedObject { + + static protected Logger logger = null; + EntityContext ejbContext; + + // ------------------------------------------------------------------ + // Get and Set accessor methods of the bean's abstract schema + // ------------------------------------------------------------------ + public abstract String getNom(); + public abstract void setNom(String n); + + public abstract String getNumero(); // Tx Attribute = Required + public abstract void setNumero(String n); // Tx Attribute = Required + + public abstract int getTimerIdent(); + public abstract void setTimerIdent(int id); + + public abstract int getTimerCount(); + public abstract void setTimerCount(int cnt); + + + // ------------------------------------------------------------------ + // EntityBean implementation + // ------------------------------------------------------------------ + + /** + * Set the associated entity context. The container invokes this method + * on an instance after the instance has been created. + * This method is called in an unspecified transaction context. + * + * @param ctx - An EntityContext interface for the instance. The instance + * should store the reference to the context in an instance variable. + * @throws EJBException Thrown by the method to indicate a failure caused by a + * system-level error. + */ + public void setEntityContext(EntityContext ctx) { + if (logger == null) + logger = Log.getLogger(Log.JONAS_TESTS_PREFIX); + logger.log(BasicLevel.DEBUG, ""); + ejbContext = ctx; + } + + /** + * Unset the associated entity context. The container calls this method + * before removing the instance. + * This is the last method that the container invokes on the instance. + * The Java garbage collector will eventually invoke the finalize() method + * on the instance. + * This method is called in an unspecified transaction context. + * + * @throws EJBException Thrown by the method to indicate a failure caused by a + * system-level error. + */ + public void unsetEntityContext() { + logger.log(BasicLevel.DEBUG, ""); + ejbContext = null; + } + + /** + * A container invokes this method before it removes the EJB object + * that is currently associated with the instance. This method is + * invoked when a client invokes a remove operation on the enterprise Bean's + * home interface or the EJB object's remote interface. This method + * transitions the instance from the ready state to the pool of available + * instances. + * + * This method is called in the transaction context of the remove operation. + * @throws RemoveException The enterprise Bean does not allow destruction of the object. + * @throws EJBException - Thrown by the method to indicate a failure caused by a system-level + * error. + */ + public void ejbRemove() throws RemoveException { + logger.log(BasicLevel.DEBUG, ""); + } + + /** + * A container invokes this method to instruct the instance to synchronize + * its state by loading it state from the underlying database. + * This method always executes in the proper transaction context. + * + * @throws EJBException Thrown by the method to indicate a failure caused by + * a system-level error. + */ + public void ejbLoad() { + logger.log(BasicLevel.DEBUG, ""); + } + + /** + * A container invokes this method to instruct the instance to synchronize + * its state by storing it to the underlying database. + * This method always executes in the proper transaction context. + * + * @throws EJBException Thrown by the method to indicate a failure caused by + * a system-level error. + */ + public void ejbStore() { + logger.log(BasicLevel.DEBUG, ""); + } + + /** + * There must be an ejbPostCreate par ejbCreate method + * + * @throws CreateException Failure to create an entity EJB object. + */ + public void ejbPostCreate(String nom, String numero) throws CreateException { + logger.log(BasicLevel.DEBUG, ""); + } + public void ejbPostCreate(String nom, String numero, boolean t) throws CreateException { + logger.log(BasicLevel.DEBUG, ""); + } + + + public java.lang.String ejbCreate(String nom, String numero) throws CreateException, DuplicateKeyException { + logger.log(BasicLevel.DEBUG, "ejbCreate(" + nom + ", " + numero + ")"); + + // Init here the bean fields + setNom(nom); + setNumero(numero); + setTimerIdent(0); + setTimerCount(0); + + // In CMP, should return null. + return null; + } + + public java.lang.String ejbCreate(String nom, String numero, boolean t) throws CreateException, DuplicateKeyException { + logger.log(BasicLevel.DEBUG, "ejbCreate nom numero boolean"); + + // Init here the bean fields + setNom(nom); + setNumero(numero); + setTimerIdent(0); + setTimerCount(0); + + // In CMP, should return null. + return null; + } + + /** + * This method is called before the instance enters the "passive" state. + * The instance should release any resources that it can re-acquire later in the + * ejbActivate() method. + * After the passivate method completes, the instance must be in a state that + * allows the container to use the Java Serialization protocol to externalize + * and store away the instance's state. + * This method is called with no transaction context. + * + * @exception EJBException - Thrown if the instance could not perform the + * function requested by the container + */ + public void ejbPassivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + /** + * This method is called when the instance is activated from its "passive" state. + * The instance should acquire any resource that it has released earlier in the + * ejbPassivate() method. + * This method is called with no transaction context. + * + * @exception EJBException - Thrown if the instance could not perform the + * function requested by the container + */ + public void ejbActivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + // ------------------------------------------------------------------ + // Personne implementation + // ------------------------------------------------------------------ + + /** + * getNumeroNTX / Tx Attribute = Supports + */ + public String getNumeroNTX() { + logger.log(BasicLevel.DEBUG, ""); + return getNumero(); + } + + /** + * setNumeroNTX / Tx Attribute = Supports + */ + public void setNumeroNTX(String s) { + logger.log(BasicLevel.DEBUG, ""); + setNumero(s); + } + + // + // Methods only implemented in the entity bean with "CMP version 1.x" + // used to test the isModified extension for CMP version 1 Entity Bean. + // (defined here to have a common interface) + // + + public boolean isModified() { + throw new UnsupportedOperationException(); + } + + public void reset() { + throw new UnsupportedOperationException(); + } + + public boolean isModifiedCalled() { + throw new UnsupportedOperationException(); + } + + public boolean ejbStoreCalled() { + throw new UnsupportedOperationException(); + } + + public boolean isDirty() { + throw new UnsupportedOperationException(); + } + + public int setTimer(int dur, int period) { + TimerService timerservice = ejbContext.getTimerService(); + Timer mt = null; + int ret = getTimerIdent() + 1; + setTimerIdent(ret); + if (period > 0) { + mt = timerservice.createTimer(1000 * dur, 1000 * period, new Integer(ret)); + } else { + mt = timerservice.createTimer(1000 * dur, new Integer(ret)); + } + return ret; + } + + public void cancelTimer(int ident) throws RemoteException { + TimerService timerservice = ejbContext.getTimerService(); + Collection timerList = timerservice.getTimers(); + for (Iterator i = timerList.iterator(); i.hasNext(); ) { + Timer t = (Timer) i.next(); + Integer id = (Integer) t.getInfo(); + if (id.intValue() == ident) { + t.cancel(); + } + } + } + + public long getTimeRemaining(int ident) throws RemoteException { + TimerService timerservice = ejbContext.getTimerService(); + Collection timerList = timerservice.getTimers(); + long ret = -1; + for (Iterator i = timerList.iterator(); i.hasNext(); ) { + Timer t = (Timer) i.next(); + Integer id = (Integer) t.getInfo(); + if (id.intValue() == ident) { + ret = t.getTimeRemaining(); + } + } + return ret; + } + + + // ----------------------------------------------------------- + // TimedObject implementation + // ----------------------------------------------------------- + + /** + * A timer is expired. + */ + public void ejbTimeout(Timer timer) { + setTimerCount(getTimerCount() + 1); + } +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/PersonneHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/PersonneHome.java new file mode 100644 index 0000000000000000000000000000000000000000..0ebe36beef094bb4751660f74bff3d6d4e0380b4 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/PersonneHome.java @@ -0,0 +1,46 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// PersonneHome.java + +package org.objectweb.jonas.jtests.beans.annuaire; + +import java.rmi.RemoteException; +import java.util.Enumeration; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + +/** + * Home interface for the bean Personne + */ +public interface PersonneHome extends EJBHome { + Personne create(String nom, String numero) throws CreateException, RemoteException; + Personne create(String nom, String numero, boolean t) throws CreateException, RemoteException; + Personne findByPrimaryKey(String pk) throws FinderException, RemoteException; + Personne findByNumero(String numero) throws FinderException, RemoteException; + Personne findByNom(String nom) throws FinderException, RemoteException; + Enumeration findAll() throws FinderException, RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/README b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/README new file mode 100644 index 0000000000000000000000000000000000000000..97068d95a826335b259df0d980c72e53e867ca87 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/README @@ -0,0 +1,5 @@ +Bean Personne CMP used by the test suite: +clients/entity/AdvancedHomeInterface +clients/entity/HomeInterface +clients/entity/Suite_entity + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/annuaire.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/annuaire.xml new file mode 100644 index 0000000000000000000000000000000000000000..373b5eae208279b1225d4318589a6e83fc3fc1a1 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/annuaire.xml @@ -0,0 +1,187 @@ + + + + + + Annuaire: Each person is an entity bean Personne + annuaire + + + + + Personne = nom + numero + annuaire/PersonneEC + PersonneEC + org.objectweb.jonas.jtests.beans.annuaire.PersonneHome + org.objectweb.jonas.jtests.beans.annuaire.Personne + org.objectweb.jonas.jtests.beans.annuaire.PersonneEC + Container + java.lang.String + True + 1.x + + nom + + + numero + + + timerCount + + + timerIdent + + nom + + + + Personne = nom + numero + annuaire/PersonneEC2 + PersonneEC2 + org.objectweb.jonas.jtests.beans.annuaire.PersonneHome + org.objectweb.jonas.jtests.beans.annuaire.Personne + org.objectweb.jonas.jtests.beans.annuaire.PersonneEC2 + Container + java.lang.String + True + 2.x + jt2_personne + + nom + + + numero + + + timerCount + + + timerIdent + + nom + + + findByNom + + java.lang.String + + + SELECT OBJECT(o) FROM jt2_personne o WHERE o.nom = ?1 + + + + findByNumero + + java.lang.String + + + SELECT OBJECT(o) FROM jt2_personne o WHERE o.numero = ?1 + + + + findAll + + + SELECT OBJECT(o) FROM jt2_personne o + + + + + + + + + + PersonneEC + * + + + PersonneEC + create + + java.lang.String + java.lang.String + + + + PersonneEC2 + * + + + PersonneEC2 + create + + java.lang.String + java.lang.String + + + Required + + + + + PersonneEC + Home + * + + + PersonneEC + getNumeroNTX + + + PersonneEC + setNumeroNTX + + + PersonneEC2 + Home + * + + + PersonneEC2 + getNumeroNTX + + + PersonneEC2 + setNumeroNTX + + Supports + + + + + PersonneEC2 + ejbTimeout + + RequiresNew + + + + + annuaire-client.jar + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/jonas-annuaire.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/jonas-annuaire.xml new file mode 100644 index 0000000000000000000000000000000000000000..fd4aaebffc7b5e2b619174e4727f6edf4be9dd2f --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/annuaire/jonas-annuaire.xml @@ -0,0 +1,91 @@ + + + + + + PersonneEC + annuairePersonneECHome + isModified + false + + jdbc_1 + annuairePersonneEC + + nom + c_nom + + + numero + c_numero + + + timerIdent + c_ident + + + timerCount + c_count + + + + findByNom + + where c_nom = ? + + + + findByNumero + + where c_numero = ? + + + + findAll + + + + + + + + PersonneEC2 + annuairePersonneEC2Home + 15 + false + 50 + 10 + removeall + container-serialized + + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/Appli.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/Appli.java new file mode 100644 index 0000000000000000000000000000000000000000..9b0ee942cd7fe896d254691ec291c105d149b4b7 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/Appli.java @@ -0,0 +1,36 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.applimet; + +import java.rmi.RemoteException; + +/** + * Remote interface + */ +public interface Appli extends javax.ejb.EJBObject { + public void methodeApplicative() throws RemoteException; + public void noTxMethod() throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/AppliHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/AppliHome.java new file mode 100644 index 0000000000000000000000000000000000000000..eadd5be063509e1aa9541151ff5f9e20649fc013 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/AppliHome.java @@ -0,0 +1,36 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.applimet; + +/** + */ +public interface AppliHome extends javax.ejb.EJBHome { + public static final String COMP_NAME = "java:comp/env/ejb/Appli"; + public static final String JNDI_NAME = "AppliBean"; + + public Appli create() throws javax.ejb.CreateException, java.rmi.RemoteException; + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/AppliLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/AppliLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..4171f959817dd112140dfc1235132e730440c079 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/AppliLocal.java @@ -0,0 +1,30 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.applimet; + +public interface AppliLocal extends javax.ejb.EJBLocalObject { + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/AppliLocalHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/AppliLocalHome.java new file mode 100644 index 0000000000000000000000000000000000000000..d0437af7d20d94908e953089689391c6f5038674 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/AppliLocalHome.java @@ -0,0 +1,36 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.applimet; + +/** + */ +public interface AppliLocalHome extends javax.ejb.EJBLocalHome { + public static final String COMP_NAME = "java:comp/env/ejb/AppliLocal"; + public static final String JNDI_NAME = "AppliLocal"; + + public AppliLocal create() throws javax.ejb.CreateException; + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/AppliSession.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/AppliSession.java new file mode 100644 index 0000000000000000000000000000000000000000..2287a969e9a3fb908d9fa9039ca09947e67a05bf --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/AppliSession.java @@ -0,0 +1,111 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.applimet; + +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.SessionBean; +import javax.ejb.SessionContext; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import javax.rmi.PortableRemoteObject; +import org.objectweb.jonas.common.Log; +import org.objectweb.util.monolog.api.Logger; +import org.objectweb.util.monolog.api.BasicLevel; + +/** + */ +public class AppliSession implements SessionBean { + + static protected Logger logger = null; + private MetHome th; + private Met tr; + + SessionContext ejbContext; + + public void ejbRemove() throws RemoteException { + logger.log(BasicLevel.DEBUG, ""); + try { + tr.remove(); + } catch (Exception e) { + logger.log(BasicLevel.ERROR, "Cannot remove Met:" + e); + throw new RemoteException("Cannot remove Met:" + e); + } + } + + public void ejbCreate() throws CreateException { + logger.log(BasicLevel.DEBUG, ""); + try{ + Context ctx = new InitialContext(); + Object objref = ctx.lookup(MetHome.JNDI_NAME); + th = (MetHome) PortableRemoteObject.narrow(objref, MetHome.class); + tr = th.create(); + } catch(Exception e) { + logger.log(BasicLevel.ERROR, "Cannot create Met:" + e); + throw new CreateException("Cannot create Met:" + e); + } + } + + public void methodeApplicative() throws RemoteException { + logger.log(BasicLevel.DEBUG, ""); + try { + tr.methode1(); + } catch (Exception e) { + logger.log(BasicLevel.ERROR, "Cannot call Met:" + e); + throw new RemoteException("Cannot call Met:" + e); + } + } + + public void noTxMethod() throws RemoteException { + logger.log(BasicLevel.DEBUG, ""); + try { + ejbContext.getRollbackOnly(); + throw new RemoteException("Should get IllegalStateException"); + } catch (IllegalStateException e) { + } + } + + public void ejbActivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbPassivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void setSessionContext(javax.ejb.SessionContext ctx) { + if (logger == null) { + logger = Log.getLogger(Log.JONAS_TESTS_PREFIX); + } + logger.log(BasicLevel.DEBUG, ""); + ejbContext = ctx; + } + + public void unsetSessionContext() { + logger.log(BasicLevel.DEBUG, ""); + } +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/Dao.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/Dao.java new file mode 100644 index 0000000000000000000000000000000000000000..1ca737a0a7c0dfcb50964721922919b15d093178 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/Dao.java @@ -0,0 +1,69 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.applimet; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.sql.SQLException; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import javax.sql.DataSource; + +public class Dao { + private Connection cnx = null; + private ResultSet rs = null; + private Statement st = null; + + public Dao() throws NamingException, SQLException { + Context ctx = new InitialContext(); + DataSource ds = (javax.sql.DataSource) ctx.lookup("jdbc_1"); + cnx = ds.getConnection(); + } + + public String rechercherTousLesMarches() throws SQLException { + String ret = ""; + st = cnx.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); + rs = st.executeQuery("SELECT * FROM JT2_MARCHE"); + if (rs.first()) { + do { + ret = rs.getInt("IDMAR") + ":" + rs.getString("NOM") + "\n"; + } while(rs.next()); + } + return ret; + } + + public void removeConnexion() throws SQLException { + if (st != null) { + st.close(); + } + if (cnx != null) { + cnx.close(); + } + } +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/Met.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/Met.java new file mode 100644 index 0000000000000000000000000000000000000000..c1c3d12735bc5d80ae69639afd091b1af643388a --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/Met.java @@ -0,0 +1,37 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.applimet; + +/** + */ +public interface Met extends javax.ejb.EJBObject { + public void methode1() throws java.rmi.RemoteException; + public void moscone1() throws java.rmi.RemoteException; + public void getconn() throws java.rmi.RemoteException; + public void getconntx() throws java.rmi.RemoteException; + public void useconn() throws java.rmi.RemoteException; + public void closeconn() throws java.rmi.RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/MetHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/MetHome.java new file mode 100644 index 0000000000000000000000000000000000000000..5da6f31d75ce132f9815bec099387d436ca87a5b --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/MetHome.java @@ -0,0 +1,36 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.applimet; + +/** + */ +public interface MetHome extends javax.ejb.EJBHome { + public static final String COMP_NAME="java:comp/env/ejb/Met"; + public static final String JNDI_NAME="MetBean"; + + public Met create() throws javax.ejb.CreateException,java.rmi.RemoteException; + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/MetLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/MetLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..8751e0dadbb0421f76fb0aff3b917aa89b7278f8 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/MetLocal.java @@ -0,0 +1,32 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.applimet; + +/** + */ +public interface MetLocal extends javax.ejb.EJBLocalObject { + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/MetLocalHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/MetLocalHome.java new file mode 100644 index 0000000000000000000000000000000000000000..3c31424ca1a9894224a3ed568a72dede60d1a35e --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/MetLocalHome.java @@ -0,0 +1,36 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.applimet; + +/** + */ +public interface MetLocalHome extends javax.ejb.EJBLocalHome { + public static final String COMP_NAME="java:comp/env/ejb/MetLocal"; + public static final String JNDI_NAME="MetLocal"; + + public MetLocal create() throws javax.ejb.CreateException; + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/MetSession.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/MetSession.java new file mode 100644 index 0000000000000000000000000000000000000000..a9231575a6b5ca2968492bb9ff32261c45c20ec9 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/MetSession.java @@ -0,0 +1,141 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.applimet; + +import java.rmi.RemoteException; +import java.sql.SQLException; +import javax.ejb.CreateException; +import javax.ejb.SessionBean; +import javax.ejb.SessionContext; +import org.objectweb.jonas.common.Log; +import org.objectweb.util.monolog.api.Logger; +import org.objectweb.util.monolog.api.BasicLevel; + +/** + */ +public class MetSession implements SessionBean { + + SessionContext ejbContext; + static protected Logger logger = null; + private Dao dao; + private Dao dao2; + + public void ejbRemove() throws RemoteException { + logger.log(BasicLevel.DEBUG, ""); + try { + dao.removeConnexion(); + } catch (SQLException e) { + throw new RemoteException("cannot remove Connexion: " + e); + } + } + + public void ejbCreate() throws CreateException { + logger.log(BasicLevel.DEBUG, ""); + try { + dao = new Dao(); + } catch (Exception e) { + throw new CreateException("Cannot create Dao: " + e); + } + } + + public void methode1() throws RemoteException { + logger.log(BasicLevel.DEBUG, ""); + try { + String liste = dao.rechercherTousLesMarches(); + logger.log(BasicLevel.DEBUG, liste); + } catch (Exception e) { + throw new RemoteException("Error calling Dao: " + e); + } + } + + public void moscone1() throws java.rmi.RemoteException { + logger.log(BasicLevel.DEBUG, ""); + try { + dao2 = new Dao(); + dao2.rechercherTousLesMarches(); + dao2.removeConnexion(); + } catch (Exception e) { + throw new RemoteException("Error on Dao2: " + e); + } + } + + public void getconn() throws java.rmi.RemoteException { + logger.log(BasicLevel.DEBUG, ""); + try { + dao2 = new Dao(); + } catch (Exception e) { + throw new RemoteException("Cannot create Dao: " + e); + } + } + + public void getconntx() throws java.rmi.RemoteException { + logger.log(BasicLevel.DEBUG, ""); + try { + dao2 = new Dao(); + } catch (Exception e) { + throw new RemoteException("Cannot create Dao: " + e); + } + } + + public void useconn() throws java.rmi.RemoteException { + logger.log(BasicLevel.DEBUG, ""); + try { + String liste = dao2.rechercherTousLesMarches(); + logger.log(BasicLevel.DEBUG, liste); + } catch (Exception e) { + throw new RemoteException("Error calling Dao: " + e); + } + } + + public void closeconn() throws java.rmi.RemoteException { + logger.log(BasicLevel.DEBUG, ""); + try { + dao2.removeConnexion(); + } catch (SQLException e) { + throw new RemoteException("cannot remove Connexion: " + e); + } + } + + public void ejbActivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbPassivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void setSessionContext(javax.ejb.SessionContext ctx) { + if (logger == null) { + logger = Log.getLogger(Log.JONAS_TESTS_PREFIX); + } + logger.log(BasicLevel.DEBUG, ""); + ejbContext = ctx; + } + + public void unsetSessionContext() { + logger.log(BasicLevel.DEBUG, ""); + } +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/applimet.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/applimet.xml new file mode 100644 index 0000000000000000000000000000000000000000..d8e86ac8ac702b39c3892f4cf7bc0c2229ab2c39 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/applimet.xml @@ -0,0 +1,97 @@ + + + + + + + applimet + + + + + + Met + + org.objectweb.jonas.jtests.beans.applimet.MetHome + org.objectweb.jonas.jtests.beans.applimet.Met + org.objectweb.jonas.jtests.beans.applimet.MetLocalHome + org.objectweb.jonas.jtests.beans.applimet.MetLocal + org.objectweb.jonas.jtests.beans.applimet.MetSession + Stateful + Container + + + + + + Appli + + org.objectweb.jonas.jtests.beans.applimet.AppliHome + org.objectweb.jonas.jtests.beans.applimet.Appli + org.objectweb.jonas.jtests.beans.applimet.AppliLocalHome + org.objectweb.jonas.jtests.beans.applimet.AppliLocal + org.objectweb.jonas.jtests.beans.applimet.AppliSession + Stateful + Container + + + + + + + + + Appli + noTxMethod + + NotSupported + + + + Met + * + + + Appli + * + + Required + + + + Met + moscone1 + + + Met + getconn + + Supports + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/jonas-applimet.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/jonas-applimet.xml new file mode 100644 index 0000000000000000000000000000000000000000..52a7b121c1b2db4d381e68834997e45bfd74717a --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/applimet/jonas-applimet.xml @@ -0,0 +1,40 @@ + + + + + + + Met + MetBean + + + + Appli + AppliBean + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/AccountEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/AccountEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..32a52feb136fdda6f6678ad8496d399a56c76527 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/AccountEC2.java @@ -0,0 +1,245 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.bank; + +import javax.ejb.CreateException; +import javax.ejb.DuplicateKeyException; +import javax.ejb.EJBException; +import javax.ejb.EntityBean; +import javax.ejb.EntityContext; +import javax.ejb.RemoveException; + +import org.objectweb.jonas.common.Log; +import org.objectweb.util.monolog.api.Logger; +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Account Implementation (with container-managed persistence version 2) + * @author Philippe Durieux + */ +public abstract class AccountEC2 implements EntityBean { + + protected static Logger history = null; + EntityContext ejbContext; + + // ------------------------------------------------------------------ + // Get and Set accessor methods of the bean's abstract schema + // ------------------------------------------------------------------ + public abstract String getName(); + public abstract void setName(String n); + public abstract int getNum(); + public abstract void setNum(int n); + public abstract int getBalance(); + public abstract void setBalance(int b); + + // ------------------------------------------------------------------ + // EntityBean implementation + // ------------------------------------------------------------------ + + /** + * Set the associated entity context. The container invokes this method + * on an instance after the instance has been created. + * This method is called in an unspecified transaction context. + * + * @param ctx - An EntityContext interface for the instance. The instance + * should store the reference to the context in an instance variable. + * @throws EJBException Thrown by the method to indicate a failure caused by a + * system-level error. + */ + public void setEntityContext(EntityContext ctx) { + if (history == null) { + history = Log.getLogger("org.objectweb.jonas_tests.history"); + } + history.log(BasicLevel.DEBUG, getName()); + ejbContext = ctx; + } + + /** + * Unset the associated entity context. The container calls this method + * before removing the instance. + * This is the last method that the container invokes on the instance. + * The Java garbage collector will eventually invoke the finalize() method + * on the instance. + * This method is called in an unspecified transaction context. + * + * @throws EJBException Thrown by the method to indicate a failure caused by a + * system-level error. + */ + public void unsetEntityContext() { + history.log(BasicLevel.DEBUG, getName()); + ejbContext = null; + } + + /** + * A container invokes this method before it removes the EJB object + * that is currently associated with the instance. This method is + * invoked when a client invokes a remove operation on the enterprise Bean's + * home interface or the EJB object's remote interface. This method + * transitions the instance from the ready state to the pool of available + * instances. + * + * This method is called in the transaction context of the remove operation. + * @throws RemoveException The enterprise Bean does not allow destruction of the object. + * @throws EJBException - Thrown by the method to indicate a failure caused by a system-level + * error. + */ + public void ejbRemove() throws RemoveException { + history.log(BasicLevel.DEBUG, getName()); + } + + /** + * A container invokes this method to instruct the instance to synchronize + * its state by loading it state from the underlying database. + * This method always executes in the proper transaction context. + * + * @throws EJBException Thrown by the method to indicate a failure caused by + * a system-level error. + */ + public void ejbLoad() { + String name = getName(); + int balance = getBalance(); + history.log(BasicLevel.DEBUG, name + "\tLOAD= " + balance); + if (balance < 0) { + history.log(BasicLevel.WARN, name + " : Bad balance loaded"); + throw new EJBException("ejbLoad: Balance "+name+" was negative ="+balance); + } + } + + /** + * A container invokes this method to instruct the instance to synchronize + * its state by storing it to the underlying database. + * This method always executes in the proper transaction context. + * + * @throws EJBException Thrown by the method to indicate a failure caused by + * a system-level error. + */ + public void ejbStore() { + String name = getName(); + int balance = getBalance(); + history.log(BasicLevel.DEBUG, name + "\tSTORE= " + balance); + if (balance < 0) { + history.log(BasicLevel.WARN, name + " : Bad balance stored"); + throw new EJBException("ejbStore: Balance "+name+" was negative ="+balance); + } + } + + /** + * There must be an ejbPostCreate par ejbCreate method + * + * @throws CreateException Failure to create an entity EJB object. + */ + public void ejbPostCreate(int num, int ib) throws CreateException { + history.log(BasicLevel.DEBUG, getName()); + } + + /** + * The Entity bean can define 0 or more ejbCreate methods. + * + * @throws CreateException Failure to create an entity EJB object. + * @throws DuplicateKeyException An object with the same key already exists. + */ + public java.lang.String ejbCreate(int num, int ib) throws CreateException, DuplicateKeyException { + + // Init here the bean fields + setNum(num); + setName("a_"+(new Integer(num)).toString()); + setBalance(ib); + + history.log(BasicLevel.DEBUG, getName()); + + // In CMP, should return null. + return null; + } + + /** + * A container invokes this method on an instance before the instance + * becomes disassociated with a specific EJB object. + */ + public void ejbPassivate() { + // balance may be wrong in case of rollback. Anyway, this instance is being + // released now, so no problem! + // This causes problems (in case of DB policy at least) + //setBalance(-80000); + history.log(BasicLevel.DEBUG, getName()); + } + + /** + * A container invokes this method when the instance is taken out of + * the pool of available instances to become associated with a specific + * EJB object. + */ + public void ejbActivate() { + history.log(BasicLevel.DEBUG, getName() + " balance=" + getBalance()); + } + + // ------------------------------------------------------------------ + // Bank implementation + // ------------------------------------------------------------------ + + /** + * credit + */ + public void credit(int v) { + String name = getName(); + if (getBalance() < 0) { + if (ejbContext.getRollbackOnly() == true) { + history.log(BasicLevel.WARN, name + " : tx already rollbackonly"); + setBalance(-99000); + return; + } + history.log(BasicLevel.WARN, name + " : Bad balance to credit ="+getBalance()); + throw new EJBException("credit: Balance "+name+" was negative ="+getBalance()); + } + int oldval = getBalance(); + setBalance(oldval + v); + history.log(BasicLevel.DEBUG, name + "\told= " + oldval + "\tnew= " + getBalance()); + } + + /** + * debit + */ + public void debit(int v) { + String name = getName(); + int oldval = getBalance(); + if (oldval < 0) { + if (ejbContext.getRollbackOnly() == true) { + history.log(BasicLevel.WARN, name + " : tx already rollbackonly"); + setBalance(-99000); + return; + } + history.log(BasicLevel.WARN, name + " : Bad balance to debit="+oldval); + throw new EJBException("debit: Balance "+name+" was negative ="+oldval); + } + setBalance(oldval - v); + if (getBalance() < 0) { + history.log(BasicLevel.WARN, name + " : set rollback only. NEW BAL = -90000"); + ejbContext.setRollbackOnly(); + setBalance(-90000); // put it a very bad balance to check rollback is OK + } + history.log(BasicLevel.DEBUG, name + "\tOLD= " + oldval + "\tNEW= " + getBalance()); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/AccountLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/AccountLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..aad0d411e93d56ee94166bf64d0e00e5394c4dcc --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/AccountLocal.java @@ -0,0 +1,40 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.bank; + +import javax.ejb.EJBLocalObject; + +/** + * Account local interface + * @author Philippe Durieux + */ +public interface AccountLocal extends EJBLocalObject { + public int getBalance(); + public void setBalance(int value); + public void credit(int value); + public void debit(int value); + public String getName(); +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/AccountLocalHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/AccountLocalHome.java new file mode 100644 index 0000000000000000000000000000000000000000..ce555f283c775a6730bc9c2cee9e05aa6cb632d1 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/AccountLocalHome.java @@ -0,0 +1,42 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.bank; + +import java.util.Collection; +import javax.ejb.CreateException; +import javax.ejb.EJBLocalHome; +import javax.ejb.FinderException; + +/** + * Local Home interface for the bean Account + * @author Philippe Durieux + */ +public interface AccountLocalHome extends EJBLocalHome { + AccountLocal create(int num, int initbal) throws CreateException; + AccountLocal findByPrimaryKey(java.lang.String pk) throws FinderException; + AccountLocal findByNum(int num) throws FinderException; + Collection findAll() throws FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/Manager.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/Manager.java new file mode 100644 index 0000000000000000000000000000000000000000..e8350d7ed07687e2345e5d291fd17d88f3e2de85 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/Manager.java @@ -0,0 +1,103 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.bank; + +import java.rmi.RemoteException; + +import javax.ejb.CreateException; +import javax.ejb.RemoveException; +import javax.ejb.EJBObject; + +/** + * Manager remote interface + * @author Philippe Durieux + */ +public interface Manager extends EJBObject { + + /** + * create a set of Accounts + * @param nb nb of Accounts created. + */ + public void createAll(int nb) throws RemoteException, CreateException; + + /** + * create an account, and set rollback only + */ + public void createRollbackOnly(int i) throws RemoteException, CreateException; + + /** + * reinit all created accounts to their initial value. + */ + public void reinitAll() throws RemoteException; + + /** + * Remove an Account + * @param d1 num of the Account. + */ + public void delAccount(int d1) throws RemoteException, RemoveException; + + /** + * Check all existing Accounts + * @return true if all are OK. + */ + public boolean checkAll() throws RemoteException; + + /** + * Check an existing Account + * @param a num of the Account. + * @return true if OK. + */ + public boolean checkAccount(int a) throws RemoteException; + + /** + * read balance for this Account + * @param a num of the Account. + * @return balance + */ + public int readBalance(int a) throws RemoteException; + + /** + * read balance for last accessed Account + * @return balance + */ + public int readBalance() throws RemoteException; + + /** + * read balance for this Account, in a transaction. + * @param a num of the Account. + * @return balance + */ + public int readBalanceTx(int a) throws RemoteException; + + /** + * move form an Account to another one. + * @param d num of the debit Account. + * @param c num of the credit Account. + * @param v value to be moved + * @param d delay in second for the operation. + */ + public void move(int d, int c, int v, int delay) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/ManagerHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/ManagerHome.java new file mode 100644 index 0000000000000000000000000000000000000000..7ca25bafa3c6340f0f9668bf858d74efee556ef8 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/ManagerHome.java @@ -0,0 +1,40 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.bank; + +import java.rmi.RemoteException; + +import javax.ejb.CreateException; +import javax.ejb.EJBHome; + +/** + * Home interface for the bean Manager + * @author Philippe Durieux + */ +public interface ManagerHome extends EJBHome { + Manager create(int ival) throws CreateException, RemoteException; + Manager create(int ival, boolean prefetch) throws CreateException, RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/ManagerSF.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/ManagerSF.java new file mode 100644 index 0000000000000000000000000000000000000000..f9720424adf0bdf8065d124ff5e0d058253faf3a --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/ManagerSF.java @@ -0,0 +1,428 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.bank; + +import java.rmi.NoSuchObjectException; +import java.rmi.RemoteException; +import java.util.Collection; +import java.util.Iterator; + +import javax.ejb.CreateException; +import javax.ejb.EJBException; +import javax.ejb.FinderException; +import javax.ejb.NoSuchObjectLocalException; +import javax.ejb.RemoveException; +import javax.ejb.SessionBean; +import javax.ejb.SessionContext; +import javax.ejb.SessionSynchronization; +import javax.ejb.TransactionRolledbackLocalException; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import javax.rmi.PortableRemoteObject; + +import org.objectweb.jonas.common.Log; +import org.objectweb.util.monolog.api.BasicLevel; +import org.objectweb.util.monolog.api.Logger; + +/** + * Manager Implementation + * @author Philippe Durieux + */ +public class ManagerSF implements SessionBean, SessionSynchronization { + + protected static Logger history = null; + SessionContext ejbContext; + AccountLocalHome accountLocalHome = null; + AccountLocal last = null; + int initialValue; + + // ------------------------------------------------------------------ + // SessionBean implementation + // ------------------------------------------------------------------ + + /** + * Set the associated session context. The container calls this method + * after the instance creation. + * The enterprise Bean instance should store the reference to the context + * object in an instance variable. + * This method is called with no transaction context. + * + * @param ctx A SessionContext interface for the instance. + * @throws EJBException Thrown by the method to indicate a failure caused by + * a system-level error. + */ + public void setSessionContext(SessionContext ctx) { + if (history == null) { + history = Log.getLogger("org.objectweb.jonas_tests.history"); + } + history.log(BasicLevel.DEBUG, ""); + ejbContext = ctx; + } + + /** + * A container invokes this method before it ends the life of the session object. + * This happens as a result of a client's invoking a remove operation, or when a + * container decides to terminate the session object after a timeout. + * This method is called with no transaction context. + * + * @throws EJBException Thrown by the method to indicate a failure caused by + * a system-level error. + */ + public void ejbRemove() { + history.log(BasicLevel.DEBUG, ""); + } + + /** + * Create a session. + * @param ival initial balance value for new accounts. + * @throws CreateException Failure to create a session EJB object. + */ + public void ejbCreate(int ival) throws CreateException { + history.log(BasicLevel.DEBUG, ""); + + // lookup AccountLocalHome + try { + Context ictx = new InitialContext(); + accountLocalHome = (AccountLocalHome) ictx.lookup("java:comp/env/ejb/bank"); + } catch (NamingException e) { + history.log(BasicLevel.ERROR, "Cannot get AccountLocalHome:" + e); + throw new CreateException("Cannot get AccountLocalHome"); + } + + initialValue = ival; + } + + /** + * Create a session. + * @param ival initial balance value for new accounts. + * @throws CreateException Failure to create a session EJB object. + */ + public void ejbCreate(int ival, boolean prefetch) throws CreateException { + history.log(BasicLevel.DEBUG, ""); + + // lookup AccountLocalHome + try { + Context ictx = new InitialContext(); + String ejblink = prefetch ? "java:comp/env/ejb/bankpf" : "java:comp/env/ejb/bank"; + accountLocalHome = (AccountLocalHome) ictx.lookup(ejblink); + } catch (NamingException e) { + history.log(BasicLevel.ERROR, "Cannot get AccountLocalHome:" + e); + throw new CreateException("Cannot get AccountLocalHome"); + } + + initialValue = ival; + } + + /** + * A container invokes this method on an instance before the instance + * becomes disassociated with a specific EJB object. + */ + public void ejbPassivate() { + history.log(BasicLevel.DEBUG, ""); + } + + /** + * A container invokes this method when the instance is taken out of + * the pool of available instances to become associated with a specific + * EJB object. + */ + public void ejbActivate() { + history.log(BasicLevel.DEBUG, ""); + } + + // ------------------------------------------------------------------ + // SessionSynchronization implementation + // ------------------------------------------------------------------ + + public void afterBegin() { + history.log(BasicLevel.DEBUG, ""); + } + + public void beforeCompletion() { + history.log(BasicLevel.DEBUG, ""); + } + + public void afterCompletion(boolean committed) { + if (committed) { + history.log(BasicLevel.DEBUG, "TX committed"); + } else { + history.log(BasicLevel.DEBUG, "TX rolled back"); + } + } + + // ------------------------------------------------------------------ + // Manager implementation + // ------------------------------------------------------------------ + + /** + * create a set of Accounts + * @param nb nb of Accounts created. + */ + public void createAll(int nb) throws RemoteException, CreateException { + // Check if accounts are already created. + history.log(BasicLevel.DEBUG, ""); + try { + accountLocalHome.findByNum(nb - 1); + } catch (Exception e) { + // create accounts + for (int i = 0; i < nb; i++) { + newAccount(i); + } + } + } + + /** + * reinit all created accounts to their initial value. + */ + public void reinitAll() throws RemoteException { + try { + Collection coll = accountLocalHome.findAll(); + for (Iterator it = coll.iterator(); it.hasNext();) { + AccountLocal a = (AccountLocal) it.next(); + a.setBalance(initialValue); + } + } catch (Exception e) { + history.log(BasicLevel.ERROR, "reinitAll:" + e); + } + } + + + /** + * Remove an Account + * @param d1 num of the Account. + */ + public void delAccount(int d1) throws RemoteException, RemoveException { + try { + AccountLocal deb1 = accountLocalHome.findByNum(d1); + deb1.remove(); + history.log(BasicLevel.DEBUG, d1 + "\tREMOVED"); + } catch (FinderException e) { + history.log(BasicLevel.INFO, d1 + "\tNot Found for remove"); + } + } + + /** + * Check all existing Accounts + * @return true if all are OK. + */ + public boolean checkAll() throws RemoteException { + int count = 0; + int total = 0; + boolean ret = true; + try { + Collection coll = accountLocalHome.findAll(); + for (Iterator it = coll.iterator(); it.hasNext();) { + count++; + AccountLocal a = (AccountLocal) it.next(); + int balance = a.getBalance(); + String name = a.getName(); + if (balance < 0) { + history.log(BasicLevel.ERROR, name + " bad balance: " + balance); + ret = false; + } else { + history.log(BasicLevel.DEBUG, name + " : FINAL BALANCE=" + balance); + total += balance; + } + } + } catch (Exception e) { + history.log(BasicLevel.ERROR, "checkAllAccounts:" + e); + return false; + } + int exp = initialValue * count; + if (total != exp) { + history.log(BasicLevel.ERROR, "checkAllAccounts: bad total: " + total + " (expected: " + exp + ")"); + return false; + } + history.log(BasicLevel.DEBUG, "CheckAll OK"); + return ret; + } + + /** + * Check an existing Account + * @param a num of the Account. + * @return true if OK. + */ + public boolean checkAccount(int a) throws RemoteException { + boolean ret = false; + AccountLocal m = null; + + // retry several times, because this operation may be rolledback + // in case of deadlock. + Exception exc = null; + int retry; + for (retry = 0; retry < 20; retry++) { + try { + history.log(BasicLevel.DEBUG, "\ta_" + a + "\tCHECKED try #" + retry); + m = accountLocalHome.findByNum(a); + int b = m.getBalance(); + if (b >= 0) { + ret = true; + } else { + history.log(BasicLevel.WARN, "bad balance=" + b); + } + return ret; + } catch (Exception e) { + exc = e; + history.log(BasicLevel.DEBUG, "retrying " + retry); + sleep(retry + 1); + } + } + history.log(BasicLevel.WARN, "cannot check account: " + exc); + return ret; + } + + /* + * read balance for this Account, in a transaction. + * @param a num of the Account. + * @return balance + */ + public int readBalanceTx(int a) throws RemoteException { + return readBalance(a); + } + + /** + * read balance for this Account + * @param a num of the Account. + * @return balance + */ + public int readBalance(int a) throws RemoteException { + int ret; + try { + AccountLocal acc = getAccount(a); + if (acc == null) { + history.log(BasicLevel.ERROR, "Cannot get account"); + throw new RemoteException("Cannot get account " + a); + } + ret = acc.getBalance(); + } catch (Exception e) { + history.log(BasicLevel.ERROR, "Cannot read balance for " + a + ": " + e); + throw new RemoteException("Cannot read balance for " + a); + } + history.log(BasicLevel.DEBUG, "READ " + a + " = " + ret); + return ret; + } + + /** + * move form an Account to another one. + * @param d num of the debit Account. + * @param c num of the credit Account. + * @param v value to be moved + * @param d delay in second for the operation. + */ + public void move(int d, int c, int v, int delay) throws RemoteException { + history.log(BasicLevel.DEBUG, "MOVE " + v + " from " + d + " to " + c); + try { + AccountLocal cred = getAccount(c); + AccountLocal deb = getAccount(d); + cred.credit(v); + sleep(delay); + deb.debit(v); + } catch (TransactionRolledbackLocalException e) { + history.log(BasicLevel.WARN, "move: Rollback transaction"); + return; + } catch (EJBException e) { + history.log(BasicLevel.ERROR, "Cannot move:" + e); + return; + } + } + + /** + * Read balance on last accessed account + */ + public int readBalance() throws RemoteException { + int ret; + try { + ret = last.getBalance(); + } catch (NoSuchObjectLocalException e) { + throw new NoSuchObjectException("Account destroyed"); + } catch (Exception e) { + throw new RemoteException("Cannot read last balance"); + } + return ret; + } + + /** + * Create an Account, but set rollback only the transaction + * @return + * @throws RemoteException + */ + public void createRollbackOnly(int i) throws RemoteException { + try { + last = newAccount(i); + } catch (CreateException c) { + throw new RemoteException("Cannot create account"); + } + ejbContext.setRollbackOnly(); + } + + // ------------------------------------------------------------------ + // private methods + // ------------------------------------------------------------------ + + /** + * Create a new Account. The account may exist (for example, when running + * tests twice without restarting the Container, or if created by another + * session meanwhile) + * @param i account number (its PK) + */ + private AccountLocal newAccount(int i) throws RemoteException, CreateException { + AccountLocal ml = null; + ml = accountLocalHome.create(i, initialValue); + history.log(BasicLevel.DEBUG, "New Account has been created\t" + i); + return ml; + } + + /** + * Create an Account if it does not exist yet. + * @param c1 num of the Account. + */ + private AccountLocal getAccount(int c1) throws RemoteException { + history.log(BasicLevel.DEBUG, "Get Account\t" + c1); + try { + last = accountLocalHome.findByNum(c1); + } catch (FinderException e) { + try { + last = newAccount(c1); + } catch (CreateException c) { + throw new RemoteException("Cannot create account"); + } + } + return last; + } + + /** + * sleep n seconds + * @param n seconds + */ + private void sleep(int n) { + try { + Thread.sleep(1000 * n); + } catch (InterruptedException e) { + } + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/README b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/README new file mode 100644 index 0000000000000000000000000000000000000000..0875f9fda90eab88043d10dc8a55c54a4b45a795 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/README @@ -0,0 +1,3 @@ +These beans are copied from the stress test suite. +They are used to test conformance in case of entity +local beans accessed from a session bean. diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/bank.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/bank.xml new file mode 100644 index 0000000000000000000000000000000000000000..d4a883973cef8142000dbca5b6d49b937d7883ac --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/bank.xml @@ -0,0 +1,698 @@ + + + + + + + + + + ManagerCS + org.objectweb.jonas.jtests.beans.bank.ManagerHome + org.objectweb.jonas.jtests.beans.bank.Manager + org.objectweb.jonas.jtests.beans.bank.ManagerSF + Stateful + Container + + ejb/bank + Entity + org.objectweb.jonas.jtests.beans.bank.AccountLocalHome + org.objectweb.jonas.jtests.beans.bank.AccountLocal + AccountCS + + + ejb/bankpf + Entity + org.objectweb.jonas.jtests.beans.bank.AccountLocalHome + org.objectweb.jonas.jtests.beans.bank.AccountLocal + AccountCSpf + + + + + ManagerCRC + org.objectweb.jonas.jtests.beans.bank.ManagerHome + org.objectweb.jonas.jtests.beans.bank.Manager + org.objectweb.jonas.jtests.beans.bank.ManagerSF + Stateful + Container + + ejb/bank + Entity + org.objectweb.jonas.jtests.beans.bank.AccountLocalHome + org.objectweb.jonas.jtests.beans.bank.AccountLocal + AccountCRC + + + ejb/bankpf + Entity + org.objectweb.jonas.jtests.beans.bank.AccountLocalHome + org.objectweb.jonas.jtests.beans.bank.AccountLocal + AccountCRCpf + + + + + ManagerCRW + org.objectweb.jonas.jtests.beans.bank.ManagerHome + org.objectweb.jonas.jtests.beans.bank.Manager + org.objectweb.jonas.jtests.beans.bank.ManagerSF + Stateful + Container + + ejb/bank + Entity + org.objectweb.jonas.jtests.beans.bank.AccountLocalHome + org.objectweb.jonas.jtests.beans.bank.AccountLocal + AccountCRW + + + + + ManagerCST + org.objectweb.jonas.jtests.beans.bank.ManagerHome + org.objectweb.jonas.jtests.beans.bank.Manager + org.objectweb.jonas.jtests.beans.bank.ManagerSF + Stateful + Container + + ejb/bank + Entity + org.objectweb.jonas.jtests.beans.bank.AccountLocalHome + org.objectweb.jonas.jtests.beans.bank.AccountLocal + AccountCST + + + + + ManagerRO + org.objectweb.jonas.jtests.beans.bank.ManagerHome + org.objectweb.jonas.jtests.beans.bank.Manager + org.objectweb.jonas.jtests.beans.bank.ManagerSF + Stateful + Container + + ejb/bank + Entity + org.objectweb.jonas.jtests.beans.bank.AccountLocalHome + org.objectweb.jonas.jtests.beans.bank.AccountLocal + AccountRO + + + + + ManagerDB + org.objectweb.jonas.jtests.beans.bank.ManagerHome + org.objectweb.jonas.jtests.beans.bank.Manager + org.objectweb.jonas.jtests.beans.bank.ManagerSF + Stateful + Container + + ejb/bank + Entity + org.objectweb.jonas.jtests.beans.bank.AccountLocalHome + org.objectweb.jonas.jtests.beans.bank.AccountLocal + AccountDB + + + ejb/bankpf + Entity + org.objectweb.jonas.jtests.beans.bank.AccountLocalHome + org.objectweb.jonas.jtests.beans.bank.AccountLocal + AccountDBpf + + + + + bank/AccountCS + AccountCS + org.objectweb.jonas.jtests.beans.bank.AccountLocalHome + org.objectweb.jonas.jtests.beans.bank.AccountLocal + org.objectweb.jonas.jtests.beans.bank.AccountEC2 + Container + java.lang.String + true + 2.x + jt2_accountcs + + name + + + num + + + balance + + name + + + findByNum + + int + + + SELECT OBJECT(o) FROM jt2_accountcs o WHERE o.num = ?1 + + + + findAll + + + SELECT OBJECT(o) FROM jt2_accountcs o + + + + + bank/AccountCSpf + AccountCSpf + org.objectweb.jonas.jtests.beans.bank.AccountLocalHome + org.objectweb.jonas.jtests.beans.bank.AccountLocal + org.objectweb.jonas.jtests.beans.bank.AccountEC2 + Container + java.lang.String + true + 2.x + jt2_accountcspf + + name + + + num + + + balance + + name + + + findByNum + + int + + + SELECT OBJECT(o) FROM jt2_accountcspf o WHERE o.num = ?1 + + + + findAll + + + SELECT OBJECT(o) FROM jt2_accountcspf o + + + + + bank/AccountCRC + AccountCRC + org.objectweb.jonas.jtests.beans.bank.AccountLocalHome + org.objectweb.jonas.jtests.beans.bank.AccountLocal + org.objectweb.jonas.jtests.beans.bank.AccountEC2 + Container + java.lang.String + true + 2.x + jt2_accountcrc + + name + + + num + + + balance + + name + + + findByNum + + int + + + SELECT OBJECT(o) FROM jt2_accountcrc o WHERE o.num = ?1 + + + + findAll + + + SELECT OBJECT(o) FROM jt2_accountcrc o + + + + + bank/AccountCRCpf + AccountCRCpf + org.objectweb.jonas.jtests.beans.bank.AccountLocalHome + org.objectweb.jonas.jtests.beans.bank.AccountLocal + org.objectweb.jonas.jtests.beans.bank.AccountEC2 + Container + java.lang.String + true + 2.x + jt2_accountcrcpf + + name + + + num + + + balance + + name + + + findByNum + + int + + + SELECT OBJECT(o) FROM jt2_accountcrcpf o WHERE o.num = ?1 + + + + findAll + + + SELECT OBJECT(o) FROM jt2_accountcrcpf o + + + + + bank/AccountCRW + AccountCRW + org.objectweb.jonas.jtests.beans.bank.AccountLocalHome + org.objectweb.jonas.jtests.beans.bank.AccountLocal + org.objectweb.jonas.jtests.beans.bank.AccountEC2 + Container + java.lang.String + true + 2.x + jt2_accountcrw + + name + + + num + + + balance + + name + + + findByNum + + int + + + SELECT OBJECT(o) FROM jt2_accountcrw o WHERE o.num = ?1 + + + + findAll + + + SELECT OBJECT(o) FROM jt2_accountcrw o + + + + + bank/AccountCST + AccountCST + org.objectweb.jonas.jtests.beans.bank.AccountLocalHome + org.objectweb.jonas.jtests.beans.bank.AccountLocal + org.objectweb.jonas.jtests.beans.bank.AccountEC2 + Container + java.lang.String + true + 2.x + jt2_accountcst + + name + + + num + + + balance + + name + + + findByNum + + int + + + SELECT OBJECT(o) FROM jt2_accountcst o WHERE o.num = ?1 + + + + findAll + + + SELECT OBJECT(o) FROM jt2_accountcst o + + + + + bank/AccountRO + AccountRO + org.objectweb.jonas.jtests.beans.bank.AccountLocalHome + org.objectweb.jonas.jtests.beans.bank.AccountLocal + org.objectweb.jonas.jtests.beans.bank.AccountEC2 + Container + java.lang.String + true + 2.x + jt2_accountro + + name + + + num + + + balance + + name + + + findByNum + + int + + + SELECT OBJECT(o) FROM jt2_accountro o WHERE o.num = ?1 + + + + findAll + + + SELECT OBJECT(o) FROM jt2_accountro o + + + + + bank/AccountDB + AccountDB + org.objectweb.jonas.jtests.beans.bank.AccountLocalHome + org.objectweb.jonas.jtests.beans.bank.AccountLocal + org.objectweb.jonas.jtests.beans.bank.AccountEC2 + Container + java.lang.String + true + 2.x + jt2_accountdb + + name + + + num + + + balance + + name + + + findByNum + + int + + + SELECT OBJECT(o) FROM jt2_accountdb o WHERE o.num = ?1 + + + + findAll + + + SELECT OBJECT(o) FROM jt2_accountdb o + + + + + bank/AccountDBpf + AccountDBpf + org.objectweb.jonas.jtests.beans.bank.AccountLocalHome + org.objectweb.jonas.jtests.beans.bank.AccountLocal + org.objectweb.jonas.jtests.beans.bank.AccountEC2 + Container + java.lang.String + true + 2.x + jt2_accountdbpf + + name + + + num + + + balance + + name + + + findByNum + + int + + + SELECT OBJECT(o) FROM jt2_accountdbpf o WHERE o.num = ?1 + + + + findAll + + + SELECT OBJECT(o) FROM jt2_accountdbpf o + + + + + + + + + + AccountCS + * + + + AccountCRC + * + + + AccountCRW + * + + + AccountCST + * + + + AccountDB + * + + + AccountCSpf + * + + + AccountCRCpf + * + + + AccountDBpf + * + + + AccountRO + * + + + ManagerCS + * + + + ManagerCRC + * + + + ManagerCRW + * + + + ManagerCST + * + + + ManagerDB + * + + + ManagerRO + * + + Required + + + + + AccountRO + getBalance + + + AccountRO + getName + + + AccountRO + findByNum + + + AccountCS + getBalance + + + AccountCS + getName + + + AccountCS + findByNum + + + AccountCRC + getBalance + + + AccountCRC + getName + + + AccountCRC + findByNum + + + AccountCST + getBalance + + + AccountCST + getName + + + AccountCST + findByNum + + + AccountDB + getBalance + + + AccountDB + getName + + + AccountDB + findByNum + + + AccountCSpf + getBalance + + + AccountCSpf + getName + + + AccountCSpf + findByNum + + + AccountCRCpf + getBalance + + + AccountCRCpf + getName + + + AccountCRCpf + findByNum + + + AccountDBpf + getBalance + + + AccountDBpf + getName + + + AccountDBpf + findByNum + + + ManagerRO + readBalance + + + ManagerCS + readBalance + + + ManagerCRC + readBalance + + + ManagerCST + readBalance + + + ManagerDB + readBalance + + + ManagerCRW + readBalance + + Supports + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/jonas-bank.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/jonas-bank.xml new file mode 100644 index 0000000000000000000000000000000000000000..22d3ee7186d6321858c9d891bb9d4b705a45df81 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bank/jonas-bank.xml @@ -0,0 +1,196 @@ + + + + + + ManagerCS + bankManagerCSHome + 5 + + + + ManagerCST + bankManagerCSTHome + 5 + + + + ManagerCRC + bankManagerCRCHome + + + + ManagerCRW + bankManagerCRWHome + + + + ManagerCRU + bankManagerCRUHome + + + + ManagerRO + bankManagerROHome + + + + ManagerDB + bankManagerDBHome + + + + AccountCS + AccountCSHome + 30 + 200 + false + 400 + 8 + removeall + container-serialized + + jdbc_1 + + + + + AccountRO + AccountROHome + 200 + true + 2 + 400 + 1 + none + read-only + + jdbc_1 + jt2_accountcs_ + + + + + AccountCSpf + AccountCSHomepf + 60 + 600 + true + 30 + 0 + removeall + container-serialized + + jdbc_1 + + + + + AccountCRC + AccountCRCHome + 166 + false + 90 + 6 + removeall + container-read-committed + + jdbc_1 + + + + + AccountCRW + AccountCRWHome + false + 400 + removeall + container-read-write + + jdbc_1 + + + + + AccountCRCpf + AccountCRCHomepf + 155 + true + 90 + 5 + removeall + container-read-committed + + jdbc_1 + + + + + AccountCST + AccountCSTHome + false + 90 + 4 + removeall + container-serialized-transacted + + jdbc_1 + + + + + AccountDB + AccountDBHome + 133 + false + 180 + 3 + removeall + database + + jdbc_1 + + + + + AccountDBpf + AccountDBHomepf + 122 + true + 90 + 2 + removeall + database + + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountCommon.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountCommon.java new file mode 100644 index 0000000000000000000000000000000000000000..db4493ce86baefe28fd5c116398eb13e3066aa49 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountCommon.java @@ -0,0 +1,131 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.beanexc; + +import javax.ejb.EJBContext; +import java.rmi.RemoteException; + +import org.objectweb.util.monolog.api.Logger; +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Common part to all beans. + * @author Philippe Durieux, Philippe Coq + */ +public abstract class AccountCommon implements java.io.Serializable { + + protected static Logger logger = null; + protected boolean iAmDestroyed = false; + + public abstract void setBalance(long val); + public abstract EJBContext getContext(); + + public void doAppException_1() throws AppException { + logger.log(BasicLevel.DEBUG, ""); + setBalance(5000); + throw new AppException("doAppException_1"); + } + + public void doAppException_2(boolean rollflg) throws AppException { + logger.log(BasicLevel.DEBUG, ""); + setBalance(50); + if (rollflg) { + getContext().setRollbackOnly(); + } + throw new AppException("doAppException_2"); + } + + public void doAppException_3() throws AppException { + logger.log(BasicLevel.DEBUG, ""); + throw new AppException("doAppException_3"); + } + + public void doUncheckedException_1() { + logger.log(BasicLevel.DEBUG, ""); + int zero = 0; + iAmDestroyed = true; + float f = 10 / zero; + } + + public void doUncheckedException_2() { + logger.log(BasicLevel.DEBUG, ""); + setBalance(1000); + int zero = 0; + iAmDestroyed = true; + float f = 10 / zero; + } + + public void doUncheckedException_3() { + logger.log(BasicLevel.DEBUG, ""); + int zero = 0; + iAmDestroyed = true; + float f = 10 / zero; + } + + public void doRemoteException_1() throws RemoteException { + logger.log(BasicLevel.DEBUG, ""); + setBalance(10); + iAmDestroyed = true; + throw new RemoteException("RemoteException in doRemoteException_1"); + } + + public void doEJBException_1() { + logger.log(BasicLevel.DEBUG, ""); + setBalance(10); + iAmDestroyed = true; + throw new javax.ejb.EJBException("EJBException in doEJBException_1"); + } + + public void doEJBException_2() { + logger.log(BasicLevel.DEBUG, ""); + setBalance(10); + iAmDestroyed = true; + throw new javax.ejb.EJBException("EJBException in doEJBException_2"); + } + + public void doEJBException_sup() { + logger.log(BasicLevel.DEBUG, ""); + setBalance(10); + iAmDestroyed = true; + throw new javax.ejb.EJBException("EJBException in doEJBException_sup"); + } + + public boolean iAmDestroyed() { + logger.log(BasicLevel.DEBUG, ""); + return iAmDestroyed; + } + + public void ping() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbPostCreate(int flag) { + } + + public void ejbPostCreate(boolean flag) { + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountE.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountE.java new file mode 100644 index 0000000000000000000000000000000000000000..44d749ec5add69e141a1e9a2494c4926a0cd0ef2 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountE.java @@ -0,0 +1,39 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.beanexc; + +import java.rmi.RemoteException; + +public interface AccountE extends AccountS { + public int getNumber() throws RemoteException; + public long getBalance() throws RemoteException; + public void setBalance(long d) throws RemoteException; + public String getCustomer() throws RemoteException; + public void setCustomer(String c) throws RemoteException; + public void doFailedEjbStore_1() throws RemoteException; + public void doFailedEjbStore_2() throws RemoteException; + public void doFailedEjbStore_3() throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountEB.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountEB.java new file mode 100644 index 0000000000000000000000000000000000000000..54f23b01dff022cfc2a87674b13ef14e986bdc16 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountEB.java @@ -0,0 +1,373 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.beanexc; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Enumeration; +import java.util.Vector; + +import javax.ejb.EntityBean; +import javax.ejb.FinderException; +import javax.ejb.ObjectNotFoundException; +import javax.ejb.RemoveException; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.sql.DataSource; + +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * This is an entity bean with "bean managed persistence". + * The state of an instance is stored into a relational database. + * The table must exist. + * @author Philippe Durieux, Philippe Coq + */ +public class AccountEB extends AccountEC implements EntityBean { + + static final String tableName = "beanexcAccountEB"; + + // Database related information + private DataSource dataSource = null; + private static String dataSourceName; + + + public void ejbLoad() { + logger.log(BasicLevel.DEBUG, ""); + AccountPK pk = (AccountPK) entityContext.getPrimaryKey(); + PreparedStatement loadPstmt = null; + Connection conn = null; + try { + conn = getConnection(); + loadPstmt = conn.prepareStatement("select c_number, c_customer, c_balance from " + tableName + " where c_number=?"); + + // PK fields + loadPstmt.setInt(1, pk.number); + ResultSet rs = loadPstmt.executeQuery(); + if (!rs.next()) { + System.err.println("Fails to load bean from database"); + throw new javax.ejb.EJBException("Failed to load bean from database"); + } + number = rs.getInt("c_number"); + customer = rs.getString("c_customer"); + balance = rs.getLong("c_balance"); + } catch (SQLException e) { + System.err.println("Fails to load bean from database"); + throw new javax.ejb.EJBException("Failed to load bean from database" + e); + } finally { + try { + loadPstmt.close(); + conn.close(); + } catch (Exception e) { + System.err.println("ejbLoad: Ignore exception:" + e); + } + } + + } + + public void ejbStore() { + AccountPK pk = (AccountPK) entityContext.getPrimaryKey(); + logger.log(BasicLevel.DEBUG, "pk=" + pk.number); + PreparedStatement storePstmt = null; + Connection conn = null; + if (forceToFailEjbStore) { + forceToFailEjbStore = false; + throw new javax.ejb.EJBException("Failed to store bean to database"); + } + + try { + conn = getConnection(); + storePstmt = conn.prepareStatement("update " + tableName + " set c_customer=?,c_balance=? where c_number=?"); + + // non PK fields + if (customer == null) { + storePstmt.setNull(1, java.sql.Types.VARCHAR); + } else { + storePstmt.setString(1, customer); + } + storePstmt.setLong(2, balance); + // PK fields + storePstmt.setInt(3, number); + storePstmt.executeUpdate(); + } catch (SQLException e) { + throw new javax.ejb.EJBException("Failed to store bean to database"); + } finally { + try { + storePstmt.close(); + conn.close(); + } catch (Exception e) { + System.err.println("ejbStore: Ignore exception:" + e); + } + } + } + + public void ejbRemove() throws RemoveException { + logger.log(BasicLevel.DEBUG, ""); + + // A RemoveException may be throwned depending on the PK value + super.ejbRemove(); + + AccountPK pk = (AccountPK) entityContext.getPrimaryKey(); + PreparedStatement removePstmt = null; + Connection conn = null; + try { + conn = getConnection(); + removePstmt = conn.prepareStatement("delete from " + tableName + " where c_number=?"); + // PK fields + removePstmt.setInt(1, pk.number); + removePstmt.executeUpdate(); + } catch (SQLException e) { + throw new javax.ejb.EJBException("Failed to delete bean from database"); + } finally { + try { + removePstmt.close(); + conn.close(); + } catch (Exception e) { + System.err.println("ejbRemove: Ignore exception:" + e); + } + } + } + + + public AccountPK ejbCreate(int val_number, String val_customer, long val_balance) throws javax.ejb.CreateException { + logger.log(BasicLevel.DEBUG, ""); + + super.ejbCreate(val_number, val_customer, val_balance); + + PreparedStatement createPstmt = null; + Connection conn = null; + AccountPK pk = new AccountPK(val_number); + + // persistence management + try { + conn = getConnection(); + createPstmt = conn.prepareStatement("insert into " + tableName + " values (?, ?, ?)"); + // all fields + createPstmt.setInt(1, pk.number); + if (customer == null) { + createPstmt.setNull(2, java.sql.Types.VARCHAR); + } else { + createPstmt.setString(2, customer); + } + createPstmt.setLong(3, balance); + createPstmt.executeUpdate(); + } catch (SQLException e) { + throw new javax.ejb.EJBException("Failed to create bean in database" + e); + } finally { + try { + createPstmt.close(); + conn.close(); + } catch (Exception e) { + logger.log(BasicLevel.ERROR, "ejbCreate: Ignore exception:" + e); + } + } + return pk; + } + + /** + * creer une instance bidon le flag sert pour savoir quelle exception lever + */ + public AccountPK ejbCreate(int flag) throws javax.ejb.CreateException, AppException { + logger.log(BasicLevel.DEBUG, ""); + AccountPK pk = super.ejbCreate(flag); + return pk; + } + + public AccountPK ejbCreate(boolean flag) throws javax.ejb.CreateException, AppException { + logger.log(BasicLevel.DEBUG, ""); + AccountPK pk = super.ejbCreate(flag); + return pk; + } + + public void ejbPostCreate(int val_number, String val_customer, long val_balance) { + logger.log(BasicLevel.DEBUG, ""); + } + + public AccountPK ejbFindByPrimaryKey(AccountPK pk) throws ObjectNotFoundException, FinderException { + logger.log(BasicLevel.DEBUG, ""); + PreparedStatement loadPstmt = null; + Connection conn = null; + try { + conn = getConnection(); + loadPstmt = conn.prepareStatement("select c_customer, c_balance from " + tableName + " where c_number=?"); + loadPstmt.setInt(1, pk.number); + ResultSet rs = loadPstmt.executeQuery(); + if (!rs.next()) { + throw new javax.ejb.ObjectNotFoundException("primary key"); + } + } catch (SQLException e) { + System.err.println("Fails to executeQuery " + e); + throw new javax.ejb.FinderException("Failed to executeQuery " + e); + } finally { + try { + loadPstmt.close(); + conn.close(); + } catch (Exception e) { + logger.log(BasicLevel.ERROR, "ejbFindByPrimaryKey: Ignore exception:" + e); + } + } + return pk; + } + + public AccountPK ejbFindByNoAccount(int number) + throws ObjectNotFoundException, FinderException { + logger.log(BasicLevel.DEBUG, ""); + PreparedStatement loadPstmt = null; + Connection conn = null; + AccountPK pk = new AccountPK(number); + try { + conn = getConnection(); + loadPstmt = conn.prepareStatement("select c_customer,c_balance from " + tableName + " where c_number=?"); + loadPstmt.setInt(1, pk.number); + ResultSet rs = loadPstmt.executeQuery(); + if (!rs.next()) { + logger.log(BasicLevel.ERROR, "Object Not Found primary key : " + pk.number); + throw new javax.ejb.ObjectNotFoundException("primary key : " + pk.number); + } + } catch (SQLException e) { + System.err.println("Fails to executeQuery " + e); + throw new javax.ejb.FinderException("Failed to executeQuery " + e); + } finally { + try { + loadPstmt.close(); + conn.close(); + } catch (Exception e) { + logger.log(BasicLevel.ERROR, "ejbFindByNoAccount: Ignore exception:" + e); + } + } + return pk; + } + + public Enumeration ejbFindCustomerAccounts(String name) throws FinderException { + logger.log(BasicLevel.DEBUG, ""); + PreparedStatement loadPstmt = null; + Connection conn = null; + Vector pkV = new Vector(); + try { + conn = getConnection(); + loadPstmt = conn.prepareStatement("select c_number from " + tableName + " where c_customer=?"); + loadPstmt.setString(1, name); + ResultSet rs = loadPstmt.executeQuery(); + while (rs.next()) { + int b = rs.getInt("c_number"); + AccountPK pk = new AccountPK(b); + pkV.addElement((Object) pk); + } + + } catch (SQLException e) { + System.err.println("Fails to executeQuery " + e); + throw new javax.ejb.FinderException("Failed to executeQuery " + e); + } finally { + try { + loadPstmt.close(); + conn.close(); + } catch (Exception e) { + logger.log(BasicLevel.ERROR, "ejbFindCustomerAccounts: Ignore exception:" + e); + } + } + return (pkV.elements()); + } + + public Enumeration ejbFindBigAccounts(long minBalance) throws FinderException { + logger.log(BasicLevel.DEBUG, ""); + PreparedStatement loadPstmt = null; + Connection conn = null; + Vector pkV = new Vector(); + try { + conn = getConnection(); + loadPstmt = conn.prepareStatement("select c_number from " + tableName + " where c_balance>?"); + loadPstmt.setLong(1, minBalance); + ResultSet rs = loadPstmt.executeQuery(); + while (rs.next()) { + int b = rs.getInt("c_number"); + AccountPK pk = new AccountPK(b); + pkV.addElement((Object) pk); + } + } catch (SQLException e) { + System.err.println("Fails to executeQuery " + e); + throw new javax.ejb.FinderException("Failed to executeQuery " + e); + } finally { + try { + loadPstmt.close(); + conn.close(); + } catch (Exception e) { + logger.log(BasicLevel.ERROR, "ejbFindBigAccounts: Ignore exception:" + e); + } + } + return (pkV.elements()); + } + + public Enumeration ejbFindAllAccounts() throws FinderException { + logger.log(BasicLevel.DEBUG, ""); + PreparedStatement loadPstmt = null; + Connection conn = null; + Vector pkV = new Vector(); + try { + conn = getConnection(); + loadPstmt = conn.prepareStatement("select c_number from " + tableName); + ResultSet rs = loadPstmt.executeQuery(); + while (rs.next()) { + int b = rs.getInt("c_number"); + AccountPK pk = new AccountPK(b); + pkV.addElement((Object) pk); + } + } catch (SQLException e) { + System.err.println("Fails to executeQuery " + e); + throw new javax.ejb.FinderException("Failed to executeQuery " + e); + } finally { + try { + loadPstmt.close(); + conn.close(); + } catch (Exception e) { + logger.log(BasicLevel.ERROR, "ejbFindAllAccounts: Ignore exception:" + e); + } + } + return (pkV.elements()); + } + + private Connection getConnection() throws java.sql.SQLException { + logger.log(BasicLevel.DEBUG, ""); + if (dataSource == null) { + // Finds DataSource from JNDI + Context initialContext = null; + try { + initialContext = new InitialContext(); + dataSource = (DataSource) initialContext.lookup("java:comp/env/jdbc/AccountEB"); + } catch (Exception e) { + logger.log(BasicLevel.ERROR, "Pb with naming context"); + throw new javax.ejb.EJBException("Pb with naming context "); + } + } + Connection ret = dataSource.getConnection(); + if (ret == null) { + throw new javax.ejb.EJBException("dataSource.getConnection() returned null"); + } + return ret; + } +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountEC.java new file mode 100644 index 0000000000000000000000000000000000000000..cd335e8b3b4c72097ba0cecd8b3e38c5887dc5d7 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountEC.java @@ -0,0 +1,83 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.beanexc; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * This is an entity bean with "container managed persistenceversion 1". + * The state of an instance is stored into a relational database. + * @author Philippe Durieux, Philippe Coq, Helene Joanin + */ +public class AccountEC extends AccountEC2 implements EntityBean { + + // ------------------------------------------------------------------ + // State of the bean (CMP v1) + // They must be public for Container Managed Persistence. + // ------------------------------------------------------------------ + public int number; + public String customer; + public long balance; + + + // ------------------------------------------------------------------ + // Accessors and setters implementation + // ------------------------------------------------------------------ + + public int getNumber() { + logger.log(BasicLevel.DEBUG, "number:"+number); + return number; + } + + public void setNumber(int n) { + logger.log(BasicLevel.DEBUG, ""); + number = n; + } + + public long getBalance() { + logger.log(BasicLevel.DEBUG, "balance:"+number); + return balance; + } + + public void setBalance(long d) { + logger.log(BasicLevel.DEBUG, ""); + balance = d; + } + + public String getCustomer() { + logger.log(BasicLevel.DEBUG, ""); + return customer; + } + + public void setCustomer(String c) { + logger.log(BasicLevel.DEBUG, ""); + customer = c; + } + +} + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..c9045eb1e38a7b017532f513e468a2f1b1cab4dd --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountEC2.java @@ -0,0 +1,188 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.beanexc; + +import javax.ejb.EntityBean; +import javax.ejb.EntityContext; +import javax.ejb.EJBContext; +import javax.ejb.RemoveException; +import javax.ejb.CreateException; + +import org.objectweb.jonas.common.Log; +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * This is an entity bean with "container managed persistence version 2". + * The state of an instance is stored into a relational database. + * @author Philippe Durieux, Philippe Coq, Helene Joanin + */ +public abstract class AccountEC2 extends AccountCommon implements EntityBean { + + boolean forceToFailEjbStore; + protected EntityContext entityContext; + + + // Get and Set accessor methods of the bean's abstract schema + public abstract int getNumber(); + public abstract void setNumber(int n); + public abstract long getBalance(); + public abstract void setBalance(long d); + public abstract String getCustomer(); + public abstract void setCustomer(String c); + + + + public EJBContext getContext() { + return entityContext; + } + + public void ejbActivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbPassivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbLoad() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbStore() { + logger.log(BasicLevel.DEBUG, ""); + if (forceToFailEjbStore) { + forceToFailEjbStore = false; + throw new RuntimeException("RunTimeExceptionInEjbStore"); + } + } + + /** + * This method is common for impl and expl bean + * it is used to test exception raised in ejbRemove() + * with unspecified transactional context (Required attribute). + * This method throws a RemoveException when the value of the PK is between 999990 and 999999 + */ + public void ejbRemove() throws RemoveException { + logger.log(BasicLevel.DEBUG, ""); + AccountPK pk = (AccountPK) entityContext.getPrimaryKey(); + if ((pk.number >= 999990) && (pk.number <= 999999)) { + logger.log(BasicLevel.DEBUG, + "RemoveException throwned by bean provider in ejbRemove"); + throw new RemoveException("RemoveException throwned by bean provider in ejbRemove"); + } + } + + public void setEntityContext(EntityContext ctx) { + if (logger == null) { + logger = Log.getLogger(Log.JONAS_TESTS_PREFIX); + } + logger.log(BasicLevel.DEBUG, ""); + entityContext = ctx; + } + + public void unsetEntityContext() { + logger.log(BasicLevel.DEBUG, ""); + entityContext = null; + } + + public AccountPK ejbCreate(int val_number, String val_customer, long val_balance) throws CreateException { + logger.log(BasicLevel.DEBUG, ""); + setNumber(val_number); + setCustomer(val_customer); + setBalance(val_balance); + return (null); + } + + /** + * this method is common for impl and expl bean + * it is used to test exception raised in ejbCreate + * with unspecified transactional context (Required attribute) + * CAUTION: Do not call ejbCreate inside another ejbCreate (known bug) + */ + public AccountPK ejbCreate(int flag) throws CreateException, AppException { + logger.log(BasicLevel.DEBUG, ""); + setNumber(1951); + setCustomer("Myself"); + setBalance(10000); + if (flag == 0) { + entityContext.setRollbackOnly(); + throw new AppException("AppException in ejbCreate(boolean)"); + } else { + int zero = 0; + float f = 10 / zero; + } + return (null); + } + + /** + * this method is common for impl and expl bean + * NotSupported attr. + * CAUTION: Do not call ejbCreate inside another ejbCreate (known bug) + */ + public AccountPK ejbCreate(boolean flag) throws CreateException, AppException { + logger.log(BasicLevel.DEBUG, ""); + setNumber(1951); + setCustomer("Myself"); + setBalance(10000); + if (flag) { + throw new AppException("AppException in ejbCreate(boolean)"); + } else { + int zero = 0; + float f = 10 / zero; + } + return (null); + } + + public void ejbPostCreate(int val_number, String val_customer, long val_balance) { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbPostCreate(int flag) { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbPostCreate(boolean flag) { + logger.log(BasicLevel.DEBUG, ""); + } + + public void doFailedEjbStore_1() { + logger.log(BasicLevel.DEBUG, ""); + setBalance(1000); + forceToFailEjbStore = true; + } + public void doFailedEjbStore_2() { + logger.log(BasicLevel.DEBUG, ""); + setBalance(2000); + forceToFailEjbStore = true; + } + public void doFailedEjbStore_3() { + logger.log(BasicLevel.DEBUG, ""); + setBalance(3000); + forceToFailEjbStore = true; + } + +} + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountEHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountEHome.java new file mode 100644 index 0000000000000000000000000000000000000000..71d008389472b346cf0461854c7f0b5023f0dd5d --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountEHome.java @@ -0,0 +1,48 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// AccountEHome.java + + +package org.objectweb.jonas.jtests.beans.beanexc; + +import java.util.Enumeration; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +public interface AccountEHome extends EJBHome { + + public AccountE create(int number, String customer, long balance) throws RemoteException, CreateException; + public AccountE create(boolean flg) throws RemoteException, CreateException, AppException; + public AccountE create(int flg) throws RemoteException, CreateException, AppException; + public AccountE findByPrimaryKey(AccountPK pk) throws RemoteException, FinderException; + public AccountE findByNoAccount(int number) throws RemoteException, FinderException; + public Enumeration findCustomerAccounts(String name) throws RemoteException, FinderException; + public Enumeration findBigAccounts(long b) throws RemoteException, FinderException; + public Enumeration findAllAccounts() throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountPK.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountPK.java new file mode 100644 index 0000000000000000000000000000000000000000..3c40fab29a237a86c418060c0985a6702b169a45 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountPK.java @@ -0,0 +1,53 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// AccountPK.java + +package org.objectweb.jonas.jtests.beans.beanexc; + +public class AccountPK implements java.io.Serializable { + + public int number; + + public AccountPK(int number) { + this.number = number; + } + + public AccountPK() { + } + + public int hashCode() { + return number; + } + + public boolean equals(Object other) { + boolean isEqual = false; + if (other instanceof AccountPK) { + isEqual = (number == ((AccountPK) other).number); + } + return isEqual; + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountS.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountS.java new file mode 100644 index 0000000000000000000000000000000000000000..1a85b5c1c7dad88c977e840a8cd5745f30747b35 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountS.java @@ -0,0 +1,46 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// AccountS.java + +package org.objectweb.jonas.jtests.beans.beanexc; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +public interface AccountS extends EJBObject { + public void doAppException_1() throws RemoteException, AppException; + public void doUncheckedException_1() throws RemoteException; + public void doRemoteException_1() throws RemoteException; + public void doAppException_2(boolean rollflg) throws RemoteException, AppException; + public void doUncheckedException_2() throws RemoteException; + public void doEJBException_1() throws RemoteException; + public void doEJBException_2() throws RemoteException; + public void doEJBException_sup() throws RemoteException; + public void doAppException_3() throws RemoteException, AppException; + public void doUncheckedException_3() throws RemoteException; + public void ping() throws RemoteException; + public boolean iAmDestroyed() throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountSF.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountSF.java new file mode 100644 index 0000000000000000000000000000000000000000..6b47cea4a3aa6ab7c7fff2cdac5f54957659b8d3 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountSF.java @@ -0,0 +1,40 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// AccountSF.java + +package org.objectweb.jonas.jtests.beans.beanexc; + +/* + * Stateful session bean + */ +public class AccountSF extends AccountSL { + + public int i = 0; + + public void ejbCreate(int i) { + this.i = i; + } +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountSHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountSHome.java new file mode 100644 index 0000000000000000000000000000000000000000..30678f4f25eee9de361612b373cfbccc1212a7ab --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountSHome.java @@ -0,0 +1,36 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// AccountSHome.java + +package org.objectweb.jonas.jtests.beans.beanexc; + +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; + +public interface AccountSHome extends EJBHome { + AccountS create() throws RemoteException, CreateException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountSL.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountSL.java new file mode 100644 index 0000000000000000000000000000000000000000..202f03f0c798d6db6ed475e6dd05f7ba9c97ff55 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountSL.java @@ -0,0 +1,85 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.beanexc; + +import javax.ejb.SessionBean; +import javax.ejb.SessionContext; +import javax.ejb.EJBContext; +import org.objectweb.jonas.common.Log; +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Stateless Session Bean + * @author Philippe Coq + */ +public class AccountSL extends AccountCommon implements SessionBean { + protected SessionContext sessionContext = null; + + public void ejbActivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbPassivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbRemove() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void setSessionContext(SessionContext t) { + if (logger == null) { + logger = Log.getLogger(Log.JONAS_TESTS_PREFIX); + } + logger.log(BasicLevel.DEBUG, ""); + sessionContext = t; + } + + public void ejbCreate() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void setBalance(long val) { + logger.log(BasicLevel.DEBUG, ""); + } + + public EJBContext getContext() { + logger.log(BasicLevel.DEBUG, ""); + return sessionContext; + } + + public void doFailedEjbStore_1() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void doFailedEjbStore_2() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void doFailedEjbStore_3() { + logger.log(BasicLevel.DEBUG, ""); + } +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountSY.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountSY.java new file mode 100644 index 0000000000000000000000000000000000000000..dde67ce972c88dd713b860d0d909bc1864527642 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AccountSY.java @@ -0,0 +1,89 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// AccountSY.java + +package org.objectweb.jonas.jtests.beans.beanexc; + +import javax.ejb.SessionSynchronization; + +/* + * Stateful session bean + */ + +public class AccountSY extends AccountSL implements SessionSynchronization { + + + // ------------------------------------------------------------------ + // SessionSynchronization implementation + // ------------------------------------------------------------------ + + /** + * The afterBegin method notifies a session Bean instance that a new + * transaction has started, and that the subsequent business methods on + * the instance will be invoked in the context of the transaction. + * This method executes in the proper transaction context. + * + * @throws EJBException Thrown if the instance could not perform + * the function requested by the container because of a system-level error. + */ + public void afterBegin() { + + } + + + /** + * The beforeCompletion method notifies a session Bean instance that a + * transaction is about to be committed. + * This method executes in the proper transaction context. + * Note: The instance may still cause the container to rollback the transaction + * by invoking the setRollbackOnly() method on the instance context, or by throwing + * an exception. + * + * @throws EJBException Thrown by the method to indicate a failure caused by a + * system-level error. + */ + public void beforeCompletion() { + + } + + + /** + * The afterCompletion method notifies a session Bean instance that a + * transaction commit protocol has completed, and tells the instance whether + * the transaction has been committed or rolled back. + * This method executes with no transaction context. + * + * @param : committed - True if the transaction has been committed, false if + * it has been rolled back. + * + * @throws EJBException Thrown by the method to indicate a failure caused by a + * system-level error. + */ + public void afterCompletion(boolean committed) { + + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AppException.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AppException.java new file mode 100644 index 0000000000000000000000000000000000000000..e902586c0fdb81caacb25abec0bd436e0a2ae3f1 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/AppException.java @@ -0,0 +1,40 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// AppException.java + +package org.objectweb.jonas.jtests.beans.beanexc; + +import java.lang.Exception; + + +public class AppException extends Exception { + + public AppException() { + } + public AppException(String msg) { + super(msg); + } +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/BTAccountSL.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/BTAccountSL.java new file mode 100644 index 0000000000000000000000000000000000000000..6db33b089d9a3dbf944ed0d9ee2ed0b023e7c367 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/BTAccountSL.java @@ -0,0 +1,35 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// AccountSL.java + +package org.objectweb.jonas.jtests.beans.beanexc; + +import javax.ejb.SessionBean; + + +public class BTAccountSL extends AccountSL implements SessionBean { + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/beanexc.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/beanexc.xml new file mode 100644 index 0000000000000000000000000000000000000000..c5805d37afbff6b756d2a9d26252b5539ae6c03d --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/beanexc.xml @@ -0,0 +1,527 @@ + + + + + + beanexc + + + + + beanexc/AccountEC + AccountEC + org.objectweb.jonas.jtests.beans.beanexc.AccountEHome + org.objectweb.jonas.jtests.beans.beanexc.AccountE + org.objectweb.jonas.jtests.beans.beanexc.AccountEC + Container + org.objectweb.jonas.jtests.beans.beanexc.AccountPK + False + 1.x + + number + + + customer + + + balance + + + + + beanexc/AccountEC2 + AccountEC2 + org.objectweb.jonas.jtests.beans.beanexc.AccountEHome + org.objectweb.jonas.jtests.beans.beanexc.AccountE + org.objectweb.jonas.jtests.beans.beanexc.AccountEC2 + Container + org.objectweb.jonas.jtests.beans.beanexc.AccountPK + False + 2.x + jt2_beanexc + + number + + + customer + + + balance + + + + findByNoAccount + + int + + + SELECT OBJECT(o) FROM jt2_beanexc o WHERE o.number = ?1 + + + + findCustomerAccounts + + java.lang.String + + + SELECT OBJECT(o) FROM jt2_beanexc o WHERE o.customer = ?1 + + + + findBigAccounts + + long + + + SELECT OBJECT(o) FROM jt2_beanexc o WHERE o.balance > ?1 + + + + findAllAccounts + + + SELECT OBJECT(o) FROM jt2_beanexc o + + + + + beanexc/AccountEB + AccountEB + org.objectweb.jonas.jtests.beans.beanexc.AccountEHome + org.objectweb.jonas.jtests.beans.beanexc.AccountE + org.objectweb.jonas.jtests.beans.beanexc.AccountEB + Bean + org.objectweb.jonas.jtests.beans.beanexc.AccountPK + False + + jdbc/AccountEB + javax.sql.DataSource + Container + + + + + Non Secured Stateless Session + beanexc/AccountSL + AccountSL + org.objectweb.jonas.jtests.beans.beanexc.AccountSHome + org.objectweb.jonas.jtests.beans.beanexc.AccountS + org.objectweb.jonas.jtests.beans.beanexc.AccountSL + Stateless + Container + + + + + Stateful Session + beanexc/AccountSF + AccountSF + org.objectweb.jonas.jtests.beans.beanexc.AccountSHome + org.objectweb.jonas.jtests.beans.beanexc.AccountS + org.objectweb.jonas.jtests.beans.beanexc.AccountSF + Stateful + Container + + + + Stateful Session implementing Synchronization + beanexc/AccountSY + AccountSY + org.objectweb.jonas.jtests.beans.beanexc.AccountSHome + org.objectweb.jonas.jtests.beans.beanexc.AccountS + org.objectweb.jonas.jtests.beans.beanexc.AccountSY + Stateful + Container + + + + + Stateless Session with bean-managed transaction + beanexc/BTAccountSL + BTAccountSL + org.objectweb.jonas.jtests.beans.beanexc.AccountSHome + org.objectweb.jonas.jtests.beans.beanexc.AccountS + org.objectweb.jonas.jtests.beans.beanexc.BTAccountSL + Stateless + Bean + + + + + + + + + + + AccountEB + create + + int + + + + AccountEB + remove + + + AccountEB + doEJBException_2 + + + AccountEB + iAmDestroyed + + + AccountEC + create + + int + + + + AccountEC + remove + + + AccountEC + doEJBException_2 + + + AccountEC + iAmDestroyed + + + AccountEC2 + create + + int + + + + AccountEC2 + remove + + + AccountEC2 + doEJBException_2 + + + AccountEC2 + iAmDestroyed + + Required + + + + + AccountEB + * + + + AccountEB + doRemoteException_1 + + + AccountEC + * + + + AccountEC + doRemoteException_1 + + + AccountEC2 + * + + + AccountEC2 + doRemoteException_1 + + + AccountSL + * + + + AccountSF + * + + + AccountSY + * + + Supports + + + + + + + + AccountEB + doFailedEjbStore_1 + + + AccountEB + doAppException_1 + + + AccountEB + doUncheckedException_1 + + + AccountEC + doFailedEjbStore_1 + + + AccountEC + doAppException_1 + + + AccountEC + doUncheckedException_1 + + + AccountEC2 + doFailedEjbStore_1 + + + AccountEC2 + doAppException_1 + + + AccountEC2 + doUncheckedException_1 + + + AccountSL + doAppException_1 + + + AccountSL + doUncheckedException_1 + + + AccountSF + doAppException_1 + + + AccountSF + doUncheckedException_1 + + + AccountSY + doAppException_1 + + + AccountSY + doUncheckedException_1 + + Mandatory + + + + + + + + AccountEB + doFailedEjbStore_2 + + + AccountEB + doAppException_2 + + + AccountEB + doUncheckedException_2 + + + AccountEB + doEJBException_1 + + + AccountEC + doFailedEjbStore_2 + + + AccountEC + doAppException_2 + + + AccountEC + doUncheckedException_2 + + + AccountEC + doEJBException_1 + + + AccountEC2 + doFailedEjbStore_2 + + + AccountEC2 + doAppException_2 + + + AccountEC2 + doUncheckedException_2 + + + AccountEC2 + doEJBException_1 + + + AccountSL + doAppException_2 + + + AccountSL + doUncheckedException_2 + + + AccountSL + doEJBException_1 + + + AccountSF + doAppException_2 + + + AccountSF + doUncheckedException_2 + + + AccountSF + doEJBException_1 + + + AccountSY + doAppException_2 + + + AccountSY + doUncheckedException_2 + + + AccountSY + doEJBException_1 + + RequiresNew + + + + + + AccountEB + create + + boolean + + + + AccountEB + doFailedEjbStore_3 + + + AccountEB + doAppException_3 + + + AccountEB + doUncheckedException_3 + + + AccountEC + create + + boolean + + + + AccountEC + doFailedEjbStore_3 + + + AccountEC + doAppException_3 + + + AccountEC + doUncheckedException_3 + + + AccountEC2 + create + + boolean + + + + AccountEC2 + doFailedEjbStore_3 + + + AccountEC2 + doAppException_3 + + + AccountEC2 + doUncheckedException_3 + + + AccountSL + doAppException_3 + + + AccountSL + doUncheckedException_3 + + + AccountSF + doAppException_3 + + + AccountSF + doUncheckedException_3 + + + AccountSY + doAppException_3 + + + AccountSY + doUncheckedException_3 + + NotSupported + + + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/jonas-beanexc.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/jonas-beanexc.xml new file mode 100644 index 0000000000000000000000000000000000000000..304ab5f48f23c0bddb9a11e58487ad916782ead0 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/beanexc/jonas-beanexc.xml @@ -0,0 +1,101 @@ + + + + + + AccountSF + 4 + + + + AccountEC + beanexcAccountECHome + + jdbc_1 + beanexcAccountEC + + number + c_number + + + customer + c_customer + + + balance + c_balance + + + + findByNoAccount + + where c_number = ? + + + + findCustomerAccounts + + where c_customer = ? + + + + findBigAccounts + + where c_balance > ? + + + + findAllAccounts + + + + + + + + AccountEC2 + beanexcAccountEC2Home + removeall + container-serialized + + jdbc_1 + + + + + AccountEB + beanexcAccountEBHome + + jdbc/AccountEB + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bmt/Moscone.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bmt/Moscone.java new file mode 100644 index 0000000000000000000000000000000000000000..1b883860c032432c81e68a68096d4abe58453b9b --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bmt/Moscone.java @@ -0,0 +1,16 @@ +// Moscone.java + +package org.objectweb.jonas.jtests.beans.bmt; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Moscone remote interface + */ +public interface Moscone extends EJBObject { + public void tx_start() throws RemoteException; + public void tx_commit() throws RemoteException; + public void tx_rollback() throws RemoteException; + public void moscone1() throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bmt/MosconeHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bmt/MosconeHome.java new file mode 100644 index 0000000000000000000000000000000000000000..5153b6194fcdd5a1aca7854e135c65244c782123 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bmt/MosconeHome.java @@ -0,0 +1,15 @@ +// MosconeHome.java + +package org.objectweb.jonas.jtests.beans.bmt; + +import java.rmi.RemoteException; + +import javax.ejb.CreateException; +import javax.ejb.EJBHome; + +/** + * Home interface for the bean Moscone + */ +public interface MosconeHome extends EJBHome { + Moscone create() throws CreateException, RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bmt/MosconeST.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bmt/MosconeST.java new file mode 100644 index 0000000000000000000000000000000000000000..ed9aa579bd71f02ea33c47b554322e84e29c591b --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bmt/MosconeST.java @@ -0,0 +1,243 @@ +// MosconeST.java +// Stateful Session Bean + +package org.objectweb.jonas.jtests.beans.bmt; + +import java.rmi.RemoteException; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.sql.SQLException; + +import javax.ejb.CreateException; +import javax.ejb.EJBException; +import javax.ejb.SessionBean; +import javax.ejb.SessionContext; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import javax.rmi.PortableRemoteObject; +import javax.sql.DataSource; +import javax.transaction.NotSupportedException; +import javax.transaction.SystemException; +import javax.transaction.UserTransaction; + +import org.objectweb.jonas.common.Log; +import org.objectweb.util.monolog.api.BasicLevel; +import org.objectweb.util.monolog.api.Logger; + + +/** + * Stateful Session bean that manages transactions inside the bean. + * This type of bean must NOT implement SessionSynchronization. + */ +public class MosconeST implements SessionBean { + + static private Logger logger = null; + SessionContext ejbContext; + + // state of the sessionbean + Context ictx = null; + UserTransaction ut = null; + Connection cnx = null; + ResultSet rs = null; + Statement st = null; + + // ------------------------------------------------------------------ + // SessionBean implementation + // ------------------------------------------------------------------ + + /** + * Set the associated session context. The container calls this method + * after the instance creation. + * The enterprise Bean instance should store the reference to the context + * object in an instance variable. + * This method is called with no transaction context. + * + * @param sessionContext A SessionContext interface for the instance. + * @throws EJBException Thrown by the method to indicate a failure caused by + * a system-level error. + */ + public void setSessionContext(SessionContext ctx) { + if( logger == null) + logger = Log.getLogger("org.objectweb.jonas_tests"); + logger.log(BasicLevel.DEBUG, ""); + ejbContext = ctx; + } + + /** + * A container invokes this method before it ends the life of the session object. + * This happens as a result of a client's invoking a remove operation, or when a + * container decides to terminate the session object after a timeout. + * This method is called with no transaction context. + * + * @throws EJBException Thrown by the method to indicate a failure caused by + * a system-level error. + */ + public void ejbRemove() { + logger.log(BasicLevel.DEBUG, ""); + } + + private void getConnection() throws RemoteException { + try { + ictx = new InitialContext(); + DataSource ds = (DataSource) PortableRemoteObject.narrow(ictx.lookup("jdbc_1"), DataSource.class); + cnx = ds.getConnection(); + } catch (Exception e) { + throw new RemoteException("cannot get connection: " + e); + } + } + + private void closeConnection() throws RemoteException { + try { + if (cnx != null) { + cnx.close(); + } + } catch (Exception e) { + throw new RemoteException("cannot close connection: " + e); + } + } + + /** + * The Session bean must define 1 or more ejbCreate methods. + * + * @throws CreateException Failure to create a session EJB object. + */ + public void ejbCreate() throws CreateException { + logger.log(BasicLevel.DEBUG, ""); + } + + + /** + * A container invokes this method on an instance before the instance + * becomes disassociated with a specific EJB object. + */ + public void ejbPassivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + /** + * A container invokes this method when the instance is taken out of + * the pool of available instances to become associated with a specific + * EJB object. + */ + public void ejbActivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + // ------------------------------------------------------------------ + // Moscone implementation + // ------------------------------------------------------------------ + + /** + * The following method start a transaction that will be continued + * in other methods of this bean. + */ + public void tx_start() throws RemoteException { + logger.log(BasicLevel.DEBUG, ""); + + // Obtain the UserTransaction interface + try { + ut = ejbContext.getUserTransaction(); + } catch (IllegalStateException e) { + logger.log(BasicLevel.ERROR, "Can't get UserTransaction"); + throw new RemoteException("Can't get UserTransaction:", e); + } + + // Start a global transaction + try { + ut.begin(); + } catch (NotSupportedException e) { + logger.log(BasicLevel.ERROR, "Can't start Transaction"); + throw new RemoteException("Can't start Transaction:", e); + } catch (SystemException e) { + logger.log(BasicLevel.ERROR, "Can't start Transaction"); + throw new RemoteException("Can't start Transaction:", e); + } + } + + /** + * This method commits the current transaction, started previously by tx_start(). + */ + public void tx_commit() throws RemoteException { + logger.log(BasicLevel.DEBUG, ""); + + // Commit this GLOBAL transaction + try { + ut.commit(); + } catch (Exception e) { + logger.log(BasicLevel.ERROR, "Can't commit Transaction"); + throw new RemoteException("Can't commit Transaction:", e); + } + } + + /** + * This method rolls back the current transaction, started previously by tx_start(). + */ + public void tx_rollback() throws RemoteException { + logger.log(BasicLevel.DEBUG, ""); + + // Roll back this GLOBAL transaction + try { + ut.rollback(); + } catch (Exception e) { + logger.log(BasicLevel.ERROR, "Can't rollback Transaction"); + throw new RemoteException("Can't rollback Transaction:", e); + } + } + + /** + * This method open a connection before starting transactions. + */ + public void moscone1() throws RemoteException { + logger.log(BasicLevel.DEBUG, ""); + + getConnection(); + + // Obtain the UserTransaction interface + try { + ut = ejbContext.getUserTransaction(); + } catch (IllegalStateException e) { + logger.log(BasicLevel.ERROR, "Can't get UserTransaction"); + throw new RemoteException("Can't get UserTransaction:", e); + } + + // Start a global transaction + try { + ut.begin(); + } catch (NotSupportedException e) { + logger.log(BasicLevel.ERROR, "Can't start Transaction"); + throw new RemoteException("Can't start Transaction:", e); + } catch (SystemException e) { + logger.log(BasicLevel.ERROR, "Can't start Transaction"); + throw new RemoteException("Can't start Transaction:", e); + } + + // work with connection. + try { + String ret = null; + st = cnx.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); + rs = st.executeQuery("SELECT * FROM JT2_MARCHE"); + if (rs.first()) { + do { + ret += rs.getInt("IDMAR") + ":" + rs.getString("NOM") + "\n"; + } while(rs.next()); + } + st.close(); + } catch (SQLException e) { + throw new RemoteException("Error working on database: " + e); + } + + // Commit this GLOBAL transaction + try { + ut.commit(); + } catch (Exception e) { + logger.log(BasicLevel.ERROR, "Can't commit Transaction"); + throw new RemoteException("Can't commit Transaction:", e); + } + + closeConnection(); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bmt/bmt.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bmt/bmt.xml new file mode 100644 index 0000000000000000000000000000000000000000..abcd14d7c3c6963ee847a5ce60817f3e7e5cb9c1 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bmt/bmt.xml @@ -0,0 +1,52 @@ + + + + + + + Describe here the content of this file + bmt + + + + Describe here the session bean Moscone + bmt/MosconeST + MosconeST + org.objectweb.jonas.jtests.beans.bmt.MosconeHome + org.objectweb.jonas.jtests.beans.bmt.Moscone + org.objectweb.jonas.jtests.beans.bmt.MosconeST + Stateful + Bean + + jdbc/mydb + javax.sql.DataSource + Application + + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bmt/jonas-bmt.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bmt/jonas-bmt.xml new file mode 100644 index 0000000000000000000000000000000000000000..0c07f2c2e1fa50ddfffd8881ec9fc5b56ee3c7eb --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/bmt/jonas-bmt.xml @@ -0,0 +1,40 @@ + + + + + + + + + MosconeST + + jdbc/mydb + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/cluster/Identity.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/cluster/Identity.java new file mode 100644 index 0000000000000000000000000000000000000000..5060b591141e4c2a40fd509ef881afa24fa0c129 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/cluster/Identity.java @@ -0,0 +1,11 @@ +package org.objectweb.jonas.jtests.beans.cluster; + +import java.lang.String; +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +public interface Identity extends EJBObject { + public String getName() throws RemoteException; // PK + public int getNumber() throws RemoteException; + public void setNumber(int val) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/cluster/IdentityEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/cluster/IdentityEC.java new file mode 100644 index 0000000000000000000000000000000000000000..b65c73b442e632b695373f99ccacbfce075880e4 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/cluster/IdentityEC.java @@ -0,0 +1,174 @@ +package org.objectweb.jonas.jtests.beans.cluster; + +import javax.ejb.CreateException; +import javax.ejb.DuplicateKeyException; +import javax.ejb.EntityBean; +import javax.ejb.EntityContext; +import javax.ejb.RemoveException; + +import org.objectweb.jonas.common.Log; +import org.objectweb.util.monolog.api.BasicLevel; +import org.objectweb.util.monolog.api.Logger; + +public class IdentityEC implements EntityBean { + + static private Logger logger = null; + EntityContext ejbContext; + + // ------------------------------------------------------------------ + // State of the bean. + // They must be public for Container Managed Persistence. + // ------------------------------------------------------------------ + public String name; + public int number; + + // ------------------------------------------------------------------ + // EntityBean implementation + // ------------------------------------------------------------------ + + /** + * Set the associated entity context. The container invokes this method + * on an instance after the instance has been created. + * This method is called in an unspecified transaction context. + * + * @param ctx - An EntityContext interface for the instance. The instance + * should store the reference to the context in an instance variable. + * @throws EJBException Thrown by the method to indicate a failure caused by a + * system-level error. + */ + public void setEntityContext(EntityContext ctx) { + if (logger == null) { + logger = Log.getLogger(Log.JONAS_TESTS_PREFIX); + } + logger.log(BasicLevel.DEBUG, ""); + ejbContext = ctx; + } + + /** + * Unset the associated entity context. The container calls this method + * before removing the instance. + * This is the last method that the container invokes on the instance. + * The Java garbage collector will eventually invoke the finalize() method + * on the instance. + * This method is called in an unspecified transaction context. + * @throws EJBException Thrown by the method to indicate a failure caused by a + * system-level error. + */ + public void unsetEntityContext() { + logger.log(BasicLevel.DEBUG, ""); + ejbContext = null; + } + + /** + * A container invokes this method before it removes the EJB object + * that is currently associated with the instance. This method is + * invoked when a client invokes a remove operation on the enterprise Bean's + * home interface or the EJB object's remote interface. This method + * transitions the instance from the ready state to the pool of available + * instances. + * + * This method is called in the transaction context of the remove operation. + * @throws RemoveException The enterprise Bean does not allow destruction of the object. + * @throws EJBException - Thrown by the method to indicate a failure caused by a system-level + * error. + */ + public void ejbRemove() throws RemoveException { + logger.log(BasicLevel.DEBUG, "="+number); + } + + /** + * A container invokes this method to instruct the instance to synchronize + * its state by loading it state from the underlying database. + * This method always executes in the proper transaction context. + * + * @throws EJBException Thrown by the method to indicate a failure caused by + * a system-level error. + */ + public void ejbLoad() { + logger.log(BasicLevel.DEBUG, "="+number); + } + + /** + * A container invokes this method to instruct the instance to synchronize + * its state by storing it to the underlying database. + * This method always executes in the proper transaction context. + * + * @throws EJBException Thrown by the method to indicate a failure caused by + * a system-level error. + */ + public void ejbStore() { + logger.log(BasicLevel.DEBUG, "="+number); + } + + /** + * The Entity bean can define 0 or more ejbCreate methods. + * + * @throws CreateException Failure to create an entity EJB object. + * @throws DuplicateKeyException An object with the same key already exists. + */ + public String ejbCreate(String s, int i) throws CreateException, DuplicateKeyException { + + // Init here the bean fields + name = s; + number = i; + logger.log(BasicLevel.DEBUG, "="+number); + + // In CMP, should return null. + return null; + } + + /** + * There must be an ejbPostCreate par ejbCreate method + * + * @throws CreateException Failure to create an entity EJB object. + */ + public void ejbPostCreate(String s, int i) throws CreateException { + logger.log(BasicLevel.DEBUG, "="+number); + } + + /** + * A container invokes this method on an instance before the instance + * becomes disassociated with a specific EJB object. + */ + public void ejbPassivate() { + logger.log(BasicLevel.DEBUG, "="+number); + } + + /** + * A container invokes this method when the instance is taken out of + * the pool of available instances to become associated with a specific + * EJB object. + */ + public void ejbActivate() { + logger.log(BasicLevel.DEBUG, "="+number); + } + + // ------------------------------------------------------------------ + // Identity implementation + // ------------------------------------------------------------------ + + /** + * getName + */ + public String getName() { + logger.log(BasicLevel.DEBUG, "="+number); + return name; + } + + /** + * getNumber + */ + public int getNumber() { + logger.log(BasicLevel.DEBUG, "="+number); + return number; + } + + /** + * setNumber + */ + public void setNumber(int val) { + number = val; + logger.log(BasicLevel.DEBUG, "="+number); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/cluster/IdentityHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/cluster/IdentityHome.java new file mode 100644 index 0000000000000000000000000000000000000000..91d1786e389fa0e8953897d9ee514ec33040cef7 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/cluster/IdentityHome.java @@ -0,0 +1,15 @@ +package org.objectweb.jonas.jtests.beans.cluster; + +import java.lang.String; +import java.rmi.RemoteException; +import java.util.Collection; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + +public interface IdentityHome extends EJBHome { + Identity create(String n, int i) throws CreateException, RemoteException; + Identity findByPrimaryKey(String pk) throws FinderException, RemoteException; + Collection findByNumber(int number) throws FinderException, RemoteException; + Collection findAll() throws FinderException, RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/cluster/README b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/cluster/README new file mode 100644 index 0000000000000000000000000000000000000000..7e68a0c5984afbcec2cc028c2b4b0462965ff11c --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/cluster/README @@ -0,0 +1,7 @@ +This bean container has no other interest than SIMULATING a "cluster" configuration +with several jonas server running the same entity beans backed on a unique database. +All entity beans must have the "shared" flag set. +Isolation level should be set to "Serialized" on the database. +All operations accessing fields that can be modified must have the "Required" +transaction attribute, even if operation don't modify this field. +This is to be sure that the bean state is read again if another process has modified it. diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/cluster/cluster.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/cluster/cluster.xml new file mode 100644 index 0000000000000000000000000000000000000000..2ef8ade4d9be539c95be70765db9c16d30e8be6a --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/cluster/cluster.xml @@ -0,0 +1,129 @@ + + + + + + cluster + + + + + cluster/Id_1 + Id_1 + org.objectweb.jonas.jtests.beans.cluster.IdentityHome + org.objectweb.jonas.jtests.beans.cluster.Identity + org.objectweb.jonas.jtests.beans.cluster.IdentityEC + Container + java.lang.String + True + 1.x + + name + + + number + + name + + + + cluster/Id_2 + Id_2 + org.objectweb.jonas.jtests.beans.cluster.IdentityHome + org.objectweb.jonas.jtests.beans.cluster.Identity + org.objectweb.jonas.jtests.beans.cluster.IdentityEC + Container + java.lang.String + True + 1.x + + name + + + number + + name + + + + cluster/Id_3 + Id_3 + org.objectweb.jonas.jtests.beans.cluster.IdentityHome + org.objectweb.jonas.jtests.beans.cluster.Identity + org.objectweb.jonas.jtests.beans.cluster.IdentityEC + Container + java.lang.String + True + 1.x + + name + + + number + + name + + + + + + + + + Id_1 + * + + + Id_2 + * + + + Id_3 + * + + Required + + + + + Id_1 + getName + + + Id_2 + getName + + + Id_3 + getName + + Supports + + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/cluster/jonas-cluster.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/cluster/jonas-cluster.xml new file mode 100644 index 0000000000000000000000000000000000000000..ac2571f67e7ab9a9fefddd954eed1316cd41b1ca --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/cluster/jonas-cluster.xml @@ -0,0 +1,124 @@ + + + + + + + + Id_1 + clusterId_1 + true + container-read-committed + + jdbc_1 + clusterIdentityEC + + name + c_name + + + number + c_number + + + + findByNumber + + where c_number = ? + + + + findAll + + + + + + + + Id_2 + clusterId_2 + true + container-read-committed + + jdbc_1 + clusterIdentityEC + + name + c_name + + + number + c_number + + + + findByNumber + + where c_number = ? + + + + findAll + + + + + + + + Id_3 + clusterId_3 + true + container-read-committed + + jdbc_1 + clusterIdentityEC + + name + c_name + + + number + c_number + + + + findByNumber + + where c_number = ? + + + + findAll + + + + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/Account.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/Account.java new file mode 100644 index 0000000000000000000000000000000000000000..304586df17cd17c14bfd065e1e5084e5d00a5f37 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/Account.java @@ -0,0 +1,15 @@ +// Account.java + +package org.objectweb.jonas.jtests.beans.ebasic; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Account remote interface + */ +public interface Account extends EJBObject { + public int getNumberPrimitive() throws RemoteException; + public java.lang.String getCustomer() throws RemoteException; + public void setCustomer(java.lang.String s) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/AccountEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/AccountEC.java new file mode 100644 index 0000000000000000000000000000000000000000..3be92cf47715c9dff814ba70681837d21b8072c7 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/AccountEC.java @@ -0,0 +1,84 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +/** + * This is an entity bean with "container managed persistence version 1.x". + * This bean is used to test an entity with a primary key that maps a java.lang.Integer + * single field. + * @author Helene Joanin + */ + +package org.objectweb.jonas.jtests.beans.ebasic; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * + */ +public class AccountEC extends AccountEC2 implements EntityBean { + + // ------------------------------------------------------------------ + // State of the bean (CMP v1) + // They must be public for Container Managed Persistence. + // ------------------------------------------------------------------ + public Integer number; + public String customer; + + // ------------------------------------------------------------------ + // Accessors and setters implementation + // ------------------------------------------------------------------ + + /** + * getNumber + */ + public Integer getNumber() { + logger.log(BasicLevel.DEBUG, ""); + return number; + } + /** + * setNumber + */ + public void setNumber(Integer numtest) { + logger.log(BasicLevel.DEBUG, ""); + number = numtest; + } + + /** + * getCustomer + */ + public String getCustomer() { + logger.log(BasicLevel.DEBUG, ""); + return customer; + } + /** + * setCustomer + */ + public void setCustomer(String s) { + logger.log(BasicLevel.DEBUG, ""); + customer = new String(s); + } +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/AccountEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/AccountEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..2898002c8a38b137b1c372a20b379645633a87f5 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/AccountEC2.java @@ -0,0 +1,191 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.ebasic; + +import javax.ejb.CreateException; +import javax.ejb.DuplicateKeyException; +import javax.ejb.EntityBean; +import javax.ejb.EntityContext; +import javax.ejb.RemoveException; + +import org.objectweb.jonas.common.Log; +import org.objectweb.util.monolog.api.BasicLevel; +import org.objectweb.util.monolog.api.Logger; + +/** + * This is an entity bean with "container managed persistence version 2.x". + * This bean is used to test an entity with a primary key that maps a java.lang.Integer + * single field. + * @author Helene Joanin + */ +public abstract class AccountEC2 implements EntityBean { + + static protected Logger logger = null; + EntityContext ejbContext; + + // ------------------------------------------------------------------ + // Get and Set accessor methods of the bean's abstract schema + // ------------------------------------------------------------------ + public abstract Integer getNumber(); + public abstract void setNumber(Integer numtest); + + public abstract String getCustomer(); + public abstract void setCustomer(String customer); + + // ------------------------------------------------------------------ + // EntityBean implementation + // ------------------------------------------------------------------ + + /** + * Set the associated entity context. The container invokes this method + * on an instance after the instance has been created. + * This method is called in an unspecified transaction context. + * + * @param ctx - An EntityContext interface for the instance. The instance + * should store the reference to the context in an instance variable. + * @throws EJBException Thrown by the method to indicate a failure caused by a + * system-level error. + */ + public void setEntityContext(EntityContext ctx) { + if (logger == null) + logger = Log.getLogger(Log.JONAS_TESTS_PREFIX); + logger.log(BasicLevel.DEBUG, ""); + ejbContext = ctx; + } + + /** + * Unset the associated entity context. The container calls this method + * before removing the instance. + * This is the last method that the container invokes on the instance. + * The Java garbage collector will eventually invoke the finalize() method + * on the instance. + * This method is called in an unspecified transaction context. + * + * @throws EJBException Thrown by the method to indicate a failure caused by a + * system-level error. + */ + public void unsetEntityContext() { + logger.log(BasicLevel.DEBUG, ""); + ejbContext = null; + } + + /** + * A container invokes this method before it removes the EJB object + * that is currently associated with the instance. This method is + * invoked when a client invokes a remove operation on the enterprise Bean's + * home interface or the EJB object's remote interface. This method + * transitions the instance from the ready state to the pool of available + * instances. + * + * This method is called in the transaction context of the remove operation. + * @throws RemoveException The enterprise Bean does not allow destruction of the object. + * @throws EJBException - Thrown by the method to indicate a failure caused by a system-level + * error. + */ + public void ejbRemove() throws RemoveException { + logger.log(BasicLevel.DEBUG, ""); + } + + /** + * A container invokes this method to instruct the instance to synchronize + * its state by loading it state from the underlying database. + * This method always executes in the proper transaction context. + * + * @throws EJBException Thrown by the method to indicate a failure caused by + * a system-level error. + */ + public void ejbLoad() { + logger.log(BasicLevel.DEBUG, ""); + } + + /** + * A container invokes this method to instruct the instance to synchronize + * its state by storing it to the underlying database. + * This method always executes in the proper transaction context. + * + * @throws EJBException Thrown by the method to indicate a failure caused by + * a system-level error. + */ + public void ejbStore() { + logger.log(BasicLevel.DEBUG, ""); + } + + /** + * The Entity bean can define 0 or more ejbCreate methods. + * + * @throws CreateException Failure to create an entity EJB object. + * @throws DuplicateKeyException An object with the same key already exists. + */ + public java.lang.Integer ejbCreate(int num, String s) throws CreateException, DuplicateKeyException { + logger.log(BasicLevel.DEBUG, ""); + + // Init here the bean fields + setNumber(new Integer(num)); + setCustomer(new String(s)); + + // In CMP, should return null. + return null; + } + + /** + * There must be an ejbPostCreate par ejbCreate method + * + * @throws CreateException Failure to create an entity EJB object. + */ + public void ejbPostCreate(int num, String s) throws CreateException { + logger.log(BasicLevel.DEBUG, ""); + } + + /** + * A container invokes this method on an instance before the instance + * becomes disassociated with a specific EJB object. + */ + public void ejbPassivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + /** + * A container invokes this method when the instance is taken out of + * the pool of available instances to become associated with a specific + * EJB object. + */ + public void ejbActivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + // ------------------------------------------------------------------ + // Account implementation + // ------------------------------------------------------------------ + + /** + * getNumberPrimitive() + */ + public int getNumberPrimitive() { + logger.log(BasicLevel.DEBUG, ""); + return getNumber().intValue(); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/AccountHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/AccountHome.java new file mode 100644 index 0000000000000000000000000000000000000000..f715b90dab9221e07ed2fe298e90dc780c7577a5 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/AccountHome.java @@ -0,0 +1,19 @@ +// AccountHome.java + +package org.objectweb.jonas.jtests.beans.ebasic; + +import java.rmi.RemoteException; +import java.util.Collection; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + +/** + * Home interface for the bean Account + */ +public interface AccountHome extends EJBHome { + Account create(int num, java.lang.String name) throws CreateException, RemoteException; + Account findByPrimaryKey(java.lang.Integer pk) throws FinderException, RemoteException; + Account findByNumber(int num) throws FinderException, RemoteException; + Collection findAll() throws FinderException, RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/BDate.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/BDate.java new file mode 100644 index 0000000000000000000000000000000000000000..2ff8bed6899de99fe08fd25b4113dfc97cd49aa0 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/BDate.java @@ -0,0 +1,22 @@ +// BDate.java + +package org.objectweb.jonas.jtests.beans.ebasic; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * BDate remote interface + */ +public interface BDate extends EJBObject { + public int getField1() throws RemoteException; + public void setField1(int f1) throws RemoteException; + + public int getField2() throws RemoteException; + public void setField2(int f2) throws RemoteException; + + public java.util.Date getField3() throws RemoteException; + public void setField3(java.util.Date f3) throws RemoteException; + + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/BDateEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/BDateEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..4d2838c5a90616c38f5f92d74f00028abe52e247 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/BDateEC2.java @@ -0,0 +1,117 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.ebasic; + +import org.objectweb.jonas.common.Log; +import org.objectweb.util.monolog.api.Logger; +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * + */ +public abstract class BDateEC2 implements javax.ejb.EntityBean { + + static private Logger logger = null; + javax.ejb.EntityContext ejbContext; + + + public java.util.Date ejbCreate(int f1, + int f2, + java.util.Date f3) throws javax.ejb.CreateException{ + + logger.log(BasicLevel.DEBUG, ""); + + // Init here the bean fields + setField1(f1); + setField2(f2); + setField3(f3); + return null; + } + + public void ejbPostCreate(int f1, int f2, java.util.Date f3) { + logger.log(BasicLevel.DEBUG, ""); + } + + // ------------------------------------------------------------------ + // Persistent fields + // + // ------------------------------------------------------------------ + public abstract int getField1(); + public abstract void setField1(int f1); + + public abstract int getField2(); + public abstract void setField2(int f2); + + public abstract java.util.Date getField3(); + public abstract void setField3(java.util.Date f3); + + // ------------------------------------------------------------------ + // Standard call back methods + // ------------------------------------------------------------------ + + + public void setEntityContext(javax.ejb.EntityContext ctx) { + if (logger == null) { + logger = Log.getLogger("org.objectweb.jonas_tests"); + } + logger.log(BasicLevel.DEBUG, ""); + ejbContext = ctx; + } + + + public void unsetEntityContext() { + logger.log(BasicLevel.DEBUG, ""); + ejbContext = null; + } + + public void ejbRemove() throws javax.ejb.RemoveException { + logger.log(BasicLevel.DEBUG, ""); + } + + + public void ejbLoad() { + logger.log(BasicLevel.DEBUG, ""); + } + + + public void ejbStore() { + logger.log(BasicLevel.DEBUG, ""); + } + + + public void ejbPassivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + + public void ejbActivate() { + logger.log(BasicLevel.DEBUG, ""); + } + +} + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/BDateHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/BDateHome.java new file mode 100644 index 0000000000000000000000000000000000000000..36dc72dcb616e543bc086de1523e8dbea621c5f7 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/BDateHome.java @@ -0,0 +1,18 @@ +// BDateHome.java + +package org.objectweb.jonas.jtests.beans.ebasic; + +import java.rmi.RemoteException; + +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + +/** + * Home interface for the bean BDate + */ +public interface BDateHome extends EJBHome { + BDate create(int f1, int f2, java.util.Date f3) throws CreateException, RemoteException; + BDate findByPrimaryKey(java.util.Date pk) throws FinderException, RemoteException; +} + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/E4Query.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/E4Query.java new file mode 100644 index 0000000000000000000000000000000000000000..19a7cd8c7829d0c0c90dd1df5c48de82e8f6eb6e --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/E4Query.java @@ -0,0 +1,41 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// E4Query.java + +package org.objectweb.jonas.jtests.beans.ebasic; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +public interface E4Query extends EJBObject { + public String getId() throws RemoteException; + public String getFstring() throws RemoteException; + public void setFstring(String s) throws RemoteException; + public int getFint() throws RemoteException; + public void setFint(int i) throws RemoteException; + public double getFdouble() throws RemoteException; + public void setFdouble(double d) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/E4QueryEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/E4QueryEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..c1f713ced449a382c00db0a7784839ef012bb46d --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/E4QueryEC2.java @@ -0,0 +1,106 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.ebasic; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; +import javax.ejb.EntityContext; +import javax.ejb.RemoveException; + +import org.objectweb.jonas.common.Log; +import org.objectweb.util.monolog.api.BasicLevel; +import org.objectweb.util.monolog.api.Logger; + + +/** + * This is an entity bean with "container managed persistence version 2.x". + * The state of an instance is stored into a relational database. + * @author Helene Joanin + */ + +public abstract class E4QueryEC2 implements EntityBean { + + static protected Logger logger = null; + + protected EntityContext entityContext; + + + // Get and Set accessor methods of the bean's abstract schema + public abstract String getId(); + public abstract void setId(String s); + public abstract String getFstring(); + public abstract void setFstring(String s); + public abstract int getFint(); + public abstract void setFint(int i); + public abstract double getFdouble(); + public abstract void setFdouble(double i); + + public void ejbActivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbPassivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbLoad() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbStore() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbRemove() throws RemoveException { + logger.log(BasicLevel.DEBUG, ""); + } + + public void setEntityContext(EntityContext ctx) { + if (logger == null) + logger = Log.getLogger(Log.JONAS_TESTS_PREFIX); + logger.log(BasicLevel.DEBUG, ""); + entityContext = ctx; + + } + + public void unsetEntityContext() { + logger.log(BasicLevel.DEBUG, ""); + } + + public String ejbCreate(String id, String s, int i, double d) throws CreateException { + logger.log(BasicLevel.DEBUG, "create "+id+","+s+","+i+","+d); + setId(id); + setFstring(s); + setFint(i); + setFdouble(d); + return(null); + } + + public void ejbPostCreate(String id, String s, int i, double d){ + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/E4QueryHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/E4QueryHome.java new file mode 100644 index 0000000000000000000000000000000000000000..48f607e31f5ef9a56dcece3028102884de14fe6b --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/E4QueryHome.java @@ -0,0 +1,72 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// E4QueryHome.java + +package org.objectweb.jonas.jtests.beans.ebasic; + +import java.rmi.RemoteException; +import java.util.Collection; + +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + +public interface E4QueryHome extends EJBHome { + public E4Query create(String id, String s, int i, double d) throws RemoteException, CreateException; + public E4Query findByPrimaryKey(String id) throws RemoteException, FinderException; + public Collection findByLengthString(int l) + throws RemoteException, FinderException; + public Collection findByLocateString(String s) + throws RemoteException, FinderException; + public Collection findByLocateStringAt(String s, int start) + throws RemoteException, FinderException; + public Collection findBySubstring(String s, int start, int length) + throws RemoteException, FinderException; + public Collection findByConcatString(String s) + throws RemoteException, FinderException; + public Collection findByAbsInt(int i) + throws RemoteException, FinderException; + public Collection findBySqrtDouble(double d) + throws RemoteException, FinderException; + public Collection findByIsNull() + throws RemoteException, FinderException; + public Collection findByIsNullParam(String s) + throws RemoteException, FinderException; + public Collection findByInStrings() + throws RemoteException, FinderException; + public Collection findByLessThanMinus100() + throws RemoteException, FinderException; + public Collection findByIntEqualExpr(int i1, int i2, int i3) + throws RemoteException, FinderException; + public Collection findByIntEqualExpr2(int i1, int i2, int i3) + throws RemoteException, FinderException; + public Collection findByStringGreaterThenExpr(String s) + throws RemoteException, FinderException; + public Collection findByStringGreaterOrEqualThenExpr(String s) + throws RemoteException, FinderException; + public Collection findByIntModXIsZero(int i) + throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/Person.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/Person.java new file mode 100644 index 0000000000000000000000000000000000000000..148c3ce80be7618ba94be2d773f4ad2d40760127 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/Person.java @@ -0,0 +1,14 @@ +// Person.java + +package org.objectweb.jonas.jtests.beans.ebasic; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Person remote interface + */ +public interface Person extends EJBObject { + public int getNumberPrimitive() throws RemoteException; + public java.lang.String getName() throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/PersonEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/PersonEC.java new file mode 100644 index 0000000000000000000000000000000000000000..3e39701cf2e4425c2e6e440638866046b1cb361d --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/PersonEC.java @@ -0,0 +1,84 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +/** + * This is an entity bean with "container managed persistence version 1.x". + * This bean is used to test an entity with an unknown primary key class at the development phase. + * @author Helene Joanin + */ + +package org.objectweb.jonas.jtests.beans.ebasic; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * + */ +public class PersonEC extends PersonEC2 implements EntityBean { + + // ------------------------------------------------------------------ + // State of the bean (CMP v1) + // They must be public for Container Managed Persistence. + // ------------------------------------------------------------------ + public Integer number; + public String name; + + // ------------------------------------------------------------------ + // Accessors and setters implementation + // ------------------------------------------------------------------ + + /** + * getNumber + */ + public Integer getNumber() { + logger.log(BasicLevel.DEBUG, ""); + return number; + } + /** + * setNumber + */ + public void setNumber(Integer num) { + logger.log(BasicLevel.DEBUG, ""); + number = num; + } + + /** + * getName + */ + public String getName() { + logger.log(BasicLevel.DEBUG, ""); + return name; + } + /** + * setName + */ + public void setName(String s) { + logger.log(BasicLevel.DEBUG, ""); + name = new String(s); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/PersonEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/PersonEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..ad7285b3655509f9630c4cf2772bc89cbe5615d2 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/PersonEC2.java @@ -0,0 +1,195 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +/** + * This is an entity bean with "container managed persistence version 2.x". + * This bean is used to test an entity with an unknown primary key class at the development phase. + * @author Helene Joanin + */ + +package org.objectweb.jonas.jtests.beans.ebasic; + +import javax.ejb.CreateException; +import javax.ejb.DuplicateKeyException; +import javax.ejb.EntityBean; +import javax.ejb.EntityContext; +import javax.ejb.RemoveException; + +import org.objectweb.jonas.common.Log; +import org.objectweb.util.monolog.api.BasicLevel; +import org.objectweb.util.monolog.api.Logger; + +/** + * + */ +public abstract class PersonEC2 implements EntityBean { + + static protected Logger logger = null; + EntityContext ejbContext; + + // ------------------------------------------------------------------ + // Get and Set accessor methods of the bean's abstract schema + // ------------------------------------------------------------------ + public abstract Integer getNumber(); + public abstract void setNumber(Integer num); + + public abstract String getName(); + public abstract void setName(String name); + + // ------------------------------------------------------------------ + // EntityBean implementation + // ------------------------------------------------------------------ + + /** + * Set the associated entity context. The container invokes this method + * on an instance after the instance has been created. + * This method is called in an unspecified transaction context. + * + * @param ctx - An EntityContext interface for the instance. The instance + * should store the reference to the context in an instance variable. + * @throws EJBException Thrown by the method to indicate a failure caused by a + * system-level error. + */ + public void setEntityContext(EntityContext ctx) { + if (logger == null) { + logger = Log.getLogger(Log.JONAS_TESTS_PREFIX); + } + logger.log(BasicLevel.DEBUG, ""); + ejbContext = ctx; + } + + /** + * Unset the associated entity context. The container calls this method + * before removing the instance. + * This is the last method that the container invokes on the instance. + * The Java garbage collector will eventually invoke the finalize() method + * on the instance. + * This method is called in an unspecified transaction context. + * + * @throws EJBException Thrown by the method to indicate a failure caused by a + * system-level error. + */ + public void unsetEntityContext() { + logger.log(BasicLevel.DEBUG, ""); + ejbContext = null; + } + + /** + * A container invokes this method before it removes the EJB object + * that is currently associated with the instance. This method is + * invoked when a client invokes a remove operation on the enterprise Bean's + * home interface or the EJB object's remote interface. This method + * transitions the instance from the ready state to the pool of available + * instances. + * + * This method is called in the transaction context of the remove operation. + * @throws RemoveException The enterprise Bean does not allow destruction of the object. + * @throws EJBException - Thrown by the method to indicate a failure caused by a system-level + * error. + */ + public void ejbRemove() throws RemoveException { + logger.log(BasicLevel.DEBUG, ""); + } + + /** + * A container invokes this method to instruct the instance to synchronize + * its state by loading it state from the underlying database. + * This method always executes in the proper transaction context. + * + * @throws EJBException Thrown by the method to indicate a failure caused by + * a system-level error. + */ + public void ejbLoad() { + logger.log(BasicLevel.DEBUG, ""); + } + + /** + * A container invokes this method to instruct the instance to synchronize + * its state by storing it to the underlying database. + * This method always executes in the proper transaction context. + * + * @throws EJBException Thrown by the method to indicate a failure caused by + * a system-level error. + */ + public void ejbStore() { + logger.log(BasicLevel.DEBUG, ""); + } + + /** + * The Entity bean can define 0 or more ejbCreate methods. + * + * @throws CreateException Failure to create an entity EJB object. + * @throws DuplicateKeyException An object with the same key already exists. + */ + public java.lang.Object ejbCreate(int i, String s) throws CreateException, DuplicateKeyException { + logger.log(BasicLevel.DEBUG, ""); + + // Init here the bean fields + setNumber(new Integer(i)); + setName(new String(s)); + + // In CMP, should return null. + return null; + } + + /** + * There must be an ejbPostCreate par ejbCreate method + * + * @throws CreateException Failure to create an entity EJB object. + */ + public void ejbPostCreate(int i, String s) throws CreateException { + logger.log(BasicLevel.DEBUG, ""); + } + + /** + * A container invokes this method on an instance before the instance + * becomes disassociated with a specific EJB object. + */ + public void ejbPassivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + /** + * A container invokes this method when the instance is taken out of + * the pool of available instances to become associated with a specific + * EJB object. + */ + public void ejbActivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + // ------------------------------------------------------------------ + // Person implementation + // ------------------------------------------------------------------ + + /** + * getNumberPrimitive + */ + public int getNumberPrimitive() { + logger.log(BasicLevel.DEBUG, ""); + return getNumber().intValue(); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/PersonHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/PersonHome.java new file mode 100644 index 0000000000000000000000000000000000000000..19412481ed373dc3bf93c4983c550e964c54377b --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/PersonHome.java @@ -0,0 +1,20 @@ +// PersonHome.java + +package org.objectweb.jonas.jtests.beans.ebasic; + +import java.rmi.RemoteException; +import java.util.Collection; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + +/** + * Home interface for the bean Person + */ +public interface PersonHome extends EJBHome { + Person create(int i, String n) throws CreateException, RemoteException; + Person findByPrimaryKey(java.lang.Object pk) throws FinderException, RemoteException; + Person findByNumber(int number) throws FinderException, RemoteException; + Person findByName(String name) throws FinderException, RemoteException; + Collection findAll() throws FinderException, RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/Simple.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/Simple.java new file mode 100644 index 0000000000000000000000000000000000000000..3e868de60bbaadc8c25b0cab77497e9905c5ada0 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/Simple.java @@ -0,0 +1,42 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Simple.java + +package org.objectweb.jonas.jtests.beans.ebasic; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +public interface Simple extends EJBObject { + public int getNumTest() throws RemoteException; + public void setNumTest(int num) throws RemoteException; + public int getInfo() throws RemoteException; + public void setInfo(int info) throws RemoteException; + public String getTestName() throws RemoteException; + public void setTestName(String name) throws RemoteException; + public boolean loopBack() throws RemoteException; + public boolean loopBackTx() throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/SimpleEB.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/SimpleEB.java new file mode 100644 index 0000000000000000000000000000000000000000..c213c5e85aa8152e785c5574040204d7bccb773a --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/SimpleEB.java @@ -0,0 +1,477 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.ebasic; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Collection; +import java.util.Enumeration; +import java.util.Vector; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; +import javax.ejb.FinderException; +import javax.ejb.ObjectNotFoundException; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.sql.DataSource; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * This is an entity bean with "bean managed persistence". The state of an + * instance is stored into a relational database. + * The table must exist. + * @author Philippe Durieux, Philippe Coq + */ +public class SimpleEB extends SimpleEC implements EntityBean { + + static final String tableName = "ebasicSimpleEB"; + + // Database related information + private DataSource dataSource = null; + private static String dataSourceName; + + + public void ejbLoad() { + logger.log(BasicLevel.DEBUG, ""); + String testname = (String)entityContext.getPrimaryKey(); + PreparedStatement loadPstmt = null; + Connection conn = null; + try { + conn = getConnection(); + loadPstmt = conn.prepareStatement("select c_info, c_numtest, c_testname from "+tableName+" where c_testname=?"); + + // PK fields + loadPstmt.setString(1, testname); + ResultSet rs = loadPstmt.executeQuery(); + if (rs.next() == false) { + throw new javax.ejb.EJBException("Failed to load bean from database "+testname); + }; + info = rs.getInt(1); + testname = rs.getString(3); + numtest = rs.getInt(2); + + } catch (SQLException e) { + throw new javax.ejb.EJBException("Failed to load bean from database" +e); + } finally { + try{ + loadPstmt.close(); + conn.close(); + } catch(Exception e) { + System.err.println("ejbLoad: Ignore exception:"+e); + } + } + + } + + public void ejbStore() { + logger.log(BasicLevel.DEBUG, ""); + String testname = (String)entityContext.getPrimaryKey(); + PreparedStatement storePstmt = null; + Connection conn = null; + + try { + conn = getConnection(); + storePstmt = conn.prepareStatement("update "+tableName+" set c_info=?,c_numtest=? where c_testname=?"); + + storePstmt.setString(3, testname); + storePstmt.setInt(1, info); + storePstmt.setInt(2, numtest); + storePstmt.executeUpdate(); + } catch (SQLException e) { + throw new javax.ejb.EJBException("Failed to store bean to database "+testname); + + } finally { + try{ + storePstmt.close(); + conn.close(); + } catch(Exception e) { + System.err.println("ejbStore: Ignore exception:"+e); + } + } + } + + public void ejbRemove() { + logger.log(BasicLevel.DEBUG, ""); + String testname = (String)entityContext.getPrimaryKey(); + PreparedStatement removePstmt = null; + Connection conn = null; + try { + conn = getConnection(); + removePstmt = conn.prepareStatement("delete from "+tableName+" where c_testname=?"); + // PK fields + removePstmt.setString(1, testname ); + removePstmt.executeUpdate(); + } catch (SQLException e) { + throw new javax.ejb.EJBException("Failed to delete bean from database "+testname); + } finally { + try{ + removePstmt.close(); + conn.close(); + } catch(Exception e) { + System.err.println("ejbRemove: Ignore exception:"+e); + } + } + } + + + public String ejbCreate(String name, int info, int num) throws CreateException { + + super.ejbCreate(name, info, num); + + PreparedStatement createPstmt = null; + Connection conn = null; + + // persistence management + try { + conn = getConnection(); + createPstmt = conn.prepareStatement("insert into "+tableName+" values (?, ?, ?)"); + // all fields + createPstmt.setString(1, testname); + createPstmt.setInt(2, info); + createPstmt.setInt(3, numtest); + createPstmt.executeUpdate(); + } catch (SQLException e) { + logger.log(BasicLevel.ERROR, "ejbCreate failed: " + e); + throw new javax.ejb.EJBException("Failed to create bean in database "+testname); + } finally { + try{ + createPstmt.close(); + conn.close(); + } catch(Exception e) { + // ignore exception + logger.log(BasicLevel.ERROR, "ejbFindByPrimaryKey: Ignore exception:"+e); + } + } + return name; + } + + public void ejbPostCreate(String name, int info, int num) { + super.ejbPostCreate(name, info, num); + } + + + + public String ejbFindByPrimaryKey(String name ) throws ObjectNotFoundException, FinderException { + logger.log(BasicLevel.DEBUG, "name="+ name); + PreparedStatement loadPstmt = null; + Connection conn = null; + try { + conn = getConnection(); + loadPstmt = conn.prepareStatement("select c_info,c_numtest from "+tableName+" where c_testname=?"); + loadPstmt.setString(1,name ); + ResultSet rs = loadPstmt.executeQuery(); + if (rs.next() == false) { + throw new javax.ejb.ObjectNotFoundException("primary key : "+name); + } + } catch (SQLException e) { + throw new javax.ejb.FinderException("Failed to executeQuery " +e); + } finally { + try{ + loadPstmt.close(); + conn.close(); + } catch(Exception e) { + // ignore exception + logger.log(BasicLevel.ERROR, "ejbFindByPrimaryKey: Ignore exception:"+e); + } + } + return name; + } + + + public String ejbFindByTestName(String name) + throws ObjectNotFoundException, FinderException { + logger.log(BasicLevel.DEBUG, "name="+ name); + PreparedStatement loadPstmt = null; + Connection conn = null; + + try { + conn = getConnection(); + loadPstmt = conn.prepareStatement("select c_info,c_numtest from "+tableName+" where c_testname=?"); + loadPstmt.setString(1, name); + ResultSet rs = loadPstmt.executeQuery(); + if (rs.next() == false) { + throw new javax.ejb.ObjectNotFoundException("primary key : "+name); + } + } catch (SQLException e) { + throw new javax.ejb.FinderException("Failed to executeQuery " +e); + } finally { + try{ + loadPstmt.close(); + conn.close(); + } catch(Exception e) { + // ignore exception + logger.log(BasicLevel.ERROR, "ejbFindByPrimaryKey: Ignore exception:"+e); + } + } + + return name; + } + + /** is similar to ejbFindByTestName but try to access to TimerService and PK that should get + IllegalStateException. + **/ + public String ejbFindByName(String name) + throws ObjectNotFoundException, FinderException { + logger.log(BasicLevel.DEBUG, "name="+ name); + PreparedStatement loadPstmt = null; + Connection conn = null; + + try { + conn = getConnection(); + loadPstmt = conn.prepareStatement("select c_info,c_numtest from "+tableName+" where c_testname=?"); + loadPstmt.setString(1, name); + ResultSet rs = loadPstmt.executeQuery(); + if (rs.next() == false) { + throw new javax.ejb.ObjectNotFoundException("primary key : "+name); + } + } catch (SQLException e) { + throw new javax.ejb.FinderException("Failed to executeQuery " +e); + } finally { + try{ + loadPstmt.close(); + conn.close(); + } catch(Exception e) { + // ignore exception + logger.log(BasicLevel.ERROR, "ejbFindByPrimaryKey: Ignore exception:"+e); + } + } + // Try to access TimerService and PK: Should get IllegalStateException. + if (entityContext != null) { + try { + entityContext.getTimerService(); + throw new FinderException("Should not get TimerService from a finder method"); + } catch (IllegalStateException e) { + logger.log(BasicLevel.DEBUG, "IllegalStateException has been thrown"); + } + try { + entityContext.getPrimaryKey(); + throw new FinderException("Should not get PK from a finder method"); + } catch (IllegalStateException e) { + logger.log(BasicLevel.DEBUG, "IllegalStateException has been thrown"); + } + } + return name; + } + + public Enumeration ejbFindInfoForNum(int num) throws FinderException { + logger.log(BasicLevel.DEBUG, "num="+ num); + PreparedStatement loadPstmt = null; + Connection conn = null; + Vector pkV = new Vector(); + try { + conn = getConnection(); + loadPstmt = conn.prepareStatement("select c_testname from "+tableName+" where c_numtest=?"); + loadPstmt.setInt(1, num); + ResultSet rs = loadPstmt.executeQuery(); + + while(rs.next()) { + String pk = rs.getString(1); + pkV.addElement(pk); + + } + + } catch (SQLException e) { + throw new javax.ejb.FinderException("Failed to executeQuery " +e); + } finally { + try{ + loadPstmt.close(); + conn.close(); + } catch(Exception e) { + // ignore exception + logger.log(BasicLevel.ERROR, "ejbFindByPrimaryKey: Ignore exception:"+e); + } + } + return (pkV.elements()); + } + + public String ejbFindOneByNum(int numTest) + throws ObjectNotFoundException, FinderException { + logger.log(BasicLevel.DEBUG, "numTest=" + numTest); + throw new FinderException(); + } + + public Collection ejbFindInCollection() throws FinderException { + logger.log(BasicLevel.DEBUG, ""); + PreparedStatement loadPstmt = null; + Connection conn = null; + Vector pkV = new Vector(); + try { + conn = getConnection(); + loadPstmt = conn.prepareStatement("select c_testname from "+tableName+" where c_numtest =?"); + loadPstmt.setInt(1, 8); + ResultSet rs = loadPstmt.executeQuery(); + while (rs.next()) { + String pk = rs.getString(1); + pkV.addElement(pk); + } + } catch (SQLException e) { + throw new javax.ejb.FinderException("Failed to executeQuery " +e); + } finally { + try{ + loadPstmt.close(); + conn.close(); + } catch(Exception e) { + // ignore exception + logger.log(BasicLevel.ERROR, "ejbFindByPrimaryKey: Ignore exception:"+e); + } + } + return (pkV); + } + + public Enumeration ejbFindInfo_beetwen(int p1, int p2) throws FinderException { + logger.log(BasicLevel.DEBUG, ""); + Vector pkC = new Vector(); + Connection conn = null; + PreparedStatement loadPstmt = null; + try { + conn = getConnection(); + loadPstmt = conn.prepareStatement("select c_testname from "+tableName+" where ?<=c_info and c_info<=? and ?<=c_numtest and c_numtest<=?"); + loadPstmt.setInt(1, p1); + loadPstmt.setInt(2, p2); + loadPstmt.setInt(3, p1); + loadPstmt.setInt(4, p2); + + ResultSet rs = loadPstmt.executeQuery(); + while (rs.next()) { + String pk = rs.getString(1); + pkC.addElement(pk); + } + } catch (Exception e) { + throw new javax.ejb.FinderException("Failed to find bean from database (findInfo_beetwen)"); + } finally { + try{ + loadPstmt.close(); + conn.close(); + } catch(Exception e) { + // ignore exception + logger.log(BasicLevel.ERROR, "ejbFindByPrimaryKey: Ignore exception:"+e); + } + } + return(pkC.elements()); + } + + public Enumeration ejbFindEqualOne(int p1) throws FinderException { + logger.log(BasicLevel.DEBUG, ""); + Vector pkC = new Vector(); + Connection conn = null; + PreparedStatement loadPstmt = null; + try { + conn = getConnection(); + loadPstmt = conn.prepareStatement("select c_testname from "+tableName+" where c_info = ? and c_numtest = ?"); + loadPstmt.setInt(1, p1); + loadPstmt.setInt(2, p1); + + ResultSet rs = loadPstmt.executeQuery(); + while (rs.next()) { + String pk = rs.getString(1); + pkC.addElement(pk); + } + } catch (Exception e) { + throw new javax.ejb.FinderException("Failed to find bean from database (findInfo_beetwen)"); + } finally { + try{ + loadPstmt.close(); + conn.close(); + } catch(Exception e) { + // ignore exception + logger.log(BasicLevel.ERROR, "ejbFindByPrimaryKey: Ignore exception:"+e); + } + } + return(pkC.elements()); + } + + public Enumeration ejbFindEqualTwo(int p1, int p2) throws FinderException { + logger.log(BasicLevel.DEBUG, ""); + Vector pkC = new Vector(); + Connection conn = null; + PreparedStatement loadPstmt = null; + try { + conn = getConnection(); + loadPstmt = conn.prepareStatement("select c_testname from "+tableName+" where c_info = ? and c_numtest = ?"); + loadPstmt.setInt(1, p1); + loadPstmt.setInt(2, p2); + + ResultSet rs = loadPstmt.executeQuery(); + while (rs.next()) { + String pk = rs.getString(1); + pkC.addElement(pk); + } + } catch (Exception e) { + throw new javax.ejb.FinderException("Failed to find bean from database (findInfo_beetwen)"); + } finally { + try{ + loadPstmt.close(); + conn.close(); + } catch(Exception e) { + // ignore exception + logger.log(BasicLevel.ERROR, "ejbFindByPrimaryKey: Ignore exception:"+e); + } + } + // Try to access TimerService and PK: Should get IllegalStateException. + if (entityContext != null) { + try { + entityContext.getTimerService(); + throw new FinderException("Should not get TimerService from a finder method"); + } catch (IllegalStateException e) { + logger.log(BasicLevel.DEBUG, "IllegalStateException has been thrown"); + } + try { + entityContext.getPrimaryKey(); + throw new FinderException("Should not get PK from a finder method"); + } catch (IllegalStateException e) { + logger.log(BasicLevel.DEBUG, "IllegalStateException has been thrown"); + } + } + return(pkC.elements()); + } + + private Connection getConnection() throws java.sql.SQLException { + if (dataSource == null) { + // Finds DataSource from JNDI + Context initialContext = null; + try { + initialContext = new InitialContext(); + dataSource = (DataSource)initialContext.lookup("java:comp/env/jdbc/BMP"); + } catch (Exception e) { + throw new javax.ejb.EJBException("Pb with naming context "); + } + } + Connection ret = dataSource.getConnection(); + if (ret == null) { + throw new javax.ejb.EJBException("dataSource.getConnection() returned null"); + } + return ret; + } + + // Just to test we can define a method named 'ejbSelect' (see bug #522) + public void ejbSelect() { + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/SimpleEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/SimpleEC.java new file mode 100644 index 0000000000000000000000000000000000000000..0d51278c96632673c75ec59f4629f331c43cae51 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/SimpleEC.java @@ -0,0 +1,80 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.ebasic; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * This is an entity bean with "container managed persistence version 1.x". + * The state of an instance is stored into a relational database. + * The following table should exist : + * ebasicSimpleEC + * c_testname varchar(30) primarey key + * c_info integer + * c_numtest integer + * @author Philippe Durieux, Philippe Coq, Helene Joanin + */ + +public class SimpleEC extends SimpleEC2 implements EntityBean { + + // State of the bean (CMP v1) + public int info; + public int numtest; + public String testname; + + + // Accessors and setters implementation + + public int getInfo() { + logger.log(BasicLevel.DEBUG, ""); + return info; + } + public void setInfo(int info) { + logger.log(BasicLevel.DEBUG, ""); + this.info = info; + } + + public int getNumTest() { + logger.log(BasicLevel.DEBUG, ""); + return numtest; + } + public void setNumTest(int num) { + logger.log(BasicLevel.DEBUG, ""); + this.numtest = num; + } + + public String getTestName() { + logger.log(BasicLevel.DEBUG, ""); + return testname; + } + public void setTestName(String name) { + logger.log(BasicLevel.DEBUG, ""); + this.testname = name; + } +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/SimpleEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/SimpleEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..c05ad1b0c24bcdff6b100611e7ba301e3f313ff2 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/SimpleEC2.java @@ -0,0 +1,170 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.ebasic; + +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EntityBean; +import javax.ejb.EntityContext; +import javax.ejb.RemoveException; + +import org.objectweb.jonas.common.Log; +import org.objectweb.util.monolog.api.BasicLevel; +import org.objectweb.util.monolog.api.Logger; + + +/** + * This is an entity bean with "container managed persistence version 2.x". + * The state of an instance is stored into a relational database. + * The following table should exist : + * ebasicSimpleEC2 + * c_testname varchar(30) primarey key + * c_info integer + * c_numtest integer + * @author Philippe Coq, Philippe Durieux, Helene Joanin + */ + +public abstract class SimpleEC2 implements EntityBean { + + static protected Logger logger = null; + + protected EntityContext entityContext; + + + // Get and Set accessor methods of the bean's abstract schema + public abstract int getInfo(); + public abstract void setInfo(int info); + + public abstract int getNumTest(); + public abstract void setNumTest(int numtest); + + public abstract String getTestName(); + public abstract void setTestName(String testname); + + + public void ejbActivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbPassivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbLoad() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbStore() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbRemove() throws RemoveException { + logger.log(BasicLevel.DEBUG, ""); + } + + public void setEntityContext(EntityContext ctx) { + if (logger == null) + logger = Log.getLogger(Log.JONAS_TESTS_PREFIX); + logger.log(BasicLevel.DEBUG, ""); + entityContext = ctx; + + } + + public void unsetEntityContext() { + logger.log(BasicLevel.DEBUG, ""); + } + + public String ejbCreate(String name, int info, int num) throws CreateException { + logger.log(BasicLevel.DEBUG, "create"+info+","+name+","+num); + setInfo(info); + setNumTest(num); + setTestName(name); + return(null); + } + + public void ejbPostCreate(String name, int info, int num) { + logger.log(BasicLevel.DEBUG, ""); + } + + /** + * loop back on the same bean instance. + * This is forbidden when bean is non reentrant. + * @return true if test passed. + * @throws RemoteException + */ + public boolean loopBack() throws RemoteException { + logger.log(BasicLevel.DEBUG, ""); + boolean pass = false; + Simple myref = (Simple) entityContext.getEJBObject(); + try { + myref.getNumTest(); + } catch (RemoteException e) { + logger.log(BasicLevel.DEBUG, "expected exception:" + e); + pass = true; + } + return pass; + } + + /** + * loop back on the same bean instance. + * This is forbidden when bean is non reentrant. + * @return true if test passed. + * @throws RemoteException + */ + public boolean loopBackTx() throws RemoteException { + logger.log(BasicLevel.DEBUG, ""); + boolean pass = false; + Simple myref = (Simple) entityContext.getEJBObject(); + try { + myref.getNumTest(); + } catch (RemoteException e) { + logger.log(BasicLevel.DEBUG, "expected exception:" + e); + pass = true; + } + return pass; + } + + /** + * Check the set of allowed operations + * See EJB 2.1 spec - 12.1.6 + */ + public void ejbHomeGlobalOpe() throws RemoteException { + logger.log(BasicLevel.DEBUG, ""); + if (entityContext == null) { + throw new RemoteException("null entityContext"); + } + entityContext.getEJBHome(); + // This bean has no local interface + try { + entityContext.getEJBLocalHome(); + } catch (IllegalStateException e) { + } + entityContext.getCallerPrincipal(); + entityContext.getRollbackOnly(); + entityContext.isCallerInRole("role"); + entityContext.getTimerService(); + } +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/SimpleHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/SimpleHome.java new file mode 100644 index 0000000000000000000000000000000000000000..f1ee029814c69a2280837c3caae526ea0d175bbb --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/SimpleHome.java @@ -0,0 +1,49 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// SimpleHome.java + +package org.objectweb.jonas.jtests.beans.ebasic; + +import java.util.Enumeration; +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + +public interface SimpleHome extends EJBHome { + public Simple create(String name, int info, int num) throws RemoteException, CreateException; + public Simple findByTestName(String name) throws RemoteException, FinderException; + public Simple findByName(String name) throws RemoteException, FinderException; + public Simple findByPrimaryKey(String name) throws RemoteException, FinderException; + public Enumeration findInfoForNum(int numtest) throws RemoteException, FinderException; + public Collection findInCollection() throws RemoteException, FinderException; + public Enumeration findInfo_beetwen(int v1, int v2) throws FinderException, RemoteException; + public Enumeration findEqualOne(int v) throws FinderException, RemoteException; + public Enumeration findEqualTwo(int v1, int v2) throws FinderException, RemoteException; + public Simple findOneByNum(int numtest) throws FinderException, RemoteException; + public void globalOpe() throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/ebasic.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/ebasic.xml new file mode 100644 index 0000000000000000000000000000000000000000..18456af1d4fdd60fd26864d4eb9527e7fcfb8430 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/ebasic.xml @@ -0,0 +1,676 @@ + + + + + + ebasic + + + + + Entity Bean with PK java.util.Date + ebasic/BDateEC2 + BDateEC2 + org.objectweb.jonas.jtests.beans.ebasic.BDateHome + org.objectweb.jonas.jtests.beans.ebasic.BDate + org.objectweb.jonas.jtests.beans.ebasic.BDateEC2 + Container + java.util.Date + False + jt2_bdate + + field1 + + + field2 + + + field3 + + field3 + + + + ebasic/SimpleEC + SimpleEC + org.objectweb.jonas.jtests.beans.ebasic.SimpleHome + org.objectweb.jonas.jtests.beans.ebasic.Simple + org.objectweb.jonas.jtests.beans.ebasic.SimpleEC + Container + java.lang.String + False + 1.x + + info + + + numtest + + + testname + + testname + + + + ebasic/SimpleEC2 + SimpleEC2 + org.objectweb.jonas.jtests.beans.ebasic.SimpleHome + org.objectweb.jonas.jtests.beans.ebasic.Simple + org.objectweb.jonas.jtests.beans.ebasic.SimpleEC2 + Container + java.lang.String + False + 2.x + jt2_simple + + info + + + numTest + + + testName + + testName + + + findByTestName + + java.lang.String + + + SELECT OBJECT(o) FROM jt2_simple o WHERE o.testName = ?1 + + + + + findByName + + java.lang.String + + + SELECT OBJECT(o) FROM jt2_simple o WHERE o.testName = ?1 + + + + + findInfoForNum + + int + + + SELECT OBJECT(o) FROM jt2_simple o WHERE o.numTest = ?1 + + + + + findInCollection + + + SELECT OBJECT(o) FROM jt2_simple o WHERE o.numTest = 8 + + + + + findInfo_beetwen + + int + int + + + SELECT OBJECT(o) FROM jt2_simple o WHERE (o.info BETWEEN ?1 AND ?2) AND (o.numTest BETWEEN ?1 AND ?2) + + + + + findEqualOne + + int + + + SELECT OBJECT(o) FROM jt2_simple o WHERE o.info = ?1 AND o.numTest = ?1 + + + + + findEqualTwo + + int + int + + + SELECT OBJECT(o) FROM jt2_simple o WHERE o.info = ?1 AND o.numTest = ?2 + + + + + findOneByNum + + int + + + SELECT OBJECT(o) FROM jt2_simple o WHERE o.numTest = ?1 + + + + + + ebasic/SimpleEB + SimpleEB + org.objectweb.jonas.jtests.beans.ebasic.SimpleHome + org.objectweb.jonas.jtests.beans.ebasic.Simple + org.objectweb.jonas.jtests.beans.ebasic.SimpleEB + Bean + java.lang.String + False + + jdbc/BMP + javax.sql.DataSource + Container + + + + + Entity BMP with the shared attribute + ebasic/SharedEB + SharedEB + org.objectweb.jonas.jtests.beans.ebasic.SimpleHome + org.objectweb.jonas.jtests.beans.ebasic.Simple + org.objectweb.jonas.jtests.beans.ebasic.SimpleEB + Bean + java.lang.String + False + + jdbc/BMP + javax.sql.DataSource + Container + + + + + Entity with CMP v1 with a PK that maps a java.lang.Integer single field + account/AccountEC + AccountEC + org.objectweb.jonas.jtests.beans.ebasic.AccountHome + org.objectweb.jonas.jtests.beans.ebasic.Account + org.objectweb.jonas.jtests.beans.ebasic.AccountEC + Container + java.lang.Integer + False + 1.x + + number + + + customer + + number + + + + Entity with CMP v2 with a PK that maps a java.lang.Integer single field + ebasic/AccountEC2 + AccountEC2 + org.objectweb.jonas.jtests.beans.ebasic.AccountHome + org.objectweb.jonas.jtests.beans.ebasic.Account + org.objectweb.jonas.jtests.beans.ebasic.AccountEC2 + Container + java.lang.Integer + False + 2.x + jt2_account + + number + + + customer + + number + + + findByNumber + + int + + + SELECT OBJECT(o) FROM jt2_account o WHERE o.number = ?1 + + + + findAll + + + SELECT OBJECT(o) FROM jt2_account o + + + + + Entity with CMP v1 with an unknown pk class at the development phase + ebasic/PersonEC + PersonEC + org.objectweb.jonas.jtests.beans.ebasic.PersonHome + org.objectweb.jonas.jtests.beans.ebasic.Person + org.objectweb.jonas.jtests.beans.ebasic.PersonEC + Container + java.lang.Integer + False + 1.x + + name + + + number + + number + + + + Entity with CMP v2 with an unknown pk class at the development phase + ebasic/PersonEC2 + PersonEC2 + org.objectweb.jonas.jtests.beans.ebasic.PersonHome + org.objectweb.jonas.jtests.beans.ebasic.Person + org.objectweb.jonas.jtests.beans.ebasic.PersonEC2 + Container + java.lang.Integer + False + 2.x + jt2_person + + name + + + number + + number + + + findByNumber + + int + + + SELECT OBJECT(o) FROM jt2_person o WHERE o.number = ?1 + + + + findByName + + java.lang.String + + + SELECT OBJECT(o) FROM jt2_person o WHERE o.name = ?1 + + + + findAll + + + SELECT OBJECT(o) FROM jt2_person o + + + + + ebasic/E4QueryEC2 + E4QueryEC2 + org.objectweb.jonas.jtests.beans.ebasic.E4QueryHome + org.objectweb.jonas.jtests.beans.ebasic.E4Query + org.objectweb.jonas.jtests.beans.ebasic.E4QueryEC2 + Container + java.lang.String + False + 2.x + jt2_e4query + + id + + + fstring + + + fint + + + fdouble + + id + + + findByLengthString + + int + + + SELECT OBJECT(o) FROM jt2_e4query o WHERE LENGTH(o.fstring) = ?1 + + + + findByLocateString + + java.lang.String + + + SELECT OBJECT(o) FROM jt2_e4query o WHERE LOCATE(?1, o.fstring) > 0 + + + + findByLocateStringAt + + java.lang.String + int + + + SELECT OBJECT(o) FROM jt2_e4query o WHERE LOCATE(?1, o.fstring, ?2) > 0 + + + + findBySubstring + + java.lang.String + int + int + + + SELECT OBJECT(o) FROM jt2_e4query o WHERE SUBSTRING(o.fstring, ?2, ?3) = ?1 + + + + findByConcatString + + java.lang.String + + + SELECT OBJECT(o) FROM jt2_e4query o WHERE CONCAT(o.id, o.fstring) = ?1 + + + + findByAbsInt + + int + + + SELECT OBJECT(o) FROM jt2_e4query o WHERE ABS(o.fint) = ?1 + + + + findBySqrtDouble + + double + + + SELECT OBJECT(o) FROM jt2_e4query o WHERE SQRT(o.fdouble) BETWEEN ?1 - 0.1 AND ?1 + 0.1 + + + + findByIsNull + + + + SELECT OBJECT(o) FROM jt2_e4query o WHERE o.fstring IS NULL + + + + findByIsNullParam + + java.lang.String + + + SELECT OBJECT(o) FROM jt2_e4query o WHERE ?1 IS NULL + + + + findByInStrings + + + + SELECT OBJECT(o) FROM jt2_e4query o WHERE o.fstring IN ('helene', 'eric') + + + + findByLessThanMinus100 + + + + + + + + findByIntEqualExpr + + int + int + int + + + SELECT OBJECT(o) FROM jt2_e4query o WHERE o.fint = (?1 + ?2 - ?3) + + + + findByIntEqualExpr2 + + int + int + int + + + SELECT OBJECT(o) FROM jt2_e4query o WHERE o.fint = (?1 - ?2 - ?3) + + + + findByStringGreaterThenExpr + + java.lang.String + + + ?1 ]]> + + + + findByStringGreaterOrEqualThenExpr + + java.lang.String + + + = ?1 ]]> + + + + findByIntModXIsZero + + int + + + + + + + + ebasic/pkautoObjectEC2 + ebasic/pkautoObjectEC2 + pkautoObjectEC2 + org.objectweb.jonas.jtests.beans.ebasic.pkautoObjectHome + org.objectweb.jonas.jtests.beans.ebasic.pkautoObject + org.objectweb.jonas.jtests.beans.ebasic.pkautoObjectEC2 + Container + java.lang.Object + False + jt2_pkautocmp2 + + field1 + + + field2 + + + name1 + java.lang.String + value1 + + + noValueEnvEntry + java.lang.String + + + + findAll + + + SELECT OBJECT(c) FROM jt2_pkautocmp2 AS c + + + + findByField1 + int + + SELECT OBJECT(c) FROM jt2_pkautocmp2 c WHERE c.field1 = ?1 + + + + + ebasic/pkautoObjectEC + ebasic/pkautoObjectEC + pkautoObjectEC + org.objectweb.jonas.jtests.beans.ebasic.pkautoObjectHome + org.objectweb.jonas.jtests.beans.ebasic.pkautoObject + org.objectweb.jonas.jtests.beans.ebasic.pkautoObjectEC + Container + java.lang.Object + False + 1.x + + field1 + + + field2 + + + + + + + + + + + SimpleEC + * + + + SimpleEC2 + * + + + SimpleEB + * + + + SharedEB + * + + + BDateEC2 + * + + Supports + + + + + SimpleEC + globalOpe + + + SimpleEC + loopBackTx + + + SimpleEC2 + globalOpe + + + SimpleEC2 + loopBackTx + + + SimpleEB + globalOpe + + + SimpleEB + loopBackTx + + + SharedEB + globalOpe + + + SharedEB + loopBackTx + + + AccountEC + * + + + AccountEC2 + * + + + PersonEC + * + + + PersonEC2 + * + + + E4QueryEC2 + * + + + pkautoEC2 + * + + + pkautoEC + * + + + pkautoObjectEC2 + * + + + pkautoObjectEC + * + + Required + + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/jonas-ebasic.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/jonas-ebasic.xml new file mode 100644 index 0000000000000000000000000000000000000000..64b0c40d759d2eb8caa930261658536caa6546c8 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/jonas-ebasic.xml @@ -0,0 +1,303 @@ + + + + + SimpleEC + ebasicSimpleECHome + container-serialized + + jdbc_1 + ebasicSimpleEC + + info + c_info + + + testname + c_testname + + + numtest + c_numtest + + + + + findByTestName + + where c_testname = ? + + + + + findByName + + where c_testname = ? + + + + + findInfoForNum + + where c_numtest = ? + + + + findInCollection + + where c_numtest = 8 + + + + findInfo_beetwen + + where ?1 <= c_info and c_info <= ?2 + and ?1 <= c_numtest and c_numtest <= ?2 + + + + + findEqualOne + + where c_info = ?1 and c_numtest = ?1 + + + + findEqualTwo + + where c_info = ? and c_numtest = ? + + + + findOneByNum + + where c_numtest = ? + + + + + + BDateEC2 + ebasicBDateEC2Home + removeall + container-serialized + + jdbc_1 + + + + + SimpleEC2 + ebasicSimpleEC2Home + removeall + container-serialized + + jdbc_1 + + + + + SimpleEB + ebasicSimpleEBHome + container-serialized + + jdbc/BMP + jdbc_1 + + + + + SharedEB + ebasicSharedEBHome + + jdbc/BMP + jdbc_1 + + true + container-serialized-transacted + + + + AccountEC + ebasicAccountECHome + + + jdbc_1 + ebasicAccountEC + + + number + c_number + + + customer + c_customer + + + + + findByNumber + + where c_number = ? + + + + findAll + + + + + + + + + + AccountEC2 + ebasicAccountEC2Home + removeall + container-serialized + + jdbc_1 + + + + + PersonEC + ebasicPersonECHome + + + jdbc_1 + ebasicPersonEC + + + name + c_name + + + number + c_number + + + + + findByNumber + + where c_number = ? + + + + findByName + + where c_name = ? + + + + findAll + + + + + + + + + + PersonEC2 + ebasicPersonEC2Home + removeall + container-serialized + + jdbc_1 + + + + + SimpleEC2 + ebasicSimpleEC2Home + removeall + container-serialized + + jdbc_1 + + + + + E4QueryEC2 + ebasicE4QueryEC2Home + removeall + container-serialized + + jdbc_1 + + + + + pkautoObjectEC2 + pkautoobjectcmp2Home + removeall + container-serialized + + jdbc_1 + pkautoincrementee + + + + + pkautoObjectEC + pkautoobjectcmp1Home + removeall + + jdbc_1 + jt2_pkautoobjectec + pkautoincrementee + + field1 + c_field1 + + + field2 + c_field2 + + + + findByField1 + + where c_field1 = ? + + + + findAll + + + + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/pkautoObject.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/pkautoObject.java new file mode 100644 index 0000000000000000000000000000000000000000..faf6bc98d70f91b1d0472d2fdeca431d0ceb106c --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/pkautoObject.java @@ -0,0 +1,42 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * --------------------------------------------------------------------------$ + * -------------------------------------------------------------------------- + */ + + +package org.objectweb.jonas.jtests.beans.ebasic; + +import java.rmi.RemoteException; + +import javax.ejb.EJBObject; + +/** + * pkautoObject remote interface + */ +public interface pkautoObject extends EJBObject { + public int getField1() throws RemoteException; + public void setField1(int f1) throws RemoteException; + + public int getField2() throws RemoteException; + public void setField2(int f2) throws RemoteException; + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/pkautoObjectEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/pkautoObjectEC.java new file mode 100644 index 0000000000000000000000000000000000000000..076df09ff38360777ab914d8ab08a0e9069d27a5 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/pkautoObjectEC.java @@ -0,0 +1,64 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * --------------------------------------------------------------------------$ + * -------------------------------------------------------------------------- + */ + +/** + * This is an entity bean with "container managed persistence version 1.x". + * This bean is used to test an entity with auto generated primary key + * @author Jerome Camilleri + */ +package org.objectweb.jonas.jtests.beans.ebasic; + + +/** + * + */ +public class pkautoObjectEC extends pkautoObjectEC2 implements javax.ejb.EntityBean { + + + // ------------------------------------------------------------------ + // State of the bean. + // ------------------------------------------------------------------ + public int field1; + public int field2; + + // ------------------------------------------------------------------ + // Accessor for CMP fields + // ------------------------------------------------------------------ + public int getField1() { + return field1; + } + public void setField1(int f1) { + field1 = f1; + } + public int getField2() { + return field2; + } + public void setField2(int f2) { + field2 = f2; + } + +} + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/pkautoObjectEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/pkautoObjectEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..87be39663af95f4ad4a84008e8b6ce8f827ded06 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/pkautoObjectEC2.java @@ -0,0 +1,104 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * --------------------------------------------------------------------------$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.ebasic; + +import org.objectweb.jonas.common.Log; +import org.objectweb.util.monolog.api.Logger; +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * This is an entity bean with "container managed persistence version 2". + * This bean is used to test an entity with auto generated primary key + * @author Jerome Camilleri + */ +public abstract class pkautoObjectEC2 implements javax.ejb.EntityBean { + + static protected Logger logger = null; + javax.ejb.EntityContext ejbContext; + + + public java.lang.Object ejbCreate(int f1, int f2) throws javax.ejb.CreateException { + logger.log(BasicLevel.DEBUG, ""); + + // Init here the bean fields + setField1(f1); + setField2(f2); + return null; + } + + public void ejbPostCreate(int f1, int f2) { + logger.log(BasicLevel.DEBUG, ""); + } + + // ------------------------------------------------------------------ + // Abstract Accessor methods for Persistent fields + // ------------------------------------------------------------------ + public abstract int getField1(); + public abstract void setField1(int f1); + + public abstract int getField2(); + public abstract void setField2(int f2); + + // ------------------------------------------------------------------ + // Standard call back methods + // ------------------------------------------------------------------ + + public void setEntityContext(javax.ejb.EntityContext ctx) { + if (logger == null) { + logger = Log.getLogger("org.objectweb.jonas_tests"); + } + logger.log(BasicLevel.DEBUG, ""); + ejbContext = ctx; + } + + public void unsetEntityContext() { + logger.log(BasicLevel.DEBUG, ""); + ejbContext = null; + } + + public void ejbRemove() throws javax.ejb.RemoveException { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbLoad() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbStore() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbPassivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbActivate() { + logger.log(BasicLevel.DEBUG, ""); + } + +} + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/pkautoObjectHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/pkautoObjectHome.java new file mode 100644 index 0000000000000000000000000000000000000000..cead02a7c2b43d8f362f5d982cd914422ed75c19 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ebasic/pkautoObjectHome.java @@ -0,0 +1,41 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * --------------------------------------------------------------------------$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.ebasic; + +import java.rmi.RemoteException; +import java.util.Collection; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + +/** + * Home interface for the bean pkauto + */ +public interface pkautoObjectHome extends EJBHome { + pkautoObject create(int f1, int f2) throws CreateException, RemoteException; + pkautoObject findByPrimaryKey(java.lang.Object pk) throws FinderException, RemoteException; + pkautoObject findByField1(int f1) throws FinderException, RemoteException; + Collection findAll() throws FinderException, RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/AddressBean.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/AddressBean.java new file mode 100644 index 0000000000000000000000000000000000000000..4280a20688fe44f6ff1adf4f6add250d90626d29 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/AddressBean.java @@ -0,0 +1,104 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; + +import javax.ejb.EntityContext; +import javax.ejb.FinderException; +import javax.naming.InitialContext; + + +public abstract class AddressBean implements javax.ejb.EntityBean { + + private SequenceSessionLocalHome seqHome = null; + private SequenceSessionLocal seqLocal = null; + + public Integer ejbCreateAddress(String street, String city, String state, String zip ) + throws javax.ejb.CreateException { + setStreet(street); + setCity(city); + setState(state); + setZip(zip); + int id = seqLocal.getNextNumberInSequence("Address"); + setId(new Integer(id)); + return null; + } + + public void ejbPostCreateAddress (String street, String city,String state, String zip){ + } + + // persistent fields + public abstract Integer getId(); + public abstract void setId(Integer id); + public abstract String getStreet(); + public abstract void setStreet(String street); + public abstract String getCity(); + public abstract void setCity(String city); + public abstract String getState(); + public abstract void setState(String state); + public abstract String getZip(); + public abstract void setZip(String zip); + + // abstract ejbSelect() methods + public abstract long ejbSelectCountOfCities() throws FinderException; + public abstract long ejbSelectCountOfDistinctCities() throws FinderException; + public abstract Collection ejbSelectCities() throws FinderException; + public abstract Collection ejbSelectCreditCompanies() throws FinderException; + public abstract Collection ejbSelectCreditCompanyNames() throws FinderException; + public abstract Collection ejbSelectCreditCompanyIds() throws FinderException; + public abstract Collection ejbSelectCreditCompanyNums() throws FinderException; + + // Public Home method required to test the private ejbSelectXXXX method + public long ejbHomeGetCountOfCities() throws FinderException { + return this.ejbSelectCountOfCities(); + } + public long ejbHomeGetCountOfDistinctCities() throws FinderException { + return this.ejbSelectCountOfDistinctCities(); + } + public Collection ejbHomeGetAllCities() throws FinderException { + return this.ejbSelectCities(); + } + public Collection ejbHomeGetAllCreditCompanies() throws FinderException { + Collection ccs = this.ejbSelectCreditCompanies(); + Iterator iCCs = ccs.iterator(); + ArrayList ccsId = new ArrayList(); + while (iCCs.hasNext()) { + CreditCompanyLocal cclb = (CreditCompanyLocal) iCCs.next(); + if (cclb != null) { + ccsId.add(cclb.getId()); + } + } + return ccsId; + } + public Collection ejbHomeGetAllCreditCompanyNames() throws FinderException { + return this.ejbSelectCreditCompanyNames(); + } + public Collection ejbHomeGetAllCreditCompanyIds() throws FinderException { + return this.ejbSelectCreditCompanyIds(); + } + public Collection ejbHomeGetAllCreditCompanyNums() throws FinderException { + return this.ejbSelectCreditCompanyNums(); + } + + // standard call back methods + public void setEntityContext(EntityContext ec){ + try { + InitialContext cntx = new InitialContext( ); + SequenceSessionLocalHome seqHome = + (SequenceSessionLocalHome)cntx.lookup("java:comp/env/ejb/SequenceSessionLocalHome"); + seqLocal = seqHome.create(); + } catch(Exception e) { + throw new javax.ejb.EJBException(e); + } + + } + + public void unsetEntityContext(){} + public void ejbLoad(){} + public void ejbStore(){} + public void ejbActivate(){} + public void ejbPassivate(){} + public void ejbRemove() throws javax.ejb.RemoveException{} + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/AddressDO.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/AddressDO.java new file mode 100644 index 0000000000000000000000000000000000000000..9edb240c144cafd32c7ca22e98e012cbc6a34103 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/AddressDO.java @@ -0,0 +1,29 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +public class AddressDO implements java.io.Serializable { + + private String street; + private String city; + private String state; + private String zip; + + public AddressDO(String street, String city, + String state, String zip ) { + this.street = street; + this.city = city; + this.state = state; + this.zip = zip; + } + public String getStreet(){ + return street; + } + public String getCity(){ + return city; + } + public String getState(){ + return state; + } + public String getZip(){ + return zip; + } +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/AddressHomeLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/AddressHomeLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..fb5c916d8a48ff118d30baf3882dce39837d6605 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/AddressHomeLocal.java @@ -0,0 +1,16 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.util.Collection; + +// Address EJB's local home interface +public interface AddressHomeLocal extends javax.ejb.EJBLocalHome { + + public AddressLocal createAddress(String street, String city, String state, String zip ) + throws javax.ejb.CreateException; + + public AddressLocal findByPrimaryKey(Integer primaryKey) + throws javax.ejb.FinderException; + + public Collection findAllAddress() + throws javax.ejb.FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/AddressHomeRemote.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/AddressHomeRemote.java new file mode 100644 index 0000000000000000000000000000000000000000..49664e7ecbc5efbf99bf1550435f5560b446956f --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/AddressHomeRemote.java @@ -0,0 +1,39 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.rmi.RemoteException; +import java.util.Collection; + + +// Address EJB's remote home interface +public interface AddressHomeRemote extends javax.ejb.EJBHome { + + public AddressRemote createAddress(String street, String city, String state, String zip ) + throws javax.ejb.CreateException, RemoteException; + + public AddressRemote findByPrimaryKey(Integer primaryKey) + throws javax.ejb.FinderException, RemoteException; + + public AddressRemote findQuery300626() + throws javax.ejb.FinderException, RemoteException; + + + public Collection findAllAddress() + throws javax.ejb.FinderException, RemoteException; + + public long getCountOfCities() throws javax.ejb.FinderException, RemoteException; + + public long getCountOfDistinctCities() throws javax.ejb.FinderException, RemoteException; + + public Collection getAllCities() + throws javax.ejb.FinderException, RemoteException; + public Collection getAllCreditCompanies() + throws javax.ejb.FinderException, RemoteException; + public Collection getAllCreditCompanyNames() + throws javax.ejb.FinderException, RemoteException; + public Collection getAllCreditCompanyIds() + throws javax.ejb.FinderException, RemoteException; + public Collection getAllCreditCompanyNums() + throws javax.ejb.FinderException, RemoteException; + +} + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/AddressLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/AddressLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..a813dbb99759c7c88691e94c11db3d42b8b427be --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/AddressLocal.java @@ -0,0 +1,14 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +// Address EJB's local interface +public interface AddressLocal extends javax.ejb.EJBLocalObject { + public Integer getId(); + public String getStreet(); + public void setStreet(String street); + public String getCity(); + public void setCity(String city); + public String getState(); + public void setState(String state); + public String getZip(); + public void setZip(String zip); +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/AddressRemote.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/AddressRemote.java new file mode 100644 index 0000000000000000000000000000000000000000..5cb22340eceeba144b3a3dc3523dd0f2be21ef9c --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/AddressRemote.java @@ -0,0 +1,9 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.rmi.RemoteException; + + +public interface AddressRemote extends javax.ejb.EJBObject { + + public Integer getId() throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CabinBean.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CabinBean.java new file mode 100644 index 0000000000000000000000000000000000000000..4f2605fdb9584e666064e5c13760be420dbce882 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CabinBean.java @@ -0,0 +1,71 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import javax.ejb.EntityContext; +import javax.ejb.FinderException; +import org.objectweb.jonas.jtests.beans.ejbql.ShipLocal; + +public abstract class CabinBean implements javax.ejb.EntityBean { + + public Integer ejbCreate(Integer id) throws javax.ejb.CreateException { + this.setId(id); + return null; + } + public void ejbPostCreate(Integer id){ + + } + public abstract void setId(Integer id); + public abstract Integer getId(); + + public abstract void setShip(ShipLocal ship); + public abstract ShipLocal getShip( ); + + public abstract void setName(String name); + public abstract String getName( ); + + public abstract void setBedCount(int count); + public abstract int getBedCount( ); + + public abstract void setDeckLevel(int level); + public abstract int getDeckLevel( ); + + // abstract ejbSelect() methods + public abstract int ejbSelectDeckLevel(Integer i) throws FinderException; + + + public int getShipId() { + return getShip().getId().intValue(); + } + + public void setShipId(int sp) { + ShipLocal sl = getShip( ); + sl.setId(new Integer(sp)); + setShip(sl); + } + + // Public Home method required to test the private ejbSelectXXXX method + public int ejbHomeSelectDeckLevel(Integer id) throws FinderException { + return this.ejbSelectDeckLevel(id); + } + + public void setEntityContext(EntityContext ctx) { + // Not implemented. + } + public void unsetEntityContext() { + // Not implemented. + } + public void ejbActivate() { + // Not implemented. + } + public void ejbPassivate() { + // Not implemented. + } + public void ejbLoad() { + // Not implemented. + } + public void ejbStore() { + // Not implemented. + } + public void ejbRemove() throws javax.ejb.RemoveException { + // Not implemented. + } +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CabinHomeLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CabinHomeLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..25fb269d7468a040f1ee9782b791df17bcbca8ad --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CabinHomeLocal.java @@ -0,0 +1,22 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import javax.ejb.EJBException; +import javax.ejb.CreateException; +import javax.ejb.FinderException; +import java.util.Collection; + +public interface CabinHomeLocal extends javax.ejb.EJBLocalHome { + + public CabinLocal create(Integer id) + throws CreateException, EJBException; + + public CabinLocal findByPrimaryKey(Integer pk) + throws FinderException, EJBException; + + public Collection findAllOnDeckLevel(Integer level) + throws FinderException; + + public Collection findAllCabins() + throws FinderException; + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CabinHomeRemote.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CabinHomeRemote.java new file mode 100644 index 0000000000000000000000000000000000000000..e50a5c62c3c00771c476606c05541ac284952a45 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CabinHomeRemote.java @@ -0,0 +1,29 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.FinderException; +import java.util.Collection; + +public interface CabinHomeRemote extends javax.ejb.EJBHome { + + public CabinRemote create(Integer id) + throws CreateException, RemoteException; + + public CabinRemote findByPrimaryKey(Integer pk) + throws FinderException, RemoteException; + + public Collection findAllOnDeckLevel(Integer level) + throws FinderException, RemoteException; + + public Collection findAllOnDeckLevel1_3_5() + throws FinderException, RemoteException; + + public Collection findAllOnDeckLevel1_3_X(int levelX) + throws FinderException, RemoteException; + + // Home method, requires ejbHomeXXX method in bean class + public int selectDeckLevel(Integer id) + throws FinderException, RemoteException; + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CabinLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CabinLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..120959f727d81a418fd11511215260347a4e29c6 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CabinLocal.java @@ -0,0 +1,17 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import javax.ejb.EJBException; +import org.objectweb.jonas.jtests.beans.ejbql.ShipLocal; + +public interface CabinLocal extends javax.ejb.EJBLocalObject { + + public String getName() throws EJBException; + public void setName(String str) throws EJBException; + public int getDeckLevel() throws EJBException; + public void setDeckLevel(int level) throws EJBException; + public ShipLocal getShip(); + public void setShip(ShipLocal ship); + public int getBedCount() throws EJBException; + public void setBedCount(int bc) throws EJBException; + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CabinRemote.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CabinRemote.java new file mode 100644 index 0000000000000000000000000000000000000000..7be7fad41da52dd159f473baa8891a2094f0e686 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CabinRemote.java @@ -0,0 +1,15 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.rmi.RemoteException; + +public interface CabinRemote extends javax.ejb.EJBObject { + public String getName() throws RemoteException; + public void setName(String str) throws RemoteException; + public int getDeckLevel() throws RemoteException; + public void setDeckLevel(int level) throws RemoteException; + public int getShipId() throws RemoteException; + public void setShipId(int sp) throws RemoteException; + public int getBedCount() throws RemoteException; + public void setBedCount(int bc) throws RemoteException; + public Integer getId() throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCardBean.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCardBean.java new file mode 100644 index 0000000000000000000000000000000000000000..e2d1f720a3bafa819ccc70d0e095b4878e925669 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCardBean.java @@ -0,0 +1,67 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.util.Date; + +import javax.ejb.EntityContext; +import javax.naming.InitialContext; + +public abstract class CreditCardBean implements javax.ejb.EntityBean { + private SequenceSessionLocalHome seqHome = null; + private SequenceSessionLocal seqLocal = null; + + public Object ejbCreate(Date exp, String numb, String name, String org) + throws javax.ejb.CreateException { + + + setExpirationDate(exp); + setNumber(numb); + setNameOnCard(name); + setCreditOrganization(org); + int id = seqLocal.getNextNumberInSequence("CreditCard"); + setId(new Integer(id)); + return null; + } + + public void ejbPostCreate(Date exp, String numb, String name, String org) { + } + + // relationship fields + + public abstract CustomerLocal getCustomer( ); + public abstract void setCustomer(CustomerLocal cust); + + public abstract CreditCompanyLocal getCreditCompany( ); + public abstract void setCreditCompany(CreditCompanyLocal cc); // persistent fields + + + public abstract Integer getId(); + public abstract void setId(Integer id); + public abstract Date getExpirationDate(); + public abstract void setExpirationDate(Date date); + public abstract String getNumber(); + public abstract void setNumber(String number); + public abstract String getNameOnCard(); + public abstract void setNameOnCard(String name); + public abstract String getCreditOrganization(); + public abstract void setCreditOrganization(String org); + + // standard call back methods + + public void setEntityContext(EntityContext ec){ + try { + InitialContext cntx = new InitialContext( ); + SequenceSessionLocalHome seqHome = + (SequenceSessionLocalHome)cntx.lookup("java:comp/env/ejb/SequenceSessionLocalHome"); + seqLocal = seqHome.create(); + } catch(Exception e) { + throw new javax.ejb.EJBException(e); + } + } + public void unsetEntityContext(){} + public void ejbLoad(){} + public void ejbStore(){} + public void ejbActivate(){} + public void ejbPassivate(){} + public void ejbRemove() throws javax.ejb.RemoveException{} + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCardHomeLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCardHomeLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..69d3d527e7695e70e3bc6b2fb06a6bc1e149f612 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCardHomeLocal.java @@ -0,0 +1,18 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.util.Collection; +import java.util.Date; + +import javax.ejb.FinderException; + +// CreditCard EJB's local home interface +public interface CreditCardHomeLocal extends javax.ejb.EJBLocalHome { + + public CreditCardLocal create(Date exp, String numb, String name, String org) + throws javax.ejb.CreateException; + + public CreditCardLocal findByPrimaryKey(Object primaryKey) + throws javax.ejb.FinderException; + + public Collection findAllCreditCards() throws FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCardHomeRemote.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCardHomeRemote.java new file mode 100644 index 0000000000000000000000000000000000000000..f28fc439b3709b729486d1d2bc2990aedaf0d918 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCardHomeRemote.java @@ -0,0 +1,21 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.util.Collection; +import java.util.Date; + +import javax.ejb.FinderException; + +// CreditCard EJB's Remote interface +public interface CreditCardHomeRemote extends javax.ejb.EJBHome { + + public CreditCardLocal create(Date exp, String numb, String name, String org) + throws javax.ejb.CreateException; + + public CreditCardLocal findByPrimaryKey(Object primaryKey) + throws javax.ejb.FinderException; + + public Collection findAllCreditCards() throws FinderException; + +} + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCardLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCardLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..ddf31fd18d9fc85564d7569bbf331324486162d4 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCardLocal.java @@ -0,0 +1,21 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.util.Date; + +// Credit Card EJB's local interface +public interface CreditCardLocal extends javax.ejb.EJBLocalObject { + + public Date getExpirationDate(); + public void setExpirationDate(Date date); + public String getNumber(); + public void setNumber(String number); + public String getNameOnCard(); + public void setNameOnCard(String name); + public String getCreditOrganization(); + public void setCreditOrganization(String org); + public void setCreditCompany(CreditCompanyLocal cc); + public CustomerLocal getCustomer(); + public void setCustomer(CustomerLocal cust); + +} + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCompanyBean.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCompanyBean.java new file mode 100644 index 0000000000000000000000000000000000000000..23a475cc4294845afd087cc7d589b6729b7bcba8 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCompanyBean.java @@ -0,0 +1,56 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import javax.ejb.CreateException; +import javax.ejb.EntityContext; +import javax.ejb.RemoveException; +import javax.naming.InitialContext; + +public abstract class CreditCompanyBean implements javax.ejb.EntityBean { + + private SequenceSessionLocal seqLocal = null; + + public Integer ejbCreate(String name) throws CreateException { + int id = seqLocal.getNextNumberInSequence("CreditCompany"); + setId(new Integer(id)); + setName(name); + setNum(id); + return null; + } + + public void ejbPostCreate( String name) { + } + + // persistent fields + + public abstract void setId(Integer id); + public abstract Integer getId(); + public abstract void setName(String name); + public abstract String getName( ); + public abstract void setNum(int num); + public abstract int getNum( ); + + // relationship fields + + public abstract AddressLocal getAddress( ); + public abstract void setAddress(AddressLocal cust); + + // standard call back methods + + public void setEntityContext(EntityContext ec){ + try { + InitialContext cntx = new InitialContext( ); + SequenceSessionLocalHome seqHome = + (SequenceSessionLocalHome)cntx.lookup("java:comp/env/ejb/SequenceSessionLocalHome"); + seqLocal = seqHome.create(); + } catch(Exception e) { + throw new javax.ejb.EJBException(e); + } +} + public void unsetEntityContext(){} + public void ejbLoad(){} + public void ejbStore(){} + public void ejbActivate(){} + public void ejbPassivate(){} + public void ejbRemove() throws RemoveException {} + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCompanyHomeLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCompanyHomeLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..e2f0010d2f4d6d04af90b6a142bff965a7ffd5cb --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCompanyHomeLocal.java @@ -0,0 +1,19 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.util.Collection; + +import javax.ejb.FinderException; + +// Ship EJB's local home interface +public interface CreditCompanyHomeLocal extends javax.ejb.EJBLocalHome { + + public CreditCompanyLocal create(String name) + throws javax.ejb.CreateException; + + public CreditCompanyLocal findByPrimaryKey(Object primaryKey) + throws javax.ejb.FinderException; + + public Collection findAllCreditCompany() + throws FinderException; + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCompanyLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCompanyLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..d9cac04f2dbcad3aadc5ce6ad12b1290520ba76f --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CreditCompanyLocal.java @@ -0,0 +1,11 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +// Ship EJB's local interface +public interface CreditCompanyLocal extends javax.ejb.EJBLocalObject { + + public Integer getId(); + public void setId(Integer id); + public String getName(); + public void setName(String name); + public void setAddress(AddressLocal cust); +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CruiseBean.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CruiseBean.java new file mode 100644 index 0000000000000000000000000000000000000000..da7889caa57a03668cd4caa1fb1c55f75e89fec5 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CruiseBean.java @@ -0,0 +1,71 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.util.Collection; + +import javax.ejb.CreateException; +import javax.ejb.EntityContext; +import javax.ejb.FinderException; +import javax.ejb.RemoveException; +import javax.naming.InitialContext; + +public abstract class CruiseBean implements javax.ejb.EntityBean { + + private SequenceSessionLocalHome seqHome = null; + private SequenceSessionLocal seqLocal = null; + private ShipHomeLocal shipHome = null; + + public Integer ejbCreate(String name,Integer ship) throws CreateException { + setName(name); + int id = seqLocal.getNextNumberInSequence("Cruise"); + setId(new Integer(id)); + return null; + } + + public void ejbPostCreate(String name, Integer ship) { + try { + ShipLocal shiploc = shipHome.findByPrimaryKey(ship); + setShip(shiploc); + } catch (FinderException e) { + System.out.println("Ship not found during Cruise creation :"+ship); + } + } + + // persistent fields + + public abstract void setId(Integer id); + public abstract Integer getId(); + public abstract void setName(String name); + public abstract String getName( ); + + public abstract void setShip(ShipLocal ship); + public abstract ShipLocal getShip( ); + + // relationship fields + + public abstract void setReservations(Collection res); + public abstract Collection getReservations( ); + + // standard call back methods + + public void setEntityContext(EntityContext ec){ + try { + InitialContext cntx = new InitialContext( ); + SequenceSessionLocalHome seqHome = + (SequenceSessionLocalHome)cntx.lookup("java:comp/env/ejb/SequenceSessionLocalHome"); + shipHome = + (ShipHomeLocal)cntx.lookup("java:comp/env/ejb/ShipLocalHome"); + + seqLocal = seqHome.create(); + } catch(Exception e) { + throw new javax.ejb.EJBException(e); + } + } + + public void unsetEntityContext(){} + public void ejbLoad(){} + public void ejbStore(){} + public void ejbActivate(){} + public void ejbPassivate(){} + public void ejbRemove() throws RemoveException {} + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CruiseHomeLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CruiseHomeLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..fc5da3cd7a165039c6d3214f759ecd83fffecb43 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CruiseHomeLocal.java @@ -0,0 +1,22 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.util.Collection; + +import javax.ejb.FinderException; + + +// Cruise EJB's local home interface +public interface CruiseHomeLocal extends javax.ejb.EJBLocalHome { + + public CruiseLocal create(String name, Integer ship) + throws javax.ejb.CreateException; + + public CruiseLocal findByPrimaryKey(Object primaryKey) + throws javax.ejb.FinderException; + + public Collection findAllCruises() + throws FinderException; + + public CruiseLocal findByName(String name) + throws FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CruiseHomeRemote.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CruiseHomeRemote.java new file mode 100644 index 0000000000000000000000000000000000000000..87146d2e01919e58ba59b33f00d5b9137568848c --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CruiseHomeRemote.java @@ -0,0 +1,23 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.rmi.RemoteException; +import java.util.Collection; + +import javax.ejb.FinderException; + +// Cruise EJB's remote home interface +public interface CruiseHomeRemote extends javax.ejb.EJBHome { + + public CruiseRemote create(String name, Integer ship) + throws javax.ejb.CreateException, RemoteException; + + public CruiseRemote findByPrimaryKey(Object primaryKey) + throws javax.ejb.FinderException, RemoteException; + + public Collection findAllCruises() + throws FinderException, RemoteException; + + public CruiseRemote findByName(String name) + throws FinderException, RemoteException; + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CruiseLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CruiseLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..77e2a928a756ba3de5e5c189c1e97ca5e3d9bc7c --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CruiseLocal.java @@ -0,0 +1,17 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.util.Collection; + +// Cruise EJB's local interface +public interface CruiseLocal extends javax.ejb.EJBLocalObject { + + public String getName(); + public void setName(String name); + + public ShipLocal getShip(); + public void setShip(ShipLocal ship); + + public void setReservations(Collection res); + public Collection getReservations( ); + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CruiseRemote.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CruiseRemote.java new file mode 100644 index 0000000000000000000000000000000000000000..f931d04acbd381323cf4dd19245bcda31384a345 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CruiseRemote.java @@ -0,0 +1,7 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.rmi.RemoteException; + +public interface CruiseRemote extends javax.ejb.EJBObject { + public Integer getId() throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CustomerBean.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CustomerBean.java new file mode 100644 index 0000000000000000000000000000000000000000..b5f2d34f6f6058eb8bd62cd5716acc2296263b2c --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CustomerBean.java @@ -0,0 +1,340 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import javax.ejb.FinderException; +import javax.ejb.EJBException; +import javax.ejb.EntityContext; +import javax.ejb.CreateException; +import javax.naming.InitialContext; +import javax.naming.NamingException; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.Iterator; +import java.util.Set; +import java.util.Vector; +import java.rmi.RemoteException; + +public abstract class CustomerBean implements javax.ejb.EntityBean { + + private CruiseHomeLocal cruiseHomeLocal = null; + + private CustomerHomeLocal customerHomeLocal = null; + + private CreditCardHomeLocal creditCardHomeLocal = null; + + private CreditCompanyHomeLocal creditCompanyHomeLocal = null; + + private AddressHomeLocal addressHomeLocal = null; + + public Integer ejbCreate(Integer id) throws javax.ejb.CreateException { + this.setId(id); + return null; + } + + public void ejbPostCreate(Integer id) { + } + + + // business methods + + public Name getName() { + Name name = new Name(getLastName(), getFirstName()); + return name; + } + public void setName(Name name) { + setLastName(name.getLastName()); + setFirstName(name.getFirstName()); + } + + public void setAddress(String street, String city, String state, String zip) + throws EJBException { + + AddressLocal addr = this.getHomeAddress(); + + try { + + if (addr == null) { + // Customer doesn't have an address yet. Create a new one. + InitialContext cntx = new InitialContext(); + AddressHomeLocal addrHome = + (AddressHomeLocal) cntx.lookup("java:comp/env/ejb/AddressHomeLocal"); + addr = addrHome.createAddress(street, city, state, zip); + this.setHomeAddress(addr); + } else { + // Customer already has an address. Change its fields + addr.setStreet(street); + addr.setCity(city); + addr.setState(state); + addr.setZip(zip); + } + } catch (NamingException ne) { + throw new EJBException(ne); + } catch (CreateException ce) { + throw new EJBException(ce); + } + } + + public void setAddress(AddressDO addrValue) throws CreateException, NamingException { + String street = addrValue.getStreet(); + String city = addrValue.getCity(); + String state = addrValue.getState(); + String zip = addrValue.getZip(); + + setAddress(street, city, state, zip); + } + + + public AddressDO getAddress() { + + AddressLocal addrLocal = this.getHomeAddress(); + if (addrLocal == null) { + return null; + } + String street = addrLocal.getStreet(); + String city = addrLocal.getCity(); + String state = addrLocal.getState(); + String zip = addrLocal.getZip(); + AddressDO addrValue = new AddressDO(street, city, state, zip); + return addrValue; + } + + public void addPhoneNumber(String number, byte type) + throws NamingException, CreateException, RemoteException { + InitialContext jndiEnc = new InitialContext(); + PhoneHomeLocal phoneHome = (PhoneHomeLocal) (jndiEnc.lookup("java:comp/env/ejb/PhoneHomeLocal")); + + PhoneLocal phone = phoneHome.create(number, type); + Collection phoneNumbers = this.getPhoneNumbers(); + phoneNumbers.add(phone); + } + + public void removePhoneNumber(byte typeToRemove) { + + Collection phoneNumbers = this.getPhoneNumbers(); + Iterator iterator = phoneNumbers.iterator(); + + while (iterator.hasNext()) { + PhoneLocal phone = (PhoneLocal) iterator.next(); + if (phone.getType() == typeToRemove) { + phoneNumbers.remove(phone); + break; + } + + } + } + + public void updatePhoneNumber(String number, byte typeToUpdate) { + + + Collection phoneNumbers = this.getPhoneNumbers(); + Iterator iterator = phoneNumbers.iterator(); + while (iterator.hasNext()) { + PhoneLocal phone = (PhoneLocal) iterator.next(); + if (phone.getType() == typeToUpdate) { + phone.setNumber(number); + break; + } + } + } + + public Vector getPhoneList() { + + Vector vv = new Vector(); + Collection phoneNumbers = this.getPhoneNumbers(); + + Iterator iterator = phoneNumbers.iterator(); + while (iterator.hasNext()) { + PhoneLocal phone = (PhoneLocal) iterator.next(); + String ss = "Type=" + phone.getType() + " Number=" + phone.getNumber(); + vv.add(ss); + } + + return vv; + } + + public Collection ejbHomeCallFindOnCruise(Integer cruiseId) throws FinderException { + + ArrayList customers_id = new ArrayList(); + CruiseLocal crloc = null; + if (cruiseId != null) { + crloc = cruiseHomeLocal.findByPrimaryKey(cruiseId); + } + Collection customers = customerHomeLocal.findOnCruise(crloc); + Iterator customer = customers.iterator(); + while (customer.hasNext()) { + CustomerLocal customer_local = (CustomerLocal) customer.next(); + customers_id.add(customer_local.getId()); + } + return customers_id; + } + + public Collection ejbHomeCallFindByAddressLocal(Integer add) throws FinderException { + ArrayList customers_id = new ArrayList(); + AddressLocal addloc = null; + if (add != null) { + addloc = addressHomeLocal.findByPrimaryKey(add); + } + Collection customers = customerHomeLocal.findByAddressLocal(addloc); + Iterator customer = customers.iterator(); + while (customer.hasNext()) { + CustomerLocal customer_local = (CustomerLocal)customer.next(); + customers_id.add(customer_local.getId()); + } + return customers_id; + } + + public Collection ejbHomeCallFindByParameterIsNull(Integer cc) throws FinderException { + ArrayList customers_id = new ArrayList(); + CreditCardLocal ccloc = null; + if (cc != null) { + ccloc = creditCardHomeLocal.findByPrimaryKey(cc); + } + Collection customers = customerHomeLocal.findByParameterIsNull(ccloc); + Iterator customer = customers.iterator(); + while (customer.hasNext()) { + CustomerLocal customer_local = (CustomerLocal)customer.next(); + customers_id.add(customer_local.getId()); + } + return customers_id; + } + + public void setCreditCard(Date expCreditcard, String numbCreditcard, String nameCreditcard, String orgCreditcard , String nameCreditCompany, String streetAddress, String cityAddress, String stateAddress, String zipAddress ) { + + // Create the CreditCompany, the Address and the CreditCard + // Associate the Address to the CreditCompany, the CreditCompany to the + // CreditCard and the CreditCard to the current customer + try { + CreditCardLocal creditcard = creditCardHomeLocal.create(expCreditcard, numbCreditcard, nameCreditcard, orgCreditcard); + this.setCreditCard(creditcard); + CreditCompanyLocal creditcompany = creditCompanyHomeLocal.create(nameCreditCompany); + creditcard.setCreditCompany(creditcompany); + AddressLocal address = addressHomeLocal.createAddress(streetAddress, cityAddress, stateAddress, zipAddress); + creditcompany.setAddress(address); + } catch (CreateException e) { + System.out.println ("Probleme dans creation du CreditCompany/Address/CrediCard"); + e.printStackTrace(System.out); + } + + } + + // persistent relationships + + public abstract AddressLocal getHomeAddress(); + public abstract void setHomeAddress(AddressLocal address); + + public abstract CreditCardLocal getCreditCard(); + public abstract void setCreditCard(CreditCardLocal card); + + public abstract java.util.Collection getPhoneNumbers( ); + public abstract void setPhoneNumbers(java.util.Collection phones); + + // abstract accessor methods + public abstract Integer getId(); + public abstract void setId(Integer id); + + public abstract String getLastName( ); + public abstract void setLastName(String lname); + + public abstract String getFirstName( ); + public abstract void setFirstName(String fname); + + public abstract boolean getHasGoodCredit(); + public abstract void setHasGoodCredit(boolean flag); + + // abstract ejbSelect() methods + public abstract String ejbSelectAddrCity(Integer id) throws FinderException; + public abstract String ejbSelectLastName(Integer id) throws FinderException; + public abstract Set ejbSelectFirstName() throws FinderException; + public abstract Collection ejbSelectDistinctFirstName() throws FinderException; + public abstract AddressLocal ejbSelectAddr(Integer id) throws FinderException; + public abstract Collection ejbSelectAllCreditCardAddr() throws FinderException; + public abstract Collection ejbSelectRogerAddr() throws FinderException; + public abstract long ejbSelectCountCreditCard() throws FinderException; + public abstract Collection ejbSelectCreditCardNumbers() throws FinderException; + public abstract long ejbSelectCountOfCustomersWithId1(Integer id) throws FinderException; + public abstract long ejbSelectCountOfCustomersWithId2(int id) throws FinderException; + public abstract long ejbSelectCountOfCustomersRingo() throws FinderException; + + // + // Public Home method required to test the private ejbSelectXXXX method + public String ejbHomeSelectAddrCity(Integer id) throws FinderException { + return this.ejbSelectAddrCity(id); + } + public String ejbHomeSelectLastName(Integer id) throws FinderException { + return this.ejbSelectLastName(id); + } + public Set ejbHomeSelectFirstName() throws FinderException { + return this.ejbSelectFirstName(); + } + public Collection ejbHomeSelectDistinctFirstName() throws FinderException { + return this.ejbSelectDistinctFirstName(); + } + public Integer ejbHomeSelectAddr(Integer id) throws FinderException { + AddressLocal address = this.ejbSelectAddr(id); + return address.getId(); + } + public Collection ejbHomeSelectAllCreditCardAddr() throws FinderException { + Collection addresses = this.ejbSelectAllCreditCardAddr(); + ArrayList addresses_id = new ArrayList(); + Iterator iAddr = addresses.iterator(); + while (iAddr.hasNext()) { + AddressLocal address = (AddressLocal) iAddr.next(); + addresses_id.add(address.getId()); + } + return addresses_id; + } + public Collection ejbHomeSelectRogerAddr() throws FinderException { + Collection addresses = this.ejbSelectRogerAddr(); + ArrayList addresses_id = new ArrayList(); + Iterator iAddr = addresses.iterator(); + while (iAddr.hasNext()) { + AddressLocal address = (AddressLocal) iAddr.next(); + addresses_id.add(address.getId()); + } + return addresses_id; + } + public long ejbHomeGetCountCreditCard() throws FinderException { + return this.ejbSelectCountCreditCard(); + } + public Collection ejbHomeGetCreditCardNumbers() throws FinderException { + return this.ejbSelectCreditCardNumbers(); + } + public long ejbHomeGetCountCustomersWithId1(Integer id) throws FinderException { + return this.ejbSelectCountOfCustomersWithId1(id); + } + public long ejbHomeGetCountCustomersWithId2(int id) throws FinderException { + return this.ejbSelectCountOfCustomersWithId2(id); + } + public long ejbHomeGetCountCustomersRingo() throws FinderException { + return this.ejbSelectCountOfCustomersRingo(); + } + + // standard call back methods + + public void setEntityContext(EntityContext ec) { + try { + InitialContext cntx = new InitialContext(); + cruiseHomeLocal = + (CruiseHomeLocal) cntx.lookup("java:comp/env/ejb/CruiseHomeLocal"); + customerHomeLocal = + (CustomerHomeLocal) cntx.lookup("java:comp/env/ejb/CustomerHomeLocal"); + creditCardHomeLocal = + (CreditCardHomeLocal) cntx.lookup("java:comp/env/ejb/CreditCardHomeLocal"); + creditCompanyHomeLocal = + (CreditCompanyHomeLocal) cntx.lookup("java:comp/env/ejb/CreditCompanyHomeLocal"); + addressHomeLocal = + (AddressHomeLocal) cntx.lookup("java:comp/env/ejb/AddressHomeLocal"); + } catch (Exception e) { + throw new javax.ejb.EJBException(e); + } + } + + public void unsetEntityContext() { } + public void ejbLoad() { } + public void ejbStore() { } + public void ejbActivate() { } + public void ejbPassivate() { } + public void ejbRemove() throws javax.ejb.RemoveException { } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CustomerHomeLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CustomerHomeLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..1843230a4973e2f4652b75b68e77740aef2da4bf --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CustomerHomeLocal.java @@ -0,0 +1,70 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.util.Collection; + +import javax.ejb.CreateException; +import javax.ejb.FinderException; + +public interface CustomerHomeLocal extends javax.ejb.EJBLocalHome { + + public CustomerLocal create(Integer id) + throws CreateException; + + public CustomerLocal findByPrimaryKey(Integer id) + throws FinderException; + + public Collection findCustomersAll() + throws FinderException; + + public Collection findByName(String lastName, String firstName) + throws FinderException; + + public CustomerLocal findByExactName(String lastName, String firstName) + throws FinderException; + + public Collection findByNameAndState(String lastName, String firstName, String state) + throws FinderException; + + public CustomerLocal findSmith90() + throws FinderException; + + public Collection findByGoodCredit() + throws FinderException; + + public Collection findByCity(String city, String state) + throws FinderException; + + public Collection findInHotStates() + throws FinderException; + + public Collection findWithoutReservations() + throws FinderException; + + public Collection findOnCruise(CruiseLocal cruise) + throws FinderException; + + public Collection findByAddressLocal(AddressLocal add) + throws FinderException; + + public Collection findByParameterIsNull(CreditCardLocal cc) + throws FinderException; + + public Collection findByState(String state) + throws FinderException; + + public Collection findAllCreditCardAddress(String citie) + throws FinderException; + + public Collection findAllCustomersWithReservation() + throws FinderException; + + public Collection findAllCustomersWithReservationDistinct() + throws FinderException; + + public CustomerLocal findCustomerWithPhone(PhoneLocal phone) + throws FinderException; + + public Collection findCustomersWithCreditCard() + throws FinderException; + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CustomerHomeRemote.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CustomerHomeRemote.java new file mode 100644 index 0000000000000000000000000000000000000000..549f314681dab6c76d0604dfd8e5c36c45eb3a84 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CustomerHomeRemote.java @@ -0,0 +1,116 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import javax.ejb.CreateException; +import javax.ejb.FinderException; +import java.rmi.RemoteException; +import java.util.Collection; +import java.util.Set; + +import org.objectweb.jonas.jtests.beans.ejbql.AddressRemote; + +public interface CustomerHomeRemote extends javax.ejb.EJBHome { + + public CustomerRemote create(Integer id) + throws CreateException, RemoteException; + + public CustomerRemote findByPrimaryKey(Integer id) + throws FinderException, RemoteException; + public CustomerRemote findById(Integer id) + throws FinderException, RemoteException; + public CustomerRemote findByExactName(String lastName, String firstName) + throws FinderException, RemoteException; + public Collection findByName(String lastName, String firstName) + throws FinderException, RemoteException; + public Collection findByNotName(String lastName, String firstName) + throws FinderException, RemoteException; + public Collection findAllMike() + throws FinderException, RemoteException; + public CustomerRemote findSmith90() + throws FinderException, RemoteException; + public Collection findByGoodCredit() + throws FinderException, RemoteException; + public Collection findByCity(String city, String state) + throws FinderException, RemoteException; + public Collection findInHotStates() + throws FinderException, RemoteException; + public Collection findWithoutReservations() + throws FinderException, RemoteException; + public Collection findWithReservations() + throws FinderException, RemoteException; + public Collection findWithOrWithoutReservations() + throws FinderException, RemoteException; + public Collection findWithoutReservationsAndWithGoodCredit(boolean b) + throws FinderException, RemoteException; + public Collection findBisWithoutReservationsAndWithGoodCredit(boolean b) + throws FinderException, RemoteException; + public Collection findTerWithoutReservationsAndWithGoodCredit(boolean b) + throws FinderException, RemoteException; + public Collection findQuadWithoutReservationsAndWithGoodCredit(boolean b) + throws FinderException, RemoteException; + public Collection findWithoutReservationsOrWithGoodCredit(boolean b) + throws FinderException, RemoteException; + public Collection findByNameAndState(String lastName, String firstName, String state) + throws FinderException, RemoteException; + public Collection findAllCreditCardAddress(String city) + throws FinderException, RemoteException; + public Collection findAllCustomersWithReservation() + throws FinderException, RemoteException; + public Collection findAllCustomersWithReservationDistinct() + throws FinderException, RemoteException; + public Collection findByAddress(AddressRemote add) + throws FinderException, RemoteException; + public Collection findByAddressId(Integer addId) + throws FinderException, RemoteException; + public Collection findCustomersAll() + throws FinderException, RemoteException; + public Collection findCustomersWithCreditCard() + throws FinderException, RemoteException; + public Collection findCustomersWithOutCreditCard() + throws FinderException, RemoteException; + public Collection findCustomersXWithOutCreditCard(String firstName) + throws FinderException, RemoteException; + public Collection findCustomersWithCreditCompany() + throws FinderException, RemoteException; + public Collection findAllOrderByLastname() + throws FinderException, RemoteException; + public Collection findAllOrderByDescLastnameAscFirstname() + throws FinderException, RemoteException; + public Collection findCustWithCCNumOrAddrZip(java.lang.String ccNum, java.lang.String addrZip) + throws FinderException, RemoteException; + public Collection findAllWithLimit_1(int startAt) throws FinderException, RemoteException; + public Collection findAllWithLimit_2(int startAt) throws FinderException, RemoteException; + + // Home method, requires ejbHomeXXX method in bean class + public Collection callFindOnCruise(Integer cruiseId) + throws FinderException, RemoteException; + public Collection callFindByAddressLocal(Integer add) + throws FinderException, RemoteException; + public Collection callFindByParameterIsNull(Integer cc) + throws FinderException, RemoteException; + public String selectAddrCity(Integer id) + throws javax.ejb.FinderException, RemoteException; + public String selectLastName(Integer id) + throws javax.ejb.FinderException, RemoteException; + public Set selectFirstName() throws javax.ejb.FinderException, RemoteException; + public Collection selectDistinctFirstName() + throws javax.ejb.FinderException, RemoteException; + public Integer selectAddr(Integer id) + throws javax.ejb.FinderException, RemoteException; + public Collection selectAllCreditCardAddr() + throws javax.ejb.FinderException, RemoteException; + public Collection selectRogerAddr() + throws javax.ejb.FinderException, RemoteException; + public long getCountCreditCard() + throws javax.ejb.FinderException, RemoteException; + public Collection getCreditCardNumbers() + throws javax.ejb.FinderException, RemoteException; + public long getCountCustomersWithId1(Integer id) + throws javax.ejb.FinderException, RemoteException; + public long getCountCustomersWithId2(int id) + throws javax.ejb.FinderException, RemoteException; + public long getCountCustomersRingo() + throws javax.ejb.FinderException, RemoteException; + + +} + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CustomerLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CustomerLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..c2c50e93abfb59925072ff347d48e9d49921b4bf --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CustomerLocal.java @@ -0,0 +1,36 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.util.Collection; +import java.util.Vector; + +import javax.ejb.CreateException; +import javax.naming.NamingException; + +public interface CustomerLocal extends javax.ejb.EJBLocalObject { + + public Name getName(); + public void setName(Name name); + + public Integer getId(); + + + public boolean getHasGoodCredit(); + public void setHasGoodCredit(boolean flag); + + public void addPhoneNumber(String number, byte type) + throws NamingException, CreateException; + public void removePhoneNumber(byte typeToRemove); + public void updatePhoneNumber(String number, byte typeToUpdate); + + public Vector getPhoneList(); + + public AddressLocal getHomeAddress(); + public void setHomeAddress(AddressLocal address); + + public CreditCardLocal getCreditCard(); + public void setCreditCard(CreditCardLocal card); + + public Collection getPhoneNumbers( ); + public void setPhoneNumbers(Collection phones); + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CustomerRemote.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CustomerRemote.java new file mode 100644 index 0000000000000000000000000000000000000000..5622dd20b0ea870278424e407cf5d61e2f3bd724 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/CustomerRemote.java @@ -0,0 +1,33 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.rmi.RemoteException; +import java.util.Date; + +import javax.ejb.CreateException; +import javax.naming.NamingException; + +public interface CustomerRemote extends javax.ejb.EJBObject { + + public void setAddress(String street, String city, + String state, String zip) + throws RemoteException, CreateException, NamingException; + + + public void setAddress(AddressDO address) + throws RemoteException, CreateException, NamingException; + + public void addPhoneNumber(String number, byte type) + throws NamingException, CreateException, RemoteException ; + + public AddressDO getAddress() throws RemoteException; + + public Name getName() throws RemoteException; + public void setName(Name name) throws RemoteException; + + public boolean getHasGoodCredit() throws RemoteException; + public void setHasGoodCredit(boolean flag) throws RemoteException; + public Integer getId() throws RemoteException; + + public void setCreditCard(Date expCreditcard, String numbCreditcard, String nameCreditcard, String orgCreditcard ,String nameCreditCompany, String streetAddress, String cityAddress, String stateAddress, String zipAddress ) throws RemoteException; + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/Name.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/Name.java new file mode 100644 index 0000000000000000000000000000000000000000..797865d8d9f1ab44d4f3962bcc2889d9c7b1798d --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/Name.java @@ -0,0 +1,21 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +public class Name implements java.io.Serializable { + + private String lastName; + private String firstName; + + public Name(String lname, String fname){ + lastName = lname; + firstName = fname; + } + public String getLastName() { + return lastName; + } + public String getFirstName() { + return firstName; + } + public String toString() { + return ("(lastname='" + lastName + "',firstname=" + firstName +"')"); + } +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/PhoneBean.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/PhoneBean.java new file mode 100644 index 0000000000000000000000000000000000000000..19c40c7cd8633fd8d1fb220cc88b0a58bb609054 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/PhoneBean.java @@ -0,0 +1,49 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import javax.ejb.EntityContext; +import javax.naming.InitialContext; + +public abstract class PhoneBean implements javax.ejb.EntityBean { + private SequenceSessionLocalHome seqHome = null; + private SequenceSessionLocal seqLocal = null; + + public Object ejbCreate(String number, byte type) throws javax.ejb.CreateException { + setNumber(number); + setType(type); + int id = seqLocal.getNextNumberInSequence("Phone"); + setId(new Integer(id)); + return null; + } + + public void ejbPostCreate(String number, byte type) { + } + + // persistent fields + + public abstract Integer getId(); + public abstract void setId(Integer id); + public abstract String getNumber(); + public abstract void setNumber(String number); + public abstract byte getType(); + public abstract void setType(byte type); + + // standard call back methods + + public void setEntityContext(EntityContext ec){ + try { + InitialContext cntx = new InitialContext( ); + SequenceSessionLocalHome seqHome = + (SequenceSessionLocalHome)cntx.lookup("java:comp/env/ejb/SequenceSessionLocalHome"); + seqLocal = seqHome.create(); + } catch(Exception e) { + throw new javax.ejb.EJBException(e); + } + } + public void unsetEntityContext(){} + public void ejbLoad(){} + public void ejbStore(){} + public void ejbActivate(){} + public void ejbPassivate(){} + public void ejbRemove() throws javax.ejb.RemoveException{} + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/PhoneHomeLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/PhoneHomeLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..8a8ee496e3e8046b636d84b5c7aa2464a72c642b --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/PhoneHomeLocal.java @@ -0,0 +1,20 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.util.Collection; + +// Phone EJB's local home interface +public interface PhoneHomeLocal extends javax.ejb.EJBLocalHome { + + public PhoneLocal create(String number, byte type) + throws javax.ejb.CreateException; + + public PhoneLocal findByPrimaryKey(Object primaryKey) + throws javax.ejb.FinderException; + + public PhoneLocal findByNumber(String number) + throws javax.ejb.FinderException; + + public Collection findAllPhones() + throws javax.ejb.FinderException; + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/PhoneHomeRemote.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/PhoneHomeRemote.java new file mode 100644 index 0000000000000000000000000000000000000000..ca98fb495f9594bb62e3f0358a2b36e32c151af5 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/PhoneHomeRemote.java @@ -0,0 +1,17 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.util.Collection; + +// Phone EJB's local home interface +public interface PhoneHomeRemote extends javax.ejb.EJBHome { + + public PhoneLocal create(String number, byte type) + throws javax.ejb.CreateException; + + public PhoneLocal findByPrimaryKey(Object primaryKey) + throws javax.ejb.FinderException; + + public Collection findAllPhones() + throws javax.ejb.FinderException; + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/PhoneLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/PhoneLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..f8960fc27f8da5a50953930ad91e218159187dc9 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/PhoneLocal.java @@ -0,0 +1,11 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +// Phone EJB's local interface +public interface PhoneLocal extends javax.ejb.EJBLocalObject { + + public String getNumber(); + public void setNumber(String number); + public byte getType(); + public void setType(byte type); + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ReservationBean.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ReservationBean.java new file mode 100644 index 0000000000000000000000000000000000000000..b4155bd3b48c50f19a47be1007808d3f6f1394b1 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ReservationBean.java @@ -0,0 +1,194 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.Iterator; +import java.util.Set; + +import javax.ejb.CreateException; +import javax.ejb.EntityContext; +import javax.ejb.FinderException; +import javax.ejb.RemoveException; +import javax.naming.InitialContext; + +public abstract class ReservationBean implements javax.ejb.EntityBean { + + private SequenceSessionLocalHome seqHome = null; + + private SequenceSessionLocal seqLocal = null; + + private CustomerHomeLocal customerhl = null; + + private CruiseHomeLocal cruisehl = null; + + private CabinHomeLocal cabinhl = null; + + public Object ejbCreate(Integer cruiseId, Collection customers) throws CreateException { + int id = seqLocal.getNextNumberInSequence("Reservation"); + setId(new Integer(id)); + return null; + } + + public void ejbPostCreate(Integer cruiseId, Collection customers) { + + try { + CruiseLocal cruise = cruisehl.findByPrimaryKey(cruiseId); + setCruise(cruise); + } catch (FinderException e) { + System.out.println("Cruise not find :" + cruiseId); + } + + Collection myCustomers = this.getCustomers(); + + ArrayList al; + if (customers == null) + al = new ArrayList(); + else { + if (customers.size() == -1) + al = new ArrayList(); + else { + al = new ArrayList(customers.size()); + for (Iterator it = customers.iterator(); it.hasNext();) { + Integer customerid = new Integer("-1"); + try { + customerid = (Integer) it.next(); + CustomerLocal customer = customerhl.findByPrimaryKey(customerid); + al.add(customer); + } catch (FinderException e) { + System.out.println("Customer not found " + customerid); + } + } + } + } + myCustomers.addAll(al); + } + + // relationship fields + public void setAllCabins(Set cabins) { + + ArrayList al; + if (cabins == null) + al = new ArrayList(); + else { + if (cabins.size() == -1) + al = new ArrayList(); + else { + al = new ArrayList(cabins.size()); + for (Iterator it = cabins.iterator(); it.hasNext();) { + Integer cabinid = new Integer("-1"); + try { + cabinid = (Integer) it.next(); + CabinLocal cabin = cabinhl.findByPrimaryKey(cabinid); + al.add(cabin); + } catch (FinderException e) { + System.out.println("Cabin not found " + cabinid); + } + } + } + } + this.getCabins().addAll(al); + } + + // persistent fields getter and setter + public abstract CruiseLocal getCruise(); + + public abstract void setCruise(CruiseLocal cruise); + + public abstract Set getCabins(); + + public abstract void setCabins(Set cabins); + + public abstract Set getCustomers(); + + public abstract void setCustomers(Set customers); + + public abstract Integer getId(); + + public abstract void setId(Integer id); + + public abstract Date getDate(); + + public abstract void setDate(Date date); + + public abstract double getAmountPaid(); + + public abstract void setAmountPaid(double amount); + + // abstract ejbSelect() methods + public abstract long ejbSelectCountOfReservations() throws FinderException; + + public abstract double ejbSelectMinAmountOfReservations() throws FinderException; + + public abstract double ejbSelectMinAmountForCruise(String cName) throws FinderException; + + public abstract Collection ejbSelectAmountsForCruise(String cName) throws FinderException; + + public abstract double ejbSelectMaxAmountOfReservations() throws FinderException; + + public abstract long ejbSelectCountOfReservationsForCustomer(CustomerLocal c) throws FinderException; + + public abstract long ejbSelectAmountOfReservationsForCustomer(CustomerLocal c) throws FinderException; + + // Public Home method required to test the private ejbSelectXXXX method + public long ejbHomeGetCountOfReservations() throws FinderException { + return this.ejbSelectCountOfReservations(); + } + + public double ejbHomeGetMinAmountOfReservations() throws FinderException { + return this.ejbSelectMinAmountOfReservations(); + } + + public double ejbHomeGetMinAmountForCruise(String cName) throws FinderException { + return this.ejbSelectMinAmountForCruise(cName); + } + + public double ejbHomeGetMaxAmountOfReservations() throws FinderException { + return this.ejbSelectMaxAmountOfReservations(); + } + + public Collection ejbHomeGetAmountsForCruise(String cName) throws FinderException { + return this.ejbSelectAmountsForCruise(cName); + } + + public long ejbHomeGetCountOfReservationsForCustomer(Integer custId) throws FinderException { + return this.ejbSelectCountOfReservationsForCustomer(customerhl.findByPrimaryKey(custId)); + } + + public double ejbHomeGetAmountOfReservationsForCustomer(Integer custId) throws FinderException { + return this.ejbSelectAmountOfReservationsForCustomer(customerhl.findByPrimaryKey(custId)); + } + + // standard call back methods + public void setEntityContext(EntityContext ec) { + try { + InitialContext cntx = new InitialContext(); + seqHome = (SequenceSessionLocalHome) cntx.lookup("java:comp/env/ejb/SequenceSessionLocalHome"); + customerhl = (CustomerHomeLocal) cntx.lookup("java:comp/env/ejb/CustomerLocalHome"); + cruisehl = (CruiseHomeLocal) cntx.lookup("java:comp/env/ejb/CruiseLocalHome"); + cabinhl = (CabinHomeLocal) cntx.lookup("java:comp/env/ejb/CabinLocalHome"); + seqLocal = seqHome.create(); + } catch (Exception e) { + throw new javax.ejb.EJBException(e); + } + } + + public void unsetEntityContext() { + } + + public void ejbLoad() { + } + + public void ejbStore() { + } + + public void ejbActivate() { + } + + public void ejbPassivate() { + } + + public void ejbRemove() throws RemoveException { + } + +} \ No newline at end of file diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ReservationHomeLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ReservationHomeLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..d2c88dad6f1966f1889b49dfb6693c1049190104 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ReservationHomeLocal.java @@ -0,0 +1,20 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.util.Collection; + +import javax.ejb.FinderException; + +// Reservation EJB's local home interface +public interface ReservationHomeLocal extends javax.ejb.EJBLocalHome { + + public ReservationLocal create(Integer cruise, Collection customers) + throws javax.ejb.CreateException; + + public ReservationLocal findByPrimaryKey(Object primaryKey) + throws javax.ejb.FinderException; + + public Collection findAllReservations() throws FinderException; + + public Collection findOrderedRsrv() throws FinderException; + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ReservationHomeRemote.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ReservationHomeRemote.java new file mode 100644 index 0000000000000000000000000000000000000000..99446256f8af3f09f774da6d6f05593b551c21e0 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ReservationHomeRemote.java @@ -0,0 +1,39 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.rmi.RemoteException; +import java.util.Collection; + +import javax.ejb.FinderException; + +// Reservation EJB's remote home interface +public interface ReservationHomeRemote extends javax.ejb.EJBHome { + + public ReservationRemote create(Integer cruiseid, Collection customers) + throws javax.ejb.CreateException, RemoteException;; + + public ReservationRemote findByPrimaryKey(Object primaryKey) + throws javax.ejb.FinderException, RemoteException; + + public Collection findAllReservations() throws FinderException, RemoteException; + + public Collection findReservationsWithLesserAmount() throws FinderException, RemoteException; + + public Collection findOrderedRsrv() throws FinderException, RemoteException; + + public long getCountOfReservations() throws FinderException, RemoteException; + + public double getMinAmountOfReservations() throws FinderException, RemoteException; + + public double getMinAmountForCruise(String cName) throws FinderException, RemoteException; + + public double getMaxAmountOfReservations() throws FinderException, RemoteException; + + public Collection getAmountsForCruise(String cName) throws FinderException, RemoteException; + + public long getCountOfReservationsForCustomer(Integer customerId) + throws FinderException, RemoteException; + + public double getAmountOfReservationsForCustomer(Integer customerId) + throws FinderException, RemoteException; +} + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ReservationLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ReservationLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..5944fb22f3f541026db019bd0341f09b38ea1ff1 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ReservationLocal.java @@ -0,0 +1,25 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.util.Date; +import java.util.Set; + +// Reservation EJB's local interface +public interface ReservationLocal extends javax.ejb.EJBLocalObject { + + public Date getDate(); + public void setDate(Date date); + public double getAmountPaid(); + public void setAmountPaid(double amount); + + public CruiseLocal getCruise(); + public void setCruise(CruiseLocal cruise); + + public Set getCabins( ); + public void setCabins(Set customers); + + public Set getCustomers( ); + public void setCustomers(Set customers); + + public Integer getId(); + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ReservationRemote.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ReservationRemote.java new file mode 100644 index 0000000000000000000000000000000000000000..173931c2b228a38390f6fa87a157e63fb19014d1 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ReservationRemote.java @@ -0,0 +1,11 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.rmi.RemoteException; +import java.util.Date; +import java.util.Set; + +public interface ReservationRemote extends javax.ejb.EJBObject { + public void setAmountPaid(double amount) throws RemoteException; + public void setDate(Date date) throws RemoteException; + public void setAllCabins(Set cabins) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..c3fe62118e8e4904faf1a7f62c837e1acf8d918b --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceEC2.java @@ -0,0 +1,34 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import javax.ejb.*; + +abstract public class SequenceEC2 implements EntityBean { + + public int getNextKeyAfterIncrementingBy(int blockSize) { + this.setIndex(this.getIndex()+ blockSize); + return this.getIndex(); + } + + public String ejbCreate(String name) throws CreateException { + this.setName(name); + this.setIndex(0); + return name; + } + + + abstract public int getIndex(); + abstract public String getName(); + abstract public void setIndex(int newIndex); + abstract public void setName(java.lang.String newName); + + public void ejbActivate() {} + public void ejbLoad() {} + public void ejbPassivate() {} + public void ejbPostCreate(String name) {} + public void ejbRemove() throws RemoveException {} + public void ejbStore() {} + + public void setEntityContext(EntityContext unused) {} + public void unsetEntityContext() {} + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..e1120af77edf88767c0306d7e3a93b1d55918806 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceLocal.java @@ -0,0 +1,6 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +public interface SequenceLocal extends javax.ejb.EJBLocalObject +{ + public int getNextKeyAfterIncrementingBy(int blockSize); +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceLocalHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceLocalHome.java new file mode 100644 index 0000000000000000000000000000000000000000..66290171a95d8c923fce087e1cd729adad9a51fe --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceLocalHome.java @@ -0,0 +1,6 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +public interface SequenceLocalHome extends javax.ejb.EJBLocalHome { + SequenceLocal create(String name) throws javax.ejb.CreateException; + SequenceLocal findByPrimaryKey(String name) throws javax.ejb.FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceSession.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceSession.java new file mode 100644 index 0000000000000000000000000000000000000000..fc3653f87a12ba472ab9c91666601d7d0e403b43 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceSession.java @@ -0,0 +1,7 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.rmi.RemoteException; + +public interface SequenceSession extends javax.ejb.EJBObject { + public int getNextNumberInSequence(String name) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceSessionHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceSessionHome.java new file mode 100644 index 0000000000000000000000000000000000000000..098a5a838019b61f738341105b3eaff7c35c1f3b --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceSessionHome.java @@ -0,0 +1,8 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + + +import javax.ejb.CreateException; +import java.rmi.RemoteException; +public interface SequenceSessionHome extends javax.ejb.EJBHome { + SequenceSession create() throws CreateException, RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceSessionLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceSessionLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..e62a5cb7a489e369f3f9334a054192f8d7073aee --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceSessionLocal.java @@ -0,0 +1,5 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +public interface SequenceSessionLocal extends javax.ejb.EJBLocalObject { + public int getNextNumberInSequence(String name); +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceSessionLocalHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceSessionLocalHome.java new file mode 100644 index 0000000000000000000000000000000000000000..f0abb4bb3c2292e36e62487ae16ec37e10544a35 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceSessionLocalHome.java @@ -0,0 +1,7 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import javax.ejb.CreateException; + +public interface SequenceSessionLocalHome extends javax.ejb.EJBLocalHome { + SequenceSessionLocal create() throws CreateException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceSessionSL.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceSessionSL.java new file mode 100644 index 0000000000000000000000000000000000000000..96204ad71d1fd9a93f9f863bde63f5ee57a71a3f --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SequenceSessionSL.java @@ -0,0 +1,72 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +public class SequenceSessionSL implements javax.ejb.SessionBean { + + private class Entry { + SequenceLocal sequence; + int last; + }; + + private java.util.Hashtable _entries = new java.util.Hashtable(); + private int _blockSize; + private int _retryCount; + private SequenceLocalHome _sequenceHome; + + public int getNextNumberInSequence(String name) { + + try { + Entry entry = (Entry) _entries.get(name); + + if (entry == null) { + // add an entry to the sequence table + entry = new Entry(); + try { + entry.sequence = _sequenceHome.findByPrimaryKey(name); + + } catch (javax.ejb.FinderException e) { + // if we couldn't find it, then create it... + entry.sequence = _sequenceHome.create(name); + } + _entries.put(name, entry); + } + if (entry.last % _blockSize == 0) { + for (int retry = 0; true; retry++) { + try { + entry.last = entry.sequence.getNextKeyAfterIncrementingBy(_blockSize); + + break; + } catch (javax.ejb.TransactionRolledbackLocalException e) { + if (retry < _retryCount) { + // we hit a concurrency exception, so try again... + continue; + } else { + // we tried too many times, so fail... + throw new javax.ejb.EJBException(e); + } + } + } + } + int ret = entry.last+1; + return entry.last++; + } catch (javax.ejb.CreateException e) { + throw new javax.ejb.EJBException(e); + } + } + public void setSessionContext( javax.ejb.SessionContext sessionContext) { + try { + javax.naming.Context namingContext = new javax.naming.InitialContext(); + _blockSize = ((Integer) namingContext.lookup("java:comp/env/blockSize")).intValue(); + _retryCount = ((Integer) namingContext.lookup("java:comp/env/retryCount")).intValue(); + + _sequenceHome = (SequenceLocalHome) namingContext.lookup("java:comp/env/ejb/SequenceLocalHome"); + } catch(javax.naming.NamingException e) { + throw new javax.ejb.EJBException(e); + } + } + public void ejbActivate() {} + public void ejbCreate() {} + public void ejbPassivate() {} + public void ejbRemove() {} + + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SessionTestBean.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SessionTestBean.java new file mode 100644 index 0000000000000000000000000000000000000000..f4d9e13d97b77540df93a99819daf861cb816b19 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SessionTestBean.java @@ -0,0 +1,94 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.ejbql; + +import javax.ejb.CreateException; +import javax.ejb.EJBException; +import javax.ejb.SessionBean; +import javax.ejb.SessionContext; +import javax.naming.InitialContext; + +import org.objectweb.jonas.common.Log; +import org.objectweb.util.monolog.api.BasicLevel; +import org.objectweb.util.monolog.api.Logger; + + +/** + * Stateless Session useful to do some specifics tests which local interfaces are needed. + * @author Helene Joanin + */ +public class SessionTestBean implements SessionBean { + + static protected Logger logger = null; + protected SessionContext ctx = null; + protected CustomerHomeLocal hCustomer = null; + protected PhoneHomeLocal hPhone = null; + + // SessionBean methods implementation + public void setSessionContext(SessionContext ctx) { + if (logger == null) { + logger = Log.getLogger(Log.JONAS_TESTS_PREFIX); + } + logger.log(BasicLevel.DEBUG, ""); + this.ctx = ctx; + try { + InitialContext inctx = new InitialContext(); + hCustomer = (CustomerHomeLocal) inctx.lookup("java:comp/env/ejb/CustomerHomeLocal"); + hPhone = (PhoneHomeLocal) inctx.lookup("java:comp/env/ejb/PhoneHomeLocal"); + } catch (Exception e) { + throw new javax.ejb.EJBException(e); + } + } + + public void ejbCreate() throws CreateException { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbRemove() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbPassivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbActivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + // SessionTestRemote implementation + public Integer getCustomerWithPhone(String phoneNumber) throws EJBException { + try { + PhoneLocal phone = hPhone.findByNumber(phoneNumber); + CustomerLocal customer = hCustomer.findCustomerWithPhone(phone); + return customer.getId(); + } catch (Exception e) { + logger.log(BasicLevel.ERROR, "Cannot get the customer with phone " + phoneNumber, e); + throw new EJBException("Cannot get the customer with phone " + phoneNumber, e); + } + } +} + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SessionTestHomeRemote.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SessionTestHomeRemote.java new file mode 100644 index 0000000000000000000000000000000000000000..a25122e06760aa0ae694361ee33c31a97580393e --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SessionTestHomeRemote.java @@ -0,0 +1,37 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; + +/** + * Home interface for the bean SessionTestBean + */ +public interface SessionTestHomeRemote extends EJBHome { + SessionTestRemote create() throws CreateException, RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SessionTestRemote.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SessionTestRemote.java new file mode 100644 index 0000000000000000000000000000000000000000..da4c2967b4fe39c862b847dbae4ce81c82a13822 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/SessionTestRemote.java @@ -0,0 +1,37 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.rmi.RemoteException; + +import javax.ejb.EJBObject; + +/** + * SessionTest remote interface + */ +public interface SessionTestRemote extends EJBObject { + public Integer getCustomerWithPhone(String phoneNumber) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ShipBean.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ShipBean.java new file mode 100644 index 0000000000000000000000000000000000000000..2dc2ddf56bc456425703fc821bf5e90d1467ead5 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ShipBean.java @@ -0,0 +1,49 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.util.Collection; + +import javax.ejb.EntityContext; +import javax.ejb.CreateException; +import javax.ejb.FinderException; +import javax.ejb.RemoveException; + +public abstract class ShipBean implements javax.ejb.EntityBean { + + public Integer ejbCreate(Integer primaryKey, String name, double tonnage) throws CreateException { + setId(primaryKey); + setName(name); + setTonnage(tonnage); + return null; + } + + public void ejbPostCreate(Integer primaryKey, String name, double tonnage) { + } + + // persistent fields + + public abstract void setId(Integer id); + public abstract Integer getId(); + public abstract void setName(String name); + public abstract String getName( ); + public abstract void setTonnage(double tonnage); + public abstract double getTonnage( ); + + // abstract ejbSelect() methods + public abstract double ejbSelectAverageOfTonnage() throws FinderException; + public abstract Collection ejbSelectListOfTonnage() throws FinderException; + + // Public Home method required to test the private ejbSelectXXXX method + public double ejbHomeGetAverageOfTonnage() throws FinderException { + return this.ejbSelectAverageOfTonnage(); + } + + // standard call back methods + public void setEntityContext(EntityContext ec){} + public void unsetEntityContext(){} + public void ejbLoad(){} + public void ejbStore(){} + public void ejbActivate(){} + public void ejbPassivate(){} + public void ejbRemove() throws RemoveException {} + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ShipHomeLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ShipHomeLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..4e7361af603697155d91a94cbfc433ad86b26f68 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ShipHomeLocal.java @@ -0,0 +1,25 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.util.Collection; + +import javax.ejb.FinderException; + +// Ship EJB's local home interface +public interface ShipHomeLocal extends javax.ejb.EJBLocalHome { + + public ShipLocal create(Integer primaryKey, String name, double tonnage) + throws javax.ejb.CreateException; + + public ShipLocal findByPrimaryKey(Object primaryKey) + throws javax.ejb.FinderException; + + public Collection findAllShips() + throws FinderException; + + public Collection findByTonnage(Double tonnage) + throws javax.ejb.FinderException; + + public Collection findByTonnage(Double tonnage1, Double tonnage2) + throws javax.ejb.FinderException; + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ShipHomeRemote.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ShipHomeRemote.java new file mode 100644 index 0000000000000000000000000000000000000000..aecf49eab6ef01860971a1d94656b5d526bb9cda --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ShipHomeRemote.java @@ -0,0 +1,30 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.rmi.RemoteException; +import java.util.Collection; + +import javax.ejb.FinderException; + +// Ship EJB's Remote home interface +public interface ShipHomeRemote extends javax.ejb.EJBHome { + + public ShipRemote create(Integer primaryKey, String name, double tonnage) + throws javax.ejb.CreateException, RemoteException; + + public ShipRemote findByPrimaryKey(Object primaryKey) + throws javax.ejb.FinderException, RemoteException; + + public Collection findAllShips() + throws FinderException, RemoteException; + + public Collection findByTonnage(Double tonnage) + throws javax.ejb.FinderException, RemoteException; + + public Collection findByTonnage(Double tonnage1, Double tonnage2) + throws javax.ejb.FinderException, RemoteException; + + public double getAverageOfTonnage() + throws javax.ejb.FinderException, RemoteException; + +} + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ShipLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ShipLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..803293d98926057a7d13f5d565388c03da6c5299 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ShipLocal.java @@ -0,0 +1,13 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +// Ship EJB's local interface +public interface ShipLocal extends javax.ejb.EJBLocalObject { + + public Integer getId(); + public void setId(Integer id); + public String getName(); + public void setName(String name); + public double getTonnage(); + public void setTonnage(double tonnage); + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ShipRemote.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ShipRemote.java new file mode 100644 index 0000000000000000000000000000000000000000..e67a3b73dc52779fc6323403b1e29c3dd27ae6d4 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ShipRemote.java @@ -0,0 +1,8 @@ +package org.objectweb.jonas.jtests.beans.ejbql; + +import java.rmi.RemoteException; + +public interface ShipRemote extends javax.ejb.EJBObject { + public Integer getId() throws RemoteException; + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ejbql.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ejbql.xml new file mode 100644 index 0000000000000000000000000000000000000000..f38cb3ed14786d369b3f2b7415f04195cd1fbe72 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/ejbql.xml @@ -0,0 +1,1646 @@ + + + + + + + + + + ejbql/SessionTest + SessionTestEJB + org.objectweb.jonas.jtests.beans.ejbql.SessionTestHomeRemote + org.objectweb.jonas.jtests.beans.ejbql.SessionTestRemote + org.objectweb.jonas.jtests.beans.ejbql.SessionTestBean + Stateless + Container + + ejb/CustomerHomeLocal + Entity + org.objectweb.jonas.jtests.beans.ejbql.CustomerHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.CustomerLocal + CustomerEJB + + + ejb/PhoneHomeLocal + Entity + org.objectweb.jonas.jtests.beans.ejbql.PhoneHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.PhoneLocal + PhoneEJB + + + + + ejbql/CustomerEJB + CustomerEJB + org.objectweb.jonas.jtests.beans.ejbql.CustomerHomeRemote + org.objectweb.jonas.jtests.beans.ejbql.CustomerRemote + org.objectweb.jonas.jtests.beans.ejbql.CustomerHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.CustomerLocal + org.objectweb.jonas.jtests.beans.ejbql.CustomerBean + Container + java.lang.Integer + false + 2.x + jt2_Customer + id + lastName + firstName + hasGoodCredit + id + + ejb/AddressHomeLocal + Entity + org.objectweb.jonas.jtests.beans.ejbql.AddressHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.AddressLocal + AddressEJB + + + ejb/CreditCardHomeLocal + Entity + org.objectweb.jonas.jtests.beans.ejbql.CreditCardHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.CreditCardLocal + CreditCardEJB + + + ejb/CreditCompanyHomeLocal + Entity + org.objectweb.jonas.jtests.beans.ejbql.CreditCompanyHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.CreditCompanyLocal + CreditCompanyEJB + + + ejb/CruiseHomeLocal + Entity + org.objectweb.jonas.jtests.beans.ejbql.CruiseHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.CruiseLocal + CruiseEJB + + + ejb/CustomerHomeLocal + Entity + org.objectweb.jonas.jtests.beans.ejbql.CustomerHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.CustomerLocal + CustomerEJB + + + ejb/PhoneHomeLocal + Entity + org.objectweb.jonas.jtests.beans.ejbql.PhoneHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.PhoneLocal + PhoneEJB + + + + + findCustomersAll + + + SELECT OBJECT(c) FROM jt2_Customer AS c + + + + findAllCustomersWithReservation + + + SELECT OBJECT(c) FROM jt2_Reservation res, IN(res.customers) c + + + + findAllCustomersWithReservationDistinct + + + SELECT DISTINCT OBJECT(c) FROM jt2_Reservation res, IN(res.customers) c + + + + + findByName + + java.lang.String + java.lang.String + + + + SELECT OBJECT(c) FROM jt2_Customer c + WHERE c.lastName LIKE ?1 AND c.firstName LIKE ?2 + + + + + + findByNotName + + java.lang.String + java.lang.String + + + + SELECT OBJECT(c) FROM jt2_Customer c + WHERE c.lastName NOT LIKE ?1 OR c.firstName NOT LIKE ?2 + + + + + + findAllMike + + + + SELECT OBJECT(c) FROM jt2_Customer c + WHERE c.firstName LIKE 'Mike' + + + + + + findSmith90 + + + + SELECT OBJECT(c) FROM jt2_Customer c + WHERE c.lastName = 'Smith90' + + + + + + findByExactName + + java.lang.String + java.lang.String + + + + SELECT OBJECT(c) FROM jt2_Customer c + WHERE c.lastName = ?1 AND c.firstName = ?2 + + + + + + findById + + java.lang.Integer + + + + SELECT OBJECT(c) FROM jt2_Customer c WHERE c.id = ?1 + + + + + + findByNameAndState + + java.lang.String + java.lang.String + java.lang.String + + + + SELECT OBJECT(c) FROM jt2_Customer c + WHERE c.lastName LIKE ?1 AND c.firstName LIKE ?2 AND c.homeAddress.state = ?3 + + + + + + findByGoodCredit + + + + SELECT OBJECT(c) FROM jt2_Customer c + WHERE c.hasGoodCredit = TRUE + + + + + + findByCity + + java.lang.String + java.lang.String + + + + SELECT OBJECT(c) FROM jt2_Customer c + WHERE c.homeAddress.city = ?1 AND c.homeAddress.state = ?2 + + + + + + findByAddress + + org.objectweb.jonas.jtests.beans.ejbql.AddressRemote + + + + + SELECT OBJECT(c) FROM jt2_Customer AS c + + + + + + findByAddressLocal + + org.objectweb.jonas.jtests.beans.ejbql.AddressLocal + + + + SELECT OBJECT(c) FROM jt2_Customer c WHERE c.homeAddress = ?1 + + + + + + findByParameterIsNull + + org.objectweb.jonas.jtests.beans.ejbql.CreditCardLocal + + + + SELECT OBJECT(c) FROM jt2_Customer c WHERE ?1 IS NULL + + + + + + findByAddressId + + java.lang.Integer + + + + SELECT OBJECT(c) FROM jt2_Customer c WHERE c.homeAddress.id = ?1 + + + + + + findInHotStates + + + + SELECT OBJECT(c) FROM jt2_Customer c + WHERE c.homeAddress.state IN ('FL','TX','AZ','CA') + + + + + + findWithoutReservations + + + + SELECT OBJECT(c) FROM jt2_Customer c + WHERE c.reservations IS EMPTY + + + + + + findWithReservations + + + + SELECT OBJECT(c) FROM jt2_Customer c + WHERE c.reservations IS NOT EMPTY + + + + + + findWithOrWithoutReservations + + + + SELECT OBJECT(c) FROM jt2_Customer c + WHERE c.reservations IS EMPTY OR c.reservations IS NOT EMPTY + + + + + + findWithoutReservationsAndWithGoodCredit + + boolean + + + + + SELECT OBJECT(c) FROM jt2_Customer c + WHERE c.reservations IS EMPTY AND c.hasGoodCredit = ?1 + + + + + + findBisWithoutReservationsAndWithGoodCredit + + boolean + + + + ?1) + ]]> + + + + + findTerWithoutReservationsAndWithGoodCredit + + boolean + + + + + + + + + findQuadWithoutReservationsAndWithGoodCredit + + boolean + + + + ?1) AND c.reservations IS EMPTY + ]]> + + + + + findWithoutReservationsOrWithGoodCredit + + boolean + + + + + SELECT OBJECT(c) FROM jt2_Customer c + WHERE c.reservations IS EMPTY OR c.hasGoodCredit = ?1 + + + + + + + findOnCruise + + org.objectweb.jonas.jtests.beans.ejbql.CruiseLocal + + + + SELECT OBJECT(cust) FROM jt2_Customer cust, jt2_Cruise cr, IN (cr.reservations) AS res + WHERE cr = ?1 AND cust MEMBER OF res.customers + + + + + + findByState + + java.lang.String + + + + SELECT OBJECT(c) FROM jt2_Customer c + WHERE c.homeAddress.state = ?1 + + + + + + findAllCreditCardAddress + + java.lang.String + + + + SELECT OBJECT(c) FROM jt2_Customer c + WHERE c.creditCard.creditCompany.address.city = ?1 + + + + + + findCustomerWithPhone + + org.objectweb.jonas.jtests.beans.ejbql.PhoneLocal + + + + SELECT OBJECT(c) FROM jt2_Customer c WHERE ?1 MEMBER OF c.phoneNumbers + + + + + + findCustomersWithCreditCard + + + + + SELECT OBJECT(c) FROM jt2_Customer c WHERE c.creditCard IS NOT NULL + + + + + + findCustomersWithOutCreditCard + + + + + SELECT OBJECT(c) FROM jt2_Customer c WHERE c.creditCard IS NULL + + + + + + findCustomersXWithOutCreditCard + + java.lang.String + + + + SELECT OBJECT(c) FROM jt2_Customer c WHERE c.firstName = ?1 AND c.creditCard IS NULL + + + + + + findCustomersWithCreditCompany + + + + + SELECT OBJECT(c) FROM jt2_Customer c WHERE c.creditCard.creditCompany IS NOT NULL + + + + + + findAllOrderByLastname + + + + SELECT OBJECT(c) FROM jt2_Customer c ORDER BY c.lastName + + + + + + findAllOrderByDescLastnameAscFirstname + + + + SELECT OBJECT(c) FROM jt2_Customer c ORDER BY c.lastName DESC, c.firstName ASC + + + + + + findAllWithLimit_1 + + int + + + + SELECT OBJECT(c) FROM jt2_Customer AS c WHERE c.id > 0 ORDER BY c.id LIMIT ?1 + + + + + + findAllWithLimit_2 + + int + + + + SELECT OBJECT(c) FROM jt2_Customer AS c ORDER BY c.id LIMIT ?1, 5 + + + + + + + findCustWithCCNumOrAddrZip + + java.lang.String + java.lang.String + + + + SELECT OBJECT(c) FROM jt2_Customer AS c WHERE c.creditCard.number = ?1 OR c.homeAddress.zip = ?2 + + + + + + ejbSelectAddrCity + + java.lang.Integer + + + + SELECT c.homeAddress.city FROM jt2_Customer AS c WHERE c.id = ?1 + + + + + + ejbSelectLastName + + java.lang.Integer + + + + SELECT c.lastName FROM jt2_Customer AS c WHERE c.id = ?1 + + + + + + ejbSelectAddr + + java.lang.Integer + + + + SELECT c.homeAddress FROM jt2_Customer AS c WHERE c.id = ?1 + + + + + + ejbSelectFirstName + + + + + SELECT c.firstName FROM jt2_Customer AS c + + + + + + ejbSelectDistinctFirstName + + + + + SELECT DISTINCT c.firstName FROM jt2_Customer AS c + + + + + + ejbSelectAllCreditCardAddr + + + Local + + SELECT c.creditCard.creditCompany.address FROM jt2_Customer c + + + + + + ejbSelectRogerAddr + + + Local + + SELECT c.homeAddress FROM jt2_Customer c WHERE c.firstName = 'Roger' + + + + + + ejbSelectCountCreditCard + + + + SELECT COUNT(c.creditCard) FROM jt2_Customer AS c + + + + + + ejbSelectCreditCardNumbers + + + + SELECT DISTINCT c.creditCard.number FROM jt2_Customer AS c ORDER BY c.creditCard.number ASC + + + + + + ejbSelectCountOfCustomersWithId1 + + java.lang.Integer + + + + SELECT COUNT(c) FROM jt2_Customer AS c WHERE c.id = ?1 + + + + + + ejbSelectCountOfCustomersWithId2 + + int + + + + SELECT COUNT(c) FROM jt2_Customer AS c WHERE c.id = ?1 + + + + + + ejbSelectCountOfCustomersRingo + + + + SELECT COUNT(c) FROM jt2_Customer AS c WHERE c.firstName = 'Ringo' + + + + + + + + ejbql/AddressEJB + AddressEJB + org.objectweb.jonas.jtests.beans.ejbql.AddressHomeRemote + org.objectweb.jonas.jtests.beans.ejbql.AddressRemote + org.objectweb.jonas.jtests.beans.ejbql.AddressHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.AddressLocal + org.objectweb.jonas.jtests.beans.ejbql.AddressBean + Container + java.lang.Integer + False + 2.x + jt2_Address + id + street + city + state + zip + id + + ejb/SequenceSessionLocalHome + Session + org.objectweb.jonas.jtests.beans.ejbql.SequenceSessionLocalHome + org.objectweb.jonas.jtests.beans.ejbql.SequenceSessionLocal + SequenceSession + + + + + findAllAddress + + + SELECT OBJECT(c) FROM jt2_Address c + + + + ejbSelectCountOfCities + + + SELECT COUNT(a.city) FROM jt2_Address AS a + + + + ejbSelectCountOfDistinctCities + + + SELECT COUNT(DISTINCT a.city) FROM jt2_Address AS a + + + + ejbSelectCities + + + SELECT a.city FROM jt2_Address AS a + + + + ejbSelectCreditCompanies + + + Local + SELECT a.creditCompany FROM jt2_Address AS a + + + + ejbSelectCreditCompanyNames + + + SELECT a.creditCompany.name FROM jt2_Address AS a + + + + ejbSelectCreditCompanyIds + + + SELECT a.creditCompany.id FROM jt2_Address AS a + + + + ejbSelectCreditCompanyNums + + + SELECT a.creditCompany.num FROM jt2_Address AS a + + + + findQuery300626 + + + SELECT OBJECT(a) FROM jt2_Address AS a + WHERE a.homecustomer.lastName = 'Smith80' + AND a.homecustomer.creditCard.id = 10 + AND a.homecustomer.creditCard.creditCompany.name = 'CETELEM' + AND a.homecustomer.creditCard.creditCompany.id = 10 + + + + + + + + ejbql/PhoneEJB + PhoneEJB + org.objectweb.jonas.jtests.beans.ejbql.PhoneHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.PhoneLocal + org.objectweb.jonas.jtests.beans.ejbql.PhoneBean + Container + java.lang.Integer + False + 2.x + jt2_Phone + id + number + type + id + + ejb/SequenceSessionLocalHome + Session + org.objectweb.jonas.jtests.beans.ejbql.SequenceSessionLocalHome + org.objectweb.jonas.jtests.beans.ejbql.SequenceSessionLocal + SequenceSession + + + + + findAllPhones + + + SELECT OBJECT(c) FROM jt2_Phone c + + + + findByNumber + + java.lang.String + + + SELECT OBJECT(p) FROM jt2_Phone AS p WHERE p.number = ?1 + + + + + ejbql/CreditCardEJB + CreditCardEJB + org.objectweb.jonas.jtests.beans.ejbql.CreditCardHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.CreditCardLocal + org.objectweb.jonas.jtests.beans.ejbql.CreditCardBean + Container + java.lang.Integer + False + 2.x + jt2_CCard + id + expirationDate + number + nameOnCard + creditOrganization + id + + ejb/CreditCompanyLocal + Entity + org.objectweb.jonas.jtests.beans.ejbql.CreditCompanyHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.CreditCompanyLocal + CreditCompanyEJB + + + ejb/SequenceSessionLocalHome + Session + org.objectweb.jonas.jtests.beans.ejbql.SequenceSessionLocalHome + org.objectweb.jonas.jtests.beans.ejbql.SequenceSessionLocal + SequenceSession + + + + + findAllCreditCards + + + SELECT OBJECT(cc) FROM jt2_CCard cc + + + + + + ejbql/CruiseEJB + CruiseEJB + org.objectweb.jonas.jtests.beans.ejbql.CruiseHomeRemote + org.objectweb.jonas.jtests.beans.ejbql.CruiseRemote + org.objectweb.jonas.jtests.beans.ejbql.CruiseHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.CruiseLocal + org.objectweb.jonas.jtests.beans.ejbql.CruiseBean + Container + java.lang.Integer + False + 2.x + jt2_Cruise + id + name + id + + ejb/SequenceSessionLocalHome + Session + org.objectweb.jonas.jtests.beans.ejbql.SequenceSessionLocalHome + org.objectweb.jonas.jtests.beans.ejbql.SequenceSessionLocal + SequenceSession + + + ejb/ShipLocalHome + Entity + org.objectweb.jonas.jtests.beans.ejbql.ShipHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.ShipLocal + ShipEJB + + + + + findAllCruises + + + SELECT OBJECT(cc) FROM jt2_Cruise cc + + + + + findByName + + java.lang.String + + + SELECT OBJECT(c) FROM jt2_Cruise c WHERE c.name = ?1 + + + + + ejbql/ShipEJB + ShipEJB + org.objectweb.jonas.jtests.beans.ejbql.ShipHomeRemote + org.objectweb.jonas.jtests.beans.ejbql.ShipRemote + org.objectweb.jonas.jtests.beans.ejbql.ShipHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.ShipLocal + org.objectweb.jonas.jtests.beans.ejbql.ShipBean + Container + java.lang.Integer + False + 2.x + jt2_Ship + id + name + tonnage + id + + + + findAllShips + + + SELECT OBJECT(cc) FROM jt2_Ship cc + + + + findByTonnage + + java.lang.Double + + + + SELECT OBJECT(s) FROM jt2_Ship s + WHERE s.tonnage = ?1 + + + + + findByTonnage + + java.lang.Double + java.lang.Double + + + + SELECT OBJECT(s) FROM jt2_Ship s + WHERE s.tonnage BETWEEN ?1 AND ?2 + + + + + ejbSelectAverageOfTonnage + + + + SELECT AVG(s.tonnage) FROM jt2_Ship AS s + + + + + ejbSelectListOfTonnage + + + + SELECT s.tonnage FROM jt2_Ship AS s + + + + + + ejbql/CreditCompanyEJB + CreditCompanyEJB + org.objectweb.jonas.jtests.beans.ejbql.CreditCompanyHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.CreditCompanyLocal + org.objectweb.jonas.jtests.beans.ejbql.CreditCompanyBean + Container + java.lang.Integer + False + 2.x + jt2_CCompany + id + name + num + id + + ejb/AddressHomeRemote + Entity + org.objectweb.jonas.jtests.beans.ejbql.AddressHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.AddressLocal + AddressEJB + + + ejb/SequenceSessionLocalHome + Session + org.objectweb.jonas.jtests.beans.ejbql.SequenceSessionLocalHome + org.objectweb.jonas.jtests.beans.ejbql.SequenceSessionLocal + SequenceSession + + + + + findAllCreditCompany + + + SELECT OBJECT(cc) FROM jt2_CCompany cc + + + + + ejbql/ReservationEJB + ReservationEJB + org.objectweb.jonas.jtests.beans.ejbql.ReservationHomeRemote + org.objectweb.jonas.jtests.beans.ejbql.ReservationRemote + org.objectweb.jonas.jtests.beans.ejbql.ReservationHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.ReservationLocal + org.objectweb.jonas.jtests.beans.ejbql.ReservationBean + Container + java.lang.Integer + False + 2.x + jt2_Reservation + id + amountPaid + date + id + + ejb/SequenceSessionLocalHome + Session + org.objectweb.jonas.jtests.beans.ejbql.SequenceSessionLocalHome + org.objectweb.jonas.jtests.beans.ejbql.SequenceSessionLocal + SequenceSession + + + ejb/CustomerLocalHome + Entity + org.objectweb.jonas.jtests.beans.ejbql.CustomerHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.CustomerLocal + CustomerEJB + + + ejb/CruiseLocalHome + Entity + org.objectweb.jonas.jtests.beans.ejbql.CruiseHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.CruiseLocal + CruiseEJB + + + ejb/CabinLocalHome + Entity + org.objectweb.jonas.jtests.beans.ejbql.CabinHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.CabinLocal + CabinEJB + + + + + findAllReservations + + + SELECT OBJECT(cc) FROM jt2_Reservation cc + + + + findReservationsWithLesserAmount + + + + SELECT DISTINCT OBJECT(r1) FROM jt2_Reservation AS r1, jt2_Reservation AS r2 + WHERE r1.amountPaid < r2.amountPaid AND r2.id = 26 + + + + + findOrderedRsrv + + + SELECT DISTINCT OBJECT(r) FROM jt2_Reservation AS r ORDER BY r.amountPaid + + + + ejbSelectCountOfReservations + + + SELECT COUNT(r) FROM jt2_Reservation AS r + + + + ejbSelectMinAmountOfReservations + + + SELECT MIN(r.amountPaid) FROM jt2_Reservation AS r + + + + ejbSelectMinAmountForCruise + + java.lang.String + + + SELECT MIN(r.amountPaid) FROM jt2_Reservation AS r WHERE r.cruise.name = ?1 + + + + ejbSelectMaxAmountOfReservations + + + SELECT MAX(r.amountPaid) FROM jt2_Reservation AS r + + + + ejbSelectAmountsForCruise + + java.lang.String + + + SELECT r.amountPaid FROM jt2_Reservation AS r WHERE r.cruise.name = ?1 + + + + ejbSelectCountOfReservationsForCustomer + + org.objectweb.jonas.jtests.beans.ejbql.CustomerLocal + + + SELECT COUNT(r) FROM jt2_Reservation AS r WHERE ?1 MEMBER OF r.customers + + + + ejbSelectAmountOfReservationsForCustomer + + org.objectweb.jonas.jtests.beans.ejbql.CustomerLocal + + + SELECT SUM(r.amountPaid) FROM jt2_Reservation AS r WHERE ?1 MEMBER OF r.customers + + + + + ejbql/CabinEJB + CabinEJB + org.objectweb.jonas.jtests.beans.ejbql.CabinHomeRemote + org.objectweb.jonas.jtests.beans.ejbql.CabinRemote + org.objectweb.jonas.jtests.beans.ejbql.CabinHomeLocal + org.objectweb.jonas.jtests.beans.ejbql.CabinLocal + org.objectweb.jonas.jtests.beans.ejbql.CabinBean + Container + java.lang.Integer + False + 2.x + jt2_Cabin + id + name + deckLevel + bedCount + id + + + + findAllOnDeckLevel + + java.lang.Integer + + + + SELECT OBJECT(c) FROM jt2_Cabin as c WHERE c.deckLevel = ?1 + + + + + findAllOnDeckLevel1_3_5 + + + + + SELECT OBJECT(c) FROM jt2_Cabin as c WHERE c.deckLevel IN ( 1 , 3 , 5 ) + + + + + findAllOnDeckLevel1_3_X + + int + + + + SELECT OBJECT(c) FROM jt2_Cabin as c WHERE c.deckLevel IN ( 1 , 3 , ?1 ) + + + + + findAllCabins + + + SELECT OBJECT(cc) FROM jt2_Cabin cc + + + + ejbSelectDeckLevel + + java.lang.Integer + + + + SELECT c.deckLevel FROM jt2_Cabin AS c WHERE c.id = ?1 + + + + + + ejbql/Sequence + Sequence + org.objectweb.jonas.jtests.beans.ejbql.SequenceLocalHome + org.objectweb.jonas.jtests.beans.ejbql.SequenceLocal + org.objectweb.jonas.jtests.beans.ejbql.SequenceEC2 + Container + java.lang.String + False + 2.x + jt2_Sequence + + index + + + name + + name + + + + SequenceSession + org.objectweb.jonas.jtests.beans.ejbql.SequenceSessionHome + org.objectweb.jonas.jtests.beans.ejbql.SequenceSession + org.objectweb.jonas.jtests.beans.ejbql.SequenceSessionLocalHome + org.objectweb.jonas.jtests.beans.ejbql.SequenceSessionLocal + org.objectweb.jonas.jtests.beans.ejbql.SequenceSessionSL + Stateless + Container + + + retryCount + java.lang.Integer + 5 + + + + blockSize + java.lang.Integer + 10 + + + ejb/SequenceLocalHome + Entity + org.objectweb.jonas.jtests.beans.ejbql.SequenceLocalHome + org.objectweb.jonas.jtests.beans.ejbql.SequenceLocal + Sequence + + + + + + + + Customer-Address + + Customer-has-a-Address + One + + CustomerEJB + + + homeAddress + + + + Address-belongs-to-Customer + One + + AddressEJB + + + homecustomer + + + + + + Customer-CreditCard + + Customer-has-a-CreditCard + One + + CustomerEJB + + creditCard + + + + CreditCard-belongs-to-Customer + One + + CreditCardEJB + + customer + + + + + Customer-Phones + + Customer-has-many-Phone-numbers + One + + CustomerEJB + + + phoneNumbers + java.util.Collection + + + + Phone-belongs-to-Customer + Many + + PhoneEJB + + + + + + Customer-Reservation + + Customer-has-many-Reservations + Many + + CustomerEJB + + + reservations + java.util.Collection + + + + Reservation-has-many-Customers + Many + ReservationEJB + + + customers + java.util.Set + + + + + + Cruise-Ship + + Cruise-has-a-Ship + Many + + CruiseEJB + + ship + + + Ship-has-many-Cruises + One + + ShipEJB + + + + + + CreditCard-CreditCompany + + CreditCard-has-a-CreditCompany + Many + + CreditCardEJB + + creditCompany + + + CreditCompany-has-many-CreditCard + One + + CreditCompanyEJB + + + + + + CreditCompany-Address + + CreditCompany-has-a-Address + One + + CreditCompanyEJB + + address + + + Address-has-a-Creditcompany + One + + AddressEJB + + creditCompany + + + + + Cruise-Reservation + + Cruise-has-many-Reservations + One + + CruiseEJB + + + reservations + java.util.Collection + + + + Reservation-has-a-Cruise + Many + + ReservationEJB + + cruise + + + + + Cabin-Ship + + Cabin-has-a-Ship + Many + + CabinEJB + + ship + + + Ship-has-many-Cabins + One + + ShipEJB + + + + + + Cabin-Reservation + + Cabin-has-many-Reservations + Many + + CabinEJB + + + + Reservation-has-many-Cabins + Many + + ReservationEJB + + + cabins + java.util.Set + + + + + + + + + + + + CabinEJB + * + + + RTravelAgentEJB + * + + + TravelAgentEJB + * + + + CustomerEJB + * + + + AddressEJB + * + + + CreditCardEJB + * + + + PhoneEJB + * + + + CruiseEJB + * + + + ShipEJB + * + + + CreditCompanyEJB + * + + + ReservationEJB + * + + Required + + + + + SessionTestEJB + * + + Required + + + + + + Sequence + getNextKeyAfterIncrementingBy + + Required + + + + + SequenceSession + * + + + Sequence + * + + Required + + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/jonas-ejbql.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/jonas-ejbql.xml new file mode 100644 index 0000000000000000000000000000000000000000..411be77c5ff1745a0b0a0409a31f15064d6e7c48 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/ejbql/jonas-ejbql.xml @@ -0,0 +1,121 @@ + + + + + + SessionTestEJB + EjbqlSessionTestHomeRemote + + + + CustomerEJB + CustomerHomeRemote + removeall + container-read-write + jdbc_1 + + + + AddressEJB + AddressHomeRemote + removeall + container-read-write + jdbc_1 + + + + CabinEJB + CabinHomeRemote + removeall + container-read-write + jdbc_1 + + + + PhoneEJB + PhoneHomeRemote + removeall + container-read-write + jdbc_1 + + + + CreditCardEJB + CreditCardHomeRemote + removeall + container-read-write + jdbc_1 + + + + CruiseEJB + CruiseHomeRemote + removeall + container-read-write + jdbc_1 + + + + ShipEJB + ShipHomeRemote + removeall + container-read-write + jdbc_1 + + + + CreditCompanyEJB + CreditCompanyLocal + removeall + container-read-write + jdbc_1 + + + + ReservationEJB + ReservationHomeRemote + removeall + container-read-write + jdbc_1 + + + + + Sequence + removedata + jdbc_1 + + + + SequenceSession + SequenceSessionHomeRemote + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/EtypeBean.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/EtypeBean.java new file mode 100644 index 0000000000000000000000000000000000000000..8ff06d46919ad3dc627fdfa819e7e383003e1366 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/EtypeBean.java @@ -0,0 +1,82 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype; + +import javax.ejb.EntityBean; +import javax.ejb.EntityContext; +import javax.ejb.RemoveException; + +import org.objectweb.jonas.common.Log; +import org.objectweb.util.monolog.api.BasicLevel; +import org.objectweb.util.monolog.api.Logger; + + +/** + * This class implements the common code of all the entities beans classes of the etype/* tests. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class EtypeBean implements EntityBean { + + static protected Logger logger = null; + + protected EntityContext entityContext; + + public void setEntityContext(EntityContext ctx) { + if (logger == null) + logger = Log.getLogger(Log.JONAS_TESTS_PREFIX); + logger.log(BasicLevel.DEBUG, ""); + entityContext = ctx; + + } + + public void unsetEntityContext() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbActivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbPassivate() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbLoad() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbStore() { + logger.log(BasicLevel.DEBUG, ""); + } + + public void ejbRemove() throws RemoveException { + logger.log(BasicLevel.DEBUG, ""); + } + + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/bytearray/ByteArray.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/bytearray/ByteArray.java new file mode 100644 index 0000000000000000000000000000000000000000..e96d9ba489568b71cf2d1bc1ac15f910cb2c0e89 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/bytearray/ByteArray.java @@ -0,0 +1,44 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// ByteArray.java + +package org.objectweb.jonas.jtests.beans.etype.bytearray; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the bytearray bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface ByteArray extends EJBObject { + public String getPk() throws RemoteException; + public byte[] getF1() throws RemoteException; + public void setF1(byte[] F1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/bytearray/ByteArrayEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/bytearray/ByteArrayEC.java new file mode 100644 index 0000000000000000000000000000000000000000..40380afede337fd57f652054351c099cbe9fcae9 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/bytearray/ByteArrayEC.java @@ -0,0 +1,63 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.bytearray; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Entity bean with container-managed persistence version 1.1, + * with a field which is a byte array. + * @author Helene Joanin + * Contributor(s): + */ + +public class ByteArrayEC extends ByteArrayEC2 implements EntityBean { + + // State of the bean (CMP v1) + public String pk; + public byte[] f1; + + // Accessors implementation + public String getPk() { + logger.log(BasicLevel.DEBUG, ""); + return this.pk; + } + public void setPk(String pk) { + logger.log(BasicLevel.DEBUG, ""); + this.pk = pk; + } + public byte[] getF1() { + logger.log(BasicLevel.DEBUG, ""); + return this.f1; + } + public void setF1(byte[] f1) { + logger.log(BasicLevel.DEBUG, ""); + this.f1 = f1; + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/bytearray/ByteArrayEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/bytearray/ByteArrayEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..5bd641a737e06afffe6942365b9020bf129064cc --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/bytearray/ByteArrayEC2.java @@ -0,0 +1,63 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.bytearray; + +import javax.ejb.EntityBean; +import javax.ejb.CreateException; + +import org.objectweb.util.monolog.api.BasicLevel; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; + + +/** + * bytearray entity bean class. + * bytearray is an entity bean with container-managed persistence version 2, + * with a field which is a byte array. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class ByteArrayEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract String getPk(); + public abstract void setPk(String pk); + public abstract byte[] getF1(); + public abstract void setF1(byte[] f1); + + public String ejbCreate(String pk, byte[] f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate(" + pk + "," + f1 + ")"); + setPk(pk); + setF1(f1); + return (null); + } + + public void ejbPostCreate(String pk, byte[] f1) { + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/bytearray/ByteArrayHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/bytearray/ByteArrayHome.java new file mode 100644 index 0000000000000000000000000000000000000000..de6e3d4f6a2509535cd9b03663b3d8f69a040b09 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/bytearray/ByteArrayHome.java @@ -0,0 +1,48 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// ByteArrayHome.java + +package org.objectweb.jonas.jtests.beans.etype.bytearray; + +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the bytearray bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface ByteArrayHome extends EJBHome { + ByteArray create(String pk, byte[] f1) throws RemoteException, CreateException; + ByteArray findByPrimaryKey(String pk) throws RemoteException, FinderException; + Collection findByF1(byte[] f1) throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/bytearray/bytearray.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/bytearray/bytearray.xml new file mode 100644 index 0000000000000000000000000000000000000000..f67d3dfb253b14f4e56e37b995b81828eb88be67 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/bytearray/bytearray.xml @@ -0,0 +1,101 @@ + + + + + etype/bytearray + + + + + etype/bytearray/ByteArrayEC + ByteArrayEC + org.objectweb.jonas.jtests.beans.etype.bytearray.ByteArrayHome + org.objectweb.jonas.jtests.beans.etype.bytearray.ByteArray + org.objectweb.jonas.jtests.beans.etype.bytearray.ByteArrayEC + Container + java.lang.String + false + 1.x + + pk + + + f1 + + pk + + + + etype/bytearray/ByteArrayEC2 + ByteArrayEC2 + org.objectweb.jonas.jtests.beans.etype.bytearray.ByteArrayHome + org.objectweb.jonas.jtests.beans.etype.bytearray.ByteArray + org.objectweb.jonas.jtests.beans.etype.bytearray.ByteArrayEC2 + Container + java.lang.String + false + 2.x + jt2_bytearray + + pk + + + f1 + + pk + + + findByF1 + + byte[] + + + SELECT OBJECT(o) FROM jt2_bytearray o WHERE o.f1 = ?1 + + + + + + + + + ByteArrayEC + * + + + ByteArrayEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/bytearray/jonas-bytearray.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/bytearray/jonas-bytearray.xml new file mode 100644 index 0000000000000000000000000000000000000000..fe42ccb78f7339fb8ecd7951271b3f3bcdb89a84 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/bytearray/jonas-bytearray.xml @@ -0,0 +1,73 @@ + + + + + + ByteArrayEC + EtypeByteArrayECHome + + jdbc_1 + JT_EtypeByteArrayEC + + pk + c_pk + + + f1 + c_f1 + + + + findByF1 + + where c_f1 = ? + + + + + + ByteArrayEC2 + EtypeByteArrayEC2Home + removeall + + jdbc_1 + JT2_BYTEARRAY_ + + pk + pk_ + + + f1 + f1_ + + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obigd/Obigdecimal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obigd/Obigdecimal.java new file mode 100644 index 0000000000000000000000000000000000000000..659ce56562982b193fcb55f9bc0eee46ef8247ff --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obigd/Obigdecimal.java @@ -0,0 +1,44 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Obigdecimal.java + +package org.objectweb.jonas.jtests.beans.etype.obigd; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the obigd bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Obigdecimal extends EJBObject { + public String getPk() throws RemoteException; + public java.math.BigDecimal getF1() throws RemoteException; + public void setF1(java.math.BigDecimal F1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obigd/ObigdecimalEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obigd/ObigdecimalEC.java new file mode 100644 index 0000000000000000000000000000000000000000..b35437dca6ee33a4dc07f30e939faafcf31da7bd --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obigd/ObigdecimalEC.java @@ -0,0 +1,63 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.obigd; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Entity bean with container-managed persistence version 1.1, + * with a field which is a java.math.BigDecimal. + * @author Helene Joanin + * Contributor(s): + */ + +public class ObigdecimalEC extends ObigdecimalEC2 implements EntityBean { + + // State of the bean (CMP v1) + public String pk; + public java.math.BigDecimal f1; + + // Accessors implementation + public String getPk() { + logger.log(BasicLevel.DEBUG, ""); + return this.pk; + } + public void setPk(String pk) { + logger.log(BasicLevel.DEBUG, ""); + this.pk = pk; + } + public java.math.BigDecimal getF1() { + logger.log(BasicLevel.DEBUG, ""); + return this.f1; + } + public void setF1(java.math.BigDecimal f1) { + logger.log(BasicLevel.DEBUG, ""); + this.f1 = f1; + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obigd/ObigdecimalEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obigd/ObigdecimalEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..71c57cc66a51ea86518f3919106b5db2890b02b4 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obigd/ObigdecimalEC2.java @@ -0,0 +1,62 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.obigd; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * obigd entity bean class. + * obigd is an entity bean with container-managed persistence version 2, + * with a field which is a java.math.BigDecimal. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class ObigdecimalEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract String getPk(); + public abstract void setPk(String pk); + public abstract java.math.BigDecimal getF1(); + public abstract void setF1(java.math.BigDecimal f1); + + public String ejbCreate(String pk, java.math.BigDecimal f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate("+pk+","+f1+")"); + setPk(pk); + setF1(f1); + return(null); + } + + public void ejbPostCreate(String pk, java.math.BigDecimal f1){ + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obigd/ObigdecimalHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obigd/ObigdecimalHome.java new file mode 100644 index 0000000000000000000000000000000000000000..0e7007c2ee6d8fb1509ec18edf6336155ed76beb --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obigd/ObigdecimalHome.java @@ -0,0 +1,48 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// ObigdecimalHome.java + +package org.objectweb.jonas.jtests.beans.etype.obigd; + +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the obigd bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface ObigdecimalHome extends EJBHome { + public Obigdecimal create(String pk, java.math.BigDecimal f1) throws RemoteException, CreateException; + public Obigdecimal findByPrimaryKey(String pk) throws RemoteException, FinderException; + public Collection findByF1(java.math.BigDecimal f1) throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obigd/jonas-obigd.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obigd/jonas-obigd.xml new file mode 100644 index 0000000000000000000000000000000000000000..ddfd8c7013a654e53b78682e60495d8a93ed4e63 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obigd/jonas-obigd.xml @@ -0,0 +1,63 @@ + + + + + + + + ObigdecimalEC + EtypeObigdecimalECHome + + jdbc_1 + JT_EtypeObigdecimalEC + + pk + c_pk + + + f1 + c_f1 + + + + findByF1 + + where c_f1 = ? + + + + + + ObigdecimalEC2 + EtypeObigdecimalEC2Home + removeall + + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obigd/obigd.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obigd/obigd.xml new file mode 100644 index 0000000000000000000000000000000000000000..e38865b3a2e51e26cb61a86e5a76fee62de62106 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obigd/obigd.xml @@ -0,0 +1,98 @@ + + + + + + etype/obigd + + + + + etype/obigd/ObigdecimalEC + ObigdecimalEC + org.objectweb.jonas.jtests.beans.etype.obigd.ObigdecimalHome + org.objectweb.jonas.jtests.beans.etype.obigd.Obigdecimal + org.objectweb.jonas.jtests.beans.etype.obigd.ObigdecimalEC + Container + java.lang.String + False + 1.x + + pk + + + f1 + + pk + + + + etype/obigd/ObigdecimalEC2 + ObigdecimalEC2 + org.objectweb.jonas.jtests.beans.etype.obigd.ObigdecimalHome + org.objectweb.jonas.jtests.beans.etype.obigd.Obigdecimal + org.objectweb.jonas.jtests.beans.etype.obigd.ObigdecimalEC2 + Container + java.lang.String + False + 2.x + jt2_obigd + + pk + + + f1 + + pk + + + findByF1 + + java.math.BigDecimal + + + SELECT OBJECT(o) FROM jt2_obigd o WHERE o.f1 = ?1 + + + + + + + + + ObigdecimalEC + * + + + ObigdecimalEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oboolean/Oboolean.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oboolean/Oboolean.java new file mode 100644 index 0000000000000000000000000000000000000000..0bcb62ef397bab9a87698f4ca77460e75011add5 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oboolean/Oboolean.java @@ -0,0 +1,44 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Oboolean.java + +package org.objectweb.jonas.jtests.beans.etype.oboolean; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the oboolean bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Oboolean extends EJBObject { + public String getPk() throws RemoteException; + public Boolean getF1() throws RemoteException; + public void setF1(Boolean F1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oboolean/ObooleanEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oboolean/ObooleanEC.java new file mode 100644 index 0000000000000000000000000000000000000000..ef840baf67f5b488117683cc90a72adb1b867ace --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oboolean/ObooleanEC.java @@ -0,0 +1,63 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.oboolean; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Entity bean with container-managed persistence version 1.1, + * with a field which is a java.lang.Boolean. + * @author Helene Joanin + * Contributor(s): + */ + +public class ObooleanEC extends ObooleanEC2 implements EntityBean { + + // State of the bean (CMP v1) + public String pk; + public Boolean f1; + + // Accessors implementation + public String getPk() { + logger.log(BasicLevel.DEBUG, ""); + return this.pk; + } + public void setPk(String pk) { + logger.log(BasicLevel.DEBUG, ""); + this.pk = pk; + } + public Boolean getF1() { + logger.log(BasicLevel.DEBUG, ""); + return this.f1; + } + public void setF1(Boolean f1) { + logger.log(BasicLevel.DEBUG, ""); + this.f1 = f1; + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oboolean/ObooleanEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oboolean/ObooleanEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..f58f6e783f1071b53220910eb5df943896340417 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oboolean/ObooleanEC2.java @@ -0,0 +1,62 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.oboolean; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * oboolean entity bean class. + * oboolean is an entity bean with container-managed persistence version 2, + * with a field which is a java.lang.Boolean. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class ObooleanEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract String getPk(); + public abstract void setPk(String pk); + public abstract Boolean getF1(); + public abstract void setF1(Boolean f1); + + public String ejbCreate(String pk, Boolean f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate("+pk+","+f1+")"); + setPk(pk); + setF1(f1); + return(null); + } + + public void ejbPostCreate(String pk, Boolean f1){ + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oboolean/ObooleanHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oboolean/ObooleanHome.java new file mode 100644 index 0000000000000000000000000000000000000000..d9de3361cff966ab68647fdffb57c345006349fa --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oboolean/ObooleanHome.java @@ -0,0 +1,48 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// ObooleanHome.java + +package org.objectweb.jonas.jtests.beans.etype.oboolean; + +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the oboolean bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface ObooleanHome extends EJBHome { + public Oboolean create(String pk, Boolean f1) throws RemoteException, CreateException; + public Oboolean findByPrimaryKey(String pk) throws RemoteException, FinderException; + public Collection findByF1(Boolean f1) throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oboolean/jonas-oboolean.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oboolean/jonas-oboolean.xml new file mode 100644 index 0000000000000000000000000000000000000000..d5f8ce42b045d89fbd363391f5ba0958241f1b41 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oboolean/jonas-oboolean.xml @@ -0,0 +1,63 @@ + + + + + + + + ObooleanEC + EtypeObooleanECHome + + jdbc_1 + JT_EtypeObooleanEC + + pk + c_pk + + + f1 + c_f1 + + + + findByF1 + + where c_f1 = ? + + + + + + ObooleanEC2 + EtypeObooleanEC2Home + removeall + + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oboolean/oboolean.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oboolean/oboolean.xml new file mode 100644 index 0000000000000000000000000000000000000000..21debc84a40fe1e1a2e0e895f116f80722e301c8 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oboolean/oboolean.xml @@ -0,0 +1,98 @@ + + + + + + etype/oboolean + + + + + etype/oboolean/ObooleanEC + ObooleanEC + org.objectweb.jonas.jtests.beans.etype.oboolean.ObooleanHome + org.objectweb.jonas.jtests.beans.etype.oboolean.Oboolean + org.objectweb.jonas.jtests.beans.etype.oboolean.ObooleanEC + Container + java.lang.String + False + 1.x + + pk + + + f1 + + pk + + + + etype/oboolean/ObooleanEC2 + ObooleanEC2 + org.objectweb.jonas.jtests.beans.etype.oboolean.ObooleanHome + org.objectweb.jonas.jtests.beans.etype.oboolean.Oboolean + org.objectweb.jonas.jtests.beans.etype.oboolean.ObooleanEC2 + Container + java.lang.String + False + 2.x + jt2_oboolean + + pk + + + f1 + + pk + + + findByF1 + + java.lang.Boolean + + + SELECT OBJECT(o) FROM jt2_oboolean o WHERE o.f1 = ?1 + + + + + + + + + ObooleanEC + * + + + ObooleanEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obyte/Obyte.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obyte/Obyte.java new file mode 100644 index 0000000000000000000000000000000000000000..c1327da969f09478449367f0b9a6bab628c714ed --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obyte/Obyte.java @@ -0,0 +1,44 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Obyte.java + +package org.objectweb.jonas.jtests.beans.etype.obyte; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the obyte bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Obyte extends EJBObject { + public String getPk() throws RemoteException; + public Byte getF1() throws RemoteException; + public void setF1(Byte F1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obyte/ObyteEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obyte/ObyteEC.java new file mode 100644 index 0000000000000000000000000000000000000000..e11d29961b0333f3a321ae2a737ebc39a9c6a1df --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obyte/ObyteEC.java @@ -0,0 +1,63 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.obyte; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Entity bean with container-managed persistence version 1.1, + * with a field which is a java.lang.Byte. + * @author Helene Joanin + * Contributor(s): + */ + +public class ObyteEC extends ObyteEC2 implements EntityBean { + + // State of the bean (CMP v1) + public String pk; + public Byte f1; + + // Accessors implementation + public String getPk() { + logger.log(BasicLevel.DEBUG, ""); + return this.pk; + } + public void setPk(String pk) { + logger.log(BasicLevel.DEBUG, ""); + this.pk = pk; + } + public Byte getF1() { + logger.log(BasicLevel.DEBUG, ""); + return this.f1; + } + public void setF1(Byte f1) { + logger.log(BasicLevel.DEBUG, ""); + this.f1 = f1; + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obyte/ObyteEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obyte/ObyteEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..11809d95387f96a08c9e37c08d354472d7f3283e --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obyte/ObyteEC2.java @@ -0,0 +1,62 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.obyte; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * obyte entity bean class. + * obyte is an entity bean with container-managed persistence version 2, + * with a field which is a java.lang.Byte. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class ObyteEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract String getPk(); + public abstract void setPk(String pk); + public abstract Byte getF1(); + public abstract void setF1(Byte f1); + + public String ejbCreate(String pk, Byte f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate("+pk+","+f1+")"); + setPk(pk); + setF1(f1); + return(null); + } + + public void ejbPostCreate(String pk, Byte f1){ + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obyte/ObyteHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obyte/ObyteHome.java new file mode 100644 index 0000000000000000000000000000000000000000..42c58ea89822a9f45e091db64c586af48b42b0ec --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obyte/ObyteHome.java @@ -0,0 +1,48 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// ObyteHome.java + +package org.objectweb.jonas.jtests.beans.etype.obyte; + +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the obyte bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface ObyteHome extends EJBHome { + public Obyte create(String pk, Byte f1) throws RemoteException, CreateException; + public Obyte findByPrimaryKey(String pk) throws RemoteException, FinderException; + public Collection findByF1(Byte f1) throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obyte/jonas-obyte.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obyte/jonas-obyte.xml new file mode 100644 index 0000000000000000000000000000000000000000..3bd856c3c81c6684b11868332669041b7fc5cbc9 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obyte/jonas-obyte.xml @@ -0,0 +1,63 @@ + + + + + + + + ObyteEC + EtypeObyteECHome + + jdbc_1 + JT_EtypeObyteEC + + pk + c_pk + + + f1 + c_f1 + + + + findByF1 + + where c_f1 = ? + + + + + + ObyteEC2 + EtypeObyteEC2Home + removeall + + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obyte/obyte.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obyte/obyte.xml new file mode 100644 index 0000000000000000000000000000000000000000..5e01471733ad678ec596aa526225a6a8c7724925 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/obyte/obyte.xml @@ -0,0 +1,99 @@ + + + + + + + etype/obyte + + + + + etype/obyte/ObyteEC + ObyteEC + org.objectweb.jonas.jtests.beans.etype.obyte.ObyteHome + org.objectweb.jonas.jtests.beans.etype.obyte.Obyte + org.objectweb.jonas.jtests.beans.etype.obyte.ObyteEC + Container + java.lang.String + False + 1.x + + pk + + + f1 + + pk + + + + etype/obyte/ObyteEC2 + ObyteEC2 + org.objectweb.jonas.jtests.beans.etype.obyte.ObyteHome + org.objectweb.jonas.jtests.beans.etype.obyte.Obyte + org.objectweb.jonas.jtests.beans.etype.obyte.ObyteEC2 + Container + java.lang.String + False + 2.x + jt2_obyte + + pk + + + f1 + + pk + + + findByF1 + + java.lang.Byte + + + SELECT OBJECT(o) FROM jt2_obyte o WHERE o.f1 = ?1 + + + + + + + + + ObyteEC + * + + + ObyteEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/odouble/Odouble.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/odouble/Odouble.java new file mode 100644 index 0000000000000000000000000000000000000000..a72c827e5a4582cbb5179cb6af053af9bb09f824 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/odouble/Odouble.java @@ -0,0 +1,44 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Odouble.java + +package org.objectweb.jonas.jtests.beans.etype.odouble; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the odouble bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Odouble extends EJBObject { + public String getPk() throws RemoteException; + public Double getF1() throws RemoteException; + public void setF1(Double F1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/odouble/OdoubleEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/odouble/OdoubleEC.java new file mode 100644 index 0000000000000000000000000000000000000000..84383781de91387f2bda6cc1a0bd923c6cfdbc2d --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/odouble/OdoubleEC.java @@ -0,0 +1,63 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.odouble; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Entity bean with container-managed persistence version 1.1, + * with a field which is a java.lang.Double. + * @author Helene Joanin + * Contributor(s): + */ + +public class OdoubleEC extends OdoubleEC2 implements EntityBean { + + // State of the bean (CMP v1) + public String pk; + public Double f1; + + // Accessors implementation + public String getPk() { + logger.log(BasicLevel.DEBUG, ""); + return this.pk; + } + public void setPk(String pk) { + logger.log(BasicLevel.DEBUG, ""); + this.pk = pk; + } + public Double getF1() { + logger.log(BasicLevel.DEBUG, ""); + return this.f1; + } + public void setF1(Double f1) { + logger.log(BasicLevel.DEBUG, ""); + this.f1 = f1; + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/odouble/OdoubleEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/odouble/OdoubleEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..d426d547fb6f75fb87b8951c50f41bbf50de0f2c --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/odouble/OdoubleEC2.java @@ -0,0 +1,62 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.odouble; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * odouble entity bean class. + * odouble is an entity bean with container-managed persistence version 2, + * with a field which is a java.lang.Double. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class OdoubleEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract String getPk(); + public abstract void setPk(String pk); + public abstract Double getF1(); + public abstract void setF1(Double f1); + + public String ejbCreate(String pk, Double f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate("+pk+","+f1+")"); + setPk(pk); + setF1(f1); + return(null); + } + + public void ejbPostCreate(String pk, Double f1){ + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/odouble/OdoubleHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/odouble/OdoubleHome.java new file mode 100644 index 0000000000000000000000000000000000000000..98dbc55377b59f2d03133f1e39c1536638a8e8c4 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/odouble/OdoubleHome.java @@ -0,0 +1,48 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// OdoubleHome.java + +package org.objectweb.jonas.jtests.beans.etype.odouble; + +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the odouble bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface OdoubleHome extends EJBHome { + public Odouble create(String pk, Double f1) throws RemoteException, CreateException; + public Odouble findByPrimaryKey(String pk) throws RemoteException, FinderException; + public Collection findByF1(Double f1Min, Double f1Max) throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/odouble/jonas-odouble.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/odouble/jonas-odouble.xml new file mode 100644 index 0000000000000000000000000000000000000000..1e146e849e675bb7aaac8e493e1a394dcc505e7f --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/odouble/jonas-odouble.xml @@ -0,0 +1,63 @@ + + + + + + + + OdoubleEC + EtypeOdoubleECHome + + jdbc_1 + JT_EtypeOdoubleEC + + pk + c_pk + + + f1 + c_f1 + + + + findByF1 + + where c_f1 BETWEEN ?1 AND ?2 + + + + + + OdoubleEC2 + EtypeOdoubleEC2Home + removeall + + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/odouble/odouble.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/odouble/odouble.xml new file mode 100644 index 0000000000000000000000000000000000000000..f3c2d5fb78b849286348382e401649e09862955f --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/odouble/odouble.xml @@ -0,0 +1,99 @@ + + + + + + etype/odouble + + + + + etype/odouble/OdoubleEC + OdoubleEC + org.objectweb.jonas.jtests.beans.etype.odouble.OdoubleHome + org.objectweb.jonas.jtests.beans.etype.odouble.Odouble + org.objectweb.jonas.jtests.beans.etype.odouble.OdoubleEC + Container + java.lang.String + False + 1.x + + pk + + + f1 + + pk + + + + etype/odouble/OdoubleEC2 + OdoubleEC2 + org.objectweb.jonas.jtests.beans.etype.odouble.OdoubleHome + org.objectweb.jonas.jtests.beans.etype.odouble.Odouble + org.objectweb.jonas.jtests.beans.etype.odouble.OdoubleEC2 + Container + java.lang.String + False + 2.x + jt2_odouble + + pk + + + f1 + + pk + + + findByF1 + + java.lang.Double + java.lang.Double + + + SELECT OBJECT(o) FROM jt2_odouble o WHERE (o.f1 BETWEEN ?1 AND ?2) + + + + + + + + + OdoubleEC + * + + + OdoubleEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat/Ofloat.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat/Ofloat.java new file mode 100644 index 0000000000000000000000000000000000000000..e3ea17d13c83ece7698f19953559b1e16089c362 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat/Ofloat.java @@ -0,0 +1,44 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Ofloat.java + +package org.objectweb.jonas.jtests.beans.etype.ofloat; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the ofloat bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Ofloat extends EJBObject { + public String getPk() throws RemoteException; + public Float getF1() throws RemoteException; + public void setF1(Float F1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat/OfloatEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat/OfloatEC.java new file mode 100644 index 0000000000000000000000000000000000000000..c748ec61bea849013e989b6e1c40d4cc2e896202 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat/OfloatEC.java @@ -0,0 +1,63 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.ofloat; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Entity bean with container-managed persistence version 1.1, + * with a field which is a java.lang.Float. + * @author Helene Joanin + * Contributor(s): + */ + +public class OfloatEC extends OfloatEC2 implements EntityBean { + + // State of the bean (CMP v1) + public String pk; + public Float f1; + + // Accessors implementation + public String getPk() { + logger.log(BasicLevel.DEBUG, ""); + return this.pk; + } + public void setPk(String pk) { + logger.log(BasicLevel.DEBUG, ""); + this.pk = pk; + } + public Float getF1() { + logger.log(BasicLevel.DEBUG, ""); + return this.f1; + } + public void setF1(Float f1) { + logger.log(BasicLevel.DEBUG, ""); + this.f1 = f1; + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat/OfloatEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat/OfloatEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..2bc7514100f5dc22b89f284adf62543edadbdec4 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat/OfloatEC2.java @@ -0,0 +1,62 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.ofloat; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * ofloat entity bean class. + * ofloat is an entity bean with container-managed persistence version 2, + * with a field which is a java.lang.Float. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class OfloatEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract String getPk(); + public abstract void setPk(String pk); + public abstract Float getF1(); + public abstract void setF1(Float f1); + + public String ejbCreate(String pk, Float f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate("+pk+","+f1+")"); + setPk(pk); + setF1(f1); + return(null); + } + + public void ejbPostCreate(String pk, Float f1){ + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat/OfloatHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat/OfloatHome.java new file mode 100644 index 0000000000000000000000000000000000000000..f743c092634d27b80e1b602f963e1d3ced33071f --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat/OfloatHome.java @@ -0,0 +1,48 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// OfloatHome.java + +package org.objectweb.jonas.jtests.beans.etype.ofloat; + +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the ofloat bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface OfloatHome extends EJBHome { + public Ofloat create(String pk, Float f1) throws RemoteException, CreateException; + public Ofloat findByPrimaryKey(String pk) throws RemoteException, FinderException; + public Collection findByF1(Float f1Min, Float f1Max) throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat/jonas-ofloat.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat/jonas-ofloat.xml new file mode 100644 index 0000000000000000000000000000000000000000..88b14699ac511ab41917c32acf633a63b89dad07 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat/jonas-ofloat.xml @@ -0,0 +1,63 @@ + + + + + + + + OfloatEC + EtypeOfloatECHome + + jdbc_1 + JT_EtypeOfloatEC + + pk + c_pk + + + f1 + c_f1 + + + + findByF1 + + where c_f1 BETWEEN ?1 AND ?2 + + + + + + OfloatEC2 + EtypeOfloatEC2Home + removeall + + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat/ofloat.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat/ofloat.xml new file mode 100644 index 0000000000000000000000000000000000000000..bde167f1719e7f0af72b5108f02bd3838a3d882e --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat/ofloat.xml @@ -0,0 +1,99 @@ + + + + + + etype/ofloat + + + + + etype/ofloat/OfloatEC + OfloatEC + org.objectweb.jonas.jtests.beans.etype.ofloat.OfloatHome + org.objectweb.jonas.jtests.beans.etype.ofloat.Ofloat + org.objectweb.jonas.jtests.beans.etype.ofloat.OfloatEC + Container + java.lang.String + False + 1.x + + pk + + + f1 + + pk + + + + etype/ofloat/OfloatEC2 + OfloatEC2 + org.objectweb.jonas.jtests.beans.etype.ofloat.OfloatHome + org.objectweb.jonas.jtests.beans.etype.ofloat.Ofloat + org.objectweb.jonas.jtests.beans.etype.ofloat.OfloatEC2 + Container + java.lang.String + False + 2.x + jt2_ofloat + + pk + + + f1 + + pk + + + findByF1 + + java.lang.Float + java.lang.Float + + + SELECT OBJECT(o) FROM jt2_ofloat o WHERE (o.f1 BETWEEN ?1 AND ?2) + + + + + + + + + OfloatEC + * + + + OfloatEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat4pk/Ofloat4pk.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat4pk/Ofloat4pk.java new file mode 100644 index 0000000000000000000000000000000000000000..56acd08bd862435639e1ea1d34994c2d0ca4bd75 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat4pk/Ofloat4pk.java @@ -0,0 +1,44 @@ +/** + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999-2004 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Ofloat4pk.java + +package org.objectweb.jonas.jtests.beans.etype.ofloat4pk; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the ofloat4pk bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Ofloat4pk extends EJBObject { + public Float getPk() throws RemoteException; + public Float getF1() throws RemoteException; + public void setF1(Float F1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat4pk/Ofloat4pkEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat4pk/Ofloat4pkEC.java new file mode 100644 index 0000000000000000000000000000000000000000..034a9b117c593fdde2ed61299deaaae330c97ceb --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat4pk/Ofloat4pkEC.java @@ -0,0 +1,65 @@ +/** + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999-2004 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.ofloat4pk; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Entity bean with container-managed persistence version 1.1, with a primary key field + * which is a java.lang.Float. + * @author Helene Joanin Contributor(s): + */ + +public class Ofloat4pkEC extends Ofloat4pkEC2 implements EntityBean { + + // State of the bean (CMP v1) + public Float pk; + public Float f1; + + // Accessors implementation + public Float getPk() { + logger.log(BasicLevel.DEBUG, ""); + return this.pk; + } + + public void setPk(Float pk) { + logger.log(BasicLevel.DEBUG, ""); + this.pk = pk; + } + + public Float getF1() { + logger.log(BasicLevel.DEBUG, ""); + return this.f1; + } + + public void setF1(Float f1) { + logger.log(BasicLevel.DEBUG, ""); + this.f1 = f1; + } + +} \ No newline at end of file diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat4pk/Ofloat4pkEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat4pk/Ofloat4pkEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..4374d49d39db1e36598ec903e3fb9e6b67d87b9b --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat4pk/Ofloat4pkEC2.java @@ -0,0 +1,63 @@ +/** + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999-2004 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.ofloat4pk; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * ofloat4pk entity bean class. ofloat4pk is an entity bean with + * container-managed persistence version 2, with a primary key field which is a + * java.lang.Float. + * @author Helene Joanin Contributor(s): + */ + +public abstract class Ofloat4pkEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract Float getPk(); + + public abstract void setPk(Float pk); + + public abstract Float getF1(); + + public abstract void setF1(Float f1); + + public Float ejbCreate(Float pk, Float f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate(" + pk + "," + f1 + ")"); + setPk(pk); + setF1(f1); + return (null); + } + + public void ejbPostCreate(Float pk, Float f1) { + logger.log(BasicLevel.DEBUG, ""); + } + +} \ No newline at end of file diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat4pk/Ofloat4pkHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat4pk/Ofloat4pkHome.java new file mode 100644 index 0000000000000000000000000000000000000000..2fd99751fa2811ad8c7f9a2217660cab7820ee5e --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat4pk/Ofloat4pkHome.java @@ -0,0 +1,48 @@ +/** + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999-2004 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Ofloat4pkHome.java + +package org.objectweb.jonas.jtests.beans.etype.ofloat4pk; + +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the ofloat4pk bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Ofloat4pkHome extends EJBHome { + public Ofloat4pk create(Float pk, Float f1) throws RemoteException, CreateException; + public Ofloat4pk findByPrimaryKey(Float pk) throws RemoteException, FinderException; + public Collection findByF1(Float f1Min, Float f1Max) throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat4pk/jonas-ofloat4pk.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat4pk/jonas-ofloat4pk.xml new file mode 100644 index 0000000000000000000000000000000000000000..d147ad4bf35d92784b59f10695381d7a30eda125 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat4pk/jonas-ofloat4pk.xml @@ -0,0 +1,63 @@ + + + + + + + + Ofloat4pkEC + EtypeOfloat4pkECHome + + jdbc_1 + JT_EtypeOfloat4pkEC + + pk + c_pk + + + f1 + c_f1 + + + + findByF1 + + where c_f1 BETWEEN ?1 AND ?2 + + + + + + Ofloat4pkEC2 + EtypeOfloat4pkEC2Home + removeall + + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat4pk/ofloat4pk.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat4pk/ofloat4pk.xml new file mode 100644 index 0000000000000000000000000000000000000000..fe8974a3472d1f28e89b68955151cc676403a736 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ofloat4pk/ofloat4pk.xml @@ -0,0 +1,99 @@ + + + + + + etype/ofloat4pk + + + + + etype/ofloat4pk/Ofloat4pkEC + Ofloat4pkEC + org.objectweb.jonas.jtests.beans.etype.ofloat4pk.Ofloat4pkHome + org.objectweb.jonas.jtests.beans.etype.ofloat4pk.Ofloat4pk + org.objectweb.jonas.jtests.beans.etype.ofloat4pk.Ofloat4pkEC + Container + java.lang.Float + False + 1.x + + pk + + + f1 + + pk + + + + etype/ofloat4pk/Ofloat4pkEC2 + Ofloat4pkEC2 + org.objectweb.jonas.jtests.beans.etype.ofloat4pk.Ofloat4pkHome + org.objectweb.jonas.jtests.beans.etype.ofloat4pk.Ofloat4pk + org.objectweb.jonas.jtests.beans.etype.ofloat4pk.Ofloat4pkEC2 + Container + java.lang.Float + False + 2.x + jt2_ofloat4pk + + pk + + + f1 + + pk + + + findByF1 + + java.lang.Float + java.lang.Float + + + SELECT OBJECT(o) FROM jt2_ofloat4pk o WHERE (o.f1 BETWEEN ?1 AND ?2) + + + + + + + + + Ofloat4pkEC + * + + + Ofloat4pkEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ointeger/Ointeger.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ointeger/Ointeger.java new file mode 100644 index 0000000000000000000000000000000000000000..0493b3a5da75d168e6a803ebd4e677dd3f22c3b4 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ointeger/Ointeger.java @@ -0,0 +1,44 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Ointeger.java + +package org.objectweb.jonas.jtests.beans.etype.ointeger; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the ointeger bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Ointeger extends EJBObject { + String getPk() throws RemoteException; + Integer getF1() throws RemoteException; + void setF1(Integer f1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ointeger/OintegerEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ointeger/OintegerEC.java new file mode 100644 index 0000000000000000000000000000000000000000..5176426e327c7b55067d62cfceb2a8e093d98df8 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ointeger/OintegerEC.java @@ -0,0 +1,62 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.ointeger; + +import javax.ejb.EntityBean; +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Entity bean with container-managed persistence version 1.1, + * with a field which is a java.lang.Integer. + * @author Helene Joanin + * Contributor(s): + */ + +public class OintegerEC extends OintegerEC2 implements EntityBean { + + // State of the bean (CMP v1) + public String pk; + public Integer f1; + + // Accessors implementation + public String getPk() { + logger.log(BasicLevel.DEBUG, ""); + return this.pk; + } + public void setPk(String pk) { + logger.log(BasicLevel.DEBUG, ""); + this.pk = pk; + } + public Integer getF1() { + logger.log(BasicLevel.DEBUG, ""); + return this.f1; + } + public void setF1(Integer f1) { + logger.log(BasicLevel.DEBUG, ""); + this.f1 = f1; + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ointeger/OintegerEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ointeger/OintegerEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..d7b86b53d8a9041af0bd423b7fb822f8792afc79 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ointeger/OintegerEC2.java @@ -0,0 +1,63 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.ointeger; + +import javax.ejb.EntityBean; +import javax.ejb.CreateException; + +import org.objectweb.util.monolog.api.BasicLevel; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; + + +/** + * ointeger entity bean class. + * ointeger is an entity bean with container-managed persistence version 2, + * with a field which is a java.lang.Integer. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class OintegerEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract String getPk(); + public abstract void setPk(String pk); + public abstract Integer getF1(); + public abstract void setF1(Integer f1); + + public String ejbCreate(String pk, Integer f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate(" + pk + "," + f1 + ")"); + setPk(pk); + setF1(f1); + return null; + } + + public void ejbPostCreate(String pk, Integer f1) { + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ointeger/OintegerHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ointeger/OintegerHome.java new file mode 100644 index 0000000000000000000000000000000000000000..aab129151e1ed327b2f9d5bb464902bd88f5fe6e --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ointeger/OintegerHome.java @@ -0,0 +1,48 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// OintegerHome.java + +package org.objectweb.jonas.jtests.beans.etype.ointeger; + +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the ointeger bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface OintegerHome extends EJBHome { + Ointeger create(String pk, Integer f1) throws RemoteException, CreateException; + Ointeger findByPrimaryKey(String pk) throws RemoteException, FinderException; + Collection findByF1(Integer f1) throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ointeger/jonas-ointeger.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ointeger/jonas-ointeger.xml new file mode 100644 index 0000000000000000000000000000000000000000..48b0504179f2458899baf9edf7f40a46eb1d40d4 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ointeger/jonas-ointeger.xml @@ -0,0 +1,64 @@ + + + + + + + + OintegerEC + EtypeOintegerECHome + + jdbc_1 + JT_EtypeOintegerEC + + pk + c_pk + + + f1 + c_f1 + + + + findByF1 + + where c_f1 = ? + + + + + + OintegerEC2 + EtypeOintegerEC2Home + removeall + + jdbc_1 + + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ointeger/ointeger.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ointeger/ointeger.xml new file mode 100644 index 0000000000000000000000000000000000000000..677559e53d4800497af3cf64e75789af290ccefd --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/ointeger/ointeger.xml @@ -0,0 +1,98 @@ + + + + + + etype/ointeger + + + + + etype/ointeger/OintegerEC + OintegerEC + org.objectweb.jonas.jtests.beans.etype.ointeger.OintegerHome + org.objectweb.jonas.jtests.beans.etype.ointeger.Ointeger + org.objectweb.jonas.jtests.beans.etype.ointeger.OintegerEC + Container + java.lang.String + False + 1.x + + pk + + + f1 + + pk + + + + etype/ointeger/OintegerEC2 + OintegerEC2 + org.objectweb.jonas.jtests.beans.etype.ointeger.OintegerHome + org.objectweb.jonas.jtests.beans.etype.ointeger.Ointeger + org.objectweb.jonas.jtests.beans.etype.ointeger.OintegerEC2 + Container + java.lang.String + False + 2.x + jt2_ointeger + + pk + + + f1 + + pk + + + findByF1 + + java.lang.Integer + + + SELECT OBJECT(o) FROM jt2_ointeger o WHERE o.f1 = ?1 + + + + + + + + + OintegerEC + * + + + OintegerEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/olong/Olong.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/olong/Olong.java new file mode 100644 index 0000000000000000000000000000000000000000..e546bd8f7cb48af1ba0fd3283b6291d778d8240f --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/olong/Olong.java @@ -0,0 +1,44 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Olong.java + +package org.objectweb.jonas.jtests.beans.etype.olong; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the olong bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Olong extends EJBObject { + public String getPk() throws RemoteException; + public Long getF1() throws RemoteException; + public void setF1(Long F1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/olong/OlongEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/olong/OlongEC.java new file mode 100644 index 0000000000000000000000000000000000000000..f411549c57a9767b8f892563fc17bfde21ae67fe --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/olong/OlongEC.java @@ -0,0 +1,63 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.olong; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Entity bean with container-managed persistence version 1.1, + * with a field which is a java.lang.Long. + * @author Helene Joanin + * Contributor(s): + */ + +public class OlongEC extends OlongEC2 implements EntityBean { + + // State of the bean (CMP v1) + public String pk; + public Long f1; + + // Accessors implementation + public String getPk() { + logger.log(BasicLevel.DEBUG, ""); + return this.pk; + } + public void setPk(String pk) { + logger.log(BasicLevel.DEBUG, ""); + this.pk = pk; + } + public Long getF1() { + logger.log(BasicLevel.DEBUG, ""); + return this.f1; + } + public void setF1(Long f1) { + logger.log(BasicLevel.DEBUG, ""); + this.f1 = f1; + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/olong/OlongEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/olong/OlongEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..d0458c49ee9bc606edcd1fa1d1ba4956ef541224 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/olong/OlongEC2.java @@ -0,0 +1,62 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.olong; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * olong entity bean class. + * olong is an entity bean with container-managed persistence version 2, + * with a field which is a java.lang.Long. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class OlongEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract String getPk(); + public abstract void setPk(String pk); + public abstract Long getF1(); + public abstract void setF1(Long f1); + + public String ejbCreate(String pk, Long f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate("+pk+","+f1+")"); + setPk(pk); + setF1(f1); + return(null); + } + + public void ejbPostCreate(String pk, Long f1){ + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/olong/OlongHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/olong/OlongHome.java new file mode 100644 index 0000000000000000000000000000000000000000..1373e21debe2f030b24cf0ec9e91588a706c06d2 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/olong/OlongHome.java @@ -0,0 +1,48 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// OlongHome.java + +package org.objectweb.jonas.jtests.beans.etype.olong; + +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the olong bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface OlongHome extends EJBHome { + public Olong create(String pk, Long f1) throws RemoteException, CreateException; + public Olong findByPrimaryKey(String pk) throws RemoteException, FinderException; + public Collection findByF1(Long f1) throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/olong/jonas-olong.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/olong/jonas-olong.xml new file mode 100644 index 0000000000000000000000000000000000000000..835691485eca63e38f4134b9d7d268f9b1da019b --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/olong/jonas-olong.xml @@ -0,0 +1,63 @@ + + + + + + + + OlongEC + EtypeOlongECHome + + jdbc_1 + JT_EtypeOlongEC + + pk + c_pk + + + f1 + c_f1 + + + + findByF1 + + where c_f1 = ? + + + + + + OlongEC2 + EtypeOlongEC2Home + removeall + + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/olong/olong.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/olong/olong.xml new file mode 100644 index 0000000000000000000000000000000000000000..e19ab5de9d07f99d0c7e95e6473b71dc81412e75 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/olong/olong.xml @@ -0,0 +1,98 @@ + + + + + + etype/olong + + + + + etype/olong/OlongEC + OlongEC + org.objectweb.jonas.jtests.beans.etype.olong.OlongHome + org.objectweb.jonas.jtests.beans.etype.olong.Olong + org.objectweb.jonas.jtests.beans.etype.olong.OlongEC + Container + java.lang.String + False + 1.x + + pk + + + f1 + + pk + + + + etype/olong/OlongEC2 + OlongEC2 + org.objectweb.jonas.jtests.beans.etype.olong.OlongHome + org.objectweb.jonas.jtests.beans.etype.olong.Olong + org.objectweb.jonas.jtests.beans.etype.olong.OlongEC2 + Container + java.lang.String + False + 2.x + jt2_olong + + pk + + + f1 + + pk + + + findByF1 + + java.lang.Long + + + SELECT OBJECT(o) FROM jt2_olong o WHERE o.f1 = ?1 + + + + + + + + + OlongEC + * + + + OlongEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oobj/Oobj.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oobj/Oobj.java new file mode 100644 index 0000000000000000000000000000000000000000..de5e34f663a7c9ec5cab36455d77f0ea20f97349 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oobj/Oobj.java @@ -0,0 +1,42 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + + +package org.objectweb.jonas.jtests.beans.etype.oobj; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the oobj bean. + * @author Rafael Schloming + * + */ + +public interface Oobj extends EJBObject { + public String getPk() throws RemoteException; + public Object getF1() throws RemoteException; + public void setF1(Object F1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oobj/OobjEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oobj/OobjEC.java new file mode 100644 index 0000000000000000000000000000000000000000..fa88ec9c97b6bb6a9e693a9e3915468f63232b53 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oobj/OobjEC.java @@ -0,0 +1,63 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.oobj; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Entity bean with container-managed persistence version 1.1, + * with a field which is a serializable object. + * @author Helene Joanin + * Contributor(s): + */ + +public class OobjEC extends OobjEC2 implements EntityBean { + + // State of the bean (CMP v1) + public String pk; + public Object f1; + + // Accessors implementation + public String getPk() { + logger.log(BasicLevel.DEBUG, ""); + return this.pk; + } + public void setPk(String pk) { + logger.log(BasicLevel.DEBUG, ""); + this.pk = pk; + } + public Object getF1() { + logger.log(BasicLevel.DEBUG, ""); + return this.f1; + } + public void setF1(Object f1) { + logger.log(BasicLevel.DEBUG, ""); + this.f1 = f1; + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oobj/OobjEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oobj/OobjEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..a8b3f6458722a7d62534b1925ae4f3efd8cab530 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oobj/OobjEC2.java @@ -0,0 +1,62 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.oobj; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * oobj entity bean class. + * oobj is an entity bean with container-managed persistence version 2, + * with a field which is a serializable object. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class OobjEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract String getPk(); + public abstract void setPk(String pk); + public abstract Object getF1(); + public abstract void setF1(Object f1); + + public String ejbCreate(String pk, Object f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate("+pk+","+f1+")"); + setPk(pk); + setF1(f1); + return(null); + } + + public void ejbPostCreate(String pk, Object f1){ + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oobj/OobjHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oobj/OobjHome.java new file mode 100644 index 0000000000000000000000000000000000000000..4fd59152da8f96ed046dfc2e28d1f6d80ed6c45d --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oobj/OobjHome.java @@ -0,0 +1,49 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// OobjHome.java + +package org.objectweb.jonas.jtests.beans.etype.oobj; + +import java.io.Serializable; +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the oobj bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface OobjHome extends EJBHome { + public Oobj create(String pk, Object f1) throws RemoteException, CreateException; + public Oobj findByPrimaryKey(String pk) throws RemoteException, FinderException; + //public Collection findByF1(Serializable f1) throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oobj/jonas-oobj.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oobj/jonas-oobj.xml new file mode 100644 index 0000000000000000000000000000000000000000..b146860a82c239f452eef77175e3d51eb421fa13 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oobj/jonas-oobj.xml @@ -0,0 +1,63 @@ + + + + + + + + + + OobjEC2 + EtypeOobjEC2Home + removeall + + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oobj/oobj.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oobj/oobj.xml new file mode 100644 index 0000000000000000000000000000000000000000..bdaa9ec13d8ef8fb64d00b564f6c4fb143acd3e4 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oobj/oobj.xml @@ -0,0 +1,98 @@ + + + + + + etype/oobj + + + + + + + etype/oobj/OobjEC2 + OobjEC2 + org.objectweb.jonas.jtests.beans.etype.oobj.OobjHome + org.objectweb.jonas.jtests.beans.etype.oobj.Oobj + org.objectweb.jonas.jtests.beans.etype.oobj.OobjEC2 + Container + java.lang.String + False + 2.x + jt2_oobj + + pk + + + f1 + + pk + + + + + + + + + OobjEC + * + + + OobjEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/Name.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/Name.java new file mode 100644 index 0000000000000000000000000000000000000000..1de1c3023ec43696ff14b1118d50d26d81be006e --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/Name.java @@ -0,0 +1,72 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.oser; + +import java.io.Serializable; + +/** + * Serializable object. + * @author Helene Joanin + * Contributor(s): + */ + +public class Name implements Serializable { + + public String firstName; + public String lastName; + + public Name() { + firstName = new String("fn_unknown"); + lastName = new String("ln_unknown"); + } + + public Name(String f, String l) { + firstName = new String(f); + lastName = new String(l); + } + + public Name(Name n) { + firstName = new String(n.firstName); + lastName = new String(n.lastName); + } + + public String toString() { + String s = new String("(firstName='" + firstName + "',lastName='" + lastName +"')"); + return(s); + } + + public boolean equals(Object other) { + if (other == null) { + return false; + } + if (!(other instanceof Name)) { + return false; + } + Name oName = (Name) other; + return (this.firstName.equals(oName.firstName) && this.lastName.equals(oName.lastName)); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/Oser.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/Oser.java new file mode 100644 index 0000000000000000000000000000000000000000..2e39ad4bcc37fe2de7be81f2ffeef9165f4ca8a6 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/Oser.java @@ -0,0 +1,43 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + + +package org.objectweb.jonas.jtests.beans.etype.oser; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the oser bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Oser extends EJBObject { + public String getPk() throws RemoteException; + public Name getF1() throws RemoteException; + public void setF1(Name F1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/OserEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/OserEC.java new file mode 100644 index 0000000000000000000000000000000000000000..eb5e467456ae6b4138aefc675c47f2726d8f6cdd --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/OserEC.java @@ -0,0 +1,63 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.oser; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Entity bean with container-managed persistence version 1.1, + * with a field which is a serializable object. + * @author Helene Joanin + * Contributor(s): + */ + +public class OserEC extends OserEC2 implements EntityBean { + + // State of the bean (CMP v1) + public String pk; + public Name f1; + + // Accessors implementation + public String getPk() { + logger.log(BasicLevel.DEBUG, ""); + return this.pk; + } + public void setPk(String pk) { + logger.log(BasicLevel.DEBUG, ""); + this.pk = pk; + } + public Name getF1() { + logger.log(BasicLevel.DEBUG, ""); + return this.f1; + } + public void setF1(Name f1) { + logger.log(BasicLevel.DEBUG, ""); + this.f1 = f1; + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/OserEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/OserEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..8f50ac290cc99785513b23790ff4deb980bbfc5b --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/OserEC2.java @@ -0,0 +1,62 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.oser; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * oser entity bean class. + * oser is an entity bean with container-managed persistence version 2, + * with a field which is a serializable object. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class OserEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract String getPk(); + public abstract void setPk(String pk); + public abstract Name getF1(); + public abstract void setF1(Name f1); + + public String ejbCreate(String pk, Name f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate("+pk+","+f1+")"); + setPk(pk); + setF1(f1); + return(null); + } + + public void ejbPostCreate(String pk, Name f1){ + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/OserHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/OserHome.java new file mode 100644 index 0000000000000000000000000000000000000000..f8d37bd476ae65853cba98ff17b35134c7e5aed9 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/OserHome.java @@ -0,0 +1,48 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// OserHome.java + +package org.objectweb.jonas.jtests.beans.etype.oser; + +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the oser bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface OserHome extends EJBHome { + public Oser create(String pk, Name f1) throws RemoteException, CreateException; + public Oser findByPrimaryKey(String pk) throws RemoteException, FinderException; + public Collection findByF1(Name f1) throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/jonas-oser.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/jonas-oser.xml new file mode 100644 index 0000000000000000000000000000000000000000..34ec93965263cf96f025f12002da9a8c5bc2f536 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/jonas-oser.xml @@ -0,0 +1,63 @@ + + + + + + + + OserEC + EtypeOserECHome + + jdbc_1 + JT_EtypeOserEC + + pk + c_pk + + + f1 + c_f1 + + + + findByF1 + + where c_f1 = ? + + + + + + OserEC2 + EtypeOserEC2Home + removeall + + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/oser.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/oser.xml new file mode 100644 index 0000000000000000000000000000000000000000..1a406bb8f0888c26ea009e4efa08c68e607f9c9e --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oser/oser.xml @@ -0,0 +1,98 @@ + + + + + + etype/oser + + + + + etype/oser/OserEC + OserEC + org.objectweb.jonas.jtests.beans.etype.oser.OserHome + org.objectweb.jonas.jtests.beans.etype.oser.Oser + org.objectweb.jonas.jtests.beans.etype.oser.OserEC + Container + java.lang.String + False + 1.x + + pk + + + f1 + + pk + + + + etype/oser/OserEC2 + OserEC2 + org.objectweb.jonas.jtests.beans.etype.oser.OserHome + org.objectweb.jonas.jtests.beans.etype.oser.Oser + org.objectweb.jonas.jtests.beans.etype.oser.OserEC2 + Container + java.lang.String + False + 2.x + jt2_oser + + pk + + + f1 + + pk + + + findByF1 + + org.objectweb.jonas.jtests.beans.etype.oser.Name + + + SELECT OBJECT(o) FROM jt2_oser o WHERE o.f1 = ?1 + + + + + + + + + OserEC + * + + + OserEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oshort/Oshort.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oshort/Oshort.java new file mode 100644 index 0000000000000000000000000000000000000000..1f5efbfaa6d8388fac45e8e752fc3053243a3aec --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oshort/Oshort.java @@ -0,0 +1,44 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Oshort.java + +package org.objectweb.jonas.jtests.beans.etype.oshort; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the oshort bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Oshort extends EJBObject { + public String getPk() throws RemoteException; + public Short getF1() throws RemoteException; + public void setF1(Short F1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oshort/OshortEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oshort/OshortEC.java new file mode 100644 index 0000000000000000000000000000000000000000..154aadc3df2ea728763d95c7d2dbf9e77c4e910f --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oshort/OshortEC.java @@ -0,0 +1,63 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.oshort; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Entity bean with container-managed persistence version 1.1, + * with a field which is a java.lang.Short. + * @author Helene Joanin + * Contributor(s): + */ + +public class OshortEC extends OshortEC2 implements EntityBean { + + // State of the bean (CMP v1) + public String pk; + public Short f1; + + // Accessors implementation + public String getPk() { + logger.log(BasicLevel.DEBUG, ""); + return this.pk; + } + public void setPk(String pk) { + logger.log(BasicLevel.DEBUG, ""); + this.pk = pk; + } + public Short getF1() { + logger.log(BasicLevel.DEBUG, ""); + return this.f1; + } + public void setF1(Short f1) { + logger.log(BasicLevel.DEBUG, ""); + this.f1 = f1; + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oshort/OshortEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oshort/OshortEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..c8131cadbe50a2edb72c0b9d14de8a46e2f7219d --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oshort/OshortEC2.java @@ -0,0 +1,62 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.oshort; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * oshort entity bean class. + * oshort is an entity bean with container-managed persistence version 2, + * with a field which is a java.lang.Short. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class OshortEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract String getPk(); + public abstract void setPk(String pk); + public abstract Short getF1(); + public abstract void setF1(Short f1); + + public String ejbCreate(String pk, Short f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate("+pk+","+f1+")"); + setPk(pk); + setF1(f1); + return(null); + } + + public void ejbPostCreate(String pk, Short f1){ + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oshort/OshortHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oshort/OshortHome.java new file mode 100644 index 0000000000000000000000000000000000000000..618a2d0f96859770a433211d905a225ba8fc45fc --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oshort/OshortHome.java @@ -0,0 +1,48 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// OshortHome.java + +package org.objectweb.jonas.jtests.beans.etype.oshort; + +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the oshort bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface OshortHome extends EJBHome { + public Oshort create(String pk, Short f1) throws RemoteException, CreateException; + public Oshort findByPrimaryKey(String pk) throws RemoteException, FinderException; + public Collection findByF1(Short f1) throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oshort/jonas-oshort.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oshort/jonas-oshort.xml new file mode 100644 index 0000000000000000000000000000000000000000..9f7224fe55f9de868111eaa05ac6ecea2907a04d --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oshort/jonas-oshort.xml @@ -0,0 +1,63 @@ + + + + + + + + OshortEC + EtypeOshortECHome + + jdbc_1 + JT_EtypeOshortEC + + pk + c_pk + + + f1 + c_f1 + + + + findByF1 + + where c_f1 = ? + + + + + + OshortEC2 + EtypeOshortEC2Home + removeall + + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oshort/oshort.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oshort/oshort.xml new file mode 100644 index 0000000000000000000000000000000000000000..b51817f8d467a8b11eb3253243a549dbd452624b --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/oshort/oshort.xml @@ -0,0 +1,99 @@ + + + + + + + etype/oshort + + + + + etype/oshort/OshortEC + OshortEC + org.objectweb.jonas.jtests.beans.etype.oshort.OshortHome + org.objectweb.jonas.jtests.beans.etype.oshort.Oshort + org.objectweb.jonas.jtests.beans.etype.oshort.OshortEC + Container + java.lang.String + False + 1.x + + pk + + + f1 + + pk + + + + etype/oshort/OshortEC2 + OshortEC2 + org.objectweb.jonas.jtests.beans.etype.oshort.OshortHome + org.objectweb.jonas.jtests.beans.etype.oshort.Oshort + org.objectweb.jonas.jtests.beans.etype.oshort.OshortEC2 + Container + java.lang.String + False + 2.x + jt2_oshort + + pk + + + f1 + + pk + + + findByF1 + + java.lang.Short + + + SELECT OBJECT(o) FROM jt2_oshort o WHERE o.f1 = ?1 + + + + + + + + + OshortEC + * + + + OshortEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqldate/Osqldate.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqldate/Osqldate.java new file mode 100644 index 0000000000000000000000000000000000000000..e7c897a4874802ad0a5398e76e523367d31a97c1 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqldate/Osqldate.java @@ -0,0 +1,44 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Osqldate.java + +package org.objectweb.jonas.jtests.beans.etype.osqldate; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the osqldate bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Osqldate extends EJBObject { + public String getPk() throws RemoteException; + public java.sql.Date getF1() throws RemoteException; + public void setF1(java.sql.Date F1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqldate/OsqldateEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqldate/OsqldateEC.java new file mode 100644 index 0000000000000000000000000000000000000000..d5348f13fe21a52d22bf0c7d14bfc5e694292d7b --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqldate/OsqldateEC.java @@ -0,0 +1,63 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.osqldate; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Entity bean with container-managed persistence version 1.1, + * with a field which is a java.sql.Date. + * @author Helene Joanin + * Contributor(s): + */ + +public class OsqldateEC extends OsqldateEC2 implements EntityBean { + + // State of the bean (CMP v1) + public String pk; + public java.sql.Date f1; + + // Accessors implementation + public String getPk() { + logger.log(BasicLevel.DEBUG, ""); + return this.pk; + } + public void setPk(String pk) { + logger.log(BasicLevel.DEBUG, ""); + this.pk = pk; + } + public java.sql.Date getF1() { + logger.log(BasicLevel.DEBUG, ""); + return this.f1; + } + public void setF1(java.sql.Date f1) { + logger.log(BasicLevel.DEBUG, ""); + this.f1 = f1; + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqldate/OsqldateEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqldate/OsqldateEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..45bd212bda74072a21cbcca8380e0ffc1510f2b3 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqldate/OsqldateEC2.java @@ -0,0 +1,62 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.osqldate; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * osqldate entity bean class. + * osqldate is an entity bean with container-managed persistence version 2, + * with a field which is a java.sql.Date. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class OsqldateEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract String getPk(); + public abstract void setPk(String pk); + public abstract java.sql.Date getF1(); + public abstract void setF1(java.sql.Date f1); + + public String ejbCreate(String pk, java.sql.Date f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate("+pk+","+f1+")"); + setPk(pk); + setF1(f1); + return(null); + } + + public void ejbPostCreate(String pk, java.sql.Date f1){ + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqldate/OsqldateHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqldate/OsqldateHome.java new file mode 100644 index 0000000000000000000000000000000000000000..aa31fa6b172ca17c45e54e5d2088c46e80a00fa2 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqldate/OsqldateHome.java @@ -0,0 +1,48 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// OsqldateHome.java + +package org.objectweb.jonas.jtests.beans.etype.osqldate; + +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the osqldate bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface OsqldateHome extends EJBHome { + public Osqldate create(String pk, java.sql.Date f1) throws RemoteException, CreateException; + public Osqldate findByPrimaryKey(String pk) throws RemoteException, FinderException; + public Collection findByF1(java.sql.Date f1) throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqldate/jonas-osqldate.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqldate/jonas-osqldate.xml new file mode 100644 index 0000000000000000000000000000000000000000..ca24ac5c862f1da8a5e930c079e8008f44043c7c --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqldate/jonas-osqldate.xml @@ -0,0 +1,63 @@ + + + + + + + + OsqldateEC + EtypeOsqldateECHome + + jdbc_1 + JT_EtypeOsqldateEC + + pk + c_pk + + + f1 + c_f1 + + + + findByF1 + + where c_f1 = ? + + + + + + OsqldateEC2 + EtypeOsqldateEC2Home + removeall + + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqldate/osqldate.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqldate/osqldate.xml new file mode 100644 index 0000000000000000000000000000000000000000..4ca387b2b32995c369305ec5a418791b15618b02 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqldate/osqldate.xml @@ -0,0 +1,99 @@ + + + + + + etype/osqldate + + + + + etype/osqldate/OsqldateEC + OsqldateEC + org.objectweb.jonas.jtests.beans.etype.osqldate.OsqldateHome + org.objectweb.jonas.jtests.beans.etype.osqldate.Osqldate + org.objectweb.jonas.jtests.beans.etype.osqldate.OsqldateEC + Container + java.lang.String + False + 1.x + + pk + + + f1 + + pk + + + + + etype/osqldate/OsqldateEC2 + OsqldateEC2 + org.objectweb.jonas.jtests.beans.etype.osqldate.OsqldateHome + org.objectweb.jonas.jtests.beans.etype.osqldate.Osqldate + org.objectweb.jonas.jtests.beans.etype.osqldate.OsqldateEC2 + Container + java.lang.String + False + 2.x + jt2_osqldateEC2 + + pk + + + f1 + + pk + + + findByF1 + + java.sql.Date + + + SELECT OBJECT(o) FROM jt2_osqldateEC2 o WHERE o.f1 = ?1 + + + + + + + + + OsqldateEC + * + + + OsqldateEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqltime/Osqltime.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqltime/Osqltime.java new file mode 100644 index 0000000000000000000000000000000000000000..a548a37c1943b087d6ce7dfdd009a0817ada52cf --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqltime/Osqltime.java @@ -0,0 +1,44 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Osqltime.java + +package org.objectweb.jonas.jtests.beans.etype.osqltime; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the osqltime bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Osqltime extends EJBObject { + public String getPk() throws RemoteException; + public java.sql.Time getF1() throws RemoteException; + public void setF1(java.sql.Time F1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqltime/OsqltimeEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqltime/OsqltimeEC.java new file mode 100644 index 0000000000000000000000000000000000000000..41c0e4edbe0ec0ccfba3706f49ef02210994053f --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqltime/OsqltimeEC.java @@ -0,0 +1,63 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.osqltime; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Entity bean with container-managed persistence version 1.1, + * with a field which is a java.sql.Time. + * @author Helene Joanin + * Contributor(s): + */ + +public class OsqltimeEC extends OsqltimeEC2 implements EntityBean { + + // State of the bean (CMP v1) + public String pk; + public java.sql.Time f1; + + // Accessors implementation + public String getPk() { + logger.log(BasicLevel.DEBUG, ""); + return this.pk; + } + public void setPk(String pk) { + logger.log(BasicLevel.DEBUG, ""); + this.pk = pk; + } + public java.sql.Time getF1() { + logger.log(BasicLevel.DEBUG, ""); + return this.f1; + } + public void setF1(java.sql.Time f1) { + logger.log(BasicLevel.DEBUG, ""); + this.f1 = f1; + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqltime/OsqltimeEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqltime/OsqltimeEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..6eb6bc92d68810d21ce3f62171a87da5e4b7e08d --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqltime/OsqltimeEC2.java @@ -0,0 +1,62 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.osqltime; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * osqltime entity bean class. + * osqltime is an entity bean with container-managed persistence version 2, + * with a field which is a java.sql.Time. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class OsqltimeEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract String getPk(); + public abstract void setPk(String pk); + public abstract java.sql.Time getF1(); + public abstract void setF1(java.sql.Time f1); + + public String ejbCreate(String pk, java.sql.Time f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate("+pk+","+f1+")"); + setPk(pk); + setF1(f1); + return(null); + } + + public void ejbPostCreate(String pk, java.sql.Time f1){ + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqltime/OsqltimeHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqltime/OsqltimeHome.java new file mode 100644 index 0000000000000000000000000000000000000000..5654bc1d2b71e22a507debdae3b7bc689676dc8a --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqltime/OsqltimeHome.java @@ -0,0 +1,48 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// OsqltimeHome.java + +package org.objectweb.jonas.jtests.beans.etype.osqltime; + +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the osqltime bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface OsqltimeHome extends EJBHome { + public Osqltime create(String pk, java.sql.Time f1) throws RemoteException, CreateException; + public Osqltime findByPrimaryKey(String pk) throws RemoteException, FinderException; + public Collection findByF1(java.sql.Time f1) throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqltime/jonas-osqltime.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqltime/jonas-osqltime.xml new file mode 100644 index 0000000000000000000000000000000000000000..a3ed3cfb68eda6666faf1385d4e3ca43d522de28 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqltime/jonas-osqltime.xml @@ -0,0 +1,63 @@ + + + + + + + + OsqltimeEC + EtypeOsqltimeECHome + + jdbc_1 + JT_EtypeOsqltimeEC + + pk + c_pk + + + f1 + c_f1 + + + + findByF1 + + where c_f1 = ? + + + + + + OsqltimeEC2 + EtypeOsqltimeEC2Home + removeall + + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqltime/osqltime.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqltime/osqltime.xml new file mode 100644 index 0000000000000000000000000000000000000000..15ec35fa2120513c0dde59cfabb012f94ed79f5d --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqltime/osqltime.xml @@ -0,0 +1,99 @@ + + + + + + etype/osqltime + + + + + etype/osqltime/OsqltimeEC + OsqltimeEC + org.objectweb.jonas.jtests.beans.etype.osqltime.OsqltimeHome + org.objectweb.jonas.jtests.beans.etype.osqltime.Osqltime + org.objectweb.jonas.jtests.beans.etype.osqltime.OsqltimeEC + Container + java.lang.String + False + 1.x + + pk + + + f1 + + pk + + + + + etype/osqltime/OsqltimeEC2 + OsqltimeEC2 + org.objectweb.jonas.jtests.beans.etype.osqltime.OsqltimeHome + org.objectweb.jonas.jtests.beans.etype.osqltime.Osqltime + org.objectweb.jonas.jtests.beans.etype.osqltime.OsqltimeEC2 + Container + java.lang.String + False + 2.x + jt2_osqltimeEC2 + + pk + + + f1 + + pk + + + findByF1 + + java.sql.Time + + + SELECT OBJECT(o) FROM jt2_osqltimeEC2 o WHERE o.f1 = ?1 + + + + + + + + + OsqltimeEC + * + + + OsqltimeEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts/Osqlts.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts/Osqlts.java new file mode 100644 index 0000000000000000000000000000000000000000..87f5225e8195ed30e31300067d7c17c4afc8add9 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts/Osqlts.java @@ -0,0 +1,44 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Osqlts.java + +package org.objectweb.jonas.jtests.beans.etype.osqlts; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the osqlts bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Osqlts extends EJBObject { + public String getPk() throws RemoteException; + public java.sql.Timestamp getF1() throws RemoteException; + public void setF1(java.sql.Timestamp F1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts/OsqltsEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts/OsqltsEC.java new file mode 100644 index 0000000000000000000000000000000000000000..de940712af2dc731e740187a5ecf4d43973b399a --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts/OsqltsEC.java @@ -0,0 +1,63 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.osqlts; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Entity bean with container-managed persistence version 1.1, + * with a field which is a java.sql.Timestamp. + * @author Helene Joanin + * Contributor(s): + */ + +public class OsqltsEC extends OsqltsEC2 implements EntityBean { + + // State of the bean (CMP v1) + public String pk; + public java.sql.Timestamp f1; + + // Accessors implementation + public String getPk() { + logger.log(BasicLevel.DEBUG, ""); + return this.pk; + } + public void setPk(String pk) { + logger.log(BasicLevel.DEBUG, ""); + this.pk = pk; + } + public java.sql.Timestamp getF1() { + logger.log(BasicLevel.DEBUG, ""); + return this.f1; + } + public void setF1(java.sql.Timestamp f1) { + logger.log(BasicLevel.DEBUG, ""); + this.f1 = f1; + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts/OsqltsEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts/OsqltsEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..1f3bc82aa6daa9b62015e64c91e666677ffb61f0 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts/OsqltsEC2.java @@ -0,0 +1,62 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.osqlts; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * osqlts entity bean class. + * osqlts is an entity bean with container-managed persistence version 2, + * with a field which is a java.sql.Timestamp. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class OsqltsEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract String getPk(); + public abstract void setPk(String pk); + public abstract java.sql.Timestamp getF1(); + public abstract void setF1(java.sql.Timestamp f1); + + public String ejbCreate(String pk, java.sql.Timestamp f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate("+pk+","+f1+")"); + setPk(pk); + setF1(f1); + return(null); + } + + public void ejbPostCreate(String pk, java.sql.Timestamp f1){ + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts/OsqltsHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts/OsqltsHome.java new file mode 100644 index 0000000000000000000000000000000000000000..167c3d7f43e91501a2570dd46bb1e7510d6ef63e --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts/OsqltsHome.java @@ -0,0 +1,48 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// OsqltsHome.java + +package org.objectweb.jonas.jtests.beans.etype.osqlts; + +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the osqlts bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface OsqltsHome extends EJBHome { + public Osqlts create(String pk, java.sql.Timestamp f1) throws RemoteException, CreateException; + public Osqlts findByPrimaryKey(String pk) throws RemoteException, FinderException; + public Collection findByF1(java.sql.Timestamp f1) throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts/jonas-osqlts.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts/jonas-osqlts.xml new file mode 100644 index 0000000000000000000000000000000000000000..26ff6acfddd811af9bc5f12d2a70b1229c490cac --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts/jonas-osqlts.xml @@ -0,0 +1,63 @@ + + + + + + + + OsqltsEC + EtypeOsqltsECHome + + jdbc_1 + JT_EtypeOsqltsEC + + pk + c_pk + + + f1 + c_f1 + + + + findByF1 + + where c_f1 = ? + + + + + + OsqltsEC2 + EtypeOsqltsEC2Home + removeall + + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts/osqlts.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts/osqlts.xml new file mode 100644 index 0000000000000000000000000000000000000000..42c6cbbed51e5572698ca8bcd4ea0f4ef6ec236a --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts/osqlts.xml @@ -0,0 +1,99 @@ + + + + + + etype/osqlts + + + + + etype/osqlts/OsqltsEC + OsqltsEC + org.objectweb.jonas.jtests.beans.etype.osqlts.OsqltsHome + org.objectweb.jonas.jtests.beans.etype.osqlts.Osqlts + org.objectweb.jonas.jtests.beans.etype.osqlts.OsqltsEC + Container + java.lang.String + False + 1.x + + pk + + + f1 + + pk + + + + + etype/osqlts/OsqltsEC2 + OsqltsEC2 + org.objectweb.jonas.jtests.beans.etype.osqlts.OsqltsHome + org.objectweb.jonas.jtests.beans.etype.osqlts.Osqlts + org.objectweb.jonas.jtests.beans.etype.osqlts.OsqltsEC2 + Container + java.lang.String + False + 2.x + jt2_osqltsEC2 + + pk + + + f1 + + pk + + + findByF1 + + java.sql.Timestamp + + + SELECT OBJECT(o) FROM jt2_osqltsEC2 o WHERE o.f1 = ?1 + + + + + + + + + OsqltsEC + * + + + OsqltsEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/Osqlts4pk.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/Osqlts4pk.java new file mode 100644 index 0000000000000000000000000000000000000000..d64ca046891aa51217cad0cc9f70ad344b7512d8 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/Osqlts4pk.java @@ -0,0 +1,44 @@ +/** + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.osqlts4pk; + +import java.rmi.RemoteException; +import java.sql.Timestamp; + +import javax.ejb.EJBObject; + +/** + * Remote interface of the osqlts4pk bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Osqlts4pk extends EJBObject { + public Timestamp getId() throws RemoteException; + public String getF1() throws RemoteException; + public void setF1(String f1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/Osqlts4pkEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/Osqlts4pkEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..e52d4787e4660c431052f33879aca2325fed576c --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/Osqlts4pkEC2.java @@ -0,0 +1,64 @@ +/** + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.osqlts4pk; + +import java.sql.Timestamp; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * osqlts4pk entity bean class. + * osqlts4pk is an entity bean with container-managed persistence version 2, + * with a field which is a java.sql.Timestamp. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class Osqlts4pkEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract Timestamp getId(); + public abstract void setId(Timestamp id); + public abstract String getF1(); + public abstract void setF1(String f1); + + public String ejbCreate(Timestamp pk, String f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate("+pk+","+f1+")"); + setId(pk); + setF1(f1); + return(null); + } + + public void ejbPostCreate(Timestamp pk, String f1){ + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/Osqlts4pkHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/Osqlts4pkHome.java new file mode 100644 index 0000000000000000000000000000000000000000..feca4e407dfbbd23ec2ea1be5a3145b312fdf434 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/Osqlts4pkHome.java @@ -0,0 +1,49 @@ +/** + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.osqlts4pk; + +import java.util.Collection; +import java.rmi.RemoteException; +import java.sql.Timestamp; + +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the osqlts4pk bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Osqlts4pkHome extends EJBHome { + public Osqlts4pk create(Timestamp id, String f1) throws RemoteException, CreateException; + public Osqlts4pk findByPrimaryKey(Pk pk) throws RemoteException, FinderException; + public Osqlts4pk findByDate(Timestamp id) throws RemoteException, FinderException; + public Collection findAll() throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/Osqlts4pkHomeLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/Osqlts4pkHomeLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..879f9afdb7f220957e116b2f3ae3615f3ff82b07 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/Osqlts4pkHomeLocal.java @@ -0,0 +1,44 @@ +/** + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.osqlts4pk; + +import java.sql.Timestamp; +import java.util.Collection; + +import javax.ejb.CreateException; +import javax.ejb.EJBLocalHome; +import javax.ejb.FinderException; + +/** + * @author joaninh Local Home interface of the osqlts4pk bean + */ +public interface Osqlts4pkHomeLocal extends EJBLocalHome { + Osqlts4pkLocal create(Timestamp id, String f1) throws CreateException; + Osqlts4pkLocal findByPrimaryKey(Pk pk) throws FinderException; + Osqlts4pkLocal findByDate(Timestamp id) throws FinderException; + Collection findAll() throws FinderException; +} + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/Osqlts4pkLocal.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/Osqlts4pkLocal.java new file mode 100644 index 0000000000000000000000000000000000000000..36fccb69165a2a6a67931ced3e7ee1800213fe11 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/Osqlts4pkLocal.java @@ -0,0 +1,44 @@ +/** + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.osqlts4pk; + +import java.sql.Timestamp; + +import javax.ejb.EJBLocalObject; + +/** + * Local interface of the osqlts4pk bean. + * @author Helene Joanin Contributor(s): + */ + +public interface Osqlts4pkLocal extends EJBLocalObject { + + public Timestamp getId(); + + public String getF1(); + + public void setF1(String f1); +} \ No newline at end of file diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/Pk.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/Pk.java new file mode 100644 index 0000000000000000000000000000000000000000..119313614fc65f1dbec18164c6057a9dcb986cbf --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/Pk.java @@ -0,0 +1,65 @@ +/** + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.osqlts4pk; + +import java.sql.Timestamp; + +/** + * @author H.Joanin + */ +public class Pk implements java.io.Serializable { + + public Timestamp id; + + public Pk() { + } + + public Pk(Timestamp id) { + this.id = id; + } + + public boolean equals(Object other) { + if (other == null) { + return false; + } + if (other == this) { + return true; + } + if (!(other instanceof Pk)) { + return false; + } + Pk otherPK = (Pk) other; + return (id.equals(otherPK.id)); + } + + public int hashCode() { + return(id.hashCode()); + } + +public String toString() { + return("(" + id); + }} + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/jonas-osqlts4pk.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/jonas-osqlts4pk.xml new file mode 100644 index 0000000000000000000000000000000000000000..60c8de2f91f9d2d964af471c09d9aef67b62c307 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/jonas-osqlts4pk.xml @@ -0,0 +1,38 @@ + + + + + + + osqlts4pkEC2 + EtypeOsqlts4pkEC2Home + removeall + + jdbc_1 + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/osqlts4pk.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/osqlts4pk.xml new file mode 100644 index 0000000000000000000000000000000000000000..d12e4f16c718973a6a08a9a0a06716f21dfb7428 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/osqlts4pk/osqlts4pk.xml @@ -0,0 +1,83 @@ + + + + + + + etype/osqlts4pk + + + + etype/osqlts4pk/osqlts4pkEC2 + osqlts4pkEC2 + org.objectweb.jonas.jtests.beans.etype.osqlts4pk.Osqlts4pkHome + org.objectweb.jonas.jtests.beans.etype.osqlts4pk.Osqlts4pk + org.objectweb.jonas.jtests.beans.etype.osqlts4pk.Osqlts4pkHomeLocal + org.objectweb.jonas.jtests.beans.etype.osqlts4pk.Osqlts4pkLocal + org.objectweb.jonas.jtests.beans.etype.osqlts4pk.Osqlts4pkEC2 + Container + org.objectweb.jonas.jtests.beans.etype.osqlts4pk.Pk + False + 2.x + jt2_osqlts4pkEC2 + + id + + + f1 + + + + findByDate + + java.sql.Timestamp + + + SELECT OBJECT(o) FROM jt2_osqlts4pkEC2 o WHERE o.id = ?1 + + + + findAll + + + + SELECT OBJECT(o) FROM jt2_osqlts4pkEC2 o + + + + + + + + osqlts4pkEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/outildate/Outildate.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/outildate/Outildate.java new file mode 100644 index 0000000000000000000000000000000000000000..b3c66eec44eb6df08051f3b2a9d5a8856bec9b94 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/outildate/Outildate.java @@ -0,0 +1,44 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Outildate.java + +package org.objectweb.jonas.jtests.beans.etype.outildate; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the outildate bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Outildate extends EJBObject { + public String getPk() throws RemoteException; + public java.util.Date getF1() throws RemoteException; + public void setF1(java.util.Date F1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/outildate/OutildateEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/outildate/OutildateEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..4c0249e0a98612f994e450fed29d571b592b9dfa --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/outildate/OutildateEC2.java @@ -0,0 +1,62 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.outildate; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * outildate entity bean class. + * outildate is an entity bean with container-managed persistence version 2, + * with a field which is a java.util.Date. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class OutildateEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract String getPk(); + public abstract void setPk(String pk); + public abstract java.util.Date getF1(); + public abstract void setF1(java.util.Date f1); + + public String ejbCreate(String pk, java.util.Date f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate("+pk+","+f1+")"); + setPk(pk); + setF1(f1); + return(null); + } + + public void ejbPostCreate(String pk, java.util.Date f1){ + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/outildate/OutildateHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/outildate/OutildateHome.java new file mode 100644 index 0000000000000000000000000000000000000000..1f68efc87fef29a89ac1512141acc56013151694 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/outildate/OutildateHome.java @@ -0,0 +1,51 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// OutildateHome.java + +package org.objectweb.jonas.jtests.beans.etype.outildate; + +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the outildate bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface OutildateHome extends EJBHome { + public Outildate create(String pk, java.util.Date f1) throws RemoteException, CreateException; + public Outildate findByPrimaryKey(String pk) throws RemoteException, FinderException; + public Collection findByF1(java.util.Date f1) throws RemoteException, FinderException; + public Collection findByF1LessThen(java.util.Date f1) throws RemoteException, FinderException; + public Collection findByF1LessOrEqualThen(java.util.Date f1) throws RemoteException, FinderException; + public Collection findWithThreeArgs(java.util.Date f1, java.util.Date f2, String pk) throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/outildate/jonas-outildate.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/outildate/jonas-outildate.xml new file mode 100644 index 0000000000000000000000000000000000000000..945d31c4ab343bbc2530bbda0c7affdb63a9c9bd --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/outildate/jonas-outildate.xml @@ -0,0 +1,40 @@ + + + + + + + + OutildateEC2 + EtypeOutildateEC2Home + removeall + + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/outildate/outildate.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/outildate/outildate.xml new file mode 100644 index 0000000000000000000000000000000000000000..a7828068518486456eb96da8b4adff514a10ae5e --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/outildate/outildate.xml @@ -0,0 +1,107 @@ + + + + + + etype/outildate + + + + + etype/outildate/OutildateEC2 + OutildateEC2 + org.objectweb.jonas.jtests.beans.etype.outildate.OutildateHome + org.objectweb.jonas.jtests.beans.etype.outildate.Outildate + org.objectweb.jonas.jtests.beans.etype.outildate.OutildateEC2 + Container + java.lang.String + False + 2.x + jt2_outildate + + pk + + + f1 + + pk + + + findByF1 + + java.util.Date + + + SELECT OBJECT(o) FROM jt2_outildate o WHERE o.f1 = ?1 + + + + findByF1LessThen + + java.util.Date + + + + + + + findByF1LessOrEqualThen + + java.util.Date + + + + + + + findWithThreeArgs + + java.util.Date + java.util.Date + java.lang.String + + + ?2) + and (?3 is null or o.pk = ?3)]]> + + + + + + + + + OutildateEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pboolean/Pboolean.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pboolean/Pboolean.java new file mode 100644 index 0000000000000000000000000000000000000000..5332223523bbaa72c90df1957b4946c574322733 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pboolean/Pboolean.java @@ -0,0 +1,44 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Pboolean.java + +package org.objectweb.jonas.jtests.beans.etype.pboolean; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the pboolean bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Pboolean extends EJBObject { + public String getPk() throws RemoteException; + public boolean getF1() throws RemoteException; + public void setF1(boolean F1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pboolean/PbooleanEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pboolean/PbooleanEC.java new file mode 100644 index 0000000000000000000000000000000000000000..12c4d4095d3de833cea4a4e0f984631a41431f9d --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pboolean/PbooleanEC.java @@ -0,0 +1,63 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.pboolean; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Entity bean with container-managed persistence version 1.1, + * with a field which is a primitive boolean. + * @author Helene Joanin + * Contributor(s): + */ + +public class PbooleanEC extends PbooleanEC2 implements EntityBean { + + // State of the bean (CMP v1) + public String pk; + public boolean f1; + + // Accessors implementation + public String getPk() { + logger.log(BasicLevel.DEBUG, ""); + return this.pk; + } + public void setPk(String pk) { + logger.log(BasicLevel.DEBUG, ""); + this.pk = pk; + } + public boolean getF1() { + logger.log(BasicLevel.DEBUG, ""); + return this.f1; + } + public void setF1(boolean f1) { + logger.log(BasicLevel.DEBUG, ""); + this.f1 = f1; + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pboolean/PbooleanEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pboolean/PbooleanEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..e83941ca4b900aa2b41501eab339373eca4fe7ab --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pboolean/PbooleanEC2.java @@ -0,0 +1,62 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.pboolean; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * pboolean entity bean class. + * pboolean is an entity bean with container-managed persistence version 2, + * with a field which is a primitive boolean. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class PbooleanEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract String getPk(); + public abstract void setPk(String pk); + public abstract boolean getF1(); + public abstract void setF1(boolean f1); + + public String ejbCreate(String pk, boolean f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate("+pk+","+f1+")"); + setPk(pk); + setF1(f1); + return(null); + } + + public void ejbPostCreate(String pk, boolean f1){ + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pboolean/PbooleanHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pboolean/PbooleanHome.java new file mode 100644 index 0000000000000000000000000000000000000000..2f7972e175c3a6c2b5b0aa21df99bfac9fbd4473 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pboolean/PbooleanHome.java @@ -0,0 +1,49 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// PbooleanHome.java + +package org.objectweb.jonas.jtests.beans.etype.pboolean; + +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the pboolean bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface PbooleanHome extends EJBHome { + public Pboolean create(String pk, boolean f1) throws RemoteException, CreateException; + public Pboolean findByPrimaryKey(String pk) throws RemoteException, FinderException; + public Collection findByF1(boolean f1) throws RemoteException, FinderException; + public Collection findByF1LiteralTrue() throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pboolean/jonas-pboolean.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pboolean/jonas-pboolean.xml new file mode 100644 index 0000000000000000000000000000000000000000..7fa01c43fc2f84baa2b887b6ea76a40f7e71554b --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pboolean/jonas-pboolean.xml @@ -0,0 +1,69 @@ + + + + + + + + PbooleanEC + EtypePbooleanECHome + + jdbc_1 + JT_EtypePbooleanEC + + pk + c_pk + + + f1 + c_f1 + + + + findByF1 + + where c_f1 = ? + + + + findByF1LiteralTrue + + where c_f1 = 'true' + + + + + + PbooleanEC2 + EtypePbooleanEC2Home + removeall + + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pboolean/pboolean.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pboolean/pboolean.xml new file mode 100644 index 0000000000000000000000000000000000000000..d35ffa180c5775c11e5f3405d625d33d5eeed865 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pboolean/pboolean.xml @@ -0,0 +1,106 @@ + + + + + + etype/pboolean + + + + + etype/pboolean/PbooleanEC + PbooleanEC + org.objectweb.jonas.jtests.beans.etype.pboolean.PbooleanHome + org.objectweb.jonas.jtests.beans.etype.pboolean.Pboolean + org.objectweb.jonas.jtests.beans.etype.pboolean.PbooleanEC + Container + java.lang.String + False + 1.x + + pk + + + f1 + + pk + + + + etype/pboolean/PbooleanEC2 + PbooleanEC2 + org.objectweb.jonas.jtests.beans.etype.pboolean.PbooleanHome + org.objectweb.jonas.jtests.beans.etype.pboolean.Pboolean + org.objectweb.jonas.jtests.beans.etype.pboolean.PbooleanEC2 + Container + java.lang.String + False + 2.x + jt2_pboolean + + pk + + + f1 + + pk + + + findByF1 + + boolean + + + SELECT OBJECT(o) FROM jt2_pboolean o WHERE o.f1 = ?1 + + + + findByF1LiteralTrue + + + + SELECT OBJECT(o) FROM jt2_pboolean o WHERE o.f1 = TRUE + + + + + + + + + PbooleanEC + * + + + PbooleanEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pdouble/Pdouble.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pdouble/Pdouble.java new file mode 100644 index 0000000000000000000000000000000000000000..5f1bc642248d271d9468bfcdac087a15fb408960 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pdouble/Pdouble.java @@ -0,0 +1,44 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Pdouble.java + +package org.objectweb.jonas.jtests.beans.etype.pdouble; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the pdouble bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Pdouble extends EJBObject { + public String getPk() throws RemoteException; + public double getF1() throws RemoteException; + public void setF1(double F1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pdouble/PdoubleEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pdouble/PdoubleEC.java new file mode 100644 index 0000000000000000000000000000000000000000..e6f69f333996cb83dc7db771929d1fb393bbaafb --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pdouble/PdoubleEC.java @@ -0,0 +1,63 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.pdouble; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Entity bean with container-managed persistence version 1.1, + * with a field which is a primitive double. + * @author Helene Joanin + * Contributor(s): + */ + +public class PdoubleEC extends PdoubleEC2 implements EntityBean { + + // State of the bean (CMP v1) + public String pk; + public double f1; + + // Accessors implementation + public String getPk() { + logger.log(BasicLevel.DEBUG, ""); + return this.pk; + } + public void setPk(String pk) { + logger.log(BasicLevel.DEBUG, ""); + this.pk = pk; + } + public double getF1() { + logger.log(BasicLevel.DEBUG, ""); + return this.f1; + } + public void setF1(double f1) { + logger.log(BasicLevel.DEBUG, ""); + this.f1 = f1; + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pdouble/PdoubleEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pdouble/PdoubleEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..760b5de0eeccb35424bab631aad0a94095f4ce4c --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pdouble/PdoubleEC2.java @@ -0,0 +1,62 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.pdouble; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * pdouble entity bean class. + * pdouble is an entity bean with container-managed persistence version 2, + * with a field which is a primitive double. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class PdoubleEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract String getPk(); + public abstract void setPk(String pk); + public abstract double getF1(); + public abstract void setF1(double f1); + + public String ejbCreate(String pk, double f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate("+pk+","+f1+")"); + setPk(pk); + setF1(f1); + return(null); + } + + public void ejbPostCreate(String pk, double f1){ + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pdouble/PdoubleHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pdouble/PdoubleHome.java new file mode 100644 index 0000000000000000000000000000000000000000..049043129e1fdab636478b7cfac8c5cd47a3f854 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pdouble/PdoubleHome.java @@ -0,0 +1,49 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// PdoubleHome.java + +package org.objectweb.jonas.jtests.beans.etype.pdouble; + +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the pdouble bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface PdoubleHome extends EJBHome { + public Pdouble create(String pk, double f1) throws RemoteException, CreateException; + public Pdouble findByPrimaryKey(String pk) throws RemoteException, FinderException; + public Collection findByF1(double f1Min, double f1Max) throws RemoteException, FinderException; + public Collection findByF1Literal5() throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pdouble/jonas-pdouble.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pdouble/jonas-pdouble.xml new file mode 100644 index 0000000000000000000000000000000000000000..d968075f065bb374f84d9705567d1a97c8892992 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pdouble/jonas-pdouble.xml @@ -0,0 +1,69 @@ + + + + + + + + PdoubleEC + EtypePdoubleECHome + + jdbc_1 + JT_EtypePdoubleEC + + pk + c_pk + + + f1 + c_f1 + + + + findByF1 + + where c_f1 BETWEEN ?1 AND ?2 + + + + findByF1Literal5 + + where c_f1 BETWEEN 4.99 AND 5.01 + + + + + + PdoubleEC2 + EtypePdoubleEC2Home + removeall + + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pdouble/pdouble.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pdouble/pdouble.xml new file mode 100644 index 0000000000000000000000000000000000000000..280792f6df5f83ef8e65fbae49829a8362143026 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pdouble/pdouble.xml @@ -0,0 +1,107 @@ + + + + + + etype/pdouble + + + + + etype/pdouble/PdoubleEC + PdoubleEC + org.objectweb.jonas.jtests.beans.etype.pdouble.PdoubleHome + org.objectweb.jonas.jtests.beans.etype.pdouble.Pdouble + org.objectweb.jonas.jtests.beans.etype.pdouble.PdoubleEC + Container + java.lang.String + False + 1.x + + pk + + + f1 + + pk + + + + etype/pdouble/PdoubleEC2 + PdoubleEC2 + org.objectweb.jonas.jtests.beans.etype.pdouble.PdoubleHome + org.objectweb.jonas.jtests.beans.etype.pdouble.Pdouble + org.objectweb.jonas.jtests.beans.etype.pdouble.PdoubleEC2 + Container + java.lang.String + False + 2.x + jt2_pdouble + + pk + + + f1 + + pk + + + findByF1 + + double + double + + + SELECT OBJECT(o) FROM jt2_pdouble o WHERE (o.f1 BETWEEN ?1 AND ?2) + + + + findByF1Literal5 + + + + SELECT OBJECT(o) FROM jt2_pdouble o WHERE (o.f1 BETWEEN 4.99 AND 5.01) + + + + + + + + + PdoubleEC + * + + + PdoubleEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pfloat/Pfloat.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pfloat/Pfloat.java new file mode 100644 index 0000000000000000000000000000000000000000..5f91b60ed0b7fb4a2f7c8e8ffa9c158b0de3c29e --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pfloat/Pfloat.java @@ -0,0 +1,44 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Pfloat.java + +package org.objectweb.jonas.jtests.beans.etype.pfloat; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the pfloat bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Pfloat extends EJBObject { + public String getPk() throws RemoteException; + public float getF1() throws RemoteException; + public void setF1(float F1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pfloat/PfloatEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pfloat/PfloatEC.java new file mode 100644 index 0000000000000000000000000000000000000000..f978740127efcdd2be1399f6bc6be3a82071cbf6 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pfloat/PfloatEC.java @@ -0,0 +1,63 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.pfloat; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Entity bean with container-managed persistence version 1.1, + * with a field which is a primitive float. + * @author Helene Joanin + * Contributor(s): + */ + +public class PfloatEC extends PfloatEC2 implements EntityBean { + + // State of the bean (CMP v1) + public String pk; + public float f1; + + // Accessors implementation + public String getPk() { + logger.log(BasicLevel.DEBUG, ""); + return this.pk; + } + public void setPk(String pk) { + logger.log(BasicLevel.DEBUG, ""); + this.pk = pk; + } + public float getF1() { + logger.log(BasicLevel.DEBUG, ""); + return this.f1; + } + public void setF1(float f1) { + logger.log(BasicLevel.DEBUG, ""); + this.f1 = f1; + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pfloat/PfloatEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pfloat/PfloatEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..ebb3295150d24f665c58dd0fd2e532b71ff0962d --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pfloat/PfloatEC2.java @@ -0,0 +1,62 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.pfloat; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * pfloat entity bean class. + * pfloat is an entity bean with container-managed persistence version 2, + * with a field which is a primitive float. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class PfloatEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract String getPk(); + public abstract void setPk(String pk); + public abstract float getF1(); + public abstract void setF1(float f1); + + public String ejbCreate(String pk, float f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate("+pk+","+f1+")"); + setPk(pk); + setF1(f1); + return(null); + } + + public void ejbPostCreate(String pk, float f1){ + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pfloat/PfloatHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pfloat/PfloatHome.java new file mode 100644 index 0000000000000000000000000000000000000000..ee923061a7d71123111e93b4b33dea0cc9d42203 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pfloat/PfloatHome.java @@ -0,0 +1,49 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// PfloatHome.java + +package org.objectweb.jonas.jtests.beans.etype.pfloat; + +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the pfloat bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface PfloatHome extends EJBHome { + public Pfloat create(String pk, float f1) throws RemoteException, CreateException; + public Pfloat findByPrimaryKey(String pk) throws RemoteException, FinderException; + public Collection findByF1(float f1Min, float f1Max) throws RemoteException, FinderException; + public Collection findByF1Literal5() throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pfloat/jonas-pfloat.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pfloat/jonas-pfloat.xml new file mode 100644 index 0000000000000000000000000000000000000000..ac0ff483e51fd1c8cd2c4071c7975e7e3bb4d458 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pfloat/jonas-pfloat.xml @@ -0,0 +1,69 @@ + + + + + + + + PfloatEC + EtypePfloatECHome + + jdbc_1 + JT_EtypePfloatEC + + pk + c_pk + + + f1 + c_f1 + + + + findByF1 + + where c_f1 BETWEEN ?1 AND ?2 + + + + findByF1Literal5 + + where c_f1 BETWEEN 4.99 AND 5.01 + + + + + + PfloatEC2 + EtypePfloatEC2Home + removeall + + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pfloat/pfloat.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pfloat/pfloat.xml new file mode 100644 index 0000000000000000000000000000000000000000..22c2d7d713e4652fdffef3b513079811f57ab091 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pfloat/pfloat.xml @@ -0,0 +1,107 @@ + + + + + + etype/pfloat + + + + + etype/pfloat/PfloatEC + PfloatEC + org.objectweb.jonas.jtests.beans.etype.pfloat.PfloatHome + org.objectweb.jonas.jtests.beans.etype.pfloat.Pfloat + org.objectweb.jonas.jtests.beans.etype.pfloat.PfloatEC + Container + java.lang.String + False + 1.x + + pk + + + f1 + + pk + + + + etype/pfloat/PfloatEC2 + PfloatEC2 + org.objectweb.jonas.jtests.beans.etype.pfloat.PfloatHome + org.objectweb.jonas.jtests.beans.etype.pfloat.Pfloat + org.objectweb.jonas.jtests.beans.etype.pfloat.PfloatEC2 + Container + java.lang.String + False + 2.x + jt2_pfloat + + pk + + + f1 + + pk + + + findByF1 + + float + float + + + SELECT OBJECT(o) FROM jt2_pfloat o WHERE (o.f1 BETWEEN ?1 AND ?2) + + + + findByF1Literal5 + + + + SELECT OBJECT(o) FROM jt2_pfloat o WHERE (o.f1 BETWEEN 4.99 AND 5.01) + + + + + + + + + PfloatEC + * + + + PfloatEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/plong/Plong.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/plong/Plong.java new file mode 100644 index 0000000000000000000000000000000000000000..4294884cec85b367ce30ca1b45377fb5e1830452 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/plong/Plong.java @@ -0,0 +1,44 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Plong.java + +package org.objectweb.jonas.jtests.beans.etype.plong; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the plong bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Plong extends EJBObject { + public String getPk() throws RemoteException; + public long getF1() throws RemoteException; + public void setF1(long F1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/plong/PlongEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/plong/PlongEC.java new file mode 100644 index 0000000000000000000000000000000000000000..e4c695f129c0173a620f39e3bac2e26bb0bbca06 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/plong/PlongEC.java @@ -0,0 +1,63 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.plong; + +import javax.ejb.EntityBean; + +import org.objectweb.util.monolog.api.BasicLevel; + +/** + * Entity bean with container-managed persistence version 1.1, + * with a field which is a primitive long. + * @author Helene Joanin + * Contributor(s): + */ + +public class PlongEC extends PlongEC2 implements EntityBean { + + // State of the bean (CMP v1) + public String pk; + public long f1; + + // Accessors implementation + public String getPk() { + logger.log(BasicLevel.DEBUG, ""); + return this.pk; + } + public void setPk(String pk) { + logger.log(BasicLevel.DEBUG, ""); + this.pk = pk; + } + public long getF1() { + logger.log(BasicLevel.DEBUG, ""); + return this.f1; + } + public void setF1(long f1) { + logger.log(BasicLevel.DEBUG, ""); + this.f1 = f1; + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/plong/PlongEC2.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/plong/PlongEC2.java new file mode 100644 index 0000000000000000000000000000000000000000..cb0dbd420a3ec3c809dc5fd6026a44823c085763 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/plong/PlongEC2.java @@ -0,0 +1,62 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +package org.objectweb.jonas.jtests.beans.etype.plong; + +import javax.ejb.CreateException; +import javax.ejb.EntityBean; + +import org.objectweb.jonas.jtests.beans.etype.EtypeBean; +import org.objectweb.util.monolog.api.BasicLevel; + + +/** + * plong entity bean class. + * plong is an entity bean with container-managed persistence version 2, + * with a field which is a primitive long. + * @author Helene Joanin + * Contributor(s): + */ + +public abstract class PlongEC2 extends EtypeBean implements EntityBean { + + // Accessor methods of the bean's abstract schema + public abstract String getPk(); + public abstract void setPk(String pk); + public abstract long getF1(); + public abstract void setF1(long f1); + + public String ejbCreate(String pk, long f1) throws CreateException { + logger.log(BasicLevel.DEBUG, "ejbCreate("+pk+","+f1+")"); + setPk(pk); + setF1(f1); + return(null); + } + + public void ejbPostCreate(String pk, long f1){ + logger.log(BasicLevel.DEBUG, ""); + } + +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/plong/PlongHome.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/plong/PlongHome.java new file mode 100644 index 0000000000000000000000000000000000000000..17270b0f3623b2d90b7a108e3136fbdd3a059646 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/plong/PlongHome.java @@ -0,0 +1,49 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// PlongHome.java + +package org.objectweb.jonas.jtests.beans.etype.plong; + +import java.util.Collection; +import java.rmi.RemoteException; +import javax.ejb.CreateException; +import javax.ejb.EJBHome; +import javax.ejb.FinderException; + + +/** + * Home interface of the plong bean + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface PlongHome extends EJBHome { + public Plong create(String pk, long f1) throws RemoteException, CreateException; + public Plong findByPrimaryKey(String pk) throws RemoteException, FinderException; + public Collection findByF1(long f1) throws RemoteException, FinderException; + public Collection findByF1Literal5() throws RemoteException, FinderException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/plong/jonas-plong.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/plong/jonas-plong.xml new file mode 100644 index 0000000000000000000000000000000000000000..cea1793b3606d46c23d5c66e08943982564e6aa5 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/plong/jonas-plong.xml @@ -0,0 +1,69 @@ + + + + + + + + PlongEC + EtypePlongECHome + + jdbc_1 + JT_EtypePlongEC + + pk + c_pk + + + f1 + c_f1 + + + + findByF1 + + where c_f1 = ? + + + + findByF1Literal5 + + where c_f1 = 5 + + + + + + PlongEC2 + EtypePlongEC2Home + removeall + + jdbc_1 + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/plong/plong.xml b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/plong/plong.xml new file mode 100644 index 0000000000000000000000000000000000000000..0b1fcc92c811043f83662db06ce2508c6cbdad34 --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/plong/plong.xml @@ -0,0 +1,106 @@ + + + + + + etype/plong + + + + + etype/plong/PlongEC + PlongEC + org.objectweb.jonas.jtests.beans.etype.plong.PlongHome + org.objectweb.jonas.jtests.beans.etype.plong.Plong + org.objectweb.jonas.jtests.beans.etype.plong.PlongEC + Container + java.lang.String + False + 1.x + + pk + + + f1 + + pk + + + + etype/plong/PlongEC2 + PlongEC2 + org.objectweb.jonas.jtests.beans.etype.plong.PlongHome + org.objectweb.jonas.jtests.beans.etype.plong.Plong + org.objectweb.jonas.jtests.beans.etype.plong.PlongEC2 + Container + java.lang.String + False + 2.x + jt2_plong + + pk + + + f1 + + pk + + + findByF1 + + long + + + SELECT OBJECT(o) FROM jt2_plong o WHERE o.f1 = ?1 + + + + findByF1Literal5 + + + + SELECT OBJECT(o) FROM jt2_plong o WHERE o.f1 = 5 + + + + + + + + + PlongEC + * + + + PlongEC2 + * + + Required + + + + diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pshort/Pshort.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pshort/Pshort.java new file mode 100644 index 0000000000000000000000000000000000000000..a37c2ab00bf3daaf73ea41d54c7e0123ead8188a --- /dev/null +++ b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pshort/Pshort.java @@ -0,0 +1,44 @@ +/* + * JOnAS: Java(TM) Open Application Server + * Copyright (C) 1999 Bull S.A. + * Contact: jonas-team@objectweb.org + * + * This library 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 any later version. + * + * This library 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 library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * -------------------------------------------------------------------------- + * $Id$ + * -------------------------------------------------------------------------- + */ + +// Pshort.java + +package org.objectweb.jonas.jtests.beans.etype.pshort; + +import java.rmi.RemoteException; +import javax.ejb.EJBObject; + +/** + * Remote interface of the pshort bean. + * @author Helene Joanin + * Contributor(s): + * + */ + +public interface Pshort extends EJBObject { + public String getPk() throws RemoteException; + public short getF1() throws RemoteException; + public void setF1(short F1) throws RemoteException; +} diff --git a/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pshort/PshortEC.java b/jonas_tests/conformance/src/org/objectweb/jonas/jtests/beans/etype/pshort/PshortEC.java new file mode 10