Return-Path: Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 75479 invoked by uid 500); 10 May 2003 09:59:32 -0000 Received: (qmail 75476 invoked from network); 10 May 2003 09:59:32 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 10 May 2003 09:59:32 -0000 Received: (qmail 50126 invoked by uid 1510); 10 May 2003 09:59:31 -0000 Date: 10 May 2003 09:59:31 -0000 Message-ID: <20030510095931.50125.qmail@icarus.apache.org> From: arminw@apache.org To: db-ojb-cvs@apache.org Subject: cvs commit: db-ojb/src/test/org/apache/ojb/broker/metadata RepositoryPersistorTest.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N arminw 2003/05/10 02:59:31 Modified: src/test/org/apache/ojb/broker/metadata RepositoryPersistorTest.java Log: activate uncommented test Revision Changes Path 1.11 +20 -18 db-ojb/src/test/org/apache/ojb/broker/metadata/RepositoryPersistorTest.java Index: RepositoryPersistorTest.java =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/metadata/RepositoryPersistorTest.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- RepositoryPersistorTest.java 10 May 2003 00:13:51 -0000 1.10 +++ RepositoryPersistorTest.java 10 May 2003 09:59:31 -0000 1.11 @@ -43,8 +43,8 @@ } - /** Test storing repository.*/ - public void testStoreRepository() throws Exception + /** Test storing/read repository.*/ + public void testStoreReadRepository() throws Exception { String filename = "test_respository.xml"; DescriptorRepository repository = MetadataManager.getInstance().getRepository(); @@ -74,20 +74,22 @@ assertTrue(numClasses2 > 0); } -// /** Test storing repository.*/ -// public void testStoreConnectionRepository() throws Exception -// { -// String filename = "test_repository_database.xml"; -// DescriptorRepository repository = MetadataManager.getInstance().getRepository(); -// ConnectionRepository conRepository = MetadataManager.getInstance().connectionRepository(); -// int connectionCount = conRepository.getAllDescriptor().size(); -// RepositoryPersistor persistor = new RepositoryPersistor(); -// persistor.writeToFile(repository, conRepository, filename); -// -// ConnectionRepository second = persistor.readConnectionRepository(filename); -// int connectionCount2 = second.getAllDescriptor().size(); -// -// assertEquals("read in persisted connection repository should have same number of classes", -// connectionCount, connectionCount2); -// } + /** Test storing/read repository.*/ + public void testStoreReadConnectionRepository() throws Exception + { + String filename = "test_repository_database.xml"; + DescriptorRepository repository = MetadataManager.getInstance().getRepository(); + ConnectionRepository conRepository = MetadataManager.getInstance().connectionRepository(); + int connectionCount = conRepository.getAllDescriptor().size(); + + FileOutputStream fos = new FileOutputStream(filename); + RepositoryPersistor persistor = new RepositoryPersistor(); + persistor.writeToFile(repository, conRepository, fos); + + ConnectionRepository second = persistor.readConnectionRepository(filename); + int connectionCount2 = second.getAllDescriptor().size(); + + assertEquals("read in persisted connection repository should have same number of classes", + connectionCount, connectionCount2); + } }