Skip to content

Commit

Permalink
FORGE-1206: Added test to reproduce the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Sep 16, 2013
1 parent b777956 commit 00916ee
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Copyright 2013 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/

package test.org.jboss.forge.furnace.mocks;

/**
*
* @author <a href="ggastald@redhat.com">George Gastaldi</a>
*/
public class PlainBean implements PlainInterface
{

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Copyright 2013 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/

package test.org.jboss.forge.furnace.mocks;

/**
*
* @author <a href="ggastald@redhat.com">George Gastaldi</a>
*/
public interface PlainInterface
{

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/**
* Copyright 2013 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/

package test.org.jboss.forge.furnace.addons;

import javax.inject.Inject;

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.forge.arquillian.AddonDependency;
import org.jboss.forge.arquillian.Dependencies;
import org.jboss.forge.arquillian.archive.ForgeArchive;
import org.jboss.forge.furnace.addons.AddonRegistry;
import org.jboss.forge.furnace.repositories.AddonDependencyEntry;
import org.jboss.forge.furnace.services.Imported;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

import test.org.jboss.forge.furnace.mocks.PlainBean;
import test.org.jboss.forge.furnace.mocks.PlainInterface;

/**
*
* @author <a href="ggastald@redhat.com">George Gastaldi</a>
*/
@RunWith(Arquillian.class)
@Ignore("FORGE-1206")
public class AddonRegistryTest
{
@Deployment
@Dependencies({
@AddonDependency(name = "org.jboss.forge.furnace.container:cdi")
})
public static ForgeArchive getDeployment()
{
ForgeArchive archive = ShrinkWrap.create(ForgeArchive.class)
.addClasses(PlainInterface.class, PlainBean.class)
.addAsAddonDependencies(
AddonDependencyEntry.create("org.jboss.forge.furnace.container:cdi")
)
.addBeansXML();

return archive;
}

@Inject
private AddonRegistry addonRegistry;

@Test
public void testImported() throws Exception
{
Imported<PlainInterface> services = addonRegistry.getServices(PlainInterface.class);
Assert.assertFalse(services.iterator().hasNext());
Assert.assertNull(services.get());
}

}

0 comments on commit 00916ee

Please sign in to comment.