1 /* 2 * Copyright (C) 2015 The Dagger Authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package dagger.functional.multipackage; 18 19 import dagger.Component; 20 import dagger.functional.multipackage.a.AModule; 21 import dagger.functional.multipackage.a.UsesInaccessible; 22 import dagger.functional.multipackage.a.UsesInaccessibleInGenericsOnly; 23 import dagger.functional.multipackage.sub.FooChildComponent; 24 import java.util.Set; 25 26 /** 27 * A component that tests the interaction between subcomponents, multiple packages, and 28 * multibindings. Specifically, we want: 29 * <ul> 30 * <li>A set binding with some contributions in the parent component, and some in the subcomponent. 31 * <li>The contributions come from different packages, but not the package of either component. 32 * <li>The set binding is requested in the subcomponent through a binding from a separate package. 33 * <li>No binding in the subcomponent, that's in the subcomponent's package, directly uses any 34 * binding from the component's package. 35 * </ul> 36 */ 37 // NOTE(beder): Be careful about changing any bindings in either this component or the subcomponent. 38 // Even adding a binding might stop this test from testing what it's supposed to test. 39 @Component(modules = {AModule.class}) 40 interface FooComponent { setOfString()41 Set<String> setOfString(); 42 fooChildComponent()43 FooChildComponent fooChildComponent(); 44 usesInaccessible()45 UsesInaccessible usesInaccessible(); 46 accessibleConstructorUsesInaccessibleInGenericsOnly()47 UsesInaccessibleInGenericsOnly accessibleConstructorUsesInaccessibleInGenericsOnly(); 48 } 49