Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ARQ-365 Fixed ProfileKey

* JBoss AS Remote 5 was correctly handling profiles
  • Loading branch information...
commit a77b3b05f449921673ca60e130a10dfad8023de1 1 parent d6d5e5a
@kpiwko authored
View
6 ...embedded-6/src/main/java/org/jboss/arquillian/container/jbossas/embedded_6/JBossASEmbeddedContainer.java
@@ -47,6 +47,9 @@
*/
public class JBossASEmbeddedContainer implements DeployableContainer<JBossASContainerConfiguration>
{
+ // ProfileKey name which supports hot deployment
+ private static final String DEFAULT_PROFILE_KEY_NAME = "jboss:profile=applications";
+
private JBossASEmbeddedServer server;
private ProfileService profileService;
private DeploymentManager deploymentManager;
@@ -173,13 +176,12 @@ public void undeploy(final Archive<?> archive) throws DeploymentException
private void initDeploymentManager() throws Exception
{
- String profileName = configuration.getProfileName();
Context ctx = createContext();
profileService = (ProfileService) ctx.lookup("ProfileService");
deploymentManager = profileService.getDeploymentManager();
- ProfileKey defaultKey = new ProfileKey(profileName);
+ ProfileKey defaultKey = new ProfileKey(DEFAULT_PROFILE_KEY_NAME);
deploymentManager.loadProfile(defaultKey);
}
View
11 jbossas-embedded-6/src/test/resources/arquillian.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://jboss.org/schema/arquillian"
+ xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
+
+ <container qualifier="jboss" default="true">
+ <configuration>
+ <property name="profileName">all</property>
+ </configuration>
+ </container>
+</arquillian>
View
7 ...-managed-5.1/src/main/java/org/jboss/arquillian/container/jbossas/managed_5_1/JBossASLocalContainer.java
@@ -52,6 +52,9 @@
public class JBossASLocalContainer implements DeployableContainer<JBossASConfiguration>
{
private static Logger log = Logger.getLogger(JBossASLocalContainer.class.getName());
+
+ // ProfileKey name which supports hot deployment
+ private static final String DEFAULT_PROFILE_KEY_NAME = "applications";
private JBossASConfiguration configuration;
@@ -253,13 +256,13 @@ private void removeFailedUnDeployments() throws IOException
private void initProfileService(Server server) throws Exception
{
- String profileName = configuration.getProfileName();
Context ctx = server.getNamingContext();
profileService = (ProfileService) ctx.lookup("ProfileService");
deploymentManager = profileService.getDeploymentManager();
- ProfileKey defaultKey = new ProfileKey(profileName);
+ ProfileKey defaultKey = new ProfileKey(DEFAULT_PROFILE_KEY_NAME);
+
deploymentManager.loadProfile(defaultKey);
}
View
1  jbossas-managed-5.1/src/test/resources/arquillian.xml
@@ -9,6 +9,7 @@
<!-- <property name="javaHome">/usr/lib/jvm/java-6-openjdk/</property> -->
<property name="bindAddress">127.0.0.1</property>
<property name="httpPort">8080</property>
+ <property name="profileName">all</property>
</configuration>
</container>
</arquillian>
View
6 jbossas-managed-6/src/main/java/org/jboss/arquillian/container/jbossas/managed_6/JBossASLocalContainer.java
@@ -53,6 +53,9 @@
{
private static Logger log = Logger.getLogger(JBossASLocalContainer.class.getName());
+ // ProfileKey name which supports hot deployment
+ private static final String DEFAULT_PROFILE_KEY_NAME = "jboss:profile=applications";
+
private JBossASConfiguration configuration;
protected ServerManager manager;
@@ -255,13 +258,12 @@ private void removeFailedUnDeployments() throws IOException
private void initProfileService(Server server) throws Exception
{
- String profileName = configuration.getProfileName();
Context ctx = server.getNamingContext();
profileService = (ProfileService) ctx.lookup("ProfileService");
deploymentManager = profileService.getDeploymentManager();
- ProfileKey defaultKey = new ProfileKey(profileName);
+ ProfileKey defaultKey = new ProfileKey(DEFAULT_PROFILE_KEY_NAME);
deploymentManager.loadProfile(defaultKey);
}
View
1  jbossas-managed-6/src/test/resources/arquillian.xml
@@ -13,6 +13,7 @@
<!-- <property name="javaHome">/usr/lib/jvm/java-6-openjdk/</property> -->
<property name="bindAddress">127.0.0.1</property>
<property name="httpPort">8080</property>
+ <property name="profileName">all</property>
</configuration>
</container>
</arquillian>
View
15 ...sas-remote-5.1/src/main/java/org/jboss/arquillian/container/jbossas/remote_5_1/JBossASConfiguration.java
@@ -29,11 +29,6 @@
*/
public class JBossASConfiguration implements ContainerConfiguration
{
- /**
- * ProfileService profileKey. Used to load the correct profile into the DeploymentManager.
- */
- private String profileName = "default";
-
private String contextFactory = "org.jnp.interfaces.NamingContextFactory";
private String urlPkgPrefix = "org.jboss.naming:org.jnp.interfaces";
@@ -48,16 +43,6 @@ public void validate() throws ConfigurationException
{
}
- public String getProfileName()
- {
- return profileName;
- }
-
- public void setProfileName(String profileName)
- {
- this.profileName = profileName;
- }
-
/**
* @param contextFactory the contextFactory to set
*/
View
7 ...s-remote-5.1/src/main/java/org/jboss/arquillian/container/jbossas/remote_5_1/JBossASRemoteContainer.java
@@ -46,6 +46,9 @@
*/
public class JBossASRemoteContainer implements DeployableContainer<JBossASConfiguration>
{
+ // ProfileKey name which supports hot deployment
+ private static final String DEFAULT_PROFILE_KEY_NAME = "applications";
+
private final List<String> failedUndeployments = new ArrayList<String>();
private ProfileService profileService;
private DeploymentManager deploymentManager;
@@ -192,11 +195,11 @@ private void undeploy(String name) throws DeploymentException
private void initDeploymentManager() throws Exception
{
- String profileName = configuration.getProfileName();
InitialContext ctx = createContext();
profileService = (ProfileService) ctx.lookup("ProfileService");
deploymentManager = profileService.getDeploymentManager();
- ProfileKey defaultKey = new ProfileKey(profileName);
+
+ ProfileKey defaultKey = new ProfileKey(DEFAULT_PROFILE_KEY_NAME);
deploymentManager.loadProfile(defaultKey);
VFS.init();
}
View
15 jbossas-remote-6/src/main/java/org/jboss/arquillian/container/jbossas/remote_6/JBossASConfiguration.java
@@ -29,11 +29,6 @@
*/
public class JBossASConfiguration implements ContainerConfiguration
{
- /**
- * ProfileService profileKey. Used to load the correct profile into the DeploymentManager.
- */
- private String profileName = "default";
-
private String contextFactory = "org.jnp.interfaces.NamingContextFactory";
private String urlPkgPrefix = "org.jboss.naming:org.jnp.interfaces";
@@ -47,16 +42,6 @@ public void validate() throws ConfigurationException
{
}
- public String getProfileName()
- {
- return profileName;
- }
-
- public void setProfileName(String profileName)
- {
- this.profileName = profileName;
- }
-
/**
* @param contextFactory the contextFactory to set
*/
View
6 jbossas-remote-6/src/main/java/org/jboss/arquillian/container/jbossas/remote_6/JBossASRemoteContainer.java
@@ -46,6 +46,9 @@
*/
public class JBossASRemoteContainer implements DeployableContainer<JBossASConfiguration>
{
+ // ProfileKey name which supports hot deployment
+ private static final String DEFAULT_PROFILE_KEY_NAME = "jboss:profile=applications";
+
private final List<String> failedUndeployments = new ArrayList<String>();
private ProfileService profileService;
private DeploymentManager deploymentManager;
@@ -192,13 +195,12 @@ private void undeploy(String name) throws DeploymentException
private void initDeploymentManager() throws Exception
{
- String profileName = configuration.getProfileName();
Context ctx = createContext();
profileService = (ProfileService) ctx.lookup("ProfileService");
deploymentManager = profileService.getDeploymentManager();
- ProfileKey defaultKey = new ProfileKey(profileName);
+ ProfileKey defaultKey = new ProfileKey(DEFAULT_PROFILE_KEY_NAME);
deploymentManager.loadProfile(defaultKey);
}

2 comments on commit a77b3b0

@kpiwko
Owner

Yep, the idea was that 5.0 handles it correctly.

Please sign in to comment.
Something went wrong with that request. Please try again.