forked from square/dagger
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize functional multibinding tests into separate targets.
This is part of an on-going refactor to clean up Dagger's tests. The new structure follows Bazel best practices and has a number of benefits such as: * Makes it clear which classes go with a particular test class just by reading the BUILD file * Makes error messages clearer because a problematic class will only cause its corresponding test to fail and not unrelated tests. * Speeds up builds, as tests don't need to wait for unrelated classes to build. RELNOTES=N/A PiperOrigin-RevId: 660590373
- Loading branch information
Showing
7 changed files
with
248 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
javatests/dagger/functional/multibindings/BindsInaccessibleMapKey.java
This file was deleted.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
javatests/dagger/functional/multibindings/BindsInaccessibleMapKeyTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright (C) 2018 The Dagger Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package dagger.functional.multibindings; | ||
|
||
import static com.google.common.collect.Iterables.getOnlyElement; | ||
import static com.google.common.truth.Truth.assertThat; | ||
|
||
import dagger.Component; | ||
import dagger.functional.multibindings.subpackage.BindsInaccessibleMapKeyModule; | ||
import java.util.Map; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.JUnit4; | ||
|
||
// b/73820357 | ||
@RunWith(JUnit4.class) | ||
public class BindsInaccessibleMapKeyTest { | ||
@Component(modules = BindsInaccessibleMapKeyModule.class) | ||
interface TestComponent { | ||
Map<Class<?>, Object> mapWithAnInaccessibleMapKey(); | ||
} | ||
|
||
@Test | ||
public void test() { | ||
Map<Class<?>, Object> map = | ||
DaggerBindsInaccessibleMapKeyTest_TestComponent.create().mapWithAnInaccessibleMapKey(); | ||
assertThat(map).hasSize(1); | ||
assertThat(getOnlyElement(map.keySet()).getCanonicalName()) | ||
.isEqualTo( | ||
"dagger.functional.multibindings.subpackage." | ||
+ "BindsInaccessibleMapKeyModule.Inaccessible"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters