Skip to content

Commit

Permalink
Fixed UIInput and Converter producer type discovery, moved resource t…
Browse files Browse the repository at this point in the history
…ests to proper module
  • Loading branch information
lincolnthree committed Jan 25, 2013
1 parent aeea68b commit 1aeda24
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ConverterProducer
@SuppressWarnings("unchecked")
public <S, T> Converter<S, T> produceConverter(InjectionPoint injectionPoint, ConverterFactory registry)
{
Type type = injectionPoint.getAnnotated().getTypeClosure().iterator().next();
Type type = injectionPoint.getAnnotated().getBaseType();
if (type instanceof ParameterizedType)
{
Type[] typeArguments = ((ParameterizedType) type).getActualTypeArguments();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jboss.forge.test.resource;
package test.org.jboss.forge.resource;

import java.io.File;
import java.util.UUID;
Expand Down Expand Up @@ -31,15 +31,17 @@
public class FileResourceGeneratorTest
{
@Deployment
@Dependencies(@Addon(name = "org.jboss.forge:facets", version = "2.0.0-SNAPSHOT"))
@Dependencies({
@Addon(name = "org.jboss.forge:facets", version = "2.0.0-SNAPSHOT"),
@Addon(name = "org.jboss.forge:resources", version = "2.0.0-SNAPSHOT") })
public static ForgeArchive getDeployment()
{
ForgeArchive archive = ShrinkWrap
.create(ForgeArchive.class)
.addPackages(true, ResourceFactory.class.getPackage())
ForgeArchive archive = ShrinkWrap.create(ForgeArchive.class)
.addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"))
.addAsAddonDependencies(
AddonDependency.create(AddonId.from("org.jboss.forge:facets", "2.0.0-SNAPSHOT")));
AddonDependency.create(AddonId.from("org.jboss.forge:facets", "2.0.0-SNAPSHOT")),
AddonDependency.create(AddonId.from("org.jboss.forge:resources", "2.0.0-SNAPSHOT"))
);

return archive;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jboss.forge.test.resource;
package test.org.jboss.forge.resource;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jboss.forge.test.resource;
package test.org.jboss.forge.resource;

import org.jboss.forge.container.services.Exported;
import org.jboss.forge.resource.Resource;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jboss.forge.test.resource;
package test.org.jboss.forge.resource;

import javax.inject.Inject;

Expand All @@ -24,26 +24,15 @@
public class ResourceGeneratorAddonTest
{
@Deployment(order = 1)
@Dependencies({ @Addon(name = "org.jboss.forge:resources", version = "2.0.0-SNAPSHOT") })
public static ForgeArchive getDeployment()
{
ForgeArchive archive = ShrinkWrap.create(ForgeArchive.class)
.addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"))
.addAsAddonDependencies(
AddonDependency.create(AddonId.from("resources", "1"), false, false),
AddonDependency.create(AddonId.from("mockstring", "1"), false, false));

return archive;
}

@Deployment(testable = false, name = "resources,1", order = 2)
@Dependencies(@Addon(name = "org.jboss.forge:facets", version = "2.0.0-SNAPSHOT"))
public static ForgeArchive getResourcesDeployment()
{
ForgeArchive archive = ShrinkWrap.create(ForgeArchive.class)
.addPackages(true, ResourceFactory.class.getPackage())
ForgeArchive archive = ShrinkWrap
.create(ForgeArchive.class)
.addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"))
.addAsAddonDependencies(
AddonDependency.create(AddonId.from("org.jboss.forge:facets", "2.0.0-SNAPSHOT"), true, false));
AddonDependency.create(AddonId.from("org.jboss.forge:resources", "2.0.0-SNAPSHOT")),
AddonDependency.create(AddonId.from("mockstring", "1")));

return archive;
}
Expand All @@ -55,7 +44,8 @@ public static ForgeArchive getAddonDeployment()
.addClasses(MockStringResource.class, MockStringResourceGenerator.class)
.addAsManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"))
.addAsAddonDependencies(
AddonDependency.create(AddonId.from("resources", "1"), false, false));
AddonDependency.create(AddonId.from("org.jboss.forge:resources", "2.0.0-SNAPSHOT"))
);

return archive;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class UIInputProducer
public <T> UIInput<T> produceInput(InjectionPoint injectionPoint)
{
String name = injectionPoint.getMember().getName();
Type type = injectionPoint.getAnnotated().getTypeClosure().iterator().next();
Type type = injectionPoint.getAnnotated().getBaseType();
if (type instanceof ParameterizedType)
{
Type[] typeArguments = ((ParameterizedType) type).getActualTypeArguments();
Expand Down

0 comments on commit 1aeda24

Please sign in to comment.