001package org.eclipse.aether.impl.guice; 002 003/* 004 * Licensed to the Apache Software Foundation (ASF) under one 005 * or more contributor license agreements. See the NOTICE file 006 * distributed with this work for additional information 007 * regarding copyright ownership. The ASF licenses this file 008 * to you under the Apache License, Version 2.0 (the 009 * "License"); you may not use this file except in compliance 010 * with the License. You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, 015 * software distributed under the License is distributed on an 016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 017 * KIND, either express or implied. See the License for the 018 * specific language governing permissions and limitations 019 * under the License. 020 */ 021 022import static org.junit.Assert.*; 023 024import java.util.Collections; 025import java.util.Set; 026 027import org.eclipse.aether.RepositorySystem; 028import org.eclipse.aether.impl.ArtifactDescriptorReader; 029import org.eclipse.aether.impl.MetadataGeneratorFactory; 030import org.eclipse.aether.impl.StubArtifactDescriptorReader; 031import org.eclipse.aether.impl.StubVersionRangeResolver; 032import org.eclipse.aether.impl.StubVersionResolver; 033import org.eclipse.aether.impl.VersionRangeResolver; 034import org.eclipse.aether.impl.VersionResolver; 035import org.eclipse.aether.spi.connector.RepositoryConnectorFactory; 036import org.eclipse.aether.spi.connector.transport.TransporterFactory; 037import org.junit.Test; 038 039import com.google.inject.AbstractModule; 040import com.google.inject.Guice; 041import com.google.inject.Provides; 042 043public class AetherModuleTest 044{ 045 046 @Test 047 public void testModuleCompleteness() 048 { 049 assertNotNull( Guice.createInjector( new SystemModule() ).getInstance( RepositorySystem.class ) ); 050 } 051 052 static class SystemModule 053 extends AbstractModule 054 { 055 056 @Override 057 protected void configure() 058 { 059 install( new AetherModule() ); 060 bind( ArtifactDescriptorReader.class ).to( StubArtifactDescriptorReader.class ); 061 bind( VersionRangeResolver.class ).to( StubVersionRangeResolver.class ); 062 bind( VersionResolver.class ).to( StubVersionResolver.class ); 063 } 064 065 @Provides 066 public Set<MetadataGeneratorFactory> metadataGeneratorFactories() 067 { 068 return Collections.emptySet(); 069 } 070 071 @Provides 072 public Set<RepositoryConnectorFactory> repositoryConnectorFactories() 073 { 074 return Collections.emptySet(); 075 } 076 077 @Provides 078 public Set<TransporterFactory> transporterFactories() 079 { 080 return Collections.emptySet(); 081 } 082 083 } 084 085}