Permalink
Browse files

ARQ-893 substituted instanceof with archive extension name check; add…

…ed missing license comment.
  • Loading branch information...
1 parent 08eed42 commit 80aa8eb0f9b277ea37e4e46c0d06f82bbfe8a82a @blabno blabno committed May 8, 2012
@@ -17,6 +17,11 @@
*/
package org.jboss.arquillian.extension.jrebel;
+import java.io.File;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
import org.jboss.arquillian.container.spi.client.deployment.Deployment;
import org.jboss.arquillian.container.spi.client.deployment.DeploymentDescription;
import org.jboss.arquillian.container.spi.client.protocol.metadata.HTTPContext;
@@ -38,12 +43,6 @@
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.exporter.ExplodedExporter;
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-
-import java.io.File;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
/**
* DeploymentInterceptor
@@ -128,7 +127,7 @@ public void onUnDeploy(@Observes EventContext<UnDeployDeployment> eventContext)
private void addRebelXmlIfNeeded(Archive<?> archive, String rootPath)
{
final String path = rootPath + "/" + archive.getName();
- if (archive instanceof WebArchive) {
+ if (archive.getName().endsWith(".war")) {
final String archivePath = "WEB-INF/classes/rebel.xml";
if (archive.get(archivePath) == null) {
archive.add(new StringAsset(createRebelXML(path, true)), archivePath);
@@ -181,9 +180,9 @@ private void processArchiveAndProceedWithDeployment(EventContext<DeployDeploymen
}
}
}
- if (testableArchive instanceof WebArchive) {
+ if (testableArchive.getName().endsWith(".war")) {
addRebelXmlIfNeeded(testableArchive, explodedDeploymentDirectory.getAbsolutePath());
- } else if (testableArchive instanceof EnterpriseArchive) {
+ } else if (testableArchive.getName().endsWith(".ear")) {
final EnterpriseArchive enterpriseArchive = (EnterpriseArchive) testableArchive;
final Set<Node> rootChildren = enterpriseArchive.get("/").getChildren();
for (Node node : rootChildren) {
@@ -1,11 +1,28 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
+ * as indicated by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.jboss.arquillian.extension.jrebel;
-import org.jboss.arquillian.container.spi.client.protocol.metadata.HTTPContext;
-
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
+import org.jboss.arquillian.container.spi.client.protocol.metadata.HTTPContext;
+
public class SerializableHttpContextData implements Serializable {
// ------------------------------ FIELDS ------------------------------

0 comments on commit 80aa8eb

Please sign in to comment.