db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/ejb/org/apache/ojb/ejb/pb PBClient.java PersonArticleClient.java PersonArticleManagerPBBean.java
Date Wed, 09 Jun 2004 00:49:29 GMT
arminw      2004/06/08 17:49:29

  Modified:    src/ejb/org/apache/ojb/ejb/pb PBClient.java
                        PersonArticleClient.java
                        PersonArticleManagerPBBean.java
  Log:
  add more tests
  
  Revision  Changes    Path
  1.5       +18 -1     db-ojb/src/ejb/org/apache/ojb/ejb/pb/PBClient.java
  
  Index: PBClient.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/ejb/org/apache/ojb/ejb/pb/PBClient.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PBClient.java	5 Apr 2004 00:17:08 -0000	1.4
  +++ PBClient.java	9 Jun 2004 00:49:29 -0000	1.5
  @@ -210,4 +210,21 @@
           System.out.println("");
           System.out.println("## PB-api testStress END ##");
       }
  +
  +    public void testStress2() throws Exception
  +    {
  +        System.out.println("## PB-api testStress2");
  +        System.out.println("# Store " + loops + " objects");
  +        List newObjects = null;
  +        for (int i = 0; i < loops; i++)
  +        {
  +            newObjects = VOHelper.createNewArticleList(loops);
  +        }
  +        bean.storeObjects(newObjects);
  +        List lookupObjects = new ArrayList(bean.getAllObjects(ArticleVO.class));
  +        int i =0;
  +        System.out.println("# Delete " + loops + " objects");
  +        bean.deleteObjects(lookupObjects);
  +        System.out.println("## PB-api testStress2 END ##");
  +    }
   }
  
  
  
  1.5       +19 -1     db-ojb/src/ejb/org/apache/ojb/ejb/pb/PersonArticleClient.java
  
  Index: PersonArticleClient.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/ejb/org/apache/ojb/ejb/pb/PersonArticleClient.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PersonArticleClient.java	5 Apr 2004 00:17:08 -0000	1.4
  +++ PersonArticleClient.java	9 Jun 2004 00:49:29 -0000	1.5
  @@ -122,7 +122,25 @@
           int articlesAfterDelete = bean.articleCount();
           assertEquals("wrong number of articles after delete", articlesBefore, articlesAfterDelete);
           assertEquals("wrong number of persons after delete", personsBefore, personsAfterDelete);
  +    }
   
  +    public void testStoreDelete() throws Exception
  +    {
  +        int count = 100;
  +        int articlesBefore = bean.articleCount();
  +
  +        List articleList = VOHelper.createNewArticleList(count);
  +        // storing objects
  +        articleList = bean.storeArticlesIntricately(articleList);
  +
  +        int articlesAfterStore = bean.articleCount();
  +        assertEquals("wrong number of articles after store", articlesBefore + count, articlesAfterStore);
  +
  +        //delete objects
  +        bean.deleteArticlesIntricately(articleList);
  +
  +        int articlesAfterDelete = bean.articleCount();
  +        assertEquals("wrong number of articles after delete", articlesBefore, articlesAfterDelete);
       }
   
       // only used when running outside junit
  
  
  
  1.5       +25 -1     db-ojb/src/ejb/org/apache/ojb/ejb/pb/PersonArticleManagerPBBean.java
  
  Index: PersonArticleManagerPBBean.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/ejb/org/apache/ojb/ejb/pb/PersonArticleManagerPBBean.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PersonArticleManagerPBBean.java	5 Apr 2004 00:17:08 -0000	1.4
  +++ PersonArticleManagerPBBean.java	9 Jun 2004 00:49:29 -0000	1.5
  @@ -142,6 +142,30 @@
       /**
        * @ejb:interface-method
        */
  +    public List storeArticlesIntricately(List articles)
  +    {
  +        ArrayList ret = new ArrayList();
  +        for (int i = 0; i < articles.size(); i++)
  +        {
  +            ret.add(getArticleManager().storeArticle((ArticleVO) articles.get(i)));
  +        }
  +        return ret;
  +    }
  +
  +    /**
  +     * @ejb:interface-method
  +     */
  +    public void deleteArticlesIntricately(List articles)
  +    {
  +        for (int i = 0; i < articles.size(); i++)
  +        {
  +            getArticleManager().deleteArticle((ArticleVO) articles.get(i));
  +        }
  +    }
  +
  +    /**
  +     * @ejb:interface-method
  +     */
       public List storePersons(List persons)
       {
           return new ArrayList(getPersonManager().storePersons(persons));
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message