Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
enabling a couple more tests (that don't work), and annotating sites …
Browse files Browse the repository at this point in the history
…to fix in the component-selection module

git-svn-id: https://svn.apache.org/repos/asf/maven/sandbox/trunk/mae@1158996 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
jdcasey committed Aug 18, 2011
1 parent 076be84 commit 8368f10
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 39 deletions.
Expand Up @@ -72,6 +72,7 @@ public <I> void hear( final TypeLiteral<I> type, final TypeEncounter<I> encounte
private static final class ComponentSelectionInjector<T>
implements MembersInjector<T>
{
// FIXME: This is NOT being injected!!
@Inject
private Injector injector;

Expand Down
Expand Up @@ -27,6 +27,9 @@
import org.apache.maven.mae.app.AbstractMAEApplication;
import org.apache.maven.mae.boot.embed.MAEEmbedderBuilder;
import org.apache.maven.mae.internal.container.fixture.ContainerOwner;
import org.apache.maven.mae.internal.container.fixture.DefaultSingletonOwner;
import org.apache.maven.mae.internal.container.fixture.SingletonLiteralOwner;
import org.apache.maven.mae.internal.container.fixture.SingletonOwner;
import org.junit.Test;

public class MAEApplicationTest
Expand Down Expand Up @@ -82,45 +85,40 @@ public void loadTwoApplications()
//
// assertNull( members.get( "simple" + ComponentKey.LITERAL_SUFFIX ) );
// }
//
// @Test
// public void singletonImpliedRequirementOnComponentWithImpliedHint()
// throws Throwable
// {
// final ContainerConfiguration config = new DefaultContainerConfiguration().setClassPathScanning( "ON" );
//
// final MAEContainer container = new MAEContainer( config, new ComponentSelector(), new InstanceRegistry() );
//
// final DefaultSingletonOwner owner = container.lookup( DefaultSingletonOwner.class );
//
// assertNotNull( owner.singleton() );
// }
//
// @Test
// public void singletonNonLiteralRequirement()
// throws Throwable
// {
// final ContainerConfiguration config = new DefaultContainerConfiguration().setClassPathScanning( "ON" );
//
// final MAEContainer container = new MAEContainer( config, new ComponentSelector(), new InstanceRegistry() );
//
// final SingletonOwner owner = container.lookup( SingletonOwner.class );
//
// assertNotNull( owner.singleton() );
// }
//
// @Test
// public void singletonLiteralRequirement()
// throws Throwable
// {
// final ContainerConfiguration config = new DefaultContainerConfiguration().setClassPathScanning( "ON" );
//
// final MAEContainer container = new MAEContainer( config, new ComponentSelector(), new InstanceRegistry() );
//
// final SingletonLiteralOwner owner = container.lookup( SingletonLiteralOwner.class );
//
// assertNotNull( owner.singletonLiteral() );
// }

@Test
public void singletonImpliedRequirementOnComponentWithImpliedHint()
throws Throwable
{
ContainerOwner owner = new ContainerOwner();
new TestApplication().load();
final DefaultSingletonOwner single = owner.container.lookup( DefaultSingletonOwner.class );

assertThat( single.singleton(), notNullValue() );
}

@Test
public void singletonNonLiteralRequirement()
throws Throwable
{
ContainerOwner owner = new ContainerOwner();
new TestApplication().load();
final SingletonOwner single = owner.container.lookup( SingletonOwner.class );

assertThat( single.singleton(), notNullValue() );
}

@Test
public void singletonLiteralRequirement()
throws Throwable
{
ContainerOwner owner = new ContainerOwner();
new TestApplication().load();
final SingletonLiteralOwner single = owner.container.lookup( SingletonLiteralOwner.class );

assertThat( single.singletonLiteral(), notNullValue() );
}

//
// @Test
// public void initializableUsingRequirement()
Expand Down

0 comments on commit 8368f10

Please sign in to comment.