From 01b7555594057dad01635122d58ad739c87b34e8 Mon Sep 17 00:00:00 2001 From: Jesse McConnell Date: Mon, 16 Apr 2007 17:36:32 +0000 Subject: [PATCH] working test case now that the model bug was found and squashed git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches/archiva-jpox-database-refactor@529337 13f79535-47bb-0310-9956-ffa450edef68 --- .../executors/ArchivaScheduledTaskExecutor.java | 2 ++ .../src/test/conf/repository-manager.xml | 7 +------ .../ArchivaScheduledTaskExecutorTest.java | 14 ++++++-------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutor.java b/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutor.java index 0a8903f91..047e93296 100644 --- a/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutor.java +++ b/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutor.java @@ -111,6 +111,7 @@ public class ArchivaScheduledTaskExecutor try { + getLogger().info( "Task: Updating unprocessed artifacts" ); databaseUpdater.updateAllUnprocessed(); } catch ( ArchivaDatabaseException e ) @@ -120,6 +121,7 @@ public class ArchivaScheduledTaskExecutor try { + getLogger().info( "Task: Updating processed artifacts" ); databaseUpdater.updateAllProcessed(); } catch ( ArchivaDatabaseException e ) diff --git a/archiva-scheduled/src/test/conf/repository-manager.xml b/archiva-scheduled/src/test/conf/repository-manager.xml index 07e9f969b..9e3597358 100644 --- a/archiva-scheduled/src/test/conf/repository-manager.xml +++ b/archiva-scheduled/src/test/conf/repository-manager.xml @@ -165,12 +165,7 @@ 0 0 * * ? - index-artifact - update-db-project - validate-repository-metadata - index-archive-toc - update-db-bytecode-stats - index-public-methods + update-db-artifact not-present-remove-db-artifact diff --git a/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutorTest.java b/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutorTest.java index 7a60d5f99..71a4ff540 100644 --- a/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutorTest.java +++ b/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaScheduledTaskExecutorTest.java @@ -179,10 +179,10 @@ public class ArchivaScheduledTaskExecutorTest assertNotNull( artifact ); - List results = dao.getArtifactDAO().queryArtifacts( new ArtifactsProcessedConstraint( false ) ); + List unprocessedResultList = adao.queryArtifacts( new ArtifactsProcessedConstraint( false ) ); - assertNotNull( results ); - assertEquals("Incorrect number of unprocessed artifacts detected.", results.size(), 8 ); + assertNotNull( unprocessedResultList ); + assertEquals("Incorrect number of unprocessed artifacts detected.", 8, unprocessedResultList.size() ); DatabaseTask dataTask = new DatabaseTask(); @@ -190,12 +190,10 @@ public class ArchivaScheduledTaskExecutorTest taskExecutor.executeTask( dataTask ); - List newResults = dao.getArtifactDAO().queryArtifacts( new ArtifactsProcessedConstraint( false ) ); - - assertNotNull( newResults ); - assertEquals("Incorrect number of unprocessed artifacts detected.", newResults.size(), 0 ); - assertEquals("Incorrect number of processed artifacts detected.", newResults.size(), 8 ); + List processedResultList = adao.queryArtifacts( new ArtifactsProcessedConstraint( true ) ); + assertNotNull( processedResultList ); + assertEquals("Incorrect number of processed artifacts detected.", 8, processedResultList.size() ); }