1 package org.apache.archiva.metadata.repository.file;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.archiva.metadata.model.MetadataFacetFactory;
23 import org.apache.archiva.metadata.repository.AbstractMetadataRepositoryTest;
24 import org.apache.commons.io.FileUtils;
25 import org.apache.archiva.configuration.ArchivaConfiguration;
26 import org.apache.archiva.configuration.Configuration;
27 import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
28 import org.junit.Before;
29 import org.junit.Ignore;
30
31 import java.io.File;
32 import java.util.Map;
33
34 import static org.mockito.Mockito.mock;
35 import static org.mockito.Mockito.when;
36
37 public class FileMetadataRepositoryTest
38 extends AbstractMetadataRepositoryTest
39 {
40
41 @Before
42 @Override
43 public void setUp()
44 throws Exception
45 {
46 super.setUp();
47
48 File directory = new File( "target/test-repositories" );
49 if (directory.exists())
50 {
51 FileUtils.deleteDirectory( directory );
52 }
53 ArchivaConfiguration config = createTestConfiguration( directory );
54 Map<String, MetadataFacetFactory> factories = createTestMetadataFacetFactories();
55
56 this.repository = new FileMetadataRepository( factories, config );
57 }
58
59 @Override
60 @Ignore
61 public void testGetArtifactsByProjectVersionMetadata()
62 throws Exception
63 {
64
65 }
66
67 @Override
68 @Ignore
69 public void testGetArtifactsByProjectVersionMetadataNoRepository()
70 throws Exception
71 {
72
73 }
74
75 @Override
76 @Ignore
77 public void testGetArtifactsByProjectVersionMetadataAllRepositories()
78 throws Exception
79 {
80
81 }
82
83 @Override
84 @Ignore
85 public void testGetArtifactsByMetadataAllRepositories()
86 throws Exception
87 {
88
89 }
90
91 @Override
92 @Ignore
93 public void testGetArtifactsByPropertySingleResult()
94 throws Exception
95 {
96
97 }
98
99 @Override
100 @Ignore
101 public void testSearchArtifactsByKey()
102 throws Exception
103 {
104
105 }
106
107 @Override
108 @Ignore
109 public void testSearchArtifactsByKeyExact()
110 throws Exception
111 {
112
113 }
114
115 @Override
116 @Ignore
117 public void testSearchArtifactsFullText()
118 throws Exception
119 {
120
121 }
122
123 @Override
124 @Ignore
125 public void testSearchArtifactsFullTextExact()
126 throws Exception
127 {
128
129 }
130
131 @Override
132 @Ignore
133 public void testSearchArtifactsByFacetKeyAllRepos()
134 throws Exception
135 {
136
137 }
138
139 @Override
140 @Ignore
141 public void testSearchArtifactsByFacetKey()
142 throws Exception
143 {
144
145 }
146
147 @Override
148 @Ignore
149 public void testSearchArtifactsFullTextByFacet()
150 throws Exception
151 {
152
153 }
154
155 protected static ArchivaConfiguration createTestConfiguration( File directory )
156 {
157 ArchivaConfiguration config = mock( ArchivaConfiguration.class );
158 Configuration configData = new Configuration();
159 configData.addManagedRepository( createManagedRepository( TEST_REPO_ID, directory ) );
160 configData.addManagedRepository( createManagedRepository( "other-repo", directory ) );
161 when( config.getConfiguration() ).thenReturn( configData );
162 return config;
163 }
164
165 private static ManagedRepositoryConfiguration createManagedRepository( String repoId, File directory )
166 {
167 ManagedRepositoryConfiguration managedRepository = new ManagedRepositoryConfiguration();
168 managedRepository.setId( repoId );
169 managedRepository.setLocation( new File( directory, repoId ).getAbsolutePath() );
170 return managedRepository;
171 }
172 }