You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ra...@apache.org on 2015/08/28 15:08:42 UTC

[3/3] stratos git commit: Fixing health stat publisher in PCA, adding MT app integration test to PCA

Fixing health stat publisher in PCA, adding MT app integration test to PCA


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/64368325
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/64368325
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/64368325

Branch: refs/heads/stratos-4.1.x
Commit: 643683259d1b240ed594c27c6ad013f655c32fcb
Parents: 6ed9bf6
Author: Akila Perera <ra...@gmail.com>
Authored: Fri Aug 28 18:37:29 2015 +0530
Committer: Akila Perera <ra...@gmail.com>
Committed: Fri Aug 28 18:38:14 2015 +0530

----------------------------------------------------------------------
 .../cartridge.agent/modules/databridge/agent.py |    2 +-
 .../modules/databridge/thrift/publisher.py      |    6 +-
 .../integration/cartridge-agent.log             | 3372 ++++++++++++++++++
 .../python-cartridge-agent/integration/pom.xml  |   20 +-
 .../test/ADCMTAppTest.java                      |  213 ++
 .../python.cartridge.agent/test/ADCTest.java    |  138 +-
 .../test/AgentStartupTest.java                  |  149 +
 .../test/PythonAgentTestManager.java            |  455 +++
 .../test/PythonTestManager.java                 |  411 ---
 .../test/StartUpTest.java                       |  171 -
 .../src/test/resources/pca-testing1.xml         |    2 +-
 .../src/test/resources/pca-testing3.xml         |   29 +
 .../src/test/resources/suite-1/agent.conf       |    3 +-
 .../src/test/resources/suite-2/agent.conf       |    3 +-
 .../src/test/resources/suite-3/agent.conf       |   45 +
 .../src/test/resources/suite-3/jndi.properties  |   22 +
 .../src/test/resources/suite-3/logging.ini      |   52 +
 .../resources/suite-3/payload/launch-params     |    2 +
 18 files changed, 4422 insertions(+), 673 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/64368325/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/agent.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/agent.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/agent.py
index a17a589..533cf20 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/agent.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/agent.py
@@ -142,7 +142,7 @@ class ThriftPublisher(Thread):
         except ValueError:
             raise RuntimeError("Port number for Thrift Publisher is invalid: %r" % port)
 
-        self.__publisher = Publisher(ip, port_number)
+        self.__publisher = Publisher(ip, port_number, stream_definition)
         #self.__publisher.defineStream(str(stream_definition))
         self.stream_definition = stream_definition
         self.stream_id = self.__publisher.streamId

http://git-wip-us.apache.org/repos/asf/stratos/blob/64368325/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/publisher.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/publisher.py b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/publisher.py
index ea87718..e607d1b 100644
--- a/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/publisher.py
+++ b/components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/publisher.py
@@ -31,7 +31,7 @@ from thrift.protocol import TBinaryProtocol
 class Publisher:
     client = None
 
-    def __init__(self, ip, port):
+    def __init__(self, ip, port, stream_definition):
         # Make SSL socket
         self.socket = TSSLSocket.TSSLSocket(ip, port, False)
         # Buffering is critical. Raw sockets are very slow
@@ -40,8 +40,7 @@ class Publisher:
         self.protocol = TBinaryProtocol.TBinaryProtocol(self.transport)
         self.sessionId = None
         self.streamId = None
-
-        # self.event_num = 0
+        self.streamDef = stream_definition
 
     def connect(self, username, password):
         # Create a client to use the protocol encoder
@@ -51,6 +50,7 @@ class Publisher:
         self.socket.open()
         self.transport.open()
         self.sessionId = Publisher.client.connect(username, password)
+        self.streamId = Publisher.client.defineStream(self.sessionId, self.streamDef)
 
     def defineStream(self, streamDef):
         # Create Stream Definition