1 package org.apache.maven.archiva.consumers.core.repository.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;
38 * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
41 public class LuceneRepositoryContentIndexStub
42 implements RepositoryContentIndex
44 private int expectedRecordsSize;
46 public LuceneRepositoryContentIndexStub()
51 public LuceneRepositoryContentIndexStub( int size )
53 expectedRecordsSize = size;
56 public void deleteRecords( Collection records )
57 throws RepositoryIndexException
59 Assert.assertEquals( expectedRecordsSize, records.size() );
62 public boolean exists()
63 throws RepositoryIndexException
65 // TODO Auto-generated method stub
69 public Collection getAllRecordKeys()
70 throws RepositoryIndexException
72 // TODO Auto-generated method stub
76 public Analyzer getAnalyzer()
78 // TODO Auto-generated method stub
82 public LuceneEntryConverter getEntryConverter()
84 // TODO Auto-generated method stub
90 // TODO Auto-generated method stub
94 public File getIndexDirectory()
96 // TODO Auto-generated method stub
100 public QueryParser getQueryParser()
102 // TODO Auto-generated method stub
106 public ManagedRepositoryConfiguration getRepository()
108 // TODO Auto-generated method stub
112 public Searchable getSearchable()
113 throws RepositoryIndexSearchException
115 // TODO Auto-generated method stub
119 public void indexRecords( Collection records )
120 throws RepositoryIndexException
122 // TODO Auto-generated method stub
126 public void modifyRecord( LuceneRepositoryContentRecord record )
127 throws RepositoryIndexException
129 // TODO Auto-generated method stub
133 public void modifyRecords( Collection records )
134 throws RepositoryIndexException
136 // TODO Auto-generated method stub
140 public void deleteRecord( LuceneRepositoryContentRecord record )
141 throws RepositoryIndexException
143 // TODO Auto-generated method stub