db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject cvs commit: jakarta-ojb/src/test/org/apache/ojb/broker AAlone.java PersistenceBrokerTest.java BlobTest.java A.java
Date Thu, 12 Dec 2002 20:16:04 GMT
thma        2002/12/12 12:16:04

  Modified:    src/test/org/apache/ojb/broker PersistenceBrokerTest.java
                        BlobTest.java A.java
  Added:       src/test/org/apache/ojb/broker AAlone.java
  Log:
  fix #OJB114
  
  Revision  Changes    Path
  1.19      +45 -1     jakarta-ojb/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java
  
  Index: PersistenceBrokerTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- PersistenceBrokerTest.java	8 Dec 2002 12:44:53 -0000	1.18
  +++ PersistenceBrokerTest.java	12 Dec 2002 20:16:04 -0000	1.19
  @@ -339,6 +339,50 @@
   	}
   
   	/**
  +	 * performs a test of an extent with one concrete class that uses
  +         * ojbConcreteClass identifier.
  +	 */
  +	public void testExtentWithOneConcreteClassWithOjbConcreteClass()
  +	{
  +		try
  +		{
  +			// first delete all ABs from database
  +			Collection as = null;
  +			Criteria c = null;
  +			Query q = QueryFactory.newQuery(A.class, c);
  +			as = broker.getCollectionByQuery(q);
  +			if (as != null)
  +			{
  +				Iterator iter = as.iterator();
  +				while (iter.hasNext())
  +				{
  +					broker.delete(iter.next());
  +				}
  +			}
  +
  +			// Insert 2 A
  +			A a1 = new A();
  +			A a2 = new A();
  +
  +			broker.store(a1);
  +			broker.store(a2);
  +
  +                        Criteria selectAll = null;
  +
  +			q = QueryFactory.newQuery(AAlone.class, selectAll);
  +			as = broker.getCollectionByQuery(q);
  +			assertEquals("collection size", 2, as.size());
  +			assertEquals("counted size", 2, broker.getCount(q));
  +
  +		}
  +		catch (Throwable t)
  +		{
  +			LoggerFactory.getDefaultLogger().error(t);
  +			fail(t.getMessage());
  +		}
  +	}
  +
  +        /**
   	 * performs a test of the inheritance mapping to one table.
   	 */
   	public void testMappingToOneTable() throws Exception
  @@ -1263,4 +1307,4 @@
   			fail(t.getMessage());
   		}
   	}
  -}
  \ No newline at end of file
  +}
  
  
  
  1.5       +26 -0     jakarta-ojb/src/test/org/apache/ojb/broker/BlobTest.java
  
  Index: BlobTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/test/org/apache/ojb/broker/BlobTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BlobTest.java	20 Sep 2002 17:31:29 -0000	1.4
  +++ BlobTest.java	12 Dec 2002 20:16:04 -0000	1.5
  @@ -90,6 +90,32 @@
   			fail(t.getMessage());
   		}
   	}
  +	public void testReadNullBlob()
  +	{
  +		try
  +		{
  +			ObjectWithBlob obj = new ObjectWithBlob();
  +			
  +			obj.setId(1);
  +			obj.setBlob(null);
  +			obj.setClob(null);
  +			
  +			broker.store(obj);
  +			
  +			broker.clearCache();
  +			
  +			Identity oid = new Identity(obj);
  +                        ObjectWithBlob obj1 = (ObjectWithBlob) broker.getObjectByIdentity(oid);
  +			
  +			assertEquals(null, obj.getBlob());
  +			assertEquals(null, obj.getClob());
  +		}
  +		catch (Throwable t)
  +		{
  +		    LoggerFactory.getDefaultLogger().error(t);
  +			fail(t.getMessage());
  +		}
  +	}
   
   
   }
  
  
  
  1.2       +1 -1      jakarta-ojb/src/test/org/apache/ojb/broker/A.java
  
  Index: A.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/test/org/apache/ojb/broker/A.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- A.java	20 Jun 2002 17:07:50 -0000	1.1
  +++ A.java	12 Dec 2002 20:16:04 -0000	1.2
  @@ -1,6 +1,6 @@
   package org.apache.ojb.broker;
   
  -public class A extends AB
  +public class A extends AB implements AAlone
   {
   
       int id;
  
  
  
  1.1                  jakarta-ojb/src/test/org/apache/ojb/broker/AAlone.java
  
  Index: AAlone.java
  ===================================================================
  /*
   * OneConcreteExtentA.java
   *
   * Created on December 5, 2002, 11:04 PM
   */
  
  package org.apache.ojb.broker;
  
  /**
   *
   * @author  J. Russell Smyth
   */
  public interface AAlone {
      
  }
  
  
  

Mime
View raw message