You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by al...@apache.org on 2016/01/20 11:27:26 UTC

[1/2] incubator-brooklyn git commit: winrm: switch to winrm4j v0.2.0, from 0.1.0

Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 7d2ae06ec -> 2f3e465cd


winrm: switch to winrm4j v0.2.0, from 0.1.0

- This is a pure-java WinRM client, so removes the jython depenpdency.
- Also changes WinRmTool.executeScript(...) to executeCommand(…),
  and WinRmMachineLocation.executeScript to executeCommand.
- Fixes WindowsPerformanceCounterFeedLiveTest
- Renames Winrm4jTool’s package (from pywinrm to winrm4j).
- Fixes imports that used org.python


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/70f379e4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/70f379e4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/70f379e4

Branch: refs/heads/master
Commit: 70f379e47d0656dc8eeeb95e858dfe03b6aae33b
Parents: 981f7c7
Author: Aled Sage <al...@gmail.com>
Authored: Mon Jan 18 21:29:13 2016 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Tue Jan 19 21:32:51 2016 +0000

----------------------------------------------------------------------
 .../catalog/CatalogYamlTemplateTest.java        |   3 +-
 .../location/jclouds/JcloudsLocation.java       |   4 +-
 brooklyn-server/pom.xml                         |   2 +-
 .../AbstractSoftwareProcessWinRmDriver.java     |   8 +-
 .../location/WinRmMachineLocationLiveTest.java  |  36 ++--
 .../windows/WindowsPerformanceCounterFeed.java  |   4 +-
 .../location/winrm/WinRmMachineLocation.java    |  41 +++-
 .../util/core/internal/winrm/WinRmTool.java     |   9 +
 .../internal/winrm/pywinrm/Winrm4jTool.java     | 209 ------------------
 .../internal/winrm/winrm4j/Winrm4jTool.java     | 215 +++++++++++++++++++
 .../WindowsPerformanceCounterFeedLiveTest.java  |  20 +-
 11 files changed, 295 insertions(+), 256 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/70f379e4/brooklyn-server/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlTemplateTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-server/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlTemplateTest.java b/brooklyn-server/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlTemplateTest.java
index 165fd49..a759fed 100644
--- a/brooklyn-server/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlTemplateTest.java
+++ b/brooklyn-server/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlTemplateTest.java
@@ -41,12 +41,13 @@ import org.apache.brooklyn.entity.stock.BasicApplication;
 import org.apache.brooklyn.test.Asserts;
 import org.apache.brooklyn.test.support.TestResourceUnavailableException;
 import org.apache.brooklyn.util.osgi.OsgiTestResources;
-import org.python.google.common.collect.Iterables;
 import org.testng.Assert;
 import org.testng.TestListenerAdapter;
 import org.testng.TestNG;
 import org.testng.annotations.Test;
 
+import com.google.common.collect.Iterables;
+
 
 public class CatalogYamlTemplateTest extends AbstractYamlTest {
     

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/70f379e4/brooklyn-server/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
----------------------------------------------------------------------
diff --git a/brooklyn-server/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java b/brooklyn-server/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
index 20897d9..05972a2 100644
--- a/brooklyn-server/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
+++ b/brooklyn-server/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
@@ -862,7 +862,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
                         String scriptContent = ResourceUtils.create(this).getResourceAsString(setupScriptItem);
                         String script = TemplateProcessor.processTemplateContents(scriptContent, getManagementContext(), substitutions);
                         if (windows) {
-                            ((WinRmMachineLocation)machineLocation).executeScript(ImmutableList.copyOf((script.replace("\r", "").split("\n"))));
+                            ((WinRmMachineLocation)machineLocation).executeCommand(ImmutableList.copyOf((script.replace("\r", "").split("\n"))));
                         } else {
                             ((SshMachineLocation)machineLocation).execCommands("Customizing node " + this, ImmutableList.of(script));
                         }
@@ -2664,7 +2664,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
                 public Boolean call() {
                     for (Map.Entry<WinRmMachineLocation, LoginCredentials> entry : machinesToTry.entrySet()) {
                         WinRmMachineLocation machine = entry.getKey();
-                        WinRmToolResponse response = machine.executeScript(
+                        WinRmToolResponse response = machine.executeCommand(
                                 ImmutableMap.of(WinRmTool.PROP_EXEC_TRIES.getName(), 1),
                                 ImmutableList.of("echo testing"));
                         boolean success = (response.getStatusCode() == 0);

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/70f379e4/brooklyn-server/pom.xml
----------------------------------------------------------------------
diff --git a/brooklyn-server/pom.xml b/brooklyn-server/pom.xml
index 59bf6b2..b8d58ee 100644
--- a/brooklyn-server/pom.xml
+++ b/brooklyn-server/pom.xml
@@ -146,7 +146,7 @@
         <jsr311-api.version>1.1.1</jsr311-api.version>
         <maxmind.version>0.8.1</maxmind.version>
         <jna.version>4.0.0</jna.version>
-        <winrm4j.version>0.1.0</winrm4j.version>
+        <winrm4j.version>0.2.0</winrm4j.version>
         
         <!-- Transitive dependencies, declared explicitly to avoid version mismatch -->
         <clojure.version>1.4.0</clojure.version>

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/70f379e4/brooklyn-server/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessWinRmDriver.java
----------------------------------------------------------------------
diff --git a/brooklyn-server/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessWinRmDriver.java b/brooklyn-server/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessWinRmDriver.java
index 6a39cc2..de88cba 100644
--- a/brooklyn-server/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessWinRmDriver.java
+++ b/brooklyn-server/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessWinRmDriver.java
@@ -48,7 +48,6 @@ import org.apache.brooklyn.util.repeat.Repeater;
 import org.apache.brooklyn.util.stream.Streams;
 import org.apache.brooklyn.util.text.Strings;
 import org.apache.brooklyn.util.time.Duration;
-import org.python.core.PyException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -239,7 +238,7 @@ public abstract class AbstractSoftwareProcessWinRmDriver extends AbstractSoftwar
         if (Strings.isBlank(regularCommand)) {
             response = getLocation().executePsScript(ImmutableList.of(powerShellCommand));
         } else {
-            response = getLocation().executeScript(ImmutableList.of(regularCommand));
+            response = getLocation().executeCommand(ImmutableList.of(regularCommand));
         }
 
         if (currentTask != null) {
@@ -259,7 +258,7 @@ public abstract class AbstractSoftwareProcessWinRmDriver extends AbstractSoftwar
     }
 
     public int execute(List<String> script) {
-        return getLocation().executeScript(script).getStatusCode();
+        return getLocation().executeCommand(script).getStatusCode();
     }
 
     public int executePsScriptNoRetry(List<String> psScript) {
@@ -281,8 +280,9 @@ public abstract class AbstractSoftwareProcessWinRmDriver extends AbstractSoftwar
     public void rebootAndWait() {
         try {
             executePsScriptNoRetry(ImmutableList.of("Restart-Computer -Force"));
-        } catch (PyException e) {
+        } catch (Exception e) {
             // Restarting the computer will cause the command to fail; ignore the exception and continue
+            Exceptions.propagateIfFatal(e);
         }
         waitForWinRmStatus(false, entity.getConfig(VanillaWindowsProcess.REBOOT_BEGUN_TIMEOUT));
         waitForWinRmStatus(true, entity.getConfig(VanillaWindowsProcess.REBOOT_COMPLETED_TIMEOUT)).getWithError();

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/70f379e4/brooklyn-server/software/base/src/test/java/org/apache/brooklyn/entity/software/base/test/location/WinRmMachineLocationLiveTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-server/software/base/src/test/java/org/apache/brooklyn/entity/software/base/test/location/WinRmMachineLocationLiveTest.java b/brooklyn-server/software/base/src/test/java/org/apache/brooklyn/entity/software/base/test/location/WinRmMachineLocationLiveTest.java
index 884da19..2e34ef7 100644
--- a/brooklyn-server/software/base/src/test/java/org/apache/brooklyn/entity/software/base/test/location/WinRmMachineLocationLiveTest.java
+++ b/brooklyn-server/software/base/src/test/java/org/apache/brooklyn/entity/software/base/test/location/WinRmMachineLocationLiveTest.java
@@ -63,7 +63,7 @@ import com.google.common.util.concurrent.MoreExecutors;
  * Tests execution of commands (batch and powershell) on Windows over WinRM, and of
  * file upload.
  * 
- * There are limitations with what is supported by PyWinRM. These are highlighted in
+ * There are limitations with what is supported by winrm4j. These are highlighted in
  * tests marked as "WIP" (see individual tests).
  * 
  * These limitations are documented in docs/guide/yaml/winrm/index.md.
@@ -146,7 +146,7 @@ public class WinRmMachineLocationLiveTest {
         String remotePath = "C:\\myfile-"+Identifiers.makeRandomId(4)+".txt";
         machine.copyTo(new ByteArrayInputStream(contents.getBytes()), remotePath);
         
-        WinRmToolResponse response = machine.executeScript("type "+remotePath);
+        WinRmToolResponse response = machine.executeCommand("type "+remotePath);
         String msg = "statusCode="+response.getStatusCode()+"; out="+response.getStdOut()+"; err="+response.getStdErr();
         assertEquals(response.getStatusCode(), 0, msg);
         assertEquals(response.getStdOut().trim(), contents, msg);
@@ -159,7 +159,7 @@ public class WinRmMachineLocationLiveTest {
             String remotePath = "C:\\myfile-"+Identifiers.makeRandomId(4)+".txt";
             machine.copyTo(localFile, remotePath);
             
-            WinRmToolResponse response = machine.executeScript("type "+remotePath);
+            WinRmToolResponse response = machine.executeCommand("type "+remotePath);
             String msg = "statusCode="+response.getStatusCode()+"; out="+response.getStdOut()+"; err="+response.getStdErr();
             assertEquals(response.getStatusCode(), 0, msg);
             assertEquals(response.getStdOut().trim(), contents, msg);
@@ -174,26 +174,18 @@ public class WinRmMachineLocationLiveTest {
     }
     
     /*
-     * TODO Not supported in PyWinRM.
+     * TODO Not supported in winrm4j (or PyWinRM).
      * 
-     * Executing (in python):
-     *     import winrm
-     *     s = winrm.Session('52.12.211.247', auth=('Administrator', 'pa55w0rd'))
-     *     r = s.run_cmd("echo first \r\n echo second")
-     * gives just "first".
+     * Just gives "first", and exit code 1.
      */
-    @Test(groups={"Live", "WIP"})
+    @Test(groups={"Live", "WIP"}, enabled=false)
     public void testExecMultiLineScript() throws Exception {
         assertExecSucceeds("echo first" + "\r\n" + "echo second", "first"+"\r\n"+"second", "");
     }
     
-    /*
-     * TODO Not supported in PyWinRM. Under the covers, we just concatenate the commands.
-     * See {@link #testExecMultiLineScript()}.
-     */
-    @Test(groups={"Live", "WIP"})
+    @Test(groups={"Live"})
     public void testExecMultiPartScript() throws Exception {
-        assertExecSucceeds(ImmutableList.of("echo first", "echo second"), "first"+"\r\n"+"second", "");
+        assertExecSucceeds(ImmutableList.of("echo first", "echo second"), "first "+"\r\n"+"second", "");
     }
     
     @Test(groups="Live")
@@ -212,7 +204,7 @@ public class WinRmMachineLocationLiveTest {
     }
 
     /*
-     * TODO Not supported in PyWinRM.
+     * TODO Not supported in winrm4j (or PyWinRM).
      * 
      * Executing (in python):
      *     import winrm
@@ -443,7 +435,7 @@ public class WinRmMachineLocationLiveTest {
     }
 
     /*
-     * TODO Not supported in PyWinRM - single line .ps1 file with "exit 1" gives an
+     * TODO Not supported in winrm4j - single line .ps1 file with "exit 1" gives an
      * exit code 0 over PyWinRM, but an exit code 1 when executed locally!
      * 
      * Executing (in python):
@@ -554,12 +546,12 @@ public class WinRmMachineLocationLiveTest {
 
     private void assertExecFails(String cmd) {
         Stopwatch stopwatch = Stopwatch.createStarted();
-        assertFailed(cmd, machine.executeScript(cmd), stopwatch);
+        assertFailed(cmd, machine.executeCommand(cmd), stopwatch);
     }
 
     private void assertExecFails(List<String> cmds) {
         Stopwatch stopwatch = Stopwatch.createStarted();
-        assertFailed(cmds, machine.executeScript(cmds), stopwatch);
+        assertFailed(cmds, machine.executeCommand(cmds), stopwatch);
     }
     
     private void assertExecPsFails(String cmd) {
@@ -574,12 +566,12 @@ public class WinRmMachineLocationLiveTest {
 
     private void assertExecSucceeds(String cmd, String stdout, String stderr) {
         Stopwatch stopwatch = Stopwatch.createStarted();
-        assertSucceeded(cmd, machine.executeScript(cmd), stdout, stderr, stopwatch);
+        assertSucceeded(cmd, machine.executeCommand(cmd), stdout, stderr, stopwatch);
     }
 
     private void assertExecSucceeds(List<String> cmds, String stdout, String stderr) {
         Stopwatch stopwatch = Stopwatch.createStarted();
-        assertSucceeded(cmds, machine.executeScript(cmds), stdout, stderr, stopwatch);
+        assertSucceeded(cmds, machine.executeCommand(cmds), stdout, stderr, stopwatch);
     }
 
     private void assertExecPsSucceeds(String cmd, String stdout, String stderr) {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/70f379e4/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/feed/windows/WindowsPerformanceCounterFeed.java
----------------------------------------------------------------------
diff --git a/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/feed/windows/WindowsPerformanceCounterFeed.java b/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/feed/windows/WindowsPerformanceCounterFeed.java
index b6f8684..1939ed0 100644
--- a/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/feed/windows/WindowsPerformanceCounterFeed.java
+++ b/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/feed/windows/WindowsPerformanceCounterFeed.java
@@ -116,8 +116,8 @@ public class WindowsPerformanceCounterFeed extends AbstractFeed {
         private String uniqueTag;
         private volatile boolean built;
 
-        public Builder entity(EntityLocal val) {
-            this.entity = checkNotNull(val, "entity");
+        public Builder entity(Entity val) {
+            this.entity = (EntityLocal) checkNotNull(val, "entity");
             return this;
         }
         public Builder addSensor(WindowsPerformanceCounterPollConfig<?> config) {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/70f379e4/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/location/winrm/WinRmMachineLocation.java
----------------------------------------------------------------------
diff --git a/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/location/winrm/WinRmMachineLocation.java b/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/location/winrm/WinRmMachineLocation.java
index 8a2a786..d04c366 100644
--- a/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/location/winrm/WinRmMachineLocation.java
+++ b/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/location/winrm/WinRmMachineLocation.java
@@ -44,7 +44,7 @@ import org.apache.brooklyn.util.core.config.ConfigBag;
 import org.apache.brooklyn.util.core.internal.ssh.SshTool;
 import org.apache.brooklyn.util.core.internal.winrm.WinRmTool;
 import org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse;
-import org.apache.brooklyn.util.core.internal.winrm.pywinrm.Winrm4jTool;
+import org.apache.brooklyn.util.core.internal.winrm.winrm4j.Winrm4jTool;
 import org.apache.brooklyn.util.exceptions.Exceptions;
 import org.apache.brooklyn.util.stream.Streams;
 import org.apache.brooklyn.util.text.Strings;
@@ -212,17 +212,50 @@ public class WinRmMachineLocation extends AbstractLocation implements MachineLoc
         return (result == null) ? ImmutableSet.<String>of() : ImmutableSet.copyOf(result);
     }
 
+    /**
+     * @deprecated since 0.9.0; use {@link #executeCommand(String)}
+     */
+    @Deprecated
     public WinRmToolResponse executeScript(String script) {
-        return executeScript(ImmutableList.of(script));
+        return executeCommand(script);
     }
 
+    /**
+     * @deprecated since 0.9.0; use {@link #executeCommand(List)}
+     */
+    @Deprecated
     public WinRmToolResponse executeScript(List<String> script) {
-        return executeScript(ImmutableMap.of(), script);
+        return executeCommand(script);
     }
     
+    /**
+     * @deprecated since 0.9.0; use {@link #executeCommand(Map, List)}
+     */
+    @Deprecated
     public WinRmToolResponse executeScript(Map<?,?> props, List<String> script) {
+        return executeCommand(props, script);
+    }
+
+    /**
+     * @since 0.9.0 (previously was {@code executeScript(String)}
+     */
+    public WinRmToolResponse executeCommand(String script) {
+        return executeCommand(ImmutableList.of(script));
+    }
+
+    /**
+     * @since 0.9.0 (previously was {@code executeScript(List)}
+     */
+    public WinRmToolResponse executeCommand(List<String> script) {
+        return executeCommand(ImmutableMap.of(), script);
+    }
+    
+    /**
+     * @since 0.9.0 (previously was {@code executeScript(Map, List)}
+     */
+    public WinRmToolResponse executeCommand(Map<?,?> props, List<String> script) {
         WinRmTool tool = newWinRmTool(props);
-        return tool.executeScript(script);
+        return tool.executeCommand(script);
     }
 
     public WinRmToolResponse executePsScript(String psScript) {

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/70f379e4/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/WinRmTool.java
----------------------------------------------------------------------
diff --git a/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/WinRmTool.java b/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/WinRmTool.java
index 6d2fb06..5515ec5 100644
--- a/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/WinRmTool.java
+++ b/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/WinRmTool.java
@@ -66,8 +66,17 @@ public interface WinRmTool {
             "Size of file chunks (in bytes) to be used when copying a file to the remote server", 
             1024);
 
+    /**
+     * @deprecated since 0.9.0; use {@link #executeCommand(List)} to avoid ambiguity between native command and power shell.
+     */
+    @Deprecated
     WinRmToolResponse executeScript(List<String> commands);
 
+    /**
+     * @since 0.9.0
+     */
+    WinRmToolResponse executeCommand(List<String> commands);
+
     WinRmToolResponse executePs(List<String> commands);
     
     WinRmToolResponse copyToServer(InputStream source, String destination);

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/70f379e4/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/pywinrm/Winrm4jTool.java
----------------------------------------------------------------------
diff --git a/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/pywinrm/Winrm4jTool.java b/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/pywinrm/Winrm4jTool.java
deleted file mode 100644
index 0bdfa14..0000000
--- a/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/pywinrm/Winrm4jTool.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.brooklyn.util.core.internal.winrm.pywinrm;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.io.InputStream;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.brooklyn.config.ConfigKey;
-import org.apache.brooklyn.core.config.ConfigKeys;
-import org.apache.brooklyn.core.config.Sanitizer;
-import org.apache.brooklyn.util.core.config.ConfigBag;
-import org.apache.brooklyn.util.core.internal.winrm.WinRmException;
-import org.apache.brooklyn.util.exceptions.Exceptions;
-import org.apache.brooklyn.util.time.Duration;
-import org.apache.brooklyn.util.time.Time;
-import org.apache.commons.codec.binary.Base64;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.Function;
-import com.google.common.base.Stopwatch;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Lists;
-
-import io.cloudsoft.winrm4j.winrm.WinRmTool;
-import io.cloudsoft.winrm4j.winrm.WinRmToolResponse;
-
-@Beta
-public class Winrm4jTool implements org.apache.brooklyn.util.core.internal.winrm.WinRmTool {
-
-    private static final Logger LOG = LoggerFactory.getLogger(Winrm4jTool.class);
-
-    // TODO Should we move this up to the interface?
-    @Beta
-    public static final ConfigKey<Boolean> LOG_CREDENTIALS = ConfigKeys.newBooleanConfigKey(
-            "logCredentials", 
-            "Whether to log the WinRM credentials used - strongly recommended never be used in production, as it is a big security hole!",
-            false);
-
-    private final ConfigBag bag;
-    private final String host;
-    private final Integer port;
-    private final String user;
-    private final String password;
-    private final int execTries;
-    private final Duration execRetryDelay;
-    private final boolean logCredentials;
-    
-    public Winrm4jTool(Map<String,?> config) {
-        this(ConfigBag.newInstance(config));
-    }
-    
-    public Winrm4jTool(ConfigBag config) {
-        this.bag = checkNotNull(config, "config bag");
-        host = getRequiredConfig(config, PROP_HOST);
-        port = getRequiredConfig(config, PROP_PORT);
-        user = getRequiredConfig(config, PROP_USER);
-        password = getRequiredConfig(config, PROP_PASSWORD);
-        execTries = getRequiredConfig(config, PROP_EXEC_TRIES);
-        execRetryDelay = getRequiredConfig(config, PROP_EXEC_RETRY_DELAY);
-        logCredentials = getRequiredConfig(config, LOG_CREDENTIALS);
-    }
-    
-    @Override
-    public org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse executeScript(final List<String> commands) {
-        return exec(new Function<io.cloudsoft.winrm4j.winrm.WinRmTool, io.cloudsoft.winrm4j.winrm.WinRmToolResponse>() {
-            @Override public WinRmToolResponse apply(io.cloudsoft.winrm4j.winrm.WinRmTool tool) {
-                return tool.executeScript(commands);
-            }
-        });
-    }
-
-    @Override
-    public org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse executePs(final List<String> commands) {
-        return exec(new Function<io.cloudsoft.winrm4j.winrm.WinRmTool, io.cloudsoft.winrm4j.winrm.WinRmToolResponse>() {
-            @Override public WinRmToolResponse apply(io.cloudsoft.winrm4j.winrm.WinRmTool tool) {
-                return tool.executePs(commands);
-            }
-        });
-    }
-
-    @Override
-    public org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse copyToServer(InputStream source, String destination) {
-        executePs(ImmutableList.of("rm -ErrorAction SilentlyContinue " + destination));
-        try {
-            int chunkSize = getRequiredConfig(bag, COPY_FILE_CHUNK_SIZE_BYTES);
-            byte[] inputData = new byte[chunkSize];
-            int bytesRead;
-            int expectedFileSize = 0;
-            while ((bytesRead = source.read(inputData)) > 0) {
-                byte[] chunk;
-                if (bytesRead == chunkSize) {
-                    chunk = inputData;
-                } else {
-                    chunk = Arrays.copyOf(inputData, bytesRead);
-                }
-                executePs(ImmutableList.of("If ((!(Test-Path " + destination + ")) -or ((Get-Item '" + destination + "').length -eq " +
-                        expectedFileSize + ")) {Add-Content -Encoding Byte -path " + destination +
-                        " -value ([System.Convert]::FromBase64String(\"" + new String(Base64.encodeBase64(chunk)) + "\"))}"));
-                expectedFileSize += bytesRead;
-            }
-
-            return new org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse("", "", 0);
-        } catch (java.io.IOException e) {
-            throw propagate(e, "Failed copying to server at "+destination);
-        }
-    }
-
-    private org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse exec(Function<io.cloudsoft.winrm4j.winrm.WinRmTool, io.cloudsoft.winrm4j.winrm.WinRmToolResponse> task) {
-        Collection<Throwable> exceptions = Lists.newArrayList();
-        Stopwatch totalStopwatch = Stopwatch.createStarted();
-        
-        for (int i = 0; i < execTries; i++) {
-            Stopwatch stopwatch = Stopwatch.createStarted();
-            Duration connectTimestamp = null;
-            Duration execTimestamp = null;
-            try {
-                WinRmTool tool = connect();
-                connectTimestamp = Duration.of(stopwatch);
-                WinRmToolResponse result = task.apply(tool);
-                execTimestamp = Duration.of(stopwatch);
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Finished WinRM exec on "+user+"@"+host+":"+port+" "
-                            + (logCredentials ? "password=" + password : "")
-                            + " done after "+Duration.of(execTimestamp).toStringRounded()
-                            + " (connected in "+Duration.of(connectTimestamp).toStringRounded() + ")");
-                }
-                return wrap(result);
-            } catch (Exception e) {
-                Exceptions.propagateIfFatal(e);
-                Duration sleep = Duration.millis(Math.min(Math.pow(2, i) * 1000, execRetryDelay.toMilliseconds()));
-                Duration failTimestamp = Duration.of(stopwatch);
-                String timeMsg = "total time "+Duration.of(totalStopwatch).toStringRounded()
-                        + ", this attempt failed after "+Duration.of(failTimestamp).toStringRounded()
-                        + (connectTimestamp != null ? ", connected in "+Duration.of(connectTimestamp).toStringRounded() : "");
-                
-                if ((i + 1) == execTries) {
-                    LOG.info("Propagating exception - WinRM failed on "+user+"@"+host+":"+port+" "
-                            + (logCredentials ? "password=" + password : "")
-                            + "; (attempt "+(i+1)+" of "+execTries+"; "+timeMsg+")", e);
-                } else if (i == 0) {
-                    LOG.warn("Ignoring WinRM exception on "+user+"@"+host+":"+port+" "
-                            + (logCredentials ? "password=" + password : "")
-                            + " and will retry after "+sleep+" (attempt "+(i+1)+" of "+execTries+"; "+timeMsg+")", e);
-                    Time.sleep(sleep);
-                } else {
-                    LOG.debug("Ignoring WinRM exception on "+user+"@"+host+":"+port+" "
-                            + (logCredentials ? "password=" + password : "")
-                            + " and will retry after "+sleep+" (attempt "+(i+1)+" of "+execTries+"; "+timeMsg+")", e);
-                    Time.sleep(sleep);
-                }
-                exceptions.add(e);
-            }
-        }
-        throw propagate(Exceptions.create("failed to execute command", exceptions), "");
-    }
-
-    private io.cloudsoft.winrm4j.winrm.WinRmTool connect() {
-        return io.cloudsoft.winrm4j.winrm.WinRmTool.connect(host+":"+port, user, password);
-    }
-    
-    private <T> T getRequiredConfig(ConfigBag bag, ConfigKey<T> key) {
-        T result = bag.get(key);
-        if (result == null) {
-            throw new IllegalArgumentException("Missing config "+key+" in "+Sanitizer.sanitize(bag));
-        }
-        return result;
-    }
-    
-    private org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse wrap(io.cloudsoft.winrm4j.winrm.WinRmToolResponse resp) {
-        return new org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse(resp.getStdOut(), resp.getStdErr(), resp.getStatusCode());
-    }
-
-    @Override
-    public String toString() {
-        return String.format("%s@%s:%d", user, host, port);
-    }
-    
-    /**
-     * @throws WinRmException If the given {@code e} is not fatal (e.g. not an {@link Error} or {@link InterruptedException},
-     *         then wraps it in a {@link WinRmException}.
-     */
-    protected WinRmException propagate(Exception e, String message) throws WinRmException {
-        Exceptions.propagateIfFatal(e);
-        throw new WinRmException("(" + toString() + ") " + message + ": " + e.getMessage(), e);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/70f379e4/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/winrm4j/Winrm4jTool.java
----------------------------------------------------------------------
diff --git a/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/winrm4j/Winrm4jTool.java b/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/winrm4j/Winrm4jTool.java
new file mode 100644
index 0000000..e023cfb
--- /dev/null
+++ b/brooklyn-server/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/winrm4j/Winrm4jTool.java
@@ -0,0 +1,215 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.util.core.internal.winrm.winrm4j;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.ConfigKeys;
+import org.apache.brooklyn.core.config.Sanitizer;
+import org.apache.brooklyn.util.core.config.ConfigBag;
+import org.apache.brooklyn.util.core.internal.winrm.WinRmException;
+import org.apache.brooklyn.util.exceptions.Exceptions;
+import org.apache.brooklyn.util.time.Duration;
+import org.apache.brooklyn.util.time.Time;
+import org.apache.commons.codec.binary.Base64;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.annotations.Beta;
+import com.google.common.base.Function;
+import com.google.common.base.Stopwatch;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Lists;
+
+import io.cloudsoft.winrm4j.winrm.WinRmTool;
+import io.cloudsoft.winrm4j.winrm.WinRmToolResponse;
+
+@Beta
+public class Winrm4jTool implements org.apache.brooklyn.util.core.internal.winrm.WinRmTool {
+
+    private static final Logger LOG = LoggerFactory.getLogger(Winrm4jTool.class);
+
+    // TODO Should we move this up to the interface?
+    @Beta
+    public static final ConfigKey<Boolean> LOG_CREDENTIALS = ConfigKeys.newBooleanConfigKey(
+            "logCredentials", 
+            "Whether to log the WinRM credentials used - strongly recommended never be used in production, as it is a big security hole!",
+            false);
+
+    private final ConfigBag bag;
+    private final String host;
+    private final Integer port;
+    private final String user;
+    private final String password;
+    private final int execTries;
+    private final Duration execRetryDelay;
+    private final boolean logCredentials;
+    
+    public Winrm4jTool(Map<String,?> config) {
+        this(ConfigBag.newInstance(config));
+    }
+    
+    public Winrm4jTool(ConfigBag config) {
+        this.bag = checkNotNull(config, "config bag");
+        host = getRequiredConfig(config, PROP_HOST);
+        port = getRequiredConfig(config, PROP_PORT);
+        user = getRequiredConfig(config, PROP_USER);
+        password = getRequiredConfig(config, PROP_PASSWORD);
+        execTries = getRequiredConfig(config, PROP_EXEC_TRIES);
+        execRetryDelay = getRequiredConfig(config, PROP_EXEC_RETRY_DELAY);
+        logCredentials = getRequiredConfig(config, LOG_CREDENTIALS);
+    }
+    
+    @Override
+    public org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse executeCommand(final List<String> commands) {
+        return exec(new Function<io.cloudsoft.winrm4j.winrm.WinRmTool, io.cloudsoft.winrm4j.winrm.WinRmToolResponse>() {
+            @Override public WinRmToolResponse apply(io.cloudsoft.winrm4j.winrm.WinRmTool tool) {
+                return tool.executeCommand(commands);
+            }
+        });
+    }
+
+    @Override
+    @Deprecated
+    public org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse executeScript(final List<String> commands) {
+        return executeCommand(commands);
+    }
+    
+    @Override
+    public org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse executePs(final List<String> commands) {
+        return exec(new Function<io.cloudsoft.winrm4j.winrm.WinRmTool, io.cloudsoft.winrm4j.winrm.WinRmToolResponse>() {
+            @Override public WinRmToolResponse apply(io.cloudsoft.winrm4j.winrm.WinRmTool tool) {
+                return tool.executePs(commands);
+            }
+        });
+    }
+
+    @Override
+    public org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse copyToServer(InputStream source, String destination) {
+        executePs(ImmutableList.of("rm -ErrorAction SilentlyContinue " + destination));
+        try {
+            int chunkSize = getRequiredConfig(bag, COPY_FILE_CHUNK_SIZE_BYTES);
+            byte[] inputData = new byte[chunkSize];
+            int bytesRead;
+            int expectedFileSize = 0;
+            while ((bytesRead = source.read(inputData)) > 0) {
+                byte[] chunk;
+                if (bytesRead == chunkSize) {
+                    chunk = inputData;
+                } else {
+                    chunk = Arrays.copyOf(inputData, bytesRead);
+                }
+                executePs(ImmutableList.of("If ((!(Test-Path " + destination + ")) -or ((Get-Item '" + destination + "').length -eq " +
+                        expectedFileSize + ")) {Add-Content -Encoding Byte -path " + destination +
+                        " -value ([System.Convert]::FromBase64String(\"" + new String(Base64.encodeBase64(chunk)) + "\"))}"));
+                expectedFileSize += bytesRead;
+            }
+
+            return new org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse("", "", 0);
+        } catch (java.io.IOException e) {
+            throw propagate(e, "Failed copying to server at "+destination);
+        }
+    }
+
+    private org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse exec(Function<io.cloudsoft.winrm4j.winrm.WinRmTool, io.cloudsoft.winrm4j.winrm.WinRmToolResponse> task) {
+        Collection<Throwable> exceptions = Lists.newArrayList();
+        Stopwatch totalStopwatch = Stopwatch.createStarted();
+        
+        for (int i = 0; i < execTries; i++) {
+            Stopwatch stopwatch = Stopwatch.createStarted();
+            Duration connectTimestamp = null;
+            Duration execTimestamp = null;
+            try {
+                WinRmTool tool = connect();
+                connectTimestamp = Duration.of(stopwatch);
+                WinRmToolResponse result = task.apply(tool);
+                execTimestamp = Duration.of(stopwatch);
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Finished WinRM exec on "+user+"@"+host+":"+port+" "
+                            + (logCredentials ? "password=" + password : "")
+                            + " done after "+Duration.of(execTimestamp).toStringRounded()
+                            + " (connected in "+Duration.of(connectTimestamp).toStringRounded() + ")");
+                }
+                return wrap(result);
+            } catch (Exception e) {
+                Exceptions.propagateIfFatal(e);
+                Duration sleep = Duration.millis(Math.min(Math.pow(2, i) * 1000, execRetryDelay.toMilliseconds()));
+                Duration failTimestamp = Duration.of(stopwatch);
+                String timeMsg = "total time "+Duration.of(totalStopwatch).toStringRounded()
+                        + ", this attempt failed after "+Duration.of(failTimestamp).toStringRounded()
+                        + (connectTimestamp != null ? ", connected in "+Duration.of(connectTimestamp).toStringRounded() : "");
+                
+                if ((i + 1) == execTries) {
+                    LOG.info("Propagating exception - WinRM failed on "+user+"@"+host+":"+port+" "
+                            + (logCredentials ? "password=" + password : "")
+                            + "; (attempt "+(i+1)+" of "+execTries+"; "+timeMsg+")", e);
+                } else if (i == 0) {
+                    LOG.warn("Ignoring WinRM exception on "+user+"@"+host+":"+port+" "
+                            + (logCredentials ? "password=" + password : "")
+                            + " and will retry after "+sleep+" (attempt "+(i+1)+" of "+execTries+"; "+timeMsg+")", e);
+                    Time.sleep(sleep);
+                } else {
+                    LOG.debug("Ignoring WinRM exception on "+user+"@"+host+":"+port+" "
+                            + (logCredentials ? "password=" + password : "")
+                            + " and will retry after "+sleep+" (attempt "+(i+1)+" of "+execTries+"; "+timeMsg+")", e);
+                    Time.sleep(sleep);
+                }
+                exceptions.add(e);
+            }
+        }
+        throw propagate(Exceptions.create("failed to execute command", exceptions), "");
+    }
+
+    private io.cloudsoft.winrm4j.winrm.WinRmTool connect() {
+        return io.cloudsoft.winrm4j.winrm.WinRmTool.connect(host+":"+port, user, password);
+    }
+    
+    private <T> T getRequiredConfig(ConfigBag bag, ConfigKey<T> key) {
+        T result = bag.get(key);
+        if (result == null) {
+            throw new IllegalArgumentException("Missing config "+key+" in "+Sanitizer.sanitize(bag));
+        }
+        return result;
+    }
+    
+    private org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse wrap(io.cloudsoft.winrm4j.winrm.WinRmToolResponse resp) {
+        return new org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse(resp.getStdOut(), resp.getStdErr(), resp.getStatusCode());
+    }
+
+    @Override
+    public String toString() {
+        return String.format("%s@%s:%d", user, host, port);
+    }
+    
+    /**
+     * @throws WinRmException If the given {@code e} is not fatal (e.g. not an {@link Error} or {@link InterruptedException},
+     *         then wraps it in a {@link WinRmException}.
+     */
+    protected WinRmException propagate(Exception e, String message) throws WinRmException {
+        Exceptions.propagateIfFatal(e);
+        throw new WinRmException("(" + toString() + ") " + message + ": " + e.getMessage(), e);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/70f379e4/brooklyn-server/software/winrm/src/test/java/org/apache/brooklyn/feed/windows/WindowsPerformanceCounterFeedLiveTest.java
----------------------------------------------------------------------
diff --git a/brooklyn-server/software/winrm/src/test/java/org/apache/brooklyn/feed/windows/WindowsPerformanceCounterFeedLiveTest.java b/brooklyn-server/software/winrm/src/test/java/org/apache/brooklyn/feed/windows/WindowsPerformanceCounterFeedLiveTest.java
index de7d481..412a732 100644
--- a/brooklyn-server/software/winrm/src/test/java/org/apache/brooklyn/feed/windows/WindowsPerformanceCounterFeedLiveTest.java
+++ b/brooklyn-server/software/winrm/src/test/java/org/apache/brooklyn/feed/windows/WindowsPerformanceCounterFeedLiveTest.java
@@ -20,16 +20,15 @@ package org.apache.brooklyn.feed.windows;
 
 import java.util.Map;
 
-import org.apache.brooklyn.api.entity.EntityLocal;
+import org.apache.brooklyn.api.entity.Entity;
 import org.apache.brooklyn.api.entity.EntitySpec;
 import org.apache.brooklyn.api.location.Location;
-import org.apache.brooklyn.api.location.MachineLocation;
 import org.apache.brooklyn.api.location.MachineProvisioningLocation;
 import org.apache.brooklyn.api.sensor.AttributeSensor;
+import org.apache.brooklyn.core.entity.EntityAsserts;
 import org.apache.brooklyn.core.sensor.Sensors;
 import org.apache.brooklyn.core.test.BrooklynAppLiveTestSupport;
 import org.apache.brooklyn.core.test.entity.TestEntity;
-import org.apache.brooklyn.test.EntityTestUtils;
 import org.apache.brooklyn.util.collections.MutableMap;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
@@ -51,8 +50,8 @@ import com.google.common.collect.ImmutableMap;
  * <pre>
  * {@code brooklyn.location.named.WindowsLiveTest=byon:(hosts="ec2-xx-xxx-xxx-xx.eu-west-1.compute.amazonaws.com")
  * brooklyn.location.named.WindowsLiveTest.user=Administrator
- * brooklyn.location.named.WindowsLiveTest.privateKeyFile = ~/.ssh/id_rsa
- * brooklyn.location.named.WindowsLiveTest.publicKeyFile = ~/.ssh/id_rsa.pub
+ * brooklyn.location.named.WindowsLiveTest.password=pa55word
+ * brooklyn.location.named.WindowsLiveTest.osFamily=windows
  * }</pre>
  * The location must by {@code byon} or another primitive type. Unfortunately, it's not possible to
  * use a jclouds location, as adding a dependency on brooklyn-locations-jclouds would cause a
@@ -66,7 +65,7 @@ public class WindowsPerformanceCounterFeedLiveTest extends BrooklynAppLiveTestSu
     private static final String LOCATION_SPEC = "named:WindowsLiveTest";
 
     private Location loc;
-    private EntityLocal entity;
+    private Entity entity;
 
     @BeforeMethod(alwaysRun=true)
     public void setUp() throws Exception {
@@ -75,16 +74,15 @@ public class WindowsPerformanceCounterFeedLiveTest extends BrooklynAppLiveTestSu
         Map<String,?> allFlags = MutableMap.<String,Object>builder()
                 .put("tags", ImmutableList.of(getClass().getName()))
                 .build();
-        MachineProvisioningLocation<? extends MachineLocation> provisioningLocation =
-                (MachineProvisioningLocation<? extends MachineLocation>)
-                        mgmt.getLocationRegistry().resolve(LOCATION_SPEC, allFlags);
+        MachineProvisioningLocation<?> provisioningLocation = (MachineProvisioningLocation<?>) 
+                mgmt.getLocationRegistry().resolve(LOCATION_SPEC, allFlags);
         loc = provisioningLocation.obtain(ImmutableMap.of());
 
         entity = app.createAndManageChild(EntitySpec.create(TestEntity.class));
         app.start(ImmutableList.of(loc));
     }
 
-    @Test(groups={"Live","Disabled"}, enabled=false)
+    @Test(groups={"Live","Disabled"})
     public void testRetrievesPerformanceCounters() throws Exception {
         // We can be pretty sure that a Windows instance in the cloud will have zero telephone lines...
         entity.sensors().set(TELEPHONE_LINES, 42);
@@ -94,7 +92,7 @@ public class WindowsPerformanceCounterFeedLiveTest extends BrooklynAppLiveTestSu
                 .addSensor("\\Telephony\\Lines", TELEPHONE_LINES)
                 .build();
         try {
-            EntityTestUtils.assertAttributeEqualsEventually(entity, TELEPHONE_LINES, 0);
+            EntityAsserts.assertAttributeEqualsEventually(entity, TELEPHONE_LINES, 0);
         } finally {
             feed.stop();
         }


[2/2] incubator-brooklyn git commit: This closes #1158

Posted by al...@apache.org.
This closes #1158


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/2f3e465c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/2f3e465c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/2f3e465c

Branch: refs/heads/master
Commit: 2f3e465cdebd884cac0bef985f7f2ff96e221347
Parents: 7d2ae06 70f379e
Author: Aled Sage <al...@gmail.com>
Authored: Wed Jan 20 10:27:02 2016 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Wed Jan 20 10:27:02 2016 +0000

----------------------------------------------------------------------
 .../catalog/CatalogYamlTemplateTest.java        |   3 +-
 .../location/jclouds/JcloudsLocation.java       |   4 +-
 brooklyn-server/pom.xml                         |   2 +-
 .../AbstractSoftwareProcessWinRmDriver.java     |   8 +-
 .../location/WinRmMachineLocationLiveTest.java  |  36 ++--
 .../windows/WindowsPerformanceCounterFeed.java  |   4 +-
 .../location/winrm/WinRmMachineLocation.java    |  41 +++-
 .../util/core/internal/winrm/WinRmTool.java     |   9 +
 .../internal/winrm/pywinrm/Winrm4jTool.java     | 209 ------------------
 .../internal/winrm/winrm4j/Winrm4jTool.java     | 215 +++++++++++++++++++
 .../WindowsPerformanceCounterFeedLiveTest.java  |  20 +-
 11 files changed, 295 insertions(+), 256 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2f3e465c/brooklyn-server/pom.xml
----------------------------------------------------------------------