Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 564328 API revision | conditions | rethink key interfaces #254

Merged
merged 1 commit into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,26 @@
public abstract class FrameworkContractTest {

@Test
public void exists() {
public final void exists() {
assertNotNull(framework());
assertTrue(framework().isPresent());
}

@Test
public void canResolveRequirements() {
public final void canResolveRequirements() {
Registry<StringServiceId, ResolvedRequirements> registry = framework().get().requirementsRegistry().get();
assertNotNull(registry);
assertNotNull(registry.services());
assertTrue(registry.services().size() > 0);
}

@Test
public void prohibitsRequirementsResolutionExtension() {
public final void prohibitsRequirementsResolutionExtension() {
assertTrue(readOnly(framework().get().requirementsRegistry().get()));
}

@Test
public void prohibitsInjectionIntoRequirementResolutionServices() {
public final void prohibitsInjectionIntoRequirementResolutionServices() {
Registry<StringServiceId, ResolvedRequirements> registry = framework().get().requirementsRegistry().get();
int before = registry.services().size();
registry.services().add(new FakeResolvedRequirements());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
public abstract class FrameworkRequirementResolutionServiceTest extends ReadOnlyCollectionTest<ResolvedRequirements> {

@Override
protected Supplier<Collection<ResolvedRequirements>> collection() {
protected final Supplier<Collection<ResolvedRequirements>> collection() {
return () -> framework().get().requirementsRegistry().get().services();
}

@Override
protected ResolvedRequirements single() {
protected final ResolvedRequirements single() {
return new FakeResolvedRequirements();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
public abstract class ReadOnlyCollectionTest<T> {

@Test
public void prohibitsInjections() {
public final void prohibitsInjections() {
testInterferenceResistence(shared -> shared.add(single()));
testInterferenceResistence(shared -> shared.addAll(Collections.singleton(single())));
}

@Test
public void prohibitsRemovals() {
public final void prohibitsRemovals() {
assumeTrue(collection().get().size() > 0);
testInterferenceResistence(Collection::clear);
testInterferenceResistence(shared -> shared.retainAll(Collections.emptyList()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public abstract class ResolvedRequirementsContractTest extends ReadOnlyCollectionTest<Requirement> {

@Override
protected Supplier<Collection<Requirement>> collection() {
protected final Supplier<Collection<Requirement>> collection() {
return service()::all;
}

Expand Down