String savedKeyId = JDOHelper.getObjectId( savedStats ).toString();
assertEquals( "1[OID]org.apache.maven.archiva.model.RepositoryContentStatistics", savedKeyId );
// query
List results =
repoContentStatisticsDAO.queryRepositoryContentStatistics( new RepositoryContentStatisticsByRepositoryConstraint(
"internal" ) );
assertNotNull( results );
assertEquals( 1, results.size() );
RepositoryContentStatistics stats = (RepositoryContentStatistics) results.get( 0 );
assertEquals( "internal", stats.getRepositoryId() );
// delete
repoContentStatisticsDAO.deleteRepositoryContentStatistics( stats );
assertEquals( 0, repoContentStatisticsDAO.queryRepositoryContentStatistics(
new RepositoryContentStatisticsByRepositoryConstraint( "internal" ) ).size() );
}