1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.eclipse.aether.impl.guice;
20
21 import java.util.Collections;
22 import java.util.Set;
23
24 import com.google.inject.AbstractModule;
25 import com.google.inject.Guice;
26 import com.google.inject.Provides;
27 import org.eclipse.aether.RepositorySystem;
28 import org.eclipse.aether.impl.ArtifactDescriptorReader;
29 import org.eclipse.aether.impl.MetadataGeneratorFactory;
30 import org.eclipse.aether.impl.StubArtifactDescriptorReader;
31 import org.eclipse.aether.impl.StubVersionRangeResolver;
32 import org.eclipse.aether.impl.StubVersionResolver;
33 import org.eclipse.aether.impl.VersionRangeResolver;
34 import org.eclipse.aether.impl.VersionResolver;
35 import org.eclipse.aether.spi.connector.RepositoryConnectorFactory;
36 import org.eclipse.aether.spi.connector.transport.TransporterFactory;
37 import org.junit.Test;
38
39 import static org.junit.Assert.*;
40
41 public class AetherModuleTest {
42
43 @Test
44 public void testModuleCompleteness() {
45 assertNotNull(Guice.createInjector(new SystemModule()).getInstance(RepositorySystem.class));
46 }
47
48 static class SystemModule extends AbstractModule {
49
50 @Override
51 protected void configure() {
52 install(new AetherModule());
53 bind(ArtifactDescriptorReader.class).to(StubArtifactDescriptorReader.class);
54 bind(VersionRangeResolver.class).to(StubVersionRangeResolver.class);
55 bind(VersionResolver.class).to(StubVersionResolver.class);
56 }
57
58 @Provides
59 public Set<MetadataGeneratorFactory> metadataGeneratorFactories() {
60 return Collections.emptySet();
61 }
62
63 @Provides
64 public Set<RepositoryConnectorFactory> repositoryConnectorFactories() {
65 return Collections.emptySet();
66 }
67
68 @Provides
69 public Set<TransporterFactory> transporterFactories() {
70 return Collections.emptySet();
71 }
72 }
73 }