throw new RepositoryAdminException( "Invalid cron expression." );
}
}
+ else
+ {
+ throw new RepositoryAdminException( "Cron expression cannot be empty." );
+ }
- // FIXME checkId non empty
+ if (StringUtils.isBlank( repoId ))
+ {
+ throw new RepositoryAdminException( "Repository ID cannot be empty." );
+ }
if ( !GenericValidator.matchRegexp( repoId, REPOSITORY_ID_VALID_EXPRESSION ) )
{
repo.setId( repoId );
repo.setName( "test repo" );
repo.setLocation( repoLocation );
+ repo.setCronExpression( "0 0 * * * ?" );
managedRepositoryAdmin.addManagedRepository( repo, false, getFakeAuditInformation() );
repos = managedRepositoryAdmin.getManagedRepositories();
assertNotNull( repos );
repo.setId( repoId );
repo.setName( "test repo" );
repo.setLocation( repoLocation );
+ repo.setCronExpression( "0 0 * * * ?" );
managedRepositoryAdmin.addManagedRepository( repo, false, getFakeAuditInformation() );
assertTemplateRoleExists( repoId );
repo.setName( newName );
repo.setLocation( repoLocation );
+ repo.setCronExpression( "0 0 * * * ?" );
managedRepositoryAdmin.updateManagedRepository( repo, false, getFakeAuditInformation(), false );
repo.setId( repoId );
repo.setName( "test repo" );
repo.setLocation( repoLocation );
+ repo.setCronExpression( "0 0 * * * ?" );
managedRepositoryAdmin.addManagedRepository( repo, true, getFakeAuditInformation() );
repos = managedRepositoryAdmin.getManagedRepositories();
assertNotNull( repos );