]> source.dussan.org Git - archiva.git/commitdiff
remove cache that caused BytecodeIndexTest to erroneously pass, fix test
authorBrett Porter <brett@apache.org>
Mon, 25 Feb 2008 14:25:28 +0000 (14:25 +0000)
committerBrett Porter <brett@apache.org>
Mon, 25 Feb 2008 14:25:28 +0000 (14:25 +0000)
Merged from: r630859

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches@630861 13f79535-47bb-0310-9956-ffa450edef68

archiva-1.0.x/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeIndexTest.java
archiva-1.0.x/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeRecordLoader.java

index a4bba0f4147c0eb72683ba0d2235dcc3d636b164..2fbef172ce35c6a0a147ee4e6cada232c9be2341 100644 (file)
@@ -59,6 +59,8 @@ public class BytecodeIndexTest extends AbstractIndexCreationTestCase
         ArchivaArtifact artifact = (ArchivaArtifact) dumps.get( "archiva-common" );
         
         File dumpFile = getDumpFile( artifact );
-        return BytecodeRecordLoader.loadRecord( dumpFile, artifact );
+        BytecodeRecord record = BytecodeRecordLoader.loadRecord( dumpFile, artifact );
+        record.setRepositoryId( "test-repo" );
+        return record;
     }
 }
index 2f3ed62b9d52f40c2dc82c27283a3ec96785c2dd..4b9ed12f08fad3b8f00a46e72cd26318c64df18b 100644 (file)
@@ -19,6 +19,7 @@ package org.apache.maven.archiva.indexer.bytecode;
  * under the License.
  */
 
+import junit.framework.AssertionFailedError;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 import org.apache.maven.archiva.model.ArchivaArtifactJavaDetails;
 import org.apache.maven.archiva.model.platform.JavaArtifactHelper;
@@ -29,10 +30,6 @@ import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.framework.AssertionFailedError;
 
 /**
  * BytecodeRecordLoader - Utility method for loading dump files into BytecordRecords. 
@@ -42,15 +39,16 @@ import junit.framework.AssertionFailedError;
  */
 public class BytecodeRecordLoader
 {
-    private static Map cache = new HashMap();
+//    private static Map cache = new HashMap();
 
     public static BytecodeRecord loadRecord( File dumpFile, ArchivaArtifact artifact )
     {
-        BytecodeRecord record = (BytecodeRecord) cache.get( artifact );
-        if ( record != null )
-        {
-            return record;
-        }
+        BytecodeRecord record;
+//        record = (BytecodeRecord) cache.get( artifact );
+//        if ( record != null )
+//        {
+//            return record;
+//        }
 
         record = new BytecodeRecord();
         record.setArtifact( artifact );
@@ -131,7 +129,7 @@ public class BytecodeRecordLoader
             IOUtil.close( freader );
         }
 
-        cache.put( artifact, record );
+//        cache.put( artifact, record );
 
         return record;
     }