summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-scheduled/src
diff options
context:
space:
mode:
authorBrett Porter <brett@apache.org>2009-12-04 04:07:12 +0000
committerBrett Porter <brett@apache.org>2009-12-04 04:07:12 +0000
commit6c1cd8d63fa27f895307363e7630d2f4b7ac3126 (patch)
tree5736c6cc45780efe50ee7067fae83545969dff0c /archiva-modules/archiva-scheduled/src
parentd03e92ca26debb608a9bd1e48e867212874a9632 (diff)
downloadarchiva-6c1cd8d63fa27f895307363e7630d2f4b7ac3126.tar.gz
archiva-6c1cd8d63fa27f895307363e7630d2f4b7ac3126.zip
exclude .svn directories in the test
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@887051 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-scheduled/src')
-rw-r--r--archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutor.java2
-rw-r--r--archiva-modules/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.java14
2 files changed, 10 insertions, 6 deletions
diff --git a/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutor.java b/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutor.java
index 7d47100a6..d775068f4 100644
--- a/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutor.java
+++ b/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutor.java
@@ -187,7 +187,7 @@ public class ArchivaRepositoryScanningTaskExecutor
log.error( "Error occurred while querying artifacts for artifact count : " + ae.getMessage() );
}
- // total repo size
+ // total repo size -- TODO: needs to exclude ignored files (eg .svn)
long size = FileUtils.sizeOfDirectory( new File( arepo.getLocation() ) );
dbstats.setTotalSize( size );
diff --git a/archiva-modules/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.java b/archiva-modules/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.java
index 4204fecbb..95dd3f632 100644
--- a/archiva-modules/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.java
+++ b/archiva-modules/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.java
@@ -154,6 +154,10 @@ public class ArchivaRepositoryScanningTaskExecutorTest
{
f.setLastModified( cal.getTimeInMillis() );
}
+ for ( String dir : (List<String>) FileUtils.getDirectoryNames( repoDir, "**/.svn", null, false ) )
+ {
+ FileUtils.deleteDirectory( new File( repoDir, dir ) );
+ }
assertTrue( "Default Test Repository should exist.", repoDir.exists() && repoDir.isDirectory() );
@@ -226,7 +230,7 @@ public class ArchivaRepositoryScanningTaskExecutorTest
// assertEquals( 8, newStats.getTotalArtifactCount() );
// assertEquals( 3, newStats.getTotalGroupCount() );
// assertEquals( 5, newStats.getTotalProjectCount() );
- assertEquals( 38545, newStats.getTotalSize() );
+ assertEquals( 14159, newStats.getTotalSize() );
File newArtifactGroup = new File( repoDir, "org/apache/archiva" );
@@ -260,7 +264,7 @@ public class ArchivaRepositoryScanningTaskExecutorTest
// assertEquals( 8, newStats.getTotalArtifactCount() );
// assertEquals( 3, newStats.getTotalGroupCount() );
// assertEquals( 5, newStats.getTotalProjectCount() );
- assertEquals( 43687, updatedStats.getTotalSize() );
+ assertEquals( 19301, updatedStats.getTotalSize() );
}
public void testExecutorScanOnlyNewArtifactsChangeTimes()
@@ -308,7 +312,7 @@ public class ArchivaRepositoryScanningTaskExecutorTest
// assertEquals( 8, newStats.getTotalArtifactCount() );
// assertEquals( 3, newStats.getTotalGroupCount() );
// assertEquals( 5, newStats.getTotalProjectCount() );
- assertEquals( 43687, newStats.getTotalSize() );
+ assertEquals( 19301, newStats.getTotalSize() );
}
public void testExecutorScanOnlyNewArtifactsMidScan()
@@ -356,7 +360,7 @@ public class ArchivaRepositoryScanningTaskExecutorTest
// assertEquals( 8, newStats.getTotalArtifactCount() );
// assertEquals( 3, newStats.getTotalGroupCount() );
// assertEquals( 5, newStats.getTotalProjectCount() );
- assertEquals( 43687, newStats.getTotalSize() );
+ assertEquals( 19301, newStats.getTotalSize() );
}
private void createAndSaveTestStats()
@@ -369,7 +373,7 @@ public class ArchivaRepositoryScanningTaskExecutorTest
stats.setTotalFileCount( 31 );
stats.setTotalGroupCount( 3 );
stats.setTotalProjectCount( 5 );
- stats.setTotalSize( 38545 );
+ stats.setTotalSize( 14159 );
stats.setWhenGathered( Calendar.getInstance().getTime() );
dao.getRepositoryContentStatisticsDAO().saveRepositoryContentStatistics( stats );