You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by chamilad <gi...@git.apache.org> on 2015/02/18 10:39:26 UTC

[GitHub] stratos pull request: PCA - Fixed PCA integration test to be param...

GitHub user chamilad opened a pull request:

    https://github.com/apache/stratos/pull/233

    PCA - Fixed PCA integration test to be parameterized on artifact updated event objects

    This fix enables to test the authenticated git clone on PCA and also fixes minor issues in test structure. 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/chamilad/stratos pca-test-01

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/stratos/pull/233.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #233
    
----
commit 15ab2ff48651b96de20f511d495ce2c05edcbefa
Author: Chamila de Alwis <ch...@wso2.com>
Date:   2015-02-14T22:29:12Z

    PCA - Refactored integration test to be parameterized and assert on instance activated event receival

commit 02af1f2e2877d24bc78e2747af0e60b8eeb3fb75
Author: Chamila de Alwis <ch...@wso2.com>
Date:   2015-02-14T22:49:02Z

    PCA - Adjustments in integration test

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] stratos pull request: PCA - Fixed PCA integration test to be param...

Posted by chamilad <gi...@git.apache.org>.
Github user chamilad closed the pull request at:

    https://github.com/apache/stratos/pull/233


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] stratos pull request: PCA - Fixed PCA integration test to be param...

Posted by chamilad <gi...@git.apache.org>.
Github user chamilad commented on the pull request:

    https://github.com/apache/stratos/pull/233#issuecomment-75126487
  
    Solved merge conflicts and re opened PR236.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] stratos pull request: PCA - Fixed PCA integration test to be param...

Posted by imesh <gi...@git.apache.org>.
Github user imesh commented on a diff in the pull request:

    https://github.com/apache/stratos/pull/233#discussion_r24972772
  
    --- Diff: components/org.apache.stratos.python.cartridge.agent/src/test/java/org/apache/stratos/python.cartridge.agent/test/PythonCartridgeAgentTest.java ---
    @@ -66,20 +69,77 @@
         private static final String PARTITION_ID = "partition-1";
         private static final String TENANT_ID = "-1234";
         private static final String SERVICE_NAME = "php";
    +    public static final String REPO_CLONE_PATH = "/tmp/stratos-pca-test-app-path/";
     
         private static List<ServerSocket> serverSocketList;
         private static Map<String, Executor> executorList;
    +    private final ArtifactUpdatedEvent artifactUpdatedEvent;
    +    private final Boolean expectedResult;
    +    private boolean instanceStarted;
    +    private boolean instanceActivated;
    +    private ByteArrayOutputStreamLocal outputStream;
    +    private TopologyEventReceiver topologyEventReceiver;
    +    private InstanceStatusEventReceiver instanceStatusEventReceiver;
    +    private boolean eventReceiverInitiated = false;
    +
    +    public PythonCartridgeAgentTest(ArtifactUpdatedEvent artifactUpdatedEvent, Boolean expectedResult) {
    +        this.artifactUpdatedEvent = artifactUpdatedEvent;
    +        this.expectedResult = expectedResult;
    +    }
     
         @BeforeClass
    -    public static void setUp() {
    +    public static void oneTimeSetUp() {
             // Set jndi.properties.dir system property for initializing event publishers and receivers
             System.setProperty("jndi.properties.dir", getResourcesFolderPath());
    +    }
    +
    +    @Before
    +    public void setup(){
             serverSocketList = new ArrayList<ServerSocket>();
             executorList = new HashMap<String, Executor>();
    +
    +        if (!this.eventReceiverInitiated) {
    +            ExecutorService executorService = StratosThreadPool.getExecutorService("TEST_THREAD_POOL", 5);
    +            topologyEventReceiver = new TopologyEventReceiver();
    +            topologyEventReceiver.setExecutorService(executorService);
    +            topologyEventReceiver.execute();
    +
    +            instanceStatusEventReceiver = new InstanceStatusEventReceiver();
    +            instanceStatusEventReceiver.setExecutorService(executorService);
    +            instanceStatusEventReceiver.execute();
    +
    +
    +            this.instanceStarted = false;
    +            instanceStatusEventReceiver.addEventListener(new InstanceStartedEventListener() {
    +                @Override
    +                protected void onEvent(Event event) {
    +                    log.info("Instance started event received");
    +                    instanceStarted = true;
    +                }
    +            });
    +
    +            this.instanceActivated = false;
    +            instanceStatusEventReceiver.addEventListener(new InstanceActivatedEventListener() {
    +                @Override
    +                protected void onEvent(Event event) {
    +                    log.info("Instance activated event received");
    +                    instanceActivated = true;
    +                }
    +            });
    +
    +            this.eventReceiverInitiated = true;
    +        }
    +
    +        String agentPath = setupPythonAgent();
    +        log.info("Starting python cartridge agent...");
    +        this.outputStream = executeCommand("python " + agentPath + "/agent.py");
    +
    +        // Simulate CEP server socket
    +        startServerSocket(7711);
         }
     
    -    @AfterClass
    -    public static void tearDown() {
    +    @After
    --- End diff --
    
    Can you please explain the reason for changing @AfterClass to @After?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] stratos pull request: PCA - Fixed PCA integration test to be param...

Posted by imesh <gi...@git.apache.org>.
Github user imesh commented on the pull request:

    https://github.com/apache/stratos/pull/233#issuecomment-75017599
  
    @chamilad There are some conflicts in your change. Can you please fix them?
    Thanks


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---