-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FORGE-2488: Created JMSFacet_2_0 and fixed JTAFacetImpl_2_0 prerequis…
…ites
- Loading branch information
Showing
11 changed files
with
178 additions
and
9 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
17 changes: 17 additions & 0 deletions
17
javaee/api/src/main/java/org/jboss/forge/addon/javaee/jms/JMSFacet.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,17 @@ | ||
/* | ||
* Copyright 2012 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 org.jboss.forge.addon.javaee.jms; | ||
|
||
/** | ||
* Installs the required JMS libraries | ||
* | ||
* @author <a href="mailto:ggastald@redhat.com">George Gastaldi</a> | ||
* | ||
*/ | ||
public interface JMSFacet extends org.jboss.forge.addon.javaee.facets.JMSFacet | ||
{ | ||
} |
17 changes: 17 additions & 0 deletions
17
javaee/api/src/main/java/org/jboss/forge/addon/javaee/jms/JMSFacet_1_1.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,17 @@ | ||
/* | ||
* Copyright 2012 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 org.jboss.forge.addon.javaee.jms; | ||
|
||
/** | ||
* Installs the required JMS libraries | ||
* | ||
* @author <a href="mailto:ggastald@redhat.com">George Gastaldi</a> | ||
* | ||
*/ | ||
public interface JMSFacet_1_1 extends org.jboss.forge.addon.javaee.jms.JMSFacet | ||
{ | ||
} |
17 changes: 17 additions & 0 deletions
17
javaee/api/src/main/java/org/jboss/forge/addon/javaee/jms/JMSFacet_2_0.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,17 @@ | ||
/* | ||
* Copyright 2012 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 org.jboss.forge.addon.javaee.jms; | ||
|
||
/** | ||
* Installs the required JMS libraries | ||
* | ||
* @author <a href="mailto:ggastald@redhat.com">George Gastaldi</a> | ||
* | ||
*/ | ||
public interface JMSFacet_2_0 extends org.jboss.forge.addon.javaee.jms.JMSFacet | ||
{ | ||
} |
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
59 changes: 59 additions & 0 deletions
59
javaee/impl/src/main/java/org/jboss/forge/addon/javaee/jms/JMSFacetImpl_2_0.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,59 @@ | ||
/* | ||
* Copyright 2012 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 org.jboss.forge.addon.javaee.jms; | ||
|
||
import java.util.Arrays; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.jboss.forge.addon.dependencies.Dependency; | ||
import org.jboss.forge.addon.dependencies.builder.DependencyBuilder; | ||
import org.jboss.forge.addon.javaee.AbstractJavaEEFacet; | ||
import org.jboss.forge.addon.projects.dependencies.DependencyInstaller; | ||
import org.jboss.forge.furnace.versions.SingleVersion; | ||
import org.jboss.forge.furnace.versions.Version; | ||
|
||
/** | ||
* Implementation of {@link JMSFacet_2_0} | ||
* | ||
* @author <a href="mailto:ggastald@redhat.com">George Gastaldi</a> | ||
* | ||
*/ | ||
public class JMSFacetImpl_2_0 extends AbstractJavaEEFacet implements JMSFacet_2_0 | ||
{ | ||
private static final Dependency JMS_API = DependencyBuilder | ||
.create("javax.jms:javax.jms-api:2.0.1"); | ||
|
||
@Inject | ||
public JMSFacetImpl_2_0(DependencyInstaller installer) | ||
{ | ||
super(installer); | ||
} | ||
|
||
@Override | ||
public String getSpecName() | ||
{ | ||
return "JMS"; | ||
} | ||
|
||
@Override | ||
public Version getSpecVersion() | ||
{ | ||
return SingleVersion.valueOf("2.0"); | ||
} | ||
|
||
@Override | ||
protected Map<Dependency, List<Dependency>> getRequiredDependencyOptions() | ||
{ | ||
Map<Dependency, List<Dependency>> result = new HashMap<>(); | ||
result.put(JMS_API, Arrays.asList(JMS_API, JAVAEE7)); | ||
return result; | ||
} | ||
} |
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
58 changes: 58 additions & 0 deletions
58
javaee/tests/src/test/java/org/jboss/forge/addon/javaee/jms/JMSFacetTest.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,58 @@ | ||
/** | ||
* 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 org.jboss.forge.addon.javaee.jms; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.jboss.arquillian.container.test.api.Deployment; | ||
import org.jboss.arquillian.junit.Arquillian; | ||
import org.jboss.forge.addon.facets.FacetFactory; | ||
import org.jboss.forge.addon.facets.FacetIsAmbiguousException; | ||
import org.jboss.forge.addon.projects.Project; | ||
import org.jboss.forge.addon.projects.ProjectFactory; | ||
import org.jboss.forge.arquillian.AddonDependencies; | ||
import org.jboss.forge.arquillian.AddonDependency; | ||
import org.jboss.forge.arquillian.archive.AddonArchive; | ||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
/** | ||
* | ||
* @author <a href="ggastald@redhat.com">George Gastaldi</a> | ||
*/ | ||
@RunWith(Arquillian.class) | ||
public class JMSFacetTest | ||
{ | ||
@Deployment | ||
@AddonDependencies({ | ||
@AddonDependency(name = "org.jboss.forge.addon:javaee"), | ||
@AddonDependency(name = "org.jboss.forge.addon:maven"), | ||
@AddonDependency(name = "org.jboss.forge.furnace.container:cdi") | ||
}) | ||
public static AddonArchive getDeployment() | ||
{ | ||
return ShrinkWrap.create(AddonArchive.class).addBeansXML(); | ||
} | ||
|
||
@Inject | ||
private ProjectFactory projectFactory; | ||
|
||
@Inject | ||
private FacetFactory facetFactory; | ||
|
||
@Test(expected = FacetIsAmbiguousException.class) | ||
public void testCannotInstallAmbiguousFacetType() throws Exception | ||
{ | ||
Project project = projectFactory.createTempProject(); | ||
Assert.assertNotNull(project); | ||
facetFactory.install(project, JMSFacet.class); | ||
} | ||
|
||
} |