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/test/org/apache/ojb/broker/metadata RepositoryPersistorTest.java
Date Sat, 10 May 2003 09:59:31 GMT
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);
  +	}
   }
  
  
  

Mime
View raw message