Package org.apache.openejb.test.object

Examples of org.apache.openejb.test.object.Account


    /**
     *
     */
    public void test05_singleTransactionCommit(){
        try{
            Account expected = new Account("123-45-6789","Joe","Cool",40000);
            Account actual = new Account();

            ejbObject.openAccount(expected, new Boolean(false));
            actual = ejbObject.retreiveAccount( expected.getSsn() );

            assertNotNull( "The transaction was not commited.  The record is null", actual );
View Full Code Here


    /**
     *
     */
    public void test05_singleTransactionCommit(){
        try{
            Account expected = new Account("123-45-6789","Joe","Cool",40000);
            Account actual = new Account();

            ejbObject.openAccount(expected, new Boolean(false));
            actual = ejbObject.retreiveAccount( expected.getSsn() );

            assertNotNull( "The transaction was not commited.  The record is null", actual );
View Full Code Here

     * This test does work for the IntraVM Server, but it fails on
     * the Remote Server.  For some reason, when the RollbackException is
     * sent to the client, the server blocks.
     */
    public void BUG_test06_singleTransactionRollback(){
        Account expected = new Account("234-56-7890","Charlie","Brown", 20000);
        Account actual   = new Account();

        // Try and add the account in a transaction.  This should fail and
        // throw a RollbackException
        try{
            ejbObject.openAccount(expected, new Boolean(true));
View Full Code Here

     * This test does work for the IntraVM Server, but it fails on
     * the Remote Server.  For some reason, when the RollbackException is
     * sent to the client, the server blocks.
     */
    public void BUG_test06_singleTransactionRollback(){
        Account expected = new Account("234-56-7890","Charlie","Brown", 20000);
        Account actual   = new Account();

        // Try and add the account in a transaction.  This should fail and
        // throw a RollbackException
        try{
            ejbObject.openAccount(expected, new Boolean(true));
View Full Code Here

    /**
     *
     */
    public void test05_singleTransactionCommit(){
        try{
            final Account expected = new Account("123-45-6789","Joe","Cool",40000);
            Account actual = new Account();

            ejbObject.openAccount(expected, new Boolean(false));
            actual = ejbObject.retreiveAccount( expected.getSsn() );

            assertNotNull( "The transaction was not commited.  The record is null", actual );
View Full Code Here

     * This test does work for the IntraVM Server, but it fails on
     * the Remote Server.  For some reason, when the RollbackException is
     * sent to the client, the server blocks.
     */
    public void BUG_test06_singleTransactionRollback(){
        final Account expected = new Account("234-56-7890","Charlie","Brown", 20000);
        final Account actual   = new Account();

        // Try and add the account in a transaction.  This should fail and
        // throw a RollbackException
        try{
            ejbObject.openAccount(expected, new Boolean(true));
View Full Code Here

            throw new RemoteException("[Bean] " + e.getClass().getName() + " : " + e.getMessage());
        }
    }

    public Account retreiveAccount(final String ssn) throws RemoteException {
        final Account acct = new Account();
        try {
            final DataSource ds = (DataSource) javax.rmi.PortableRemoteObject.narrow(jndiContext.lookup("java:comp/env/datasource"), DataSource.class);
            final Connection con = ds.getConnection();

            try {
                final PreparedStatement stmt = con.prepareStatement("select * from Account where SSN = ?");
                try {
                    stmt.setString(1, ssn);
                    final ResultSet rs = stmt.executeQuery();
                    if (!rs.next()) return null;

                    acct.setSsn(rs.getString(1));
                    acct.setFirstName(rs.getString(2));
                    acct.setLastName(rs.getString(3));
                    acct.setBalance(rs.getInt(4));
                } finally {
                    stmt.close();
                }
            } finally {
                con.close();
View Full Code Here

            throw new RemoteException("[Bean] " + e.getClass().getName() + " : " + e.getMessage());
        }
    }

    public Account retreiveAccount(final String ssn) throws RemoteException {
        final Account acct = new Account();
        try {
            final DataSource ds = (DataSource) javax.rmi.PortableRemoteObject.narrow(jndiContext.lookup("java:comp/env/database"), DataSource.class);
            final Connection con = ds.getConnection();

            try {
                final PreparedStatement stmt = con.prepareStatement("select * from Account where SSN = ?");
                try {
                    stmt.setString(1, ssn);
                    final ResultSet rs = stmt.executeQuery();
                    if (!rs.next()) return null;

                    acct.setSsn(rs.getString(1));
                    acct.setFirstName(rs.getString(2));
                    acct.setLastName(rs.getString(3));
                    acct.setBalance(rs.getInt(4));
                } finally {
                    stmt.close();
                }
            } finally {
                con.close();
View Full Code Here

            throw new RemoteException("[Bean] " + e.getClass().getName() + " : " + e.getMessage());
        }
    }

    public Account retreiveAccount(final String ssn) throws RemoteException {
        final Account acct = new Account();
        try {
            final DataSource ds = (DataSource) javax.rmi.PortableRemoteObject.narrow(jndiContext.lookup("java:comp/env/database"), DataSource.class);
            final Connection con = ds.getConnection();

            try {
                final PreparedStatement stmt = con.prepareStatement("select * from Account where SSN = ?");
                try {
                    stmt.setString(1, ssn);
                    final ResultSet rs = stmt.executeQuery();
                    if (!rs.next()) return null;

                    acct.setSsn(rs.getString(1));
                    acct.setFirstName(rs.getString(2));
                    acct.setLastName(rs.getString(3));
                    acct.setBalance(rs.getInt(4));
                } finally {
                    stmt.close();
                }
            } finally {
                con.close();
View Full Code Here

            //throw new RemoteException("[Bean] "+e.getClass().getName()+" : "+e.getMessage());
        }
    }

    public Account retreiveAccount(final String ssn) {
        final Account acct = new Account();
        try {
            final DataSource ds = (DataSource) jndiContext.lookup("java:comp/env/database");
            final Connection con = ds.getConnection();

            try {
                final PreparedStatement stmt = con.prepareStatement("select * from Account where SSN = ?");
                try {
                    stmt.setString(1, ssn);
                    final ResultSet rs = stmt.executeQuery();
                    if (!rs.next()) return null;

                    acct.setSsn(rs.getString(1));
                    acct.setFirstName(rs.getString(2));
                    acct.setLastName(rs.getString(3));
                    acct.setBalance(rs.getInt(4));
                } finally {
                    stmt.close();
                }
            } finally {
                con.close();
View Full Code Here

TOP

Related Classes of org.apache.openejb.test.object.Account

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.