1 package org.apache.maven.archiva.consumers.lucene.stubs;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
23 import java.util.Collection;
25 import junit.framework.Assert;
27 import org.apache.lucene.analysis.Analyzer;
28 import org.apache.lucene.queryParser.QueryParser;
29 import org.apache.lucene.search.Searchable;
30 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
31 import org.apache.maven.archiva.indexer.RepositoryContentIndex;
32 import org.apache.maven.archiva.indexer.RepositoryIndexException;
33 import org.apache.maven.archiva.indexer.RepositoryIndexSearchException;
34 import org.apache.maven.archiva.indexer.lucene.LuceneEntryConverter;
35 import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord;
40 public class LuceneRepositoryContentIndexStub
41 implements RepositoryContentIndex
44 public void deleteRecords( Collection records )
45 throws RepositoryIndexException
47 // TODO Auto-generated method stub
48 Assert.assertEquals( 2, records.size() );
51 public boolean exists()
52 throws RepositoryIndexException
54 // TODO Auto-generated method stub
58 public Collection getAllRecordKeys()
59 throws RepositoryIndexException
61 // TODO Auto-generated method stub
65 public Analyzer getAnalyzer()
67 // TODO Auto-generated method stub
71 public LuceneEntryConverter getEntryConverter()
73 // TODO Auto-generated method stub
79 // TODO Auto-generated method stub
83 public File getIndexDirectory()
85 // TODO Auto-generated method stub
89 public QueryParser getQueryParser()
91 // TODO Auto-generated method stub
95 public ManagedRepositoryConfiguration getRepository()
97 // TODO Auto-generated method stub
101 public Searchable getSearchable()
102 throws RepositoryIndexSearchException
104 // TODO Auto-generated method stub
108 public void indexRecords( Collection records )
109 throws RepositoryIndexException
111 // TODO Auto-generated method stub
115 public void modifyRecord( LuceneRepositoryContentRecord record )
116 throws RepositoryIndexException
118 // TODO Auto-generated method stub
122 public void modifyRecords( Collection records )
123 throws RepositoryIndexException
125 // TODO Auto-generated method stub
129 public void deleteRecord( LuceneRepositoryContentRecord record )
130 throws RepositoryIndexException
132 Assert.assertNotNull( record );
134 // fail since the record to be deleted should only be the deleted-artifact-1.0.jar
135 // according to the tests
136 if( record.getPrimaryKey().equals(
137 "org/apache/maven/archiva/archiva-lucene-cleanup/1.0/archiva-lucene-cleanup-1.0.jar" ) &&
138 record.getPrimaryKey().equals( "org.apache.maven.archiva:archiva-lucene-cleanup:1.0:jar" ) )