JBoss Tools SVN: r30775 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-04-22 13:46:27 -0400 (Fri, 22 Apr 2011)
New Revision: 30775
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java
Log:
JBIDE-8776
https://issues.jboss.org/browse/JBIDE-8776
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java 2011-04-22 17:40:06 UTC (rev 30774)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java 2011-04-22 17:46:27 UTC (rev 30775)
@@ -15,6 +15,8 @@
import java.util.HashSet;
import org.eclipse.core.internal.events.InternalBuilder;
+import org.eclipse.core.internal.resources.BuildConfiguration;
+import org.eclipse.core.resources.IBuildConfiguration;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -124,9 +126,9 @@
static void setProjectToBuilder(KbBuilder builder, IProject project) {
try {
- Method m = InternalBuilder.class.getDeclaredMethod("setProject", new Class[]{IProject.class});
+ Method m = InternalBuilder.class.getDeclaredMethod("setBuildConfig", new Class[]{IBuildConfiguration.class});
m.setAccessible(true);
- m.invoke(builder, project);
+ m.invoke(builder, new BuildConfiguration(project));
} catch (Exception e) {
WebModelPlugin.getPluginLog().logError(e);
}
14 years, 11 months
JBoss Tools SVN: r30774 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-04-22 13:40:06 -0400 (Fri, 22 Apr 2011)
New Revision: 30774
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java
Log:
JBIDE-8722
https://issues.jboss.org/browse/JBIDE-8722
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java 2011-04-22 13:56:22 UTC (rev 30773)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java 2011-04-22 17:40:06 UTC (rev 30774)
@@ -37,13 +37,7 @@
public void add(IPath path, IType type) throws CoreException {
if(type == null) return;
allpaths.add(path);
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=342757
- try {
- type.isAnnotation();
- } catch (ArrayIndexOutOfBoundsException e) {
- CDICorePlugin.getDefault().logError("JDT failed to load " + type.getFullyQualifiedName() + " from " + path + "\nSee https://bugs.eclipse.org/bugs/show_bug.cgi?id=342757");
- return;
- }
+ if(!checkType(type, path)) return;
if(type.isAnnotation()) {
add(annotations, path, type);
} else if(type.isInterface()) {
@@ -52,6 +46,7 @@
add(classes, path, type);
IType[] ts = type.getTypes();
for (IType t: ts) {
+ if(!checkType(t, path)) continue;
if(Flags.isStatic(t.getFlags())) {
add(path, t);
}
@@ -59,6 +54,29 @@
}
}
+ private static Set<IPath> failedPaths = new HashSet<IPath>();
+
+ /**
+ * Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=342757
+ * This method and field failedPaths should be removed as soon as the
+ * issue is fixed.
+ * @param type
+ * @param path
+ * @return
+ * @throws CoreException
+ */
+ private boolean checkType(IType type, IPath path) throws CoreException {
+ try {
+ type.isAnnotation();
+ } catch (ArrayIndexOutOfBoundsException e) {
+ if(failedPaths.contains(path)) return false; // Do not let's be too noisy.
+ failedPaths.add(path);
+ CDICorePlugin.getDefault().logError("JDT failed to load " + type.getFullyQualifiedName() + " from " + path + "\nSee https://bugs.eclipse.org/bugs/show_bug.cgi?id=342757");
+ return false;
+ }
+ return true;
+ }
+
private void add(Map<IPath, Set<IType>> target, IPath path, IType type) {
Set<IType> ts = target.get(path);
if(ts == null) {
14 years, 11 months
Newsletter Fri, 22 Apr 2011 19:34:22 +0400
by Chelsa
How are you bud!
Do you want a pleasant future, increase in money, and brownie points?
Today only:
We can assist with Diplomas from prestigious universities based on your present knowledge and professional experience.
Get a Degree in 4 weeks with our program!
~Our program will let ALL with professional experience
get a 100% verified Degree:
~Doctorate
~Bachelors
~Masters
- Just think about it...
- Follow YOUR Dreams!
- Live a wonderful life by earning or upgrading your degree.
This is a good chance to make a right move and receive your due
benefits... if you are qualified but are lacking that piece of paper. Get one from us in a short time.
If you want to get better - you must Call us NOW to start improving your life!
~CALL US~
1-310-205-2502
Please leave us a message with your phone number with country code if outside USA and name and we'll call you back asap.
It's your move...
Make the right move.
Best wishes.
Do Not Reply to this Email.
We do not reply to text inquiries, and our server will reject all response traffic.
We apologize for any inconvenience this may have caused you.
14 years, 11 months
JBoss Tools SVN: r30773 - in trunk/as: org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-04-22 09:56:22 -0400 (Fri, 22 Apr 2011)
New Revision: 30773
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7DeploymentResult.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7DeploymentState.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangementException.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DeployerException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DeploymentState.java
Modified:
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/META-INF/MANIFEST.MF
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/DetypedDeployerIntegrationTest.java
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementIntegrationTest.java
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementTestUtils.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7DeploymentManager.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7Manager.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7ManagerUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/Deployable.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DeploymentOperationResult.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DetypedDeployer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBossDeploymentManager.java
Log:
[JBIDE-8769] exposed state checking in interface
Modified: trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/META-INF/MANIFEST.MF 2011-04-22 13:03:21 UTC (rev 30772)
+++ trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/META-INF/MANIFEST.MF 2011-04-22 13:56:22 UTC (rev 30773)
@@ -4,9 +4,10 @@
Bundle-SymbolicName: org.jboss.ide.eclipse.as.management.as7.tests
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Require-Bundle: org.jboss.ide.eclipse.as.management.as7;bundle-version="1.0.0",
+Require-Bundle: org.jboss.ide.eclipse.as.management.as7;bundle-version="[1.0.0,2.0.0)",
+ org.jboss.ide.eclipse.as.core;bundle-version="[2.2.0,3.0.0)",
org.junit;bundle-version="[4.8.1,5.0.0)",
- org.eclipse.core.runtime;bundle-version="3.7.0",
- org.hamcrest;bundle-version="1.1.0"
+ org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
+ org.hamcrest;bundle-version="[1.1.0,2.0.0)"
Bundle-ClassPath: .,
wars/
Modified: trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/DetypedDeployerIntegrationTest.java
===================================================================
--- trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/DetypedDeployerIntegrationTest.java 2011-04-22 13:03:21 UTC (rev 30772)
+++ trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/DetypedDeployerIntegrationTest.java 2011-04-22 13:56:22 UTC (rev 30773)
@@ -29,7 +29,7 @@
import java.io.File;
import java.util.List;
-import org.jboss.ide.eclipse.as.management.as7.deployment.DeployerException;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
import org.jboss.ide.eclipse.as.management.as7.deployment.DetypedDeployer;
import org.junit.Test;
@@ -52,7 +52,7 @@
}
}
- @Test(expected = DeployerException.class)
+ @Test(expected = JBoss7ManangementException.class)
public void cannotDeployWarTwice() throws Exception {
File warFile = JBossManagementTestUtils.getWarFile(JBossManagementTestUtils.MINIMALISTIC_WAR);
try {
@@ -79,8 +79,8 @@
}
}
- @Test(expected = DeployerException.class)
- public void cannotUndeployNondeployed() throws DeployerException {
+ @Test(expected = JBoss7ManangementException.class)
+ public void cannotUndeployNondeployed() throws JBoss7ManangementException {
DetypedDeployer.undeploy("inexistant", JBossManagementTestUtils.HOST, JBossManagementTestUtils.MGMT_PORT);
}
Modified: trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementIntegrationTest.java
===================================================================
--- trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementIntegrationTest.java 2011-04-22 13:03:21 UTC (rev 30772)
+++ trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementIntegrationTest.java 2011-04-22 13:56:22 UTC (rev 30773)
@@ -32,8 +32,8 @@
import java.net.UnknownHostException;
import java.util.concurrent.ExecutionException;
-import org.jboss.ide.eclipse.as.management.as7.deployment.DeployerException;
-import org.jboss.ide.eclipse.as.management.as7.deployment.DeploymentState;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7DeploymentState;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
import org.jboss.ide.eclipse.as.management.as7.deployment.AS7Manager;
import org.junit.After;
import org.junit.Before;
@@ -92,7 +92,7 @@
}
@Ignore
- @Test(expected = DeployerException.class)
+ @Test(expected = JBoss7ManangementException.class)
public void cannotDeployWarTwice() throws Exception {
File warFile = JBossManagementTestUtils.getWarFile(JBossManagementTestUtils.MINIMALISTIC_WAR);
try {
@@ -104,8 +104,8 @@
}
@Ignore
- @Test(expected = DeployerException.class)
- public void cannotUndeployNondeployed() throws DeployerException, InterruptedException, ExecutionException {
+ @Test(expected = JBoss7ManangementException.class)
+ public void cannotUndeployNondeployed() throws JBoss7ManangementException, InterruptedException, ExecutionException {
JBossManagementTestUtils.waitUntilFinished(manager.undeploy("inexistant"));
}
@@ -128,35 +128,35 @@
}
@Test
- public void getEnabledStateIfDeploymentIsDeployed() throws URISyntaxException, IOException, DeployerException {
+ public void getEnabledStateIfDeploymentIsDeployed() throws URISyntaxException, IOException, JBoss7ManangementException {
String deploymentName = "testDeployment";
File warFile = JBossManagementTestUtils.getWarFile(JBossManagementTestUtils.MINIMALISTIC_WAR);
try {
JBossManagementTestUtils.waitUntilFinished(manager.deploy(deploymentName, warFile));
- DeploymentState state = manager.getDeploymentState(deploymentName);
+ JBoss7DeploymentState state = manager.getDeploymentState(deploymentName);
assertNotNull(state);
- assertThat(state, equalTo(DeploymentState.STARTED));
+ assertThat(state, equalTo(JBoss7DeploymentState.STARTED));
} finally {
JBossManagementTestUtils.quietlyUndeploy(deploymentName, manager);
}
}
@Test
- public void getDisabledStateIfDeploymentIsOnlyAdded() throws URISyntaxException, IOException, DeployerException {
+ public void getDisabledStateIfDeploymentIsOnlyAdded() throws URISyntaxException, IOException, JBoss7ManangementException {
String deploymentName = "testDeployment";
File warFile = JBossManagementTestUtils.getWarFile(JBossManagementTestUtils.MINIMALISTIC_WAR);
try {
JBossManagementTestUtils.waitUntilFinished(manager.add(deploymentName, warFile));
- DeploymentState state = manager.getDeploymentState(deploymentName);
+ JBoss7DeploymentState state = manager.getDeploymentState(deploymentName);
assertNotNull(state);
- assertThat(state, equalTo(DeploymentState.STOPPED));
+ assertThat(state, equalTo(JBoss7DeploymentState.STOPPED));
} finally {
JBossManagementTestUtils.quietlyRemove(deploymentName, manager);
}
}
- @Test(expected = DeployerException.class)
- public void getErrorIfDeploymentIsNotDeployed() throws URISyntaxException, IOException, DeployerException {
+ @Test(expected = JBoss7ManangementException.class)
+ public void getErrorIfDeploymentIsNotDeployed() throws URISyntaxException, IOException, JBoss7ManangementException {
String deploymentName = "testDeployment";
try {
manager.getDeploymentState(deploymentName);
Modified: trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementTestUtils.java
===================================================================
--- trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementTestUtils.java 2011-04-22 13:03:21 UTC (rev 30772)
+++ trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementTestUtils.java 2011-04-22 13:56:22 UTC (rev 30773)
@@ -33,8 +33,8 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
-import org.jboss.ide.eclipse.as.management.as7.deployment.DeployerException;
-import org.jboss.ide.eclipse.as.management.as7.deployment.DeploymentOperationResult;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentResult;
import org.jboss.ide.eclipse.as.management.as7.deployment.AS7Manager;
import org.osgi.framework.Bundle;
@@ -89,7 +89,7 @@
}
}
- public static void waitUntilFinished(DeploymentOperationResult result) throws DeployerException {
+ public static void waitUntilFinished(IJBoss7DeploymentResult result) throws JBoss7ManangementException {
result.getStatus(); // wait for operation to finish
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7DeploymentManager.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7DeploymentManager.java 2011-04-22 13:03:21 UTC (rev 30772)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7DeploymentManager.java 2011-04-22 13:56:22 UTC (rev 30773)
@@ -25,7 +25,7 @@
* @return Not sure what to return yet
* @throws Exception
*/
- public Object deployAsync(String host, int port,
+ public IJBoss7DeploymentResult deployAsync(String host, int port,
String deploymentName, File file, IProgressMonitor monitor) throws Exception;
/**
@@ -40,7 +40,7 @@
* @return Not sure what to return yet
* @throws Exception
*/
- public Object deploySync(String host, int port,
+ public IJBoss7DeploymentResult deploySync(String host, int port,
String deploymentName, File file, IProgressMonitor monitor) throws Exception;
@@ -56,7 +56,7 @@
* @return Not sure what to return yet
* @throws Exception
*/
- public Object undeployAsync(String host, int port,
+ public IJBoss7DeploymentResult undeployAsync(String host, int port,
String deploymentName, boolean removeFile, IProgressMonitor monitor) throws Exception;
@@ -72,7 +72,7 @@
* @return Not sure what to return yet
* @throws Exception
*/
- public Object syncUndeploy(String host, int port,
+ public IJBoss7DeploymentResult syncUndeploy(String host, int port,
String deploymentName, boolean removeFile, IProgressMonitor monitor) throws Exception;
/**
@@ -85,6 +85,6 @@
* @return the state of the deployment
* @throws Exception
*/
- public Object getDeploymentState(String host, int port, String deploymentName) throws Exception;
+ public JBoss7DeploymentState getDeploymentState(String host, int port, String deploymentName) throws Exception;
}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7DeploymentResult.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7DeploymentResult.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7DeploymentResult.java 2011-04-22 13:56:22 UTC (rev 30773)
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.core.server.internal.v7;
+
+import org.eclipse.core.runtime.IStatus;
+
+public interface IJBoss7DeploymentResult {
+
+ public abstract IStatus getStatus() throws JBoss7ManangementException;
+
+}
\ No newline at end of file
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7DeploymentResult.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7DeploymentState.java (from rev 30771, trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DeploymentState.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7DeploymentState.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7DeploymentState.java 2011-04-22 13:56:22 UTC (rev 30773)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.as.core.server.internal.v7;
+
+
+/**
+ * An enum that reflects the state of a deployment.
+ *
+ * @author André Dietisheim
+ */
+public enum JBoss7DeploymentState {
+ STARTED ,
+ STOPPED;
+}
\ No newline at end of file
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7DeploymentState.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangementException.java (from rev 30771, trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DeployerException.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangementException.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangementException.java 2011-04-22 13:56:22 UTC (rev 30773)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.ide.eclipse.as.core.server.internal.v7;
+
+/**
+ * @author André Dietisheim
+ */
+public class JBoss7ManangementException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ public JBoss7ManangementException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public JBoss7ManangementException(Throwable cause) {
+ super(cause);
+ }
+
+ public JBoss7ManangementException(String message) {
+ super(message);
+ }
+
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7Manager.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7Manager.java 2011-04-22 13:03:21 UTC (rev 30772)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7Manager.java 2011-04-22 13:56:22 UTC (rev 30773)
@@ -23,6 +23,7 @@
import static org.jboss.ide.eclipse.as.management.as7.deployment.ModelDescriptionConstants.ADDRESS;
import static org.jboss.ide.eclipse.as.management.as7.deployment.ModelDescriptionConstants.DEPLOYMENT;
+import static org.jboss.ide.eclipse.as.management.as7.deployment.ModelDescriptionConstants.ENABLED;
import static org.jboss.ide.eclipse.as.management.as7.deployment.ModelDescriptionConstants.FAILURE_DESCRIPTION;
import static org.jboss.ide.eclipse.as.management.as7.deployment.ModelDescriptionConstants.OP;
import static org.jboss.ide.eclipse.as.management.as7.deployment.ModelDescriptionConstants.READ_RESOURCE_OPERATION;
@@ -42,6 +43,9 @@
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentPlanResult;
import org.jboss.as.protocol.StreamUtils;
import org.jboss.dmr.ModelNode;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7DeploymentState;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentResult;
/**
* @author André Dietisheim
@@ -56,104 +60,115 @@
this.manager = ServerDeploymentManager.Factory.create(client);
}
- public DeploymentOperationResult undeploySync(String name, IProgressMonitor monitor) throws DeployerException {
- DeploymentOperationResult result = undeploy(name);
+ public IJBoss7DeploymentResult undeploySync(String name, IProgressMonitor monitor)
+ throws JBoss7ManangementException {
+ IJBoss7DeploymentResult result = undeploy(name);
result.getStatus();
return result;
}
- public DeploymentOperationResult deploySync(String name, File file, IProgressMonitor monitor)
- throws DeployerException {
- DeploymentOperationResult result = deploy(name, file);
+ public IJBoss7DeploymentResult deploySync(String name, File file, IProgressMonitor monitor)
+ throws JBoss7ManangementException {
+ IJBoss7DeploymentResult result = deploy(name, file);
result.getStatus();
return result;
}
- public DeploymentOperationResult undeploy(String name) throws DeployerException {
+ public IJBoss7DeploymentResult undeploy(String name) throws JBoss7ManangementException {
try {
DeploymentPlanBuilder builder = manager.newDeploymentPlan();
builder = builder.undeploy(name).andRemoveUndeployed();
return new DeploymentOperationResult(builder.getLastAction(), manager.execute(builder.build()));
} catch (Exception e) {
- throw new DeployerException(e);
+ throw new JBoss7ManangementException(e);
}
}
- public DeploymentOperationResult remove(String name) throws DeployerException {
+ public IJBoss7DeploymentResult remove(String name) throws JBoss7ManangementException {
try {
DeploymentPlanBuilder builder = manager.newDeploymentPlan();
builder = builder.remove(name);
return new DeploymentOperationResult(builder.getLastAction(), manager.execute(builder.build()));
} catch (Exception e) {
- throw new DeployerException(e);
+ throw new JBoss7ManangementException(e);
}
}
- public DeploymentOperationResult deploy(File file) throws DeployerException {
+ public IJBoss7DeploymentResult deploy(File file) throws JBoss7ManangementException {
return deploy(file.getName(), file);
}
- public DeploymentOperationResult add(String name, File file) throws DeployerException {
+ public IJBoss7DeploymentResult add(String name, File file) throws JBoss7ManangementException {
try {
return execute(manager.newDeploymentPlan().add(name, file));
} catch (IOException e) {
- throw new DeployerException(e);
+ throw new JBoss7ManangementException(e);
}
}
- public DeploymentOperationResult deploy(String name, File file) throws DeployerException {
+ public IJBoss7DeploymentResult deploy(String name, File file) throws JBoss7ManangementException {
try {
return execute(manager.newDeploymentPlan().add(name, file).andDeploy());
} catch (IOException e) {
- throw new DeployerException(e);
+ throw new JBoss7ManangementException(e);
}
}
- public DeploymentOperationResult replace(File file) throws DeployerException {
+ public IJBoss7DeploymentResult replace(File file) throws JBoss7ManangementException {
return replace(file.getName(), file);
}
- public DeploymentOperationResult replace(String name, File file) throws DeployerException {
+ public IJBoss7DeploymentResult replace(String name, File file) throws JBoss7ManangementException {
try {
return execute(manager.newDeploymentPlan().replace(name, file));
} catch (IOException e) {
- throw new DeployerException(e);
+ throw new JBoss7ManangementException(e);
}
}
- public DeploymentState getDeploymentState(String name) throws DeployerException {
+ public JBoss7DeploymentState getDeploymentState(String name) throws JBoss7ManangementException {
ModelNode request = new ModelNode();
request.get(OP).set(READ_RESOURCE_OPERATION);
request.get(ADDRESS).add(DEPLOYMENT, name);
ModelNode result = execute(request);
- return DeploymentState.getForResultNode(result);
+
+ Boolean enabled = AS7ManagerUtil.getBooleanProperty(ENABLED, result);
+ if (enabled == null) {
+ throw new JBoss7ManangementException(
+ MessageFormat.format("Could not evaluate state for deployment {0}", name));
+ } else if (enabled) {
+ return JBoss7DeploymentState.STARTED;
+ } else {
+ return JBoss7DeploymentState.STOPPED;
+ }
+
}
public void dispose() {
StreamUtils.safeClose(client);
}
- private ModelNode execute(ModelNode node) throws DeployerException {
+ private ModelNode execute(ModelNode node) throws JBoss7ManangementException {
try {
ModelNode response = client.execute(node);
if (!AS7ManagerUtil.isSuccess(response)) {
- throw new DeployerException(
+ throw new JBoss7ManangementException(
MessageFormat.format("Could not execute {0} for {1}. Failure was {2}.", node.get(OP),
node.get(ADDRESS), response.get(FAILURE_DESCRIPTION)));
}
return response.get(RESULT);
} catch (Exception e) {
- throw new DeployerException(e);
+ throw new JBoss7ManangementException(e);
}
}
- private DeploymentOperationResult execute(DeploymentPlanBuilder builder) throws DeployerException {
+ private IJBoss7DeploymentResult execute(DeploymentPlanBuilder builder) throws JBoss7ManangementException {
try {
DeploymentAction action = builder.getLastAction();
Future<ServerDeploymentPlanResult> planResult = manager.execute(builder.build());
return new DeploymentOperationResult(action, planResult);
} catch (Exception e) {
- throw new DeployerException(e);
+ throw new JBoss7ManangementException(e);
}
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7ManagerUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7ManagerUtil.java 2011-04-22 13:03:21 UTC (rev 30772)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7ManagerUtil.java 2011-04-22 13:56:22 UTC (rev 30773)
@@ -39,6 +39,7 @@
import org.jboss.dmr.ModelNode;
import org.jboss.dmr.ModelType;
import org.jboss.dmr.Property;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
import org.jboss.ide.eclipse.as.management.as7.internal.DefaultOperationRequestBuilder;
import org.jboss.ide.eclipse.as.management.as7.internal.OperationFormatException;
@@ -148,7 +149,7 @@
return Boolean.valueOf(value);
}
- public static ModelNode execute(Operation operation, ModelControllerClient client) throws DeployerException {
+ public static ModelNode execute(Operation operation, ModelControllerClient client) throws JBoss7ManangementException {
try {
ModelNode result = client.execute(operation);
if (result.hasDefined(OUTCOME)
@@ -156,13 +157,13 @@
return result.get(RESULT);
}
else if (result.hasDefined(FAILURE_DESCRIPTION)) {
- throw new DeployerException(result.get(FAILURE_DESCRIPTION).toString());
+ throw new JBoss7ManangementException(result.get(FAILURE_DESCRIPTION).toString());
}
else {
- throw new DeployerException("Operation outcome is " + result.get(OUTCOME).asString());
+ throw new JBoss7ManangementException("Operation outcome is " + result.get(OUTCOME).asString());
}
} catch (IOException e) {
- throw new DeployerException(e);
+ throw new JBoss7ManangementException(e);
}
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/Deployable.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/Deployable.java 2011-04-22 13:03:21 UTC (rev 30772)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/Deployable.java 2011-04-22 13:56:22 UTC (rev 30773)
@@ -10,6 +10,7 @@
import org.jboss.as.controller.client.helpers.standalone.DeploymentAction;
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentActionResult;
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentPlanResult;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
import org.jboss.ide.eclipse.as.management.as7.Activator;
public class Deployable {
@@ -42,7 +43,7 @@
return name;
}
- public IStatus getStatus() throws DeployerException {
+ public IStatus getStatus() throws JBoss7ManangementException {
if (resultFuture == null
|| action == null) {
return null;
@@ -52,7 +53,7 @@
ServerDeploymentActionResult actionResult = result.getDeploymentActionResult(action.getId());
return createStatus(action, actionResult);
} catch (Exception e) {
- throw new DeployerException(e);
+ throw new JBoss7ManangementException(e);
}
}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DeployerException.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DeployerException.java 2011-04-22 13:03:21 UTC (rev 30772)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DeployerException.java 2011-04-22 13:56:22 UTC (rev 30773)
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat Inc..
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat Incorporated - initial API and implementation
- *******************************************************************************/
-package org.jboss.ide.eclipse.as.management.as7.deployment;
-
-/**
- * @author André Dietisheim
- */
-public class DeployerException extends Exception {
-
- private static final long serialVersionUID = 1L;
-
- public DeployerException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public DeployerException(Throwable cause) {
- super(cause);
- }
-
- public DeployerException(String message) {
- super(message);
- }
-
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DeploymentOperationResult.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DeploymentOperationResult.java 2011-04-22 13:03:21 UTC (rev 30772)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DeploymentOperationResult.java 2011-04-22 13:56:22 UTC (rev 30773)
@@ -30,6 +30,8 @@
import org.jboss.as.controller.client.helpers.standalone.DeploymentAction;
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentActionResult;
import org.jboss.as.controller.client.helpers.standalone.ServerDeploymentPlanResult;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentResult;
import org.jboss.ide.eclipse.as.management.as7.Activator;
/**
@@ -38,7 +40,7 @@
* @author André Dietisheim
*
*/
-public class DeploymentOperationResult {
+public class DeploymentOperationResult implements IJBoss7DeploymentResult {
private Future<ServerDeploymentPlanResult> planResult;
private DeploymentAction action;
@@ -50,12 +52,16 @@
this.planResult = planResult;
}
- public IStatus getStatus() throws DeployerException {
+ /* (non-Javadoc)
+ * @see org.jboss.ide.eclipse.as.management.as7.deployment.IDeploymentResult#getStatus()
+ */
+ @Override
+ public IStatus getStatus() throws JBoss7ManangementException {
try {
ServerDeploymentActionResult actionResult = planResult.get().getDeploymentActionResult(action.getId());
return createStatus(action.getDeploymentUnitUniqueName(), action.getType().name(), actionResult);
} catch (Exception e) {
- throw new DeployerException(e);
+ throw new JBoss7ManangementException(e);
}
}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DeploymentState.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DeploymentState.java 2011-04-22 13:03:21 UTC (rev 30772)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DeploymentState.java 2011-04-22 13:56:22 UTC (rev 30773)
@@ -1,62 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.management.as7.deployment;
-
-import static org.jboss.ide.eclipse.as.management.as7.deployment.ModelDescriptionConstants.ENABLED;
-
-import org.jboss.dmr.ModelNode;
-
-/**
- * An enum that reflects the state of a deployment.
- *
- * @author André Dietisheim
- */
-public enum DeploymentState {
- STARTED {
- protected boolean matches(boolean enabled) {
- return enabled == true;
- }
- },
- STOPPED {
- protected boolean matches(boolean enabled) {
- return enabled == false;
- }
- };
-
- public static DeploymentState getForResultNode(ModelNode node) {
- Boolean enabled = AS7ManagerUtil.getBooleanProperty(ENABLED, node);
- if (enabled == null) {
- return null;
- }
-
- DeploymentState matchingState = null;
- for(DeploymentState state : values()) {
- if (state.matches(enabled)) {
- matchingState = state;
- }
- }
- return matchingState;
- }
-
- protected abstract boolean matches(boolean enabled);
-
-}
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DetypedDeployer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DetypedDeployer.java 2011-04-22 13:03:21 UTC (rev 30772)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DetypedDeployer.java 2011-04-22 13:56:22 UTC (rev 30773)
@@ -43,13 +43,14 @@
import org.jboss.as.controller.client.OperationBuilder;
import org.jboss.as.protocol.StreamUtils;
import org.jboss.dmr.ModelNode;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
/**
* @author André Dietisheim
*/
public class DetypedDeployer {
- public static void undeploy(String name, String host, int port) throws DeployerException {
+ public static void undeploy(String name, String host, int port) throws JBoss7ManangementException {
ModelControllerClient client = null;
try {
client = ModelControllerClient.Factory.create(host, port);
@@ -63,13 +64,13 @@
remove(name, host, port);
} catch (Exception e) {
- throw new DeployerException(e);
+ throw new JBoss7ManangementException(e);
} finally {
StreamUtils.safeClose(client);
}
}
- public static void remove(String name, String host, int port) throws DeployerException {
+ public static void remove(String name, String host, int port) throws JBoss7ManangementException {
ModelControllerClient client = null;
try {
client = ModelControllerClient.Factory.create(host, port);
@@ -80,17 +81,17 @@
request.get(ADDRESS).add(DEPLOYMENT, name);
client.execute(request);
} catch (Exception e) {
- throw new DeployerException(e);
+ throw new JBoss7ManangementException(e);
} finally {
StreamUtils.safeClose(client);
}
}
- public static void deploy(File file, String host, int port) throws DeployerException {
+ public static void deploy(File file, String host, int port) throws JBoss7ManangementException {
deploy(file.getName(), file, host, port);
}
- public static void deploy(String name, File file, String host, int port) throws DeployerException {
+ public static void deploy(String name, File file, String host, int port) throws JBoss7ManangementException {
ModelControllerClient client = null;
try {
client = ModelControllerClient.Factory.create(host, port);
@@ -110,13 +111,13 @@
throwOnFailure(result);
} catch (Exception e) {
- throw new DeployerException(e);
+ throw new JBoss7ManangementException(e);
} finally {
StreamUtils.safeClose(client);
}
}
- public static void replace(String name, File file, String host, int port) throws DeployerException {
+ public static void replace(String name, File file, String host, int port) throws JBoss7ManangementException {
ModelControllerClient client = null;
try {
client = ModelControllerClient.Factory.create(host, port);
@@ -134,7 +135,7 @@
throwOnFailure(result);
} catch (Exception e) {
- throw new DeployerException(e);
+ throw new JBoss7ManangementException(e);
} finally {
StreamUtils.safeClose(client);
}
@@ -154,9 +155,9 @@
return AS7ManagerUtil.getDeployments(client);
}
- private static void throwOnFailure(ModelNode result) throws DeployerException {
+ private static void throwOnFailure(ModelNode result) throws JBoss7ManangementException {
if (!AS7ManagerUtil.isSuccess(result)) {
- throw new DeployerException(AS7ManagerUtil.getFailureDescription(result));
+ throw new JBoss7ManangementException(AS7ManagerUtil.getFailureDescription(result));
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBossDeploymentManager.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBossDeploymentManager.java 2011-04-22 13:03:21 UTC (rev 30772)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBossDeploymentManager.java 2011-04-22 13:56:22 UTC (rev 30773)
@@ -25,37 +25,39 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentManager;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentResult;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7DeploymentState;
/**
* @author Rob Stryker
*/
public class JBossDeploymentManager implements IJBoss7DeploymentManager {
- public DeploymentOperationResult deployAsync(String host, int port, String deploymentName,
+ public IJBoss7DeploymentResult deployAsync(String host, int port, String deploymentName,
File file, IProgressMonitor monitor) throws Exception {
AS7Manager manager = new AS7Manager(host, port);
return manager.deploy(deploymentName, file);
}
- public DeploymentOperationResult deploySync(String host, int port, String deploymentName,
+ public IJBoss7DeploymentResult deploySync(String host, int port, String deploymentName,
File file, IProgressMonitor monitor) throws Exception {
AS7Manager manager = new AS7Manager(host, port);
return manager.deploySync(deploymentName, file, monitor);
}
- public DeploymentOperationResult undeployAsync(String host, int port, String deploymentName,
+ public IJBoss7DeploymentResult undeployAsync(String host, int port, String deploymentName,
boolean removeFile, IProgressMonitor monitor) throws Exception {
AS7Manager manager = new AS7Manager(host, port);
return manager.undeploy(deploymentName);
}
- public DeploymentOperationResult syncUndeploy(String host, int port, String deploymentName,
+ public IJBoss7DeploymentResult syncUndeploy(String host, int port, String deploymentName,
boolean removeFile, IProgressMonitor monitor) throws Exception {
AS7Manager manager = new AS7Manager(host, port);
return manager.undeploySync(deploymentName, monitor);
}
- public DeploymentState getDeploymentState(String host, int port, String deploymentName) throws Exception {
+ public JBoss7DeploymentState getDeploymentState(String host, int port, String deploymentName) throws Exception {
AS7Manager manager = new AS7Manager(host, port);
return manager.getDeploymentState(deploymentName);
14 years, 11 months
JBoss Tools SVN: r30772 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core: META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-04-22 09:03:21 -0400 (Fri, 22 Apr 2011)
New Revision: 30772
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/libval/
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/libval/HibernateUserLibraryValidator.java
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/META-INF/MANIFEST.MF
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/plugin.xml
Log:
https://issues.jboss.org/browse/JBIDE-8677
Use Library validator instead of custom Library Provider
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/META-INF/MANIFEST.MF 2011-04-22 01:49:27 UTC (rev 30771)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/META-INF/MANIFEST.MF 2011-04-22 13:03:21 UTC (rev 30772)
@@ -18,7 +18,8 @@
org.eclipse.jpt.common.core,
org.eclipse.jpt.jpa.db,
org.eclipse.jpt.jpa.core,
- org.eclipse.text;bundle-version="3.5.100"
+ org.eclipse.text;bundle-version="3.5.100",
+ org.eclipse.jst.j2ee;bundle-version="1.1.500"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: %Bundle-Vendor.0
Export-Package: org.jboss.tools.hibernate.jpt.core.internal,
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/plugin.xml 2011-04-22 01:49:27 UTC (rev 30771)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/plugin.xml 2011-04-22 13:03:21 UTC (rev 30772)
@@ -3,10 +3,16 @@
<plugin>
<extension id="org.jboss.tools.hibernate.jpt.core"
point="org.eclipse.jpt.jpa.core.jpaPlatforms">
+
+ <jpaPlatformGroup
+ id="hibernate.group"
+ label="Hibernate"/>
+
<jpaPlatform
default="false"
factoryClass="org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaPlatformFactory"
id="hibernate"
+ group="hibernate.group"
jpaFacetVersion="1.0"
label="Hibernate (JPA 1.x)">
</jpaPlatform>
@@ -14,9 +20,11 @@
default="false"
factoryClass="org.jboss.tools.hibernate.jpt.core.internal.jpa2.HibernateJpa2_0PlatformFactory"
id="hibernate2_0"
+ group="hibernate.group"
jpaFacetVersion="2.0"
label="Hibernate (JPA 2.x)">
- </jpaPlatform>
+ </jpaPlatform>
+
</extension>
<extension
point="org.eclipse.wst.common.project.facet.core.listeners">
@@ -25,6 +33,26 @@
eventTypes="POST_INSTALL">
</listener>
</extension>
+
+ <extension
+ point="org.eclipse.jpt.common.core.libraryValidators">
+
+ <libraryValidator
+ id="hibernateLibraryValidator"
+ class="org.jboss.tools.hibernate.jpt.core.internal.libval.HibernateUserLibraryValidator">
+ <enablement>
+ <and>
+ <with variable="libraryProvider">
+ <test property="org.eclipse.jpt.common.core.extendsId" value="jpa-user-library-provider"/>
+ </with>
+ <with variable="config">
+ <test property="org.eclipse.jpt.jpa.core.jpaPlatformGroup" value="hibernate.group"/>
+ </with>
+ </and>
+ </enablement>
+ </libraryValidator>
+
+ </extension>
<!--extension
point="org.eclipse.jst.common.project.facet.core.libraryProviders">
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/libval/HibernateUserLibraryValidator.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/libval/HibernateUserLibraryValidator.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/libval/HibernateUserLibraryValidator.java 2011-04-22 13:03:21 UTC (rev 30772)
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal.libval;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jpt.common.core.internal.libval.LibValUtil;
+import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
+import org.eclipse.jpt.common.core.libval.LibraryValidator;
+import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
+import org.eclipse.jpt.jpa.core.internal.libprov.JpaUserLibraryProviderInstallOperationConfig;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class HibernateUserLibraryValidator implements LibraryValidator {
+
+ @Override
+ public IStatus validate(JptLibraryProviderInstallOperationConfig config) {
+ JpaUserLibraryProviderInstallOperationConfig jpaConfig = (JpaUserLibraryProviderInstallOperationConfig) config;
+ Set<String> classNames = new HashSet<String>();
+ //classNames.add("javax.persistence.Entity"); //$NON-NLS-1$
+ classNames.add("org.hibernate.SessionFactory");//$NON-NLS-1$
+
+ Iterable<IPath> libraryPaths = new TransformationIterable<IClasspathEntry, IPath>(
+ jpaConfig.resolve()) {
+ @Override
+ protected IPath transform(IClasspathEntry o) {
+ return o.getPath();
+ }
+ };
+
+ return LibValUtil.validate(libraryPaths, classNames);
+ }
+
+}
14 years, 11 months
JBoss Tools SVN: r30771 - in trunk/as: plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-04-21 21:49:27 -0400 (Thu, 21 Apr 2011)
New Revision: 30771
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractJSTPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java
trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/SingleFileZippedDeploymentIntegrationTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/JSTDeployBinaryChildModuleTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/JSTDeploymentWarUpdateXML.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/JSTZippedDeploymentTester.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockJSTPublisherTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockPublishMethod.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/SingleFileDeploymentTester.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java
Log:
AS7 Publishing plus unit tests
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java 2011-04-21 23:19:58 UTC (rev 30770)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java 2011-04-22 01:49:27 UTC (rev 30771)
@@ -41,8 +41,7 @@
IModule lastMod = (module == null || module.length == 0 ) ? null : module[module.length -1];
if( getPublishMethod().equals(method) && lastMod == null)
return true;
- return getPublishMethod().equals(method)
- && ModuleCoreNature.isFlexibleProject(lastMod.getProject())
+ return ModuleCoreNature.isFlexibleProject(lastMod.getProject())
&& ds != null && ds.zipsWTPDeployments();
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java 2011-04-21 23:19:58 UTC (rev 30770)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java 2011-04-22 01:49:27 UTC (rev 30771)
@@ -221,6 +221,9 @@
}
return publisher;
}
+ public String toString() {
+ return element.getAttribute("class"); //$NON-NLS-1$
+ }
}
private ServerPublishMethodType[] publishMethodTypes;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractJSTPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractJSTPublisher.java 2011-04-21 23:19:58 UTC (rev 30770)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractJSTPublisher.java 2011-04-22 01:49:27 UTC (rev 30771)
@@ -34,6 +34,7 @@
if( module == null || (publishMethodSpecific() && !method.equals(getTargetedPublishMethodId())))
return false;
IDeployableServer ds = ServerConverter.getDeployableServer(server);
+ boolean b = ds.zipsWTPDeployments();
return ds != null
&& ModuleCoreNature.isFlexibleProject(module[0].getProject())
&& !ds.zipsWTPDeployments();
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2011-04-21 23:19:58 UTC (rev 30770)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2011-04-22 01:49:27 UTC (rev 30771)
@@ -19,7 +19,7 @@
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.wtp.core.modules.IJBTModule;
-public class SingleFilePublisher extends AbstractJSTPublisher {
+public class SingleFilePublisher extends JBoss7JSTPublisher {
protected boolean forceZipModule(IModule[] moduleTree) {
return false;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java 2011-04-21 23:19:58 UTC (rev 30770)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java 2011-04-22 01:49:27 UTC (rev 30771)
@@ -63,13 +63,20 @@
// jboss-7 specific
IDeployableServer ds = ServerConverter.getDeployableServer(server);
if( publishType == IJBossServerPublisher.REMOVE_PUBLISH) {
- JBoss7JSTPublisher.removeDeployedMarkerFile(method, ds, module, monitor);
+ if( JBoss7Server.supportsJBoss7MarkerDeployment(server) )
+ JBoss7JSTPublisher.removeDeployedMarkerFile(method, ds, module, monitor);
+ else
+ super.publishModule(method, server, module, publishType, delta, monitor);
} else {
IStatus s = super.publishModule(method, server, module, publishType, delta, monitor);
- if( publishType == IJBossServerPublisher.FULL_PUBLISH && module.length == 1) {
- // Only mark a doDeploy file for the root module, but this must be delayed,
- // becuase we don't know how many children modules will get published here (SUCK)
- JBoss7JSTPublisher.markDeployed(method, ds, module, monitor);
+ if( JBoss7Server.supportsJBoss7MarkerDeployment(server) ) {
+ if( module.length == 1 &&
+ publishType == IJBossServerPublisher.FULL_PUBLISH ||
+ publishType == IJBossServerPublisher.INCREMENTAL_PUBLISH) {
+ // Only mark a doDeploy file for the root module, but this must be delayed,
+ // becuase we don't know how many children modules will get published here (SUCK)
+ JBoss7JSTPublisher.markDeployed(method, ds, module, monitor);
+ }
}
return s;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java 2011-04-21 23:19:58 UTC (rev 30770)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java 2011-04-22 01:49:27 UTC (rev 30771)
@@ -33,7 +33,6 @@
return getDeployFolder(this, type);
}
-
public static boolean supportsJBoss7MarkerDeployment(IServer server) {
if( server.loadAdapter(IJBoss7Deployment.class, new NullProgressMonitor()) != null )
return true;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java 2011-04-21 23:19:58 UTC (rev 30770)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java 2011-04-22 01:49:27 UTC (rev 30771)
@@ -57,7 +57,9 @@
this.behaviour = behaviour;
loadRemoteDeploymentDetails();
ensureConnection(monitor);
- if( getServer().getServerState() == IServer.STATE_STARTED ) {
+
+ JBossServerBehavior b = (JBossServerBehavior) behaviour.getServer().loadAdapter(JBossServerBehavior.class, new NullProgressMonitor());
+ if( b != null && getServer().getServerState() == IServer.STATE_STARTED ) {
stopDeploymentScanner();
}
super.publishStart(behaviour, monitor);
@@ -65,7 +67,8 @@
public int publishFinish(DeployableServerBehavior behaviour,
IProgressMonitor monitor) throws CoreException {
- if( getServer().getServerState() == IServer.STATE_STARTED ) {
+ JBossServerBehavior b = (JBossServerBehavior) behaviour.getServer().loadAdapter(JBossServerBehavior.class, new NullProgressMonitor());
+ if( b != null && getServer().getServerState() == IServer.STATE_STARTED ) {
startDeploymentScanner();
}
return super.publishFinish(behaviour, monitor);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java 2011-04-21 23:19:58 UTC (rev 30770)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java 2011-04-22 01:49:27 UTC (rev 30771)
@@ -109,7 +109,7 @@
if( !result.isOK() ) {
monitor.done();
} else {
- result = remoteFullPublish(sourcePath, destFolder, name,
+ result = remoteFullPublish(sourcePath, destFolder.removeLastSegments(1), name,
AbstractServerToolsPublisher.getSubMon(monitor, 150));
}
}
@@ -163,7 +163,8 @@
private IStatus removeRemoteDeploymentFolder(IPath sourcePath,
IPath destFolder, String name, IProgressMonitor monitor) throws SystemMessageException, CoreException {
// Now delete the file from RSE
- method.getCallbackHandler(destFolder, server).deleteResource(new Path(name), monitor);
+ // TODO *** FIX THIS IT IS NOT LOGGING ERRORS
+ IStatus[] tmp = method.getCallbackHandler(destFolder, server).deleteResource(new Path(name), monitor);
return Status.OK_STATUS;
}
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/SingleFileZippedDeploymentIntegrationTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/SingleFileZippedDeploymentIntegrationTest.java 2011-04-21 23:19:58 UTC (rev 30770)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.archives.integration.test/src/org/jboss/ide/eclipse/as/archives/integration/test/SingleFileZippedDeploymentIntegrationTest.java 2011-04-22 01:49:27 UTC (rev 30771)
@@ -15,11 +15,13 @@
import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
import org.jboss.ide.eclipse.as.test.ASTest;
-import org.jboss.ide.eclipse.as.test.publishing.v2.SingleFileDeploymentTester;
+import org.jboss.ide.eclipse.as.test.publishing.v2.JSTDeploymentTester;
+import org.jboss.ide.eclipse.as.test.publishing.v2.MockPublishMethod;
import org.jboss.ide.eclipse.as.test.util.IOUtil;
import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
+import org.jboss.tools.test.util.JobUtils;
-public class SingleFileZippedDeploymentIntegrationTest extends SingleFileDeploymentTester {
+public class SingleFileZippedDeploymentIntegrationTest extends JSTDeploymentTester {
public void testSingleFolderZipped() throws CoreException, IOException {
server = ServerRuntimeUtils.setZipped(server, true);
try {
@@ -28,20 +30,69 @@
server = ServerRuntimeUtils.setZipped(server, false);
}
}
- public void singleFolderZippedInternal2() throws CoreException, IOException {
- // create proj and files
+
+ public void testSingleFolderZippedForAS7() throws CoreException, IOException {
+ server = ServerRuntimeUtils.createMockJBoss7Server();
+ server = ServerRuntimeUtils.useMockPublishMethod(server);
+ server = ServerRuntimeUtils.setZipped(server, true);
+
final String folderName = "test";
IFolder folder = project.getFolder(folderName);
+ createFolder(folder);
+
+ SingleDeployableFactory.makeDeployable(folder);
+ IModule[] mods = SingleDeployableFactory.getFactory().getModules();
+ assertEquals(mods.length, 1);
+ server = ServerRuntimeUtils.addModule(server, mods[0]);
+ ServerRuntimeUtils.publish(server);
+ int ch = MockPublishMethod.getChanged().length;
+ int rm = MockPublishMethod.getRemoved().length;
+ assertEquals(2,ch);
+ assertEquals(1,rm);
+ MockPublishMethod.reset();
+
+ // make workspace change, repeat
+ IOUtil.setContents(folder.getFile("3.txt"), "3a");
+ ServerRuntimeUtils.publish(server);
+ JobUtils.waitForIdle();
+ Object o1 = MockPublishMethod.getChanged();
+ Object o2 = MockPublishMethod.getRemoved();
+
+ ch = MockPublishMethod.getChanged().length;
+ rm = MockPublishMethod.getRemoved().length;
+ assertEquals(2,ch);
+ assertEquals(1,rm);
+ MockPublishMethod.reset();
+
+ server = ServerRuntimeUtils.removeModule(server, mods[0]);
+ ServerRuntimeUtils.publish(server);
+ JobUtils.waitForIdle();
+ ch = MockPublishMethod.getChanged().length;
+ rm = MockPublishMethod.getRemoved().length;
+ assertEquals(0,ch);
+ assertEquals(1,rm);
+ MockPublishMethod.reset();
+ }
+
+
+ private void createFolder(IFolder folder) throws CoreException, IOException {
folder.create(true, true, new NullProgressMonitor());
IOUtil.setContents(folder.getFile("1.txt"), "1");
IOUtil.setContents(folder.getFile("2.txt"), "2");
IOUtil.setContents(folder.getFile("3.txt"), "3");
IModule[] mods = SingleDeployableFactory.getFactory().getModules();
assertEquals(mods.length, 0);
+ }
+
+ public void singleFolderZippedInternal2() throws CoreException, IOException {
+ // create proj and files
+ final String folderName = "test";
+ IFolder folder = project.getFolder(folderName);
+ createFolder(folder);
// make deployable, do checks
SingleDeployableFactory.makeDeployable(folder);
- mods = SingleDeployableFactory.getFactory().getModules();
+ IModule[] mods = SingleDeployableFactory.getFactory().getModules();
assertEquals(mods.length, 1);
server = ServerRuntimeUtils.addModule(server, mods[0]);
IPath deployRoot = new Path(ServerRuntimeUtils.getDeployRoot(server));
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2011-04-21 23:19:58 UTC (rev 30770)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTestSuite.java 2011-04-22 01:49:27 UTC (rev 30771)
@@ -34,7 +34,9 @@
import org.jboss.ide.eclipse.as.test.publishing.JBIDE4184Test;
import org.jboss.ide.eclipse.as.test.publishing.v2.JSTDeployBinaryChildModuleTest;
import org.jboss.ide.eclipse.as.test.publishing.v2.JSTDeploymentTester;
+import org.jboss.ide.eclipse.as.test.publishing.v2.JSTDeploymentWarUpdateXML;
import org.jboss.ide.eclipse.as.test.publishing.v2.MockDeploymentBehaviour;
+import org.jboss.ide.eclipse.as.test.publishing.v2.MockJSTPublisherTest;
import org.jboss.ide.eclipse.as.test.publishing.v2.SingleFileDeploymentTester;
import org.jboss.ide.eclipse.as.test.server.JBossServerAPITest;
@@ -55,6 +57,8 @@
suite.addTestSuite(SingleFileDeploymentTester.class);
suite.addTestSuite(JBossServerAPITest.class);
suite.addTestSuite(MockDeploymentBehaviour.class);
+ suite.addTestSuite(JSTDeploymentWarUpdateXML.class);
+ suite.addTestSuite(MockJSTPublisherTest.class);
return suite;
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/JSTDeployBinaryChildModuleTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/JSTDeployBinaryChildModuleTest.java 2011-04-21 23:19:58 UTC (rev 30770)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/JSTDeployBinaryChildModuleTest.java 2011-04-22 01:49:27 UTC (rev 30771)
@@ -50,14 +50,14 @@
public void testStandardBinaryChildDeploymentMockPublishMethod() throws CoreException, IOException {
server = ServerRuntimeUtils.useMockPublishMethod(server);
- MockPublishMethod.HANDLER.reset();
+ MockPublishMethod.reset();
testJBoss7BinaryChildDeployment(8);
}
public void testJBoss7BinaryChildDeployment() throws CoreException, IOException {
server = ServerRuntimeUtils.createMockJBoss7Server();
server = ServerRuntimeUtils.useMockPublishMethod(server);
- MockPublishMethod.HANDLER.reset();
+ MockPublishMethod.reset();
testJBoss7BinaryChildDeployment(9);
}
@@ -66,8 +66,8 @@
IModule[] module = new IModule[] { mod };
server = ServerRuntimeUtils.addModule(server, mod);
ServerRuntimeUtils.publish(server);
- assertEquals(count,MockPublishMethod.HANDLER.getChanged().length);
- MockPublishMethod.HANDLER.reset();
+ assertEquals(count,MockPublishMethod.getChanged().length);
+ MockPublishMethod.reset();
}
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/JSTDeploymentWarUpdateXML.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/JSTDeploymentWarUpdateXML.java 2011-04-21 23:19:58 UTC (rev 30770)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/JSTDeploymentWarUpdateXML.java 2011-04-22 01:49:27 UTC (rev 30771)
@@ -1,10 +1,7 @@
package org.jboss.ide.eclipse.as.test.publishing.v2;
-import java.io.File;
import java.io.IOException;
-import junit.framework.TestCase;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -15,16 +12,11 @@
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerUtil;
-import org.jboss.ide.eclipse.as.core.ExtensionManager;
-import org.jboss.ide.eclipse.as.core.publishers.JstPublisher;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
-import org.jboss.ide.eclipse.as.test.ASTest;
-import org.jboss.ide.eclipse.as.test.util.IOUtil;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7JSTPublisher;
import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
import org.jboss.ide.eclipse.as.test.util.wtp.JavaEEFacetConstants;
import org.jboss.ide.eclipse.as.test.util.wtp.OperationTestCase;
import org.jboss.ide.eclipse.as.test.util.wtp.ProjectCreationUtil;
-import org.jboss.ide.eclipse.as.test.util.wtp.ProjectUtility;
public class JSTDeploymentWarUpdateXML extends AbstractJSTDeploymentTester {
@@ -74,19 +66,20 @@
public void testWarUpdateMockPublishMethodJBoss7() throws CoreException, IOException {
server = ServerRuntimeUtils.createMockJBoss7Server();
server = ServerRuntimeUtils.useMockPublishMethod(server);
- testMockPublishMethod(8,1,"newModule.war.isdeployed");
+ testMockPublishMethod(8,1,"newModule.war" + JBoss7JSTPublisher.DEPLOYED);
}
private void testMockPublishMethod(int initial, int remove, String removedFile) throws CoreException, IOException {
IModule mod = ServerUtil.getModule(project);
server = ServerRuntimeUtils.addModule(server,mod);
ServerRuntimeUtils.publish(server);
- assertEquals(initial, MockPublishMethod.HANDLER.getChanged().length);
- MockPublishMethod.HANDLER.reset();
+ assertEquals(initial, MockPublishMethod.getChanged().length);
+ MockPublishMethod.reset();
server = ServerRuntimeUtils.removeModule(server, mod);
ServerRuntimeUtils.publish(server);
- assertEquals(remove, MockPublishMethod.HANDLER.getRemoved().length);
- assertEquals(removedFile, MockPublishMethod.HANDLER.getRemoved()[0].toString());
+ assertEquals(remove, MockPublishMethod.getRemoved().length);
+ assertEquals(removedFile, MockPublishMethod.getRemoved()[0].toString());
+ MockPublishMethod.reset();
}
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/JSTZippedDeploymentTester.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/JSTZippedDeploymentTester.java 2011-04-21 23:19:58 UTC (rev 30770)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/JSTZippedDeploymentTester.java 2011-04-22 01:49:27 UTC (rev 30771)
@@ -102,7 +102,8 @@
public void testZippedDeploymentMock() throws CoreException, IOException {
server = ServerRuntimeUtils.useMockPublishMethod(server);
- MockPublishMethod.HANDLER.reset();
+ setZipFlag();
+ MockPublishMethod.reset();
IModule mod = findModule();
testZippedDeploymentMock(mod,1,1);
}
@@ -112,20 +113,25 @@
// a zipped file is done being transfered or not
server = ServerRuntimeUtils.createMockJBoss7Server();
server = ServerRuntimeUtils.useMockPublishMethod(server);
- MockPublishMethod.HANDLER.reset();
+ setZipFlag();
+ MockPublishMethod.reset();
IModule mod = findModule();
- testZippedDeploymentMock(mod,1,1);
+ testZippedDeploymentMock(mod,2,1);
}
private void testZippedDeploymentMock(IModule mod, int pubCount, int removeCount) throws IOException, CoreException {
+ MockPublishMethod.reset();
server = ServerRuntimeUtils.addModule(server, mod);
ServerRuntimeUtils.publish(server);
- int changed = MockPublishMethod.HANDLER.getChanged().length;
- MockPublishMethod.HANDLER.reset();
+ int changed = MockPublishMethod.getChanged().length;
+ int deleted = MockPublishMethod.getRemoved().length;
+ assertEquals(changed, pubCount);
+ MockPublishMethod.reset();
server = ServerRuntimeUtils.removeModule(server, mod);
ServerRuntimeUtils.publish(server);
- changed = MockPublishMethod.HANDLER.getRemoved().length;
- int x = 1;
+ deleted = MockPublishMethod.getRemoved().length;
+ assertEquals(deleted, removeCount);
+ MockPublishMethod.reset();
}
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockJSTPublisherTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockJSTPublisherTest.java 2011-04-21 23:19:58 UTC (rev 30770)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockJSTPublisherTest.java 2011-04-22 01:49:27 UTC (rev 30771)
@@ -6,21 +6,23 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.ServerUtil;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7JSTPublisher;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7Server;
import org.jboss.ide.eclipse.as.test.util.IOUtil;
import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
public class MockJSTPublisherTest extends AbstractJSTDeploymentTester {
public void testNormalLogic() throws CoreException, IOException {
server = ServerRuntimeUtils.useMockPublishMethod(server);
- MockPublishMethod.HANDLER.reset();
+ MockPublishMethod.reset();
theTest(2,1, "");
}
public void testForced7Logic() throws CoreException, IOException {
server = ServerRuntimeUtils.createMockJBoss7Server();
server = ServerRuntimeUtils.useMockPublishMethod(server);
- MockPublishMethod.HANDLER.reset();
- theTest(3,1, "newModule.ear.isDeployed");
+ MockPublishMethod.reset();
+ theTest(3,1, "newModule.ear" + JBoss7JSTPublisher.DEPLOYED);
}
private void theTest(int initialPublish, int remove, String relativePath) throws CoreException, IOException {
@@ -30,30 +32,30 @@
server = ServerRuntimeUtils.addModule(server,mod);
ServerRuntimeUtils.publish(server);
// one additional for doDeploy
- assertEquals(initialPublish, MockPublishMethod.HANDLER.getChanged().length);
- MockPublishMethod.HANDLER.reset();
+ assertEquals(initialPublish, MockPublishMethod.getChanged().length);
+ MockPublishMethod.reset();
IFile textFile = project.getFile(CONTENT_TEXT_FILE);
IOUtil.setContents(textFile, 0);
- assertEquals(0, MockPublishMethod.HANDLER.getChanged().length);
+ assertEquals(0, MockPublishMethod.getChanged().length);
ServerRuntimeUtils.publish(server);
- assertEquals(2, MockPublishMethod.HANDLER.getChanged().length);
- MockPublishMethod.HANDLER.reset();
+ assertEquals(2, MockPublishMethod.getChanged().length);
+ MockPublishMethod.reset();
IOUtil.setContents(textFile, 1);
ServerRuntimeUtils.publish(server);
- assertEquals(2, MockPublishMethod.HANDLER.getChanged().length);
- MockPublishMethod.HANDLER.reset();
+ assertEquals(2, MockPublishMethod.getChanged().length);
+ MockPublishMethod.reset();
textFile.delete(true, null);
ServerRuntimeUtils.publish(server);
- assertEquals(1, MockPublishMethod.HANDLER.getRemoved().length);
- MockPublishMethod.HANDLER.reset();
+ assertEquals(1, MockPublishMethod.getRemoved().length);
+ MockPublishMethod.reset();
server = ServerRuntimeUtils.removeModule(server, mod);
- assertEquals(0, MockPublishMethod.HANDLER.getRemoved().length);
+ assertEquals(0, MockPublishMethod.getRemoved().length);
// Still just one delete, but should be the .deployed file
ServerRuntimeUtils.publish(server);
- assertEquals(remove, MockPublishMethod.HANDLER.getRemoved().length);
+ assertEquals(remove, MockPublishMethod.getRemoved().length);
}
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockPublishMethod.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockPublishMethod.java 2011-04-21 23:19:58 UTC (rev 30770)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockPublishMethod.java 2011-04-22 01:49:27 UTC (rev 30771)
@@ -17,11 +17,12 @@
public class MockPublishMethod extends AbstractPublishMethod {
public static final String PUBLISH_METHOD_ID = "mock";
- public static final MockCopyCallbackHandler HANDLER = new MockCopyCallbackHandler();
-
+ public static ArrayList<IPath> changed = new ArrayList<IPath>();
+ public static ArrayList<IPath> removed = new ArrayList<IPath>();
+
public IPublishCopyCallbackHandler getCallbackHandler(IPath path,
IServer server) {
- return HANDLER;
+ return new MockCopyCallbackHandler(path);
}
public String getPublishDefaultRootFolder(IServer server) {
@@ -31,35 +32,38 @@
public String getPublishMethodId() {
return PUBLISH_METHOD_ID;
}
+ public static void reset() {
+ changed.clear();
+ removed.clear();
+ }
+ public static IPath[] getRemoved() {
+ return (IPath[]) removed.toArray(new IPath[removed.size()]);
+ }
- public static class MockCopyCallbackHandler implements IPublishCopyCallbackHandler {
- public ArrayList<IPath> changed = new ArrayList<IPath>();
- public ArrayList<IPath> removed = new ArrayList<IPath>();
-
- public void reset() {
- changed.clear();
- removed.clear();
+ public static IPath[] getChanged() {
+ return (IPath[]) changed.toArray(new IPath[changed.size()]);
+ }
+
+
+ public class MockCopyCallbackHandler implements IPublishCopyCallbackHandler {
+ private IPath root;
+ public MockCopyCallbackHandler(IPath root) {
+ this.root = root;
}
- public IPath[] getRemoved() {
- return (IPath[]) removed.toArray(new IPath[removed.size()]);
- }
-
- public IPath[] getChanged() {
- return (IPath[]) changed.toArray(new IPath[changed.size()]);
- }
-
public IStatus[] deleteResource(IPath path, IProgressMonitor monitor)
throws CoreException {
- if( !removed.contains(path.makeRelative()))
- removed.add(path.makeRelative());
+ IPath path2 = root.append(path);
+ if( !removed.contains(path2.makeRelative()))
+ removed.add(path2.makeRelative());
return new IStatus[]{};
}
public IStatus[] makeDirectoryIfRequired(IPath dir,
IProgressMonitor monitor) throws CoreException {
- if( !changed.contains(dir.makeRelative()))
- changed.add(dir.makeRelative());
+ IPath path2 = root.append(dir);
+ if( !changed.contains(path2.makeRelative()))
+ changed.add(path2.makeRelative());
return new IStatus[]{};
}
@@ -71,14 +75,16 @@
IProgressMonitor monitor) throws CoreException {
File file = PublishUtil.getFile(mf);
shouldRestartModule |= PublishCopyUtil.checkRestartModule(file);
- if( !changed.contains(path.makeRelative()))
- changed.add(path.makeRelative());
+ IPath path2 = root.append(path);
+ if( !changed.contains(path2.makeRelative()))
+ changed.add(path2.makeRelative());
return new IStatus[]{};
}
public IStatus[] touchResource(IPath path) {
- if( !changed.contains(path.makeRelative()))
- changed.add(path.makeRelative());
+ IPath path2 = root.append(path);
+ if( !changed.contains(path2.makeRelative()))
+ changed.add(path2.makeRelative());
return new IStatus[]{};
}
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/SingleFileDeploymentTester.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/SingleFileDeploymentTester.java 2011-04-21 23:19:58 UTC (rev 30770)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/SingleFileDeploymentTester.java 2011-04-22 01:49:27 UTC (rev 30771)
@@ -2,6 +2,7 @@
import java.io.File;
import java.io.IOException;
+import java.util.ArrayList;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
@@ -12,7 +13,6 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.wst.server.core.IModule;
import org.jboss.ide.eclipse.as.core.ExtensionManager;
-import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
import org.jboss.ide.eclipse.as.core.publishers.SingleFilePublisher;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
@@ -27,6 +27,7 @@
import org.jboss.tools.test.util.JobUtils;
public class SingleFileDeploymentTester extends JSTDeploymentTester {
+
public void testSingleFile() throws CoreException, IOException {
final String filename = "test.xml";
IResource file = createFile(filename, "<test>done</test>");
@@ -64,19 +65,7 @@
assertEquals(IOUtil.countAllResources(deployRoot.toFile()), 1);
}
- protected void verifyPublisher(IModule module, Class c) {
- IModule[] mod = new IModule[] { module };
- IJBossServerPublisher publisher = ExtensionManager
- .getDefault().getPublisher(server, mod, "local");
- assertTrue(publisher.getClass().equals(c));
- }
- protected IFile createFile(String filename, String contents) throws CoreException, IOException {
- IFile resource = project.getFile(filename);
- IOUtil.setContents(resource, contents);
- return resource;
- }
-
public void testSingleFolder() throws CoreException, IOException {
IPath moduleDeployRoot = new Path(ServerRuntimeUtils.getDeployRoot(server));
final String folderName = "test";
@@ -167,4 +156,112 @@
server = ServerRuntimeUtils.setZipped(server, false);
}
}
+
+
+ public void testSingleFileAS7() throws CoreException, IOException {
+ server = ServerRuntimeUtils.createMockJBoss7Server();
+ server = ServerRuntimeUtils.useMockPublishMethod(server);
+ MockPublishMethod.reset();
+
+ final String filename = "test.xml";
+ IResource file = createFile(filename, "<test>done</test>");
+ IModule[] mods = SingleDeployableFactory.getFactory().getModules();
+ assertEquals(mods.length, 0);
+ SingleDeployableFactory.makeDeployable(file);
+ mods = SingleDeployableFactory.getFactory().getModules();
+ assertEquals(mods.length, 1);
+ verifyPublisher(mods[0], SingleFilePublisher.class);
+ server = ServerRuntimeUtils.addModule(server, mods[0]);
+ ArrayList<IPath> changed2 = MockPublishMethod.changed;
+ ArrayList<IPath> removed2 = MockPublishMethod.removed;
+
+ assertEquals(changed2.size(), 0);
+ assertEquals(removed2.size(), 0);
+ MockPublishMethod.reset();
+ ServerRuntimeUtils.publish(server);
+ JobUtils.waitForIdle();
+ assertEquals(changed2.size(), 2); // Creating blah.jar and blah.jar.dodeploy
+ assertEquals(removed2.size(), 1); // TODO find out why its "removing" the empty string
+ MockPublishMethod.reset();
+
+ IOUtil.setContents(project.getFile(filename), "2");
+ ServerRuntimeUtils.publish(server);
+ JobUtils.waitForIdle();
+ assertEquals(changed2.size(), 2);
+ assertEquals(removed2.size(), 0);
+ MockPublishMethod.reset();
+
+ server = ServerRuntimeUtils.removeModule(server, mods[0]);
+ assertEquals(changed2.size(), 0);
+ assertEquals(removed2.size(), 0);
+ MockPublishMethod.reset();
+
+ ServerRuntimeUtils.publish(server);
+ JobUtils.waitForIdle();
+ assertEquals(changed2.size(), 0);
+ assertEquals(removed2.size(), 1);
+ MockPublishMethod.reset();
+ }
+
+ public void testSingleFolderAS7() throws CoreException, IOException {
+ IPath moduleDeployRoot = new Path(ServerRuntimeUtils.getDeployRoot(server));
+ final String folderName = "test";
+ moduleDeployRoot.toFile().mkdirs();
+ IModule[] mods = singleFolderCreateModules(folderName);
+ singleFolderPublishAndVerifyAS7(moduleDeployRoot, folderName, mods);
+ }
+
+ private void singleFolderPublishAndVerifyAS7(IPath moduleDeployRoot, String folderName, IModule[] mods) throws CoreException, IOException {
+ server = ServerRuntimeUtils.createMockJBoss7Server();
+ server = ServerRuntimeUtils.useMockPublishMethod(server);
+ MockPublishMethod.reset();
+
+ ArrayList<IPath> changed2 = MockPublishMethod.changed;
+ ArrayList<IPath> removed2 = MockPublishMethod.removed;
+ assertEquals(changed2.size(), 0);
+ assertEquals(removed2.size(), 0);
+
+ server = ServerRuntimeUtils.addModule(server, mods[0]);
+ assertEquals(changed2.size(), 0);
+ assertEquals(removed2.size(), 0);
+ ServerRuntimeUtils.publish(server);
+ assertEquals(changed2.size(), 4);
+ assertEquals(removed2.size(), 1);
+ MockPublishMethod.reset();
+
+ IFolder folder = project.getFolder(folderName);
+ IOUtil.setContents(folder.getFile("3.txt"), "3a");
+ ServerRuntimeUtils.publish(server);
+ assertEquals(changed2.size(), 2);
+ assertEquals(removed2.size(), 0);
+ MockPublishMethod.reset();
+
+ server = ServerRuntimeUtils.removeModule(server, mods[0]);
+ assertEquals(changed2.size(), 0);
+ assertEquals(removed2.size(), 0);
+ MockPublishMethod.reset();
+
+ ServerRuntimeUtils.publish(server);
+ JobUtils.waitForIdle();
+ assertEquals(changed2.size(), 0);
+ assertEquals(removed2.size(), 1);
+ MockPublishMethod.reset();
+
+ }
+
+
+ protected void verifyPublisher(IModule module, Class c) {
+ IModule[] mod = new IModule[] { module };
+ IJBossServerPublisher publisher = ExtensionManager
+ .getDefault().getPublisher(server, mod, "local");
+ assertTrue(publisher.getClass().equals(c));
+ }
+
+ protected IFile createFile(String filename, String contents) throws CoreException, IOException {
+ IFile resource = project.getFile(filename);
+ IOUtil.setContents(resource, contents);
+ return resource;
+ }
+
+
}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java 2011-04-21 23:19:58 UTC (rev 30770)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java 2011-04-22 01:49:27 UTC (rev 30771)
@@ -87,6 +87,7 @@
serverRuntimeMap.put(IJBossToolingConstants.SERVER_AS_50, IJBossToolingConstants.AS_50);
serverRuntimeMap.put(IJBossToolingConstants.SERVER_AS_51, IJBossToolingConstants.AS_51);
serverRuntimeMap.put(IJBossToolingConstants.SERVER_AS_60, IJBossToolingConstants.AS_60);
+ serverRuntimeMap.put(IJBossToolingConstants.SERVER_AS_70, IJBossToolingConstants.AS_70);
serverRuntimeMap.put(IJBossToolingConstants.SERVER_EAP_43, IJBossToolingConstants.EAP_43);
serverRuntimeMap.put(IJBossToolingConstants.SERVER_EAP_50, IJBossToolingConstants.EAP_50);
}
14 years, 11 months
JBoss Tools SVN: r30767 - trunk/requirements.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-04-21 19:05:15 -0400 (Thu, 21 Apr 2011)
New Revision: 30767
Modified:
trunk/requirements/build.xml
Log:
instead of pointing at remote /home/hudson/static_build_env/jbds/requirements folder, copy it into workspace to skip re-downloading zips
Modified: trunk/requirements/build.xml
===================================================================
--- trunk/requirements/build.xml 2011-04-21 22:41:50 UTC (rev 30766)
+++ trunk/requirements/build.xml 2011-04-21 23:05:15 UTC (rev 30767)
@@ -44,24 +44,28 @@
<!-- if there's a mirror of the requirements stuff outside hudson, use that instead; else work in local workspace -->
<target name="default" description="to fetch 1 or more requirement(s), set -Drequirements=one,two,three" unless="skipRequirementBuild">
- <!-- https://jira.jboss.org/jira/browse/JBQA-3313 Use static, shared space outside workspace, instead of working directly in the workspace -->
+ <!-- https://jira.jboss.org/jira/browse/JBQA-3313 Use static, shared space outside workspace, instead of fetching directly to the workspace -->
+ <var name="static_build_env.jbds.requirements" value="/home/hudson/static_build_env/jbds/requirements" />
<if>
- <available file="/home/hudson/static_build_env/jbds" type="dir" />
+ <available file="${static_build_env.jbds.requirements}" type="dir" />
<then>
- <var name="requirement.root" unset="true" />
- <property name="requirement.root" value="/home/hudson/static_build_env/jbds/requirements"/>
- <mkdir dir="${requirement.root}" />
-
- <var name="requirement.build.root" unset="true" />
- <property name="requirement.build.root" value="${requirement.root}/target" />
- <mkdir dir="${requirement.build.root}" />
-
- <var name="requirement.download.root" unset="true" />
- <property name="requirement.download.root" value="${requirement.root}/download" />
- <mkdir dir="${requirement.download.root}" />
+ <for list="${requirements}" param="requirement">
+ <sequential>
+ <!-- if /home/hudson/static_build_env/jbds/requirements/download/jbossas/ exists, copy into
+ ${WORKSPACE}/requirements/download/jbossas/ so no need to re-download zips -->
+ <if>
+ <available file="${static_build_env.jbds.requirements}/download/@{requirement}" />
+ <then>
+ <copy todir="${requirement.download.root}/@{requirement}">
+ <fileset dir="${static_build_env.jbds.requirements}/download/@{requirement}" />
+ </copy>
+ </then>
+ </if>
+ </sequential>
+ </for>
</then>
</if>
-
+
<echo>maven.test.skip=${maven.test.skip}</echo>
<echo>settings.offline=${settings.offline}</echo>
<echo>requirements=${requirements}</echo>
14 years, 11 months