JBoss Tools SVN: r30811 - trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-04-24 12:39:08 -0400 (Sun, 24 Apr 2011)
New Revision: 30811
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagerTest.java
Log:
@Override annotation was removed from code to fix compilation errors
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagerTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagerTest.java 2011-04-23 22:51:24 UTC (rev 30810)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagerTest.java 2011-04-24 16:39:08 UTC (rev 30811)
@@ -61,31 +61,26 @@
private static class JBoss71Manager implements IJBoss7Manager {
- @Override
public IJBoss7DeploymentResult deployAsync(String host, int port, String deploymentName, File file,
IProgressMonitor monitor) throws JBoss7ManangerException {
throw new UnsupportedOperationException();
}
- @Override
public IJBoss7DeploymentResult deploySync(String host, int port, String deploymentName, File file,
IProgressMonitor monitor) throws JBoss7ManangerException {
throw new UnsupportedOperationException();
}
- @Override
public IJBoss7DeploymentResult undeployAsync(String host, int port, String deploymentName, boolean removeFile,
IProgressMonitor monitor) throws JBoss7ManangerException {
throw new UnsupportedOperationException();
}
- @Override
public IJBoss7DeploymentResult syncUndeploy(String host, int port, String deploymentName, boolean removeFile,
IProgressMonitor monitor) throws JBoss7ManangerException {
throw new UnsupportedOperationException();
}
- @Override
public JBoss7DeploymentState getDeploymentState(String host, int port, String deploymentName)
throws JBoss7ManangerException {
throw new UnsupportedOperationException();
14 years, 11 months
Newsletter Sun, 24 Apr 2011 09:16:56 -0300
by jbosstools-commits@lists.jboss.org
Hi!!
Do you want a good future, soar in money, and the recognition of all?
Today only:
We can assist with Diplomas from prestigious universities based on your present knowledge and work experience.
Get a Degree in 6 weeks with our program!
~Our program will help EVERYONE with professional experience
gain a 100% verified Degree:
~Doctorate
~Bachelors
~Masters
- Think about it...
- Just follow YOUR Dreams!
- Live a much better life by earning or upgrading your degree.
This is a good way 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 fraction of the time.
Contact us 24 hours to start improving your life!
~CALL~
1-301-396-3506
Please leave us a message with your phone number with country code if outside USA and name and we'll contact you asap.
It's your move...
Make the right decision.
Yours sincerely.
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: r30810 - in trunk/as: plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7 and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-04-23 18:51:24 -0400 (Sat, 23 Apr 2011)
New Revision: 30810
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7Manager.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerProxy.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangerException.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBoss7Manager.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagerTest.java
Removed:
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/IJBoss7ManagementInterface.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagementUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagentServiceProxy.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangementException.java
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/JBossManagementService.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSerivceTest.java
Modified:
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/AS7ManagerIntegrationTest.java
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/AS7ManagerTestUtils.java
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/JBossManagementServiceIntegrationTest.java
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/JBoss7JSTPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/jboss-management-service.xml
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/DeploymentOperationResult.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DetypedDeployer.java
Log:
[JBIDE-8784] removed distinction between manager and deployer
Modified: trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/AS7ManagerIntegrationTest.java
===================================================================
--- trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/AS7ManagerIntegrationTest.java 2011-04-23 21:56:54 UTC (rev 30809)
+++ trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/AS7ManagerIntegrationTest.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -22,7 +22,7 @@
import java.util.concurrent.ExecutionException;
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.JBoss7ManangerException;
import org.jboss.ide.eclipse.as.management.as7.deployment.AS7Manager;
import org.junit.After;
import org.junit.Before;
@@ -81,7 +81,7 @@
}
@Ignore
- @Test(expected = JBoss7ManangementException.class)
+ @Test(expected = JBoss7ManangerException.class)
public void cannotDeployWarTwice() throws Exception {
File warFile = AS7ManagerTestUtils.getWarFile(AS7ManagerTestUtils.MINIMALISTIC_WAR);
try {
@@ -93,8 +93,8 @@
}
@Ignore
- @Test(expected = JBoss7ManangementException.class)
- public void cannotUndeployNondeployed() throws JBoss7ManangementException, InterruptedException, ExecutionException {
+ @Test(expected = JBoss7ManangerException.class)
+ public void cannotUndeployNondeployed() throws JBoss7ManangerException, InterruptedException, ExecutionException {
AS7ManagerTestUtils.waitUntilFinished(manager.undeploy("inexistant"));
}
@@ -117,7 +117,7 @@
}
@Test
- public void getEnabledStateIfDeploymentIsDeployed() throws URISyntaxException, IOException, JBoss7ManangementException {
+ public void getEnabledStateIfDeploymentIsDeployed() throws URISyntaxException, IOException, JBoss7ManangerException {
String deploymentName = "testDeployment";
File warFile = AS7ManagerTestUtils.getWarFile(AS7ManagerTestUtils.MINIMALISTIC_WAR);
try {
@@ -131,7 +131,7 @@
}
@Test
- public void getDisabledStateIfDeploymentIsOnlyAdded() throws URISyntaxException, IOException, JBoss7ManangementException {
+ public void getDisabledStateIfDeploymentIsOnlyAdded() throws URISyntaxException, IOException, JBoss7ManangerException {
String deploymentName = "testDeployment";
File warFile = AS7ManagerTestUtils.getWarFile(AS7ManagerTestUtils.MINIMALISTIC_WAR);
try {
@@ -144,8 +144,8 @@
}
}
- @Test(expected = JBoss7ManangementException.class)
- public void getErrorIfDeploymentIsNotDeployed() throws URISyntaxException, IOException, JBoss7ManangementException {
+ @Test(expected = JBoss7ManangerException.class)
+ public void getErrorIfDeploymentIsNotDeployed() throws URISyntaxException, IOException, JBoss7ManangerException {
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/AS7ManagerTestUtils.java
===================================================================
--- trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/AS7ManagerTestUtils.java 2011-04-23 21:56:54 UTC (rev 30809)
+++ trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/AS7ManagerTestUtils.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -22,7 +22,7 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangerException;
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;
@@ -78,7 +78,7 @@
}
}
- public static void waitUntilFinished(IJBoss7DeploymentResult result) throws JBoss7ManangementException {
+ public static void waitUntilFinished(IJBoss7DeploymentResult result) throws JBoss7ManangerException {
result.getStatus(); // wait for operation to finish
}
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-23 21:56:54 UTC (rev 30809)
+++ trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/DetypedDeployerIntegrationTest.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -18,7 +18,7 @@
import java.io.File;
import java.util.List;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangerException;
import org.jboss.ide.eclipse.as.management.as7.deployment.DetypedDeployer;
import org.junit.Test;
@@ -41,7 +41,7 @@
}
}
- @Test(expected = JBoss7ManangementException.class)
+ @Test(expected = JBoss7ManangerException.class)
public void cannotDeployWarTwice() throws Exception {
File warFile = AS7ManagerTestUtils.getWarFile(AS7ManagerTestUtils.MINIMALISTIC_WAR);
try {
@@ -68,8 +68,8 @@
}
}
- @Test(expected = JBoss7ManangementException.class)
- public void cannotUndeployNondeployed() throws JBoss7ManangementException {
+ @Test(expected = JBoss7ManangerException.class)
+ public void cannotUndeployNondeployed() throws JBoss7ManangerException {
DetypedDeployer.undeploy("inexistant", AS7ManagerTestUtils.HOST, AS7ManagerTestUtils.MGMT_PORT);
}
Modified: trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementServiceIntegrationTest.java
===================================================================
--- trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementServiceIntegrationTest.java 2011-04-23 21:56:54 UTC (rev 30809)
+++ trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementServiceIntegrationTest.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -14,7 +14,7 @@
import java.net.UnknownHostException;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7ManagementService;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7Manager;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -43,10 +43,10 @@
public void serviceIsReachable() throws BundleException {
ensureDSIsRunning();
BundleContext context = Activator.getContext();
- ServiceReference<IJBoss7ManagementService> reference =
- context.getServiceReference(IJBoss7ManagementService.class);
+ ServiceReference<IJBoss7Manager> reference =
+ context.getServiceReference(IJBoss7Manager.class);
assertNotNull(reference);
- IJBoss7ManagementService service = context.getService(reference);
+ IJBoss7Manager service = context.getService(reference);
assertNotNull(service);
}
@@ -56,7 +56,7 @@
Bundle bundle = getDSBundle();
assertNotNull(
DS_BUNDLEID + " not installed. You have to install the declarative services daemon so that "
- + IJBoss7ManagementService.class + " service is registered"
+ + IJBoss7Manager.class + " service is registered"
, bundle);
if (bundle.getState() != Bundle.ACTIVE) {
bundle.start();
Deleted: 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-23 21:56:54 UTC (rev 30809)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7DeploymentManager.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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 java.io.File;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-
-/**
- *
- * This class is interim API and may change drastically
- * as development on the application server continues.
- * I expect credentials to be required eventually,
- * and the API will need to adjust to handle them.
- *
- */
-public interface IJBoss7DeploymentManager {
- /**
- * Asynchronously deploy a file to a server
- *
- * @param host The host
- * @param port The port
- * @param name The deployment's name
- * @param file The file to be deployed
- * @param monitor The progress monitor
- *
- * @return Not sure what to return yet
- * @throws Exception
- */
- public IJBoss7DeploymentResult deployAsync(String host, int port,
- String deploymentName, File file, IProgressMonitor monitor) throws Exception;
-
- /**
- * Synchronously deploy a file to a server
- *
- * @param host The host
- * @param port The port
- * @param name The deployment's name
- * @param file The file to be deployed
- * @param monitor The progress monitor
- *
- * @return Not sure what to return yet
- * @throws Exception
- */
- public IJBoss7DeploymentResult deploySync(String host, int port,
- String deploymentName, File file, IProgressMonitor monitor) throws Exception;
-
-
- /**
- * Asynchronously undeploy a file to a server
- *
- * @param host The host
- * @param port The port
- * @param name The deployment's name
- * @param file The file to be deployed
- * @param monitor The progress monitor
- *
- * @return Not sure what to return yet
- * @throws Exception
- */
- public IJBoss7DeploymentResult undeployAsync(String host, int port,
- String deploymentName, boolean removeFile, IProgressMonitor monitor) throws Exception;
-
-
- /**
- * Synchronously undeploy a file to a server
- *
- * @param host The host
- * @param port The port
- * @param name The deployment's name
- * @param file The file to be deployed
- * @param monitor The progress monitor
- *
- * @return Not sure what to return yet
- * @throws Exception
- */
- public IJBoss7DeploymentResult syncUndeploy(String host, int port,
- String deploymentName, boolean removeFile, IProgressMonitor monitor) throws Exception;
-
- /**
- * Returns the state for a given deployment name on a given host and port.
- *
- * @param host the host to query
- * @param port the port to contact it on
- * @param deploymentName the name of the deployment that shall be queried
- *
- * @return the state of the deployment
- * @throws Exception
- */
- public JBoss7DeploymentState getDeploymentState(String host, int port, String deploymentName) throws Exception;
-
-}
Modified: 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 2011-04-23 21:56:54 UTC (rev 30809)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7DeploymentResult.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -14,6 +14,6 @@
public interface IJBoss7DeploymentResult {
- public abstract IStatus getStatus() throws JBoss7ManangementException;
+ public abstract IStatus getStatus() throws JBoss7ManangerException;
}
\ No newline at end of file
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementInterface.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementInterface.java 2011-04-23 21:56:54 UTC (rev 30809)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementInterface.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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;
-
-public interface IJBoss7ManagementInterface {
- /**
- * Need a method to build a request...
- * we can't just expose the entire ModelNode api, but,
- * we need a good way for them to be able to build such nodes
- */
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementService.java 2011-04-23 21:56:54 UTC (rev 30809)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementService.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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;
-
-/**
- * This class may belong in the main JBoss AS core plugin,
- * in case several different plugins need to implement it
- */
-public interface IJBoss7ManagementService {
-
- public static final String AS_VERSION_PROPERTY = "as.version"; //$NON-NLS-1$
-
- public static final String AS_VERSION_700 = "700"; //$NON-NLS-1$
-
- /**
- * Get a manager which can be responsible *only* for
- * deployments, both synchronously and asynchronously.
- * @return
- */
- public IJBoss7DeploymentManager getDeploymentManager() throws JBoss7ManangementException;
-
- /**
- * Get an interface which can handle executing any and all remote
- * management tasks via wrappers of more raw APIs.
- *
- * @return
- */
- public IJBoss7ManagementInterface getManagementInterface() throws JBoss7ManangementException;
-}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7Manager.java (from rev 30808, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementService.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7Manager.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7Manager.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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 java.io.File;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+public interface IJBoss7Manager {
+
+ public static final String AS_VERSION_PROPERTY = "as.version"; //$NON-NLS-1$
+
+ public static final String AS_VERSION_700 = "700"; //$NON-NLS-1$
+
+ /**
+ * Asynchronously deploy a file to a server
+ *
+ * @param host The host
+ * @param port The port
+ * @param name The deployment's name
+ * @param file The file to be deployed
+ * @param monitor The progress monitor
+ *
+ * @return Not sure what to return yet
+ * @throws Exception
+ */
+ public IJBoss7DeploymentResult deployAsync(String host, int port,
+ String deploymentName, File file, IProgressMonitor monitor) throws Exception;
+
+ /**
+ * Synchronously deploy a file to a server
+ *
+ * @param host The host
+ * @param port The port
+ * @param name The deployment's name
+ * @param file The file to be deployed
+ * @param monitor The progress monitor
+ *
+ * @return Not sure what to return yet
+ * @throws Exception
+ */
+ public IJBoss7DeploymentResult deploySync(String host, int port,
+ String deploymentName, File file, IProgressMonitor monitor) throws Exception;
+
+ /**
+ * Asynchronously undeploy a file to a server
+ *
+ * @param host The host
+ * @param port The port
+ * @param name The deployment's name
+ * @param file The file to be deployed
+ * @param monitor The progress monitor
+ *
+ * @return Not sure what to return yet
+ * @throws Exception
+ */
+ public IJBoss7DeploymentResult undeployAsync(String host, int port,
+ String deploymentName, boolean removeFile, IProgressMonitor monitor) throws Exception;
+
+ /**
+ * Synchronously undeploy a file to a server
+ *
+ * @param host The host
+ * @param port The port
+ * @param name The deployment's name
+ * @param file The file to be deployed
+ * @param monitor The progress monitor
+ *
+ * @return Not sure what to return yet
+ * @throws Exception
+ */
+ public IJBoss7DeploymentResult syncUndeploy(String host, int port,
+ String deploymentName, boolean removeFile, IProgressMonitor monitor) throws Exception;
+
+ /**
+ * Returns the state for a given deployment name on a given host and port.
+ *
+ * @param host the host to query
+ * @param port the port to contact it on
+ * @param deploymentName the name of the deployment that shall be queried
+ *
+ * @return the state of the deployment
+ * @throws Exception
+ */
+ public JBoss7DeploymentState getDeploymentState(String host, int port, String deploymentName) throws Exception;
+
+}
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-23 21:56:54 UTC (rev 30809)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -58,7 +58,7 @@
IServer server, IModule[] module,
int publishType, IModuleResourceDelta[] delta,
IProgressMonitor monitor) throws CoreException {
- //IJBoss7ManagementService service = JBoss7ManagementUtil.findManagementService(server);
+ //IJBoss7Manager service = JBoss7ManagerUtil.findManagementService(server);
// jboss-7 specific
IDeployableServer ds = ServerConverter.getDeployableServer(server);
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagementUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagementUtil.java 2011-04-23 21:56:54 UTC (rev 30809)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagementUtil.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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 java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-
-public class JBoss7ManagementUtil {
-
- public static final String SERVICE_VERSION_70 = "org.jboss.ide.eclipse.as.management.as7.service"; //$NON-NLS-1$
-
- public static IJBoss7ManagementService findManagementService(IServer server) {
- BundleContext context = JBossServerCorePlugin.getContext();
-
- // String tmp = "org.jboss.ide.eclipse.as.management.as7.service"; //$NON-NLS-1$
- // String clazz = "org.jboss.ide.eclipse.as.management.as7.deployment.JBossManagementService"; //$NON-NLS-1$
- // String iface = "IJBoss7ManagementService"; //$NON-NLS-1$
- // String clazz3 = "org.jboss.ide.eclipse.as.core.server.internal.v7." + iface; //$NON-NLS-1$
- String requiredService = getRequiredServiceName(server);
- if (requiredService == null)
- return null;
-
- try {
- Collection<ServiceReference<IJBoss7ManagementService>> references = context.getServiceReferences(
- IJBoss7ManagementService.class, null);
- for (Iterator<ServiceReference<IJBoss7ManagementService>> iterator = references.iterator();
- iterator.hasNext();) {
- ServiceReference<IJBoss7ManagementService> reference = iterator.next();
- Object compName = reference.getProperty("component.name"); //$NON-NLS-1$
- if (requiredService.equals(compName)) {
- return context.getService(reference);
- }
- }
- } catch (InvalidSyntaxException ise) {
- }
- return null;
- }
-
- private static String getRequiredServiceName(IServer s) {
- // TODO if required, make sure to add new versions here
- return SERVICE_VERSION_70;
- }
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagentServiceProxy.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagentServiceProxy.java 2011-04-23 21:56:54 UTC (rev 30809)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagentServiceProxy.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -1,35 +0,0 @@
-package org.jboss.ide.eclipse.as.core.server.internal.v7;
-
-import java.text.MessageFormat;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.util.tracker.ServiceTracker;
-
-public class JBoss7ManagentServiceProxy extends ServiceTracker<IJBoss7ManagementService, IJBoss7ManagementService>
- implements IJBoss7ManagementService {
-
- public JBoss7ManagentServiceProxy(BundleContext context, String asVersion) throws InvalidSyntaxException {
- super(
- context,
- context.createFilter(MessageFormat
- .format("(&(objectClass={0})(as.version={1}))", IJBoss7ManagementService.class.getCanonicalName(), asVersion)), null); //$NON-NLS-1$
- }
-
- public IJBoss7DeploymentManager getDeploymentManager() throws JBoss7ManangementException {
-
- return checkedGetService().getDeploymentManager();
- }
-
- public IJBoss7ManagementInterface getManagementInterface() throws JBoss7ManangementException {
- return checkedGetService().getManagementInterface();
- }
-
- private IJBoss7ManagementService checkedGetService() throws JBoss7ManangementException {
- IJBoss7ManagementService service = getService();
- if (service == null) {
- throw new JBoss7ManangementException("Could not acquire JBoss Management service"); //$NON-NLS-1$
- }
- return service;
- }
-}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerProxy.java (from rev 30809, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagentServiceProxy.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerProxy.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerProxy.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -0,0 +1,53 @@
+package org.jboss.ide.eclipse.as.core.server.internal.v7;
+
+import java.io.File;
+import java.text.MessageFormat;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.util.tracker.ServiceTracker;
+
+public class JBoss7ManagerProxy extends ServiceTracker<IJBoss7Manager, IJBoss7Manager>
+ implements IJBoss7Manager {
+
+ public JBoss7ManagerProxy(BundleContext context, String asVersion) throws InvalidSyntaxException {
+ super(
+ context,
+ context.createFilter(MessageFormat
+ .format("(&(objectClass={0})(as.version={1}))", IJBoss7Manager.class.getCanonicalName(), asVersion)), null); //$NON-NLS-1$
+ }
+
+ public IJBoss7DeploymentResult deployAsync(String host, int port, String deploymentName, File file,
+ IProgressMonitor monitor) throws Exception {
+ return checkedGetService().deployAsync(host, port, deploymentName, file, monitor);
+ }
+
+ public IJBoss7DeploymentResult deploySync(String host, int port, String deploymentName, File file,
+ IProgressMonitor monitor) throws Exception {
+ return checkedGetService().deployAsync(host, port, deploymentName, file, monitor);
+ }
+
+ public IJBoss7DeploymentResult undeployAsync(String host, int port, String deploymentName, boolean removeFile,
+ IProgressMonitor monitor) throws Exception {
+ return checkedGetService().undeployAsync(host, port, deploymentName, removeFile, monitor);
+ }
+
+ public IJBoss7DeploymentResult syncUndeploy(String host, int port, String deploymentName, boolean removeFile,
+ IProgressMonitor monitor) throws Exception {
+ return checkedGetService().syncUndeploy(host, port, deploymentName, removeFile, monitor);
+ }
+
+ public JBoss7DeploymentState getDeploymentState(String host, int port, String deploymentName) throws Exception {
+ return checkedGetService().getDeploymentState(host, port, deploymentName);
+ }
+
+ private IJBoss7Manager checkedGetService() throws JBoss7ManangerException {
+ IJBoss7Manager service = getService();
+ if (service == null) {
+ throw new JBoss7ManangerException("Could not acquire JBoss Management service"); //$NON-NLS-1$
+ }
+ return service;
+ }
+
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerProxy.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/JBoss7ManagerUtil.java (from rev 30808, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagementUtil.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerUtil.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerUtil.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.osgi.framework.BundleContext;
+
+public class JBoss7ManagerUtil {
+
+ public static final String SERVICE_VERSION_70 = "org.jboss.ide.eclipse.as.management.as7.service"; //$NON-NLS-1$
+
+ public static IJBoss7Manager findManagementService(IServer server) throws Exception {
+ BundleContext context = JBossServerCorePlugin.getContext();
+ return new JBoss7ManagerProxy(context, getRequiredVersion(server));
+ }
+
+ private static String getRequiredVersion(IServer server) {
+ return IJBoss7Manager.AS_VERSION_700;
+ }
+}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangementException.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangementException.java 2011-04-23 21:56:54 UTC (rev 30809)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangementException.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -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.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);
- }
-
-}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangerException.java (from rev 30773, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangementException.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangerException.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManangerException.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -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 JBoss7ManangerException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ public JBoss7ManangerException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public JBoss7ManangerException(Throwable cause) {
+ super(cause);
+ }
+
+ public JBoss7ManangerException(String message) {
+ super(message);
+ }
+
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/jboss-management-service.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/jboss-management-service.xml 2011-04-23 21:56:54 UTC (rev 30809)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/jboss-management-service.xml 2011-04-23 22:51:24 UTC (rev 30810)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.jboss.ide.eclipse.as.management.as7.service">
- <implementation class="org.jboss.ide.eclipse.as.management.as7.deployment.JBossManagementService"/>
+ <implementation class="org.jboss.ide.eclipse.as.management.as7.deployment.JBoss7Manager"/>
<service>
- <provide interface="org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7ManagementService"/>
+ <provide interface="org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7Manager"/>
</service>
<property name="as.version" type="String" value="700"/>
</scr:component>
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-23 21:56:54 UTC (rev 30809)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7Manager.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -33,7 +33,7 @@
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.JBoss7ManangerException;
import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentResult;
/**
@@ -50,72 +50,72 @@
}
public IJBoss7DeploymentResult undeploySync(String name, IProgressMonitor monitor)
- throws JBoss7ManangementException {
+ throws JBoss7ManangerException {
IJBoss7DeploymentResult result = undeploy(name);
result.getStatus();
return result;
}
public IJBoss7DeploymentResult deploySync(String name, File file, IProgressMonitor monitor)
- throws JBoss7ManangementException {
+ throws JBoss7ManangerException {
IJBoss7DeploymentResult result = deploy(name, file);
result.getStatus();
return result;
}
- public IJBoss7DeploymentResult undeploy(String name) throws JBoss7ManangementException {
+ public IJBoss7DeploymentResult undeploy(String name) throws JBoss7ManangerException {
try {
DeploymentPlanBuilder builder = manager.newDeploymentPlan();
builder = builder.undeploy(name).andRemoveUndeployed();
return new DeploymentOperationResult(builder.getLastAction(), manager.execute(builder.build()));
} catch (Exception e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
}
}
- public IJBoss7DeploymentResult remove(String name) throws JBoss7ManangementException {
+ public IJBoss7DeploymentResult remove(String name) throws JBoss7ManangerException {
try {
DeploymentPlanBuilder builder = manager.newDeploymentPlan();
builder = builder.remove(name);
return new DeploymentOperationResult(builder.getLastAction(), manager.execute(builder.build()));
} catch (Exception e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
}
}
- public IJBoss7DeploymentResult deploy(File file) throws JBoss7ManangementException {
+ public IJBoss7DeploymentResult deploy(File file) throws JBoss7ManangerException {
return deploy(file.getName(), file);
}
- public IJBoss7DeploymentResult add(String name, File file) throws JBoss7ManangementException {
+ public IJBoss7DeploymentResult add(String name, File file) throws JBoss7ManangerException {
try {
return execute(manager.newDeploymentPlan().add(name, file));
} catch (IOException e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
}
}
- public IJBoss7DeploymentResult deploy(String name, File file) throws JBoss7ManangementException {
+ public IJBoss7DeploymentResult deploy(String name, File file) throws JBoss7ManangerException {
try {
return execute(manager.newDeploymentPlan().add(name, file).andDeploy());
} catch (IOException e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
}
}
- public IJBoss7DeploymentResult replace(File file) throws JBoss7ManangementException {
+ public IJBoss7DeploymentResult replace(File file) throws JBoss7ManangerException {
return replace(file.getName(), file);
}
- public IJBoss7DeploymentResult replace(String name, File file) throws JBoss7ManangementException {
+ public IJBoss7DeploymentResult replace(String name, File file) throws JBoss7ManangerException {
try {
return execute(manager.newDeploymentPlan().replace(name, file));
} catch (IOException e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
}
}
- public JBoss7DeploymentState getDeploymentState(String name) throws JBoss7ManangementException {
+ public JBoss7DeploymentState getDeploymentState(String name) throws JBoss7ManangerException {
ModelNode request = new ModelNode();
request.get(OP).set(READ_RESOURCE_OPERATION);
request.get(ADDRESS).add(DEPLOYMENT, name);
@@ -123,7 +123,7 @@
Boolean enabled = AS7ManagerUtil.getBooleanProperty(ENABLED, result);
if (enabled == null) {
- throw new JBoss7ManangementException(
+ throw new JBoss7ManangerException(
MessageFormat.format("Could not evaluate state for deployment {0}", name));
} else if (enabled) {
return JBoss7DeploymentState.STARTED;
@@ -137,27 +137,27 @@
StreamUtils.safeClose(client);
}
- private ModelNode execute(ModelNode node) throws JBoss7ManangementException {
+ private ModelNode execute(ModelNode node) throws JBoss7ManangerException {
try {
ModelNode response = client.execute(node);
if (!AS7ManagerUtil.isSuccess(response)) {
- throw new JBoss7ManangementException(
+ throw new JBoss7ManangerException(
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 JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
}
}
- private IJBoss7DeploymentResult execute(DeploymentPlanBuilder builder) throws JBoss7ManangementException {
+ private IJBoss7DeploymentResult execute(DeploymentPlanBuilder builder) throws JBoss7ManangerException {
try {
DeploymentAction action = builder.getLastAction();
Future<ServerDeploymentPlanResult> planResult = manager.execute(builder.build());
return new DeploymentOperationResult(action, planResult);
} catch (Exception e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(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-23 21:56:54 UTC (rev 30809)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/AS7ManagerUtil.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -28,7 +28,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.core.server.internal.v7.JBoss7ManangerException;
import org.jboss.ide.eclipse.as.management.as7.internal.DefaultOperationRequestBuilder;
import org.jboss.ide.eclipse.as.management.as7.internal.OperationFormatException;
@@ -138,7 +138,7 @@
return Boolean.valueOf(value);
}
- public static ModelNode execute(Operation operation, ModelControllerClient client) throws JBoss7ManangementException {
+ public static ModelNode execute(Operation operation, ModelControllerClient client) throws JBoss7ManangerException {
try {
ModelNode result = client.execute(operation);
if (result.hasDefined(OUTCOME)
@@ -146,13 +146,13 @@
return result.get(RESULT);
}
else if (result.hasDefined(FAILURE_DESCRIPTION)) {
- throw new JBoss7ManangementException(result.get(FAILURE_DESCRIPTION).toString());
+ throw new JBoss7ManangerException(result.get(FAILURE_DESCRIPTION).toString());
}
else {
- throw new JBoss7ManangementException("Operation outcome is " + result.get(OUTCOME).asString());
+ throw new JBoss7ManangerException("Operation outcome is " + result.get(OUTCOME).asString());
}
} catch (IOException e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
}
}
}
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-23 21:56:54 UTC (rev 30809)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DeploymentOperationResult.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -19,7 +19,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.core.server.internal.v7.JBoss7ManangerException;
import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentResult;
import org.jboss.ide.eclipse.as.management.as7.Activator;
@@ -45,12 +45,12 @@
* @see org.jboss.ide.eclipse.as.management.as7.deployment.IDeploymentResult#getStatus()
*/
@Override
- public IStatus getStatus() throws JBoss7ManangementException {
+ public IStatus getStatus() throws JBoss7ManangerException {
try {
ServerDeploymentActionResult actionResult = planResult.get().getDeploymentActionResult(action.getId());
return createStatus(action.getDeploymentUnitUniqueName(), action.getType().name(), actionResult);
} catch (Exception e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
}
}
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-23 21:56:54 UTC (rev 30809)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/DetypedDeployer.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -32,14 +32,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;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangerException;
/**
* @author André Dietisheim
*/
public class DetypedDeployer {
- public static void undeploy(String name, String host, int port) throws JBoss7ManangementException {
+ public static void undeploy(String name, String host, int port) throws JBoss7ManangerException {
ModelControllerClient client = null;
try {
client = ModelControllerClient.Factory.create(host, port);
@@ -53,13 +53,13 @@
remove(name, host, port);
} catch (Exception e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
} finally {
StreamUtils.safeClose(client);
}
}
- public static void remove(String name, String host, int port) throws JBoss7ManangementException {
+ public static void remove(String name, String host, int port) throws JBoss7ManangerException {
ModelControllerClient client = null;
try {
client = ModelControllerClient.Factory.create(host, port);
@@ -70,17 +70,17 @@
request.get(ADDRESS).add(DEPLOYMENT, name);
client.execute(request);
} catch (Exception e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
} finally {
StreamUtils.safeClose(client);
}
}
- public static void deploy(File file, String host, int port) throws JBoss7ManangementException {
+ public static void deploy(File file, String host, int port) throws JBoss7ManangerException {
deploy(file.getName(), file, host, port);
}
- public static void deploy(String name, File file, String host, int port) throws JBoss7ManangementException {
+ public static void deploy(String name, File file, String host, int port) throws JBoss7ManangerException {
ModelControllerClient client = null;
try {
client = ModelControllerClient.Factory.create(host, port);
@@ -100,13 +100,13 @@
throwOnFailure(result);
} catch (Exception e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
} finally {
StreamUtils.safeClose(client);
}
}
- public static void replace(String name, File file, String host, int port) throws JBoss7ManangementException {
+ public static void replace(String name, File file, String host, int port) throws JBoss7ManangerException {
ModelControllerClient client = null;
try {
client = ModelControllerClient.Factory.create(host, port);
@@ -124,7 +124,7 @@
throwOnFailure(result);
} catch (Exception e) {
- throw new JBoss7ManangementException(e);
+ throw new JBoss7ManangerException(e);
} finally {
StreamUtils.safeClose(client);
}
@@ -144,9 +144,9 @@
return AS7ManagerUtil.getDeployments(client);
}
- private static void throwOnFailure(ModelNode result) throws JBoss7ManangementException {
+ private static void throwOnFailure(ModelNode result) throws JBoss7ManangerException {
if (!AS7ManagerUtil.isSuccess(result)) {
- throw new JBoss7ManangementException(AS7ManagerUtil.getFailureDescription(result));
+ throw new JBoss7ManangerException(AS7ManagerUtil.getFailureDescription(result));
}
}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBoss7Manager.java (from rev 30804, 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/JBoss7Manager.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBoss7Manager.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.management.as7.deployment;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentResult;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7Manager;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7DeploymentState;
+
+/**
+ * @author Rob Stryker
+ */
+public class JBoss7Manager implements IJBoss7Manager {
+
+ 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 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 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 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 JBoss7DeploymentState getDeploymentState(String host, int port, String deploymentName) throws Exception {
+ AS7Manager manager = new AS7Manager(host, port);
+ return manager.getDeploymentState(deploymentName);
+ }
+}
Deleted: 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-23 21:56:54 UTC (rev 30809)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBossDeploymentManager.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.management.as7.deployment;
-
-import java.io.File;
-
-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 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 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 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 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 JBoss7DeploymentState getDeploymentState(String host, int port, String deploymentName) throws Exception {
- AS7Manager manager = new AS7Manager(host, port);
- return manager.getDeploymentState(deploymentName);
-
- }
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBossManagementService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBossManagementService.java 2011-04-23 21:56:54 UTC (rev 30809)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/src/org/jboss/ide/eclipse/as/management/as7/deployment/JBossManagementService.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.management.as7.deployment;
-
-import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentManager;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7ManagementInterface;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7ManagementService;
-
-/**
- * @author Rob Stryker
- */
-public class JBossManagementService implements IJBoss7ManagementService {
-
- private IJBoss7DeploymentManager deploymentManager = null;
- private IJBoss7ManagementInterface manager = null;
-
- public IJBoss7DeploymentManager getDeploymentManager() {
- if( deploymentManager == null )
- deploymentManager = new JBossDeploymentManager();
- return deploymentManager;
- }
-
- public IJBoss7ManagementInterface getManagementInterface() {
- // TODO Auto-generated method stub
- return null;
- }
-}
Deleted: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSerivceTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSerivceTest.java 2011-04-23 21:56:54 UTC (rev 30809)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSerivceTest.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -1,72 +0,0 @@
-package org.jboss.ide.eclipse.as.test.server;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentManager;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7ManagementInterface;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7ManagementService;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManagentServiceProxy;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
-import org.jboss.ide.eclipse.as.test.ASTest;
-import org.junit.Test;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-
-public class JBossManagentSerivceTest {
-
- @Test
- public void canUseService() throws JBoss7ManangementException, InvalidSyntaxException {
- BundleContext context = ASTest.getContext();
- JBoss7ManagentServiceProxy serviceProxy = new JBoss7ManagentServiceProxy(context,
- IJBoss7ManagementService.AS_VERSION_700);
- serviceProxy.open();
- IJBoss7DeploymentManager manager = serviceProxy.getDeploymentManager();
- assertNotNull(manager);
- }
-
- @Test
- public void canUseServiceEvenIfAlternativeIsRegistered() throws JBoss7ManangementException, InvalidSyntaxException {
- BundleContext context = ASTest.getDefault().getBundle().getBundleContext();
- registerFakeASService("710");
- JBoss7ManagentServiceProxy serviceProxy = new JBoss7ManagentServiceProxy(context,
- IJBoss7ManagementService.AS_VERSION_700);
- serviceProxy.open();
- IJBoss7DeploymentManager manager = serviceProxy.getDeploymentManager();
- assertNotNull(manager);
- }
-
- @Test(expected = UnsupportedOperationException.class)
- public void canUseAlternative() throws JBoss7ManangementException, InvalidSyntaxException {
- BundleContext context = ASTest.getDefault().getBundle().getBundleContext();
- registerFakeASService("710");
- JBoss7ManagentServiceProxy serviceProxy =
- new JBoss7ManagentServiceProxy(context, "710");
- serviceProxy.open();
- IJBoss7DeploymentManager manager = serviceProxy.getDeploymentManager();
- assertNotNull(manager);
- }
-
- private void registerFakeASService(String version) {
- Dictionary<String, String> serviceProperties = new Hashtable<String, String>();
- serviceProperties.put(IJBoss7ManagementService.AS_VERSION_PROPERTY, version);
- ASTest.getContext().registerService(IJBoss7ManagementService.class, new JBoss71ManagementService(),
- serviceProperties);
- }
-
- private static class JBoss71ManagementService implements IJBoss7ManagementService {
-
- @Override
- public IJBoss7DeploymentManager getDeploymentManager() throws JBoss7ManangementException {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public IJBoss7ManagementInterface getManagementInterface() throws JBoss7ManangementException {
- throw new UnsupportedOperationException();
- }
-
- }
-}
Copied: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagerTest.java (from rev 30809, trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSerivceTest.java)
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagerTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagerTest.java 2011-04-23 22:51:24 UTC (rev 30810)
@@ -0,0 +1,94 @@
+package org.jboss.ide.eclipse.as.test.server;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.io.File;
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentResult;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7Manager;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7DeploymentState;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManagerProxy;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangerException;
+import org.jboss.ide.eclipse.as.test.ASTest;
+import org.junit.Test;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+
+public class JBossManagerTest {
+
+ @Test
+ public void canUseService() throws JBoss7ManangerException, InvalidSyntaxException {
+ BundleContext context = ASTest.getContext();
+ JBoss7ManagerProxy serviceProxy = new JBoss7ManagerProxy(context,
+ IJBoss7Manager.AS_VERSION_700);
+ serviceProxy.open();
+ IJBoss7Manager manager = serviceProxy.getService();
+ assertNotNull(manager);
+ }
+
+ @Test
+ public void canUseServiceEvenIfAlternativeIsRegistered() throws JBoss7ManangerException, InvalidSyntaxException {
+ BundleContext context = ASTest.getDefault().getBundle().getBundleContext();
+ registerFakeASService("710");
+ JBoss7ManagerProxy serviceProxy =
+ new JBoss7ManagerProxy(context, IJBoss7Manager.AS_VERSION_700);
+ serviceProxy.open();
+ IJBoss7Manager manager = serviceProxy.getService();
+ assertNotNull(manager);
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void canUseAlternative() throws Exception {
+ BundleContext context = ASTest.getDefault().getBundle().getBundleContext();
+ registerFakeASService("710");
+ JBoss7ManagerProxy managerProxy =
+ new JBoss7ManagerProxy(context, "710");
+ managerProxy.open();
+ IJBoss7Manager manager = managerProxy.getService();
+ assertNotNull(manager);
+ manager.getDeploymentState("fake", 4242, "fake");
+ }
+
+ private void registerFakeASService(String version) {
+ Dictionary<String, String> serviceProperties = new Hashtable<String, String>();
+ serviceProperties.put(IJBoss7Manager.AS_VERSION_PROPERTY, version);
+ ASTest.getContext().registerService(IJBoss7Manager.class, new JBoss71Manager(),
+ serviceProperties);
+ }
+
+ private static class JBoss71Manager implements IJBoss7Manager {
+
+ @Override
+ public IJBoss7DeploymentResult deployAsync(String host, int port, String deploymentName, File file,
+ IProgressMonitor monitor) throws JBoss7ManangerException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public IJBoss7DeploymentResult deploySync(String host, int port, String deploymentName, File file,
+ IProgressMonitor monitor) throws JBoss7ManangerException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public IJBoss7DeploymentResult undeployAsync(String host, int port, String deploymentName, boolean removeFile,
+ IProgressMonitor monitor) throws JBoss7ManangerException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public IJBoss7DeploymentResult syncUndeploy(String host, int port, String deploymentName, boolean removeFile,
+ IProgressMonitor monitor) throws JBoss7ManangerException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public JBoss7DeploymentState getDeploymentState(String host, int port, String deploymentName)
+ throws JBoss7ManangerException {
+ throw new UnsupportedOperationException();
+ }
+ }
+}
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagerTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years, 11 months
JBoss Tools SVN: r30809 - in trunk/as: tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-04-23 17:56:54 -0400 (Sat, 23 Apr 2011)
New Revision: 30809
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSerivceTest.java
Removed:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSeriveTest.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagentServiceProxy.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTest.java
Log:
[JBIDE-8784] added service availability test, added server version property & constant
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagentServiceProxy.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagentServiceProxy.java 2011-04-23 21:21:00 UTC (rev 30808)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagentServiceProxy.java 2011-04-23 21:56:54 UTC (rev 30809)
@@ -3,16 +3,17 @@
import java.text.MessageFormat;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
import org.osgi.util.tracker.ServiceTracker;
public class JBoss7ManagentServiceProxy extends ServiceTracker<IJBoss7ManagementService, IJBoss7ManagementService>
implements IJBoss7ManagementService {
- private static final String FILTER_EXPRESSION =
- "(&(objectClass=" + IJBoss7ManagementService.class.getCanonicalName() + ")(as.version={0}))"; //$NON-NLS-1$ //$NON-NLS-2$
-
- public JBoss7ManagentServiceProxy(BundleContext context, String asVersion) {
- super(context, MessageFormat.format(FILTER_EXPRESSION, asVersion), null);
+ public JBoss7ManagentServiceProxy(BundleContext context, String asVersion) throws InvalidSyntaxException {
+ super(
+ context,
+ context.createFilter(MessageFormat
+ .format("(&(objectClass={0})(as.version={1}))", IJBoss7ManagementService.class.getCanonicalName(), asVersion)), null); //$NON-NLS-1$
}
public IJBoss7DeploymentManager getDeploymentManager() throws JBoss7ManangementException {
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTest.java 2011-04-23 21:21:00 UTC (rev 30808)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/ASTest.java 2011-04-23 21:56:54 UTC (rev 30809)
@@ -26,7 +26,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Plugin;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
-import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.osgi.framework.BundleContext;
/**
@@ -73,8 +72,10 @@
return plugin;
}
+ public static BundleContext getContext() {
+ return plugin.getBundle().getBundleContext();
+ }
-
// set some constants for wide-use
public static final String TOMCAT_RUNTIME_55 = "org.eclipse.jst.server.tomcat.runtime.55";
public static final String JBOSS_AS_32_HOME = System.getProperty("jbosstools.test.jboss.home.3.2", "C:\\apps\\jboss\\jboss-3.2.8.SP1\\");
Copied: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSerivceTest.java (from rev 30808, trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSeriveTest.java)
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSerivceTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSerivceTest.java 2011-04-23 21:56:54 UTC (rev 30809)
@@ -0,0 +1,72 @@
+package org.jboss.ide.eclipse.as.test.server;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentManager;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7ManagementInterface;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7ManagementService;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManagentServiceProxy;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
+import org.jboss.ide.eclipse.as.test.ASTest;
+import org.junit.Test;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+
+public class JBossManagentSerivceTest {
+
+ @Test
+ public void canUseService() throws JBoss7ManangementException, InvalidSyntaxException {
+ BundleContext context = ASTest.getContext();
+ JBoss7ManagentServiceProxy serviceProxy = new JBoss7ManagentServiceProxy(context,
+ IJBoss7ManagementService.AS_VERSION_700);
+ serviceProxy.open();
+ IJBoss7DeploymentManager manager = serviceProxy.getDeploymentManager();
+ assertNotNull(manager);
+ }
+
+ @Test
+ public void canUseServiceEvenIfAlternativeIsRegistered() throws JBoss7ManangementException, InvalidSyntaxException {
+ BundleContext context = ASTest.getDefault().getBundle().getBundleContext();
+ registerFakeASService("710");
+ JBoss7ManagentServiceProxy serviceProxy = new JBoss7ManagentServiceProxy(context,
+ IJBoss7ManagementService.AS_VERSION_700);
+ serviceProxy.open();
+ IJBoss7DeploymentManager manager = serviceProxy.getDeploymentManager();
+ assertNotNull(manager);
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void canUseAlternative() throws JBoss7ManangementException, InvalidSyntaxException {
+ BundleContext context = ASTest.getDefault().getBundle().getBundleContext();
+ registerFakeASService("710");
+ JBoss7ManagentServiceProxy serviceProxy =
+ new JBoss7ManagentServiceProxy(context, "710");
+ serviceProxy.open();
+ IJBoss7DeploymentManager manager = serviceProxy.getDeploymentManager();
+ assertNotNull(manager);
+ }
+
+ private void registerFakeASService(String version) {
+ Dictionary<String, String> serviceProperties = new Hashtable<String, String>();
+ serviceProperties.put(IJBoss7ManagementService.AS_VERSION_PROPERTY, version);
+ ASTest.getContext().registerService(IJBoss7ManagementService.class, new JBoss71ManagementService(),
+ serviceProperties);
+ }
+
+ private static class JBoss71ManagementService implements IJBoss7ManagementService {
+
+ @Override
+ public IJBoss7DeploymentManager getDeploymentManager() throws JBoss7ManangementException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public IJBoss7ManagementInterface getManagementInterface() throws JBoss7ManangementException {
+ throw new UnsupportedOperationException();
+ }
+
+ }
+}
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSerivceTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSeriveTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSeriveTest.java 2011-04-23 21:21:00 UTC (rev 30808)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSeriveTest.java 2011-04-23 21:56:54 UTC (rev 30809)
@@ -1,24 +0,0 @@
-package org.jboss.ide.eclipse.as.test.server;
-
-import static org.junit.Assert.assertNotNull;
-
-import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentManager;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7ManagementService;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManagentServiceProxy;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
-import org.jboss.ide.eclipse.as.test.ASTest;
-import org.junit.Test;
-import org.osgi.framework.BundleContext;
-
-public class JBossManagentSeriveTest {
-
- @Test
- public void canUseService() throws JBoss7ManangementException {
- BundleContext context = ASTest.getDefault().getBundle().getBundleContext();
- JBoss7ManagentServiceProxy serviceProxy = new JBoss7ManagentServiceProxy(context, IJBoss7ManagementService.AS_VERSION_700);
- serviceProxy.open();
- IJBoss7DeploymentManager manager = serviceProxy.getDeploymentManager();
- assertNotNull(manager);
- }
-
-}
14 years, 11 months
JBoss Tools SVN: r30808 - in trunk/as: plugins/org.jboss.ide.eclipse.as.management.as7/META-INF and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-04-23 17:21:00 -0400 (Sat, 23 Apr 2011)
New Revision: 30808
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagentServiceProxy.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSeriveTest.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementService.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagementUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/jboss-management-service.xml
Log:
[JBIDE-8784] added service availability test, added server version property & constant
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementService.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementService.java 2011-04-23 16:56:45 UTC (rev 30807)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/IJBoss7ManagementService.java 2011-04-23 21:21:00 UTC (rev 30808)
@@ -15,12 +15,17 @@
* in case several different plugins need to implement it
*/
public interface IJBoss7ManagementService {
+
+ public static final String AS_VERSION_PROPERTY = "as.version"; //$NON-NLS-1$
+
+ public static final String AS_VERSION_700 = "700"; //$NON-NLS-1$
+
/**
* Get a manager which can be responsible *only* for
* deployments, both synchronously and asynchronously.
* @return
*/
- public IJBoss7DeploymentManager getDeploymentManager();
+ public IJBoss7DeploymentManager getDeploymentManager() throws JBoss7ManangementException;
/**
* Get an interface which can handle executing any and all remote
@@ -28,5 +33,5 @@
*
* @return
*/
- public IJBoss7ManagementInterface getManagementInterface();
+ public IJBoss7ManagementInterface getManagementInterface() throws JBoss7ManangementException;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagementUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagementUtil.java 2011-04-23 16:56:45 UTC (rev 30807)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagementUtil.java 2011-04-23 21:21:00 UTC (rev 30808)
@@ -20,7 +20,6 @@
import org.osgi.framework.ServiceReference;
public class JBoss7ManagementUtil {
- public static final String SERVER_VERSION_PROPERTY = "as.version"; //$NON-NLS-1$
public static final String SERVICE_VERSION_70 = "org.jboss.ide.eclipse.as.management.as7.service"; //$NON-NLS-1$
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagentServiceProxy.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagentServiceProxy.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagentServiceProxy.java 2011-04-23 21:21:00 UTC (rev 30808)
@@ -0,0 +1,34 @@
+package org.jboss.ide.eclipse.as.core.server.internal.v7;
+
+import java.text.MessageFormat;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.util.tracker.ServiceTracker;
+
+public class JBoss7ManagentServiceProxy extends ServiceTracker<IJBoss7ManagementService, IJBoss7ManagementService>
+ implements IJBoss7ManagementService {
+
+ private static final String FILTER_EXPRESSION =
+ "(&(objectClass=" + IJBoss7ManagementService.class.getCanonicalName() + ")(as.version={0}))"; //$NON-NLS-1$ //$NON-NLS-2$
+
+ public JBoss7ManagentServiceProxy(BundleContext context, String asVersion) {
+ super(context, MessageFormat.format(FILTER_EXPRESSION, asVersion), null);
+ }
+
+ public IJBoss7DeploymentManager getDeploymentManager() throws JBoss7ManangementException {
+
+ return checkedGetService().getDeploymentManager();
+ }
+
+ public IJBoss7ManagementInterface getManagementInterface() throws JBoss7ManangementException {
+ return checkedGetService().getManagementInterface();
+ }
+
+ private IJBoss7ManagementService checkedGetService() throws JBoss7ManangementException {
+ IJBoss7ManagementService service = getService();
+ if (service == null) {
+ throw new JBoss7ManangementException("Could not acquire JBoss Management service"); //$NON-NLS-1$
+ }
+ return service;
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagentServiceProxy.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/jboss-management-service.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/jboss-management-service.xml 2011-04-23 16:56:45 UTC (rev 30807)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/jboss-management-service.xml 2011-04-23 21:21:00 UTC (rev 30808)
@@ -4,5 +4,5 @@
<service>
<provide interface="org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7ManagementService"/>
</service>
- <property name="as.version" type="String" value="7"/>
+ <property name="as.version" type="String" value="700"/>
</scr:component>
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSeriveTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSeriveTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSeriveTest.java 2011-04-23 21:21:00 UTC (rev 30808)
@@ -0,0 +1,24 @@
+package org.jboss.ide.eclipse.as.test.server;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7DeploymentManager;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7ManagementService;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManagentServiceProxy;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ManangementException;
+import org.jboss.ide.eclipse.as.test.ASTest;
+import org.junit.Test;
+import org.osgi.framework.BundleContext;
+
+public class JBossManagentSeriveTest {
+
+ @Test
+ public void canUseService() throws JBoss7ManangementException {
+ BundleContext context = ASTest.getDefault().getBundle().getBundleContext();
+ JBoss7ManagentServiceProxy serviceProxy = new JBoss7ManagentServiceProxy(context, IJBoss7ManagementService.AS_VERSION_700);
+ serviceProxy.open();
+ IJBoss7DeploymentManager manager = serviceProxy.getDeploymentManager();
+ assertNotNull(manager);
+ }
+
+}
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/JBossManagentSeriveTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years, 11 months
Newsletter Sat, 23 Apr 2011 15:32:21 -0300
by jbosstools-commits@lists.jboss.org
Dear Lady or Gentleman!
Do you want a suitable future, grow in money, and the admiration of all?
Special offer:
We can assist with Diplomas from prestigious universities based on your present knowledge and professional experience.
Get a Degree in 6 weeks with our program!
~Our program will let EVERYONE with professional experience
get a 100% verified Degree:
~Doctorate
~Bachelors
~Masters
- Think about it...
- You can realize YOUR Dreams!
- Live a much better life by earning or upgrading your degree.
This is a splendid 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 Today to start improving your life!
~CONTACT US~
1-305-460-2287
Please leave us a message with your name and phone number with country code if outside USA and we'll call you back as soon as possible.
It's your chance...
Make the right decision.
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: r30807 - /.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-04-23 12:56:45 -0400 (Sat, 23 Apr 2011)
New Revision: 30807
Removed:
cdi/
Log:
Removed empty cdi folder from root.
14 years, 11 months
JBoss Tools SVN: r30806 - trunk/cdi/plugins and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-04-23 12:56:12 -0400 (Sat, 23 Apr 2011)
New Revision: 30806
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext.test/
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/
Removed:
cdi/plugins/org.jboss.tools.cdi.seam.text.ext.test/
cdi/plugins/org.jboss.tools.cdi.seam.text.ext/
Log:
Moved cdi.seam.text.* plugins from root to trunk/cdi/plugins.
14 years, 11 months
JBoss Tools SVN: r30805 - 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-23 09:58:56 -0400 (Sat, 23 Apr 2011)
New Revision: 30805
Added:
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementServiceIntegrationTest.java
Removed:
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementIntegrationTest.java
Modified:
trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagementUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/jboss-management-service.xml
Log:
[JBIDE-8784] added service availability test, added server version property & constant
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-23 11:55:49 UTC (rev 30804)
+++ trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/META-INF/MANIFEST.MF 2011-04-23 13:58:56 UTC (rev 30805)
@@ -11,3 +11,5 @@
org.hamcrest;bundle-version="[1.1.0,2.0.0)"
Bundle-ClassPath: .,
wars/
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.jboss.ide.eclipse.as.management.as7.tests.Activator
Deleted: 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-23 11:55:49 UTC (rev 30804)
+++ trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementIntegrationTest.java 2011-04-23 13:58:56 UTC (rev 30805)
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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.management.as7.tests;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.equalTo;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.UnknownHostException;
-import java.util.concurrent.ExecutionException;
-
-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;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- *
- * @author André Dietisheim
- */
-public class JBossManagementIntegrationTest {
-
- private AS7Manager manager;
-
- @Before
- public void setUp() throws UnknownHostException {
- this.manager = new AS7Manager(AS7ManagerTestUtils.HOST, AS7ManagerTestUtils.MGMT_PORT);
- }
-
- @After
- public void tearDown() {
- manager.dispose();
- }
-
- @Ignore
- @Test
- public void canDeploy() throws Exception {
- File warFile = AS7ManagerTestUtils.getWarFile(AS7ManagerTestUtils.MINIMALISTIC_WAR);
- try {
- AS7ManagerTestUtils.waitUntilFinished(manager.deploy(warFile));
-
- String response = AS7ManagerTestUtils.waitForRespose(
- "minimalistic", AS7ManagerTestUtils.HOST, AS7ManagerTestUtils.WEB_PORT);
- assertTrue(response != null
- && response.indexOf("minimalistic") >= 0);
- } finally {
- AS7ManagerTestUtils.quietlyUndeploy(warFile, manager);
- }
- }
-
- @Ignore
- @Test
- public void deployedWarIsResponding() throws Exception {
- File warFile = AS7ManagerTestUtils.getWarFile(AS7ManagerTestUtils.MINIMALISTIC_WAR);
- try {
- AS7ManagerTestUtils.waitUntilFinished(manager.deploy(warFile));
-
- String response = AS7ManagerTestUtils.waitForRespose(
- "minimalistic", AS7ManagerTestUtils.HOST, AS7ManagerTestUtils.WEB_PORT);
- assertTrue(response != null
- && response.indexOf("minimalistic") >= 0);
-
- } finally {
- AS7ManagerTestUtils.quietlyUndeploy(warFile, manager);
- }
- }
-
- @Ignore
- @Test(expected = JBoss7ManangementException.class)
- public void cannotDeployWarTwice() throws Exception {
- File warFile = AS7ManagerTestUtils.getWarFile(AS7ManagerTestUtils.MINIMALISTIC_WAR);
- try {
- AS7ManagerTestUtils.waitUntilFinished(manager.deploy(warFile));
- AS7ManagerTestUtils.waitUntilFinished(manager.deploy(warFile));
- } finally {
- AS7ManagerTestUtils.quietlyUndeploy(warFile, manager);
- }
- }
-
- @Ignore
- @Test(expected = JBoss7ManangementException.class)
- public void cannotUndeployNondeployed() throws JBoss7ManangementException, InterruptedException, ExecutionException {
- AS7ManagerTestUtils.waitUntilFinished(manager.undeploy("inexistant"));
- }
-
- @Ignore
- @Test
- public void canReplaceWar() throws Exception {
- File warFile = AS7ManagerTestUtils.getWarFile(AS7ManagerTestUtils.MINIMALISTIC_WAR);
- File warFile2 = AS7ManagerTestUtils.getWarFile(AS7ManagerTestUtils.GWT_HELLOWORLD_WAR);
- String name = warFile.getName();
- try {
- AS7ManagerTestUtils.waitUntilFinished(manager.deploy(name, warFile));
- AS7ManagerTestUtils.waitUntilFinished(manager.replace(name, warFile2));
- String response = AS7ManagerTestUtils.waitForRespose(
- "minimalistic", AS7ManagerTestUtils.HOST, AS7ManagerTestUtils.WEB_PORT);
- assertTrue(response != null
- && response.indexOf("GWT") >= 0);
- } finally {
- AS7ManagerTestUtils.quietlyUndeploy(name, manager);
- }
- }
-
- @Test
- public void getEnabledStateIfDeploymentIsDeployed() throws URISyntaxException, IOException, JBoss7ManangementException {
- String deploymentName = "testDeployment";
- File warFile = AS7ManagerTestUtils.getWarFile(AS7ManagerTestUtils.MINIMALISTIC_WAR);
- try {
- AS7ManagerTestUtils.waitUntilFinished(manager.deploy(deploymentName, warFile));
- JBoss7DeploymentState state = manager.getDeploymentState(deploymentName);
- assertNotNull(state);
- assertThat(state, equalTo(JBoss7DeploymentState.STARTED));
- } finally {
- AS7ManagerTestUtils.quietlyUndeploy(deploymentName, manager);
- }
- }
-
- @Test
- public void getDisabledStateIfDeploymentIsOnlyAdded() throws URISyntaxException, IOException, JBoss7ManangementException {
- String deploymentName = "testDeployment";
- File warFile = AS7ManagerTestUtils.getWarFile(AS7ManagerTestUtils.MINIMALISTIC_WAR);
- try {
- AS7ManagerTestUtils.waitUntilFinished(manager.add(deploymentName, warFile));
- JBoss7DeploymentState state = manager.getDeploymentState(deploymentName);
- assertNotNull(state);
- assertThat(state, equalTo(JBoss7DeploymentState.STOPPED));
- } finally {
- AS7ManagerTestUtils.quietlyRemove(deploymentName, manager);
- }
- }
-
- @Test(expected = JBoss7ManangementException.class)
- public void getErrorIfDeploymentIsNotDeployed() throws URISyntaxException, IOException, JBoss7ManangementException {
- String deploymentName = "testDeployment";
- try {
- manager.getDeploymentState(deploymentName);
- } finally {
- AS7ManagerTestUtils.quietlyUndeploy(deploymentName, manager);
- }
- }
-}
Copied: trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementServiceIntegrationTest.java (from rev 30803, 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/JBossManagementServiceIntegrationTest.java (rev 0)
+++ trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementServiceIntegrationTest.java 2011-04-23 13:58:56 UTC (rev 30805)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.management.as7.tests;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.net.UnknownHostException;
+
+import org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7ManagementService;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+
+/**
+ *
+ * @author André Dietisheim
+ */
+public class JBossManagementServiceIntegrationTest {
+
+ private static final String DS_BUNDLEID = "org.eclipse.equinox.ds";
+
+ @Before
+ public void setUp() throws UnknownHostException {
+ }
+
+ @After
+ public void tearDown() {
+ }
+
+ @Test
+ public void serviceIsReachable() throws BundleException {
+ ensureDSIsRunning();
+ BundleContext context = Activator.getContext();
+ ServiceReference<IJBoss7ManagementService> reference =
+ context.getServiceReference(IJBoss7ManagementService.class);
+ assertNotNull(reference);
+ IJBoss7ManagementService service = context.getService(reference);
+ assertNotNull(service);
+ }
+
+ private void ensureDSIsRunning() throws BundleException {
+ BundleContext context = Activator.getContext();
+ assertNotNull("bundle of this test is not active", context);
+ Bundle bundle = getDSBundle();
+ assertNotNull(
+ DS_BUNDLEID + " not installed. You have to install the declarative services daemon so that "
+ + IJBoss7ManagementService.class + " service is registered"
+ , bundle);
+ if (bundle.getState() != Bundle.ACTIVE) {
+ bundle.start();
+ }
+ }
+
+ private Bundle getDSBundle() {
+ Bundle dsBundle = null;
+ for (Bundle bundle : Activator.getContext().getBundles()) {
+ if (DS_BUNDLEID.equals(bundle.getSymbolicName())) {
+ dsBundle = bundle;
+ break;
+ }
+ }
+ return dsBundle;
+ }
+}
Property changes on: trunk/as/org.jboss.ide.eclipse.as.management.as7.tests/src/org/jboss/ide/eclipse/as/management/as7/tests/JBossManagementServiceIntegrationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagementUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagementUtil.java 2011-04-23 11:55:49 UTC (rev 30804)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagementUtil.java 2011-04-23 13:58:56 UTC (rev 30805)
@@ -7,47 +7,50 @@
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.internal.v7;
+import java.util.Collection;
+import java.util.Iterator;
+
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
public class JBoss7ManagementUtil {
+ public static final String SERVER_VERSION_PROPERTY = "as.version"; //$NON-NLS-1$
+
public static final String SERVICE_VERSION_70 = "org.jboss.ide.eclipse.as.management.as7.service"; //$NON-NLS-1$
-
+
public static IJBoss7ManagementService findManagementService(IServer server) {
- BundleContext context = JBossServerCorePlugin.getDefault().getContext();
-
-// String tmp = "org.jboss.ide.eclipse.as.management.as7.service"; //$NON-NLS-1$
-// String clazz = "org.jboss.ide.eclipse.as.management.as7.deployment.JBossManagementService"; //$NON-NLS-1$
- String iface = "IJBoss7ManagementService"; //$NON-NLS-1$
- String clazz3 = "org.jboss.ide.eclipse.as.core.server.internal.v7." + iface; //$NON-NLS-1$
+ BundleContext context = JBossServerCorePlugin.getContext();
+
+ // String tmp = "org.jboss.ide.eclipse.as.management.as7.service"; //$NON-NLS-1$
+ // String clazz = "org.jboss.ide.eclipse.as.management.as7.deployment.JBossManagementService"; //$NON-NLS-1$
+ // String iface = "IJBoss7ManagementService"; //$NON-NLS-1$
+ // String clazz3 = "org.jboss.ide.eclipse.as.core.server.internal.v7." + iface; //$NON-NLS-1$
String requiredService = getRequiredServiceName(server);
- if( requiredService == null )
+ if (requiredService == null)
return null;
-
+
try {
- ServiceReference[] refs = context.getServiceReferences(clazz3, null);
- for( int i = 0; i < refs.length; i++ ) {
- Object compName = refs[i].getProperty("component.name"); //$NON-NLS-1$
- if( requiredService.equals(compName)) {
- Bundle b = refs[i].getBundle();
- Object service2 = context.getService(refs[i]);
- if( service2 instanceof IJBoss7ManagementService ) {
- return ((IJBoss7ManagementService)service2);
- }
+ Collection<ServiceReference<IJBoss7ManagementService>> references = context.getServiceReferences(
+ IJBoss7ManagementService.class, null);
+ for (Iterator<ServiceReference<IJBoss7ManagementService>> iterator = references.iterator();
+ iterator.hasNext();) {
+ ServiceReference<IJBoss7ManagementService> reference = iterator.next();
+ Object compName = reference.getProperty("component.name"); //$NON-NLS-1$
+ if (requiredService.equals(compName)) {
+ return context.getService(reference);
}
}
- } catch(InvalidSyntaxException ise ) {
+ } catch (InvalidSyntaxException ise) {
}
return null;
}
-
+
private static String getRequiredServiceName(IServer s) {
// TODO if required, make sure to add new versions here
return SERVICE_VERSION_70;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/jboss-management-service.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/jboss-management-service.xml 2011-04-23 11:55:49 UTC (rev 30804)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.management.as7/META-INF/jboss-management-service.xml 2011-04-23 13:58:56 UTC (rev 30805)
@@ -4,4 +4,5 @@
<service>
<provide interface="org.jboss.ide.eclipse.as.core.server.internal.v7.IJBoss7ManagementService"/>
</service>
+ <property name="as.version" type="String" value="7"/>
</scr:component>
14 years, 11 months
Newsletter Sat, 23 Apr 2011 10:18:05 -0300
by jbosstools-commits@lists.jboss.org
Hey bud!!
Do you want an extraordinary future, double in money earning power, and brownie points?
Today only:
We can assist with Diplomas from prestigious universities based on your present knowledge and work experience.
Get a Degree in 5 weeks with our program!
~Our program will let EVERYONE with professional experience
gain a 100% verified Degree:
~Doctorate
~Bachelors
~Masters
- Think about it...
- Follow YOUR Dreams!
- Live a better life by earning or upgrading your degree.
This is a rare 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 24/7 to start improving your life!
~CONTACT US~
1-305-460-2287
You must leave us a message with your name and phone number with country code if outside USA and we'll call you back asap.
It's your decision...
Make the right decision.
Best regards.
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