Fixing RepositoryDAO and tests.

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches/archiva-jpox-database-refactor@527676 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Joakim Erdfelt 2007-04-11 21:13:53 +00:00
parent 2ce32e94ab
commit 9e39e98656
2 changed files with 5 additions and 4 deletions

View File

@ -67,7 +67,7 @@ public class JdoRepositoryDAO
public List getRepositories()
throws ObjectNotFoundException, ArchivaDatabaseException
{
return jdo.getAllObjects( ArchivaRepositoryModel.class );
return queryRepositories( null );
}
public ArchivaRepository getRepository( String id )

View File

@ -54,7 +54,8 @@ public class JdoRepositoryDAOTest
// Save it.
ArchivaRepository repoSaved = repoDao.saveRepository( repo );
assertNotNull( repoSaved );
assertEquals( "testRepo", JDOHelper.getObjectId( repoSaved ).toString() );
assertNotNull( repoSaved.getModel() );
assertEquals( "testRepo", JDOHelper.getObjectId( repoSaved.getModel() ).toString() );
// Test that something has been saved.
List repos = repoDao.getRepositories();
@ -65,7 +66,7 @@ public class JdoRepositoryDAOTest
ArchivaRepository firstRepo = (ArchivaRepository) repos.get( 0 );
assertNotNull( firstRepo );
assertEquals( "testRepo", repo.getId() );
assertEquals( "The Test Repository.", repo.getModel().getName() );
assertEquals( "Test Repository", repo.getModel().getName() );
assertEquals( "Test Case", repo.getModel().getCreationSource() );
assertEquals( "default", repo.getModel().getLayoutName() );
@ -82,7 +83,7 @@ public class JdoRepositoryDAOTest
// Test expected values.
assertEquals( "testRepo", actualRepo.getId() );
assertEquals( "http://localhost:8080/repository/foo", actualRepo.getUrl() );
assertEquals( "http://localhost:8080/repository/foo", actualRepo.getUrl().toString() );
assertEquals( "Changed", actualRepo.getModel().getCreationSource() );
// Test that only 1 object is saved.