You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ga...@apache.org on 2015/09/01 14:30:18 UTC

[40/50] [abbrv] stratos git commit: Merge with tenant-isolation branch

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
----------------------------------------------------------------------
diff --cc components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
index 8216d55,4b8fc3f..66ccf12
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41.java
@@@ -63,9 -67,10 +67,10 @@@ import java.net.URI
  import java.rmi.RemoteException;
  import java.util.ArrayList;
  import java.util.List;
+ import java.util.UUID;
  
  /**
 - * Stratos API v4.1 for Stratos 4.1.0 release.
 + * Stratos API v4.1 for Stratos 4.2.0 release.
   */
  @Path("/")
  public class StratosApiV41 extends AbstractApi {
@@@ -1253,10 -1312,17 +1315,18 @@@
              return Response.status(Response.Status.CONFLICT).entity(new ResponseMessageBean(
                      ResponseMessageBean.ERROR, message)).build();
          }
-         StratosApiV41Utils.undeployApplication(applicationId, force);
+ 
+         ApplicationContext applicationContext = null;
+         try {
+             applicationContext = AutoscalerServiceClient.getInstance().getApplicationByTenant(applicationId,
+                     carbonContext.getTenantId());
+         } catch (RemoteException e) {
+             throw new RestAPIException(e.getMessage());
+         }
+         StratosApiV41Utils.undeployApplication(applicationContext.getApplicationUuid(), force);
          return Response.accepted().entity(new ResponseMessageBean(ResponseMessageBean.SUCCESS,
 -                String.format("Application undeploy process started successfully: [application-id] %s", applicationId))).build();
 +                String.format("Application undeploy process started successfully: [application-id] %s",
 +                        applicationId))).build();
      }
  
      /**

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/util/converter/ObjectConverter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/dependencies/fabric8/pom.xml
----------------------------------------------------------------------
diff --cc dependencies/fabric8/pom.xml
index 5ecc4db,a67c452..6cde28b
--- a/dependencies/fabric8/pom.xml
+++ b/dependencies/fabric8/pom.xml
@@@ -35,4 -36,19 +35,4 @@@
      <modules>
          <module>kubernetes-api</module>
      </modules>
- </project>
 -
 -    <build>
 -        <plugins>
 -            <plugin>
 -                <groupId>org.apache.maven.plugins</groupId>
 -                <artifactId>maven-compiler-plugin</artifactId>
 -                <configuration>
 -                    <encoding>UTF-8</encoding>
 -                    <source>1.7</source>
 -                    <target>1.7</target>
 -                </configuration>
 -            </plugin>
 -        </plugins>
 -    </build>
+ </project>
 -

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/features/cloud-controller/org.apache.stratos.cloud.controller.feature/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/products/stratos/modules/distribution/src/main/conf/drools/scaling.drl
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/products/stratos/modules/distribution/src/main/conf/thrift-client-config.xml
----------------------------------------------------------------------
diff --cc products/stratos/modules/distribution/src/main/conf/thrift-client-config.xml
index 5cacada,0000000..f730c42
mode 100644,000000..100644
--- a/products/stratos/modules/distribution/src/main/conf/thrift-client-config.xml
+++ b/products/stratos/modules/distribution/src/main/conf/thrift-client-config.xml
@@@ -1,27 -1,0 +1,39 @@@
 +<?xml version="1.0" encoding="UTF-8"?>
 +<!--
 +  ~ 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.
 +  -->
 +
- <!-- Apache thrift client configuration for publishing statistics to WSO2 CEP -->
++<!-- Apache thrift client configuration for publishing statistics to WSO2 CEP and WSO2 DAS-->
 +<thriftClientConfiguration>
-     <username>admin</username>
-     <password>admin</password>
-     <ip>localhost</ip>
-     <port>7611</port>
++    <config>
++        <name>cep</name>
++        <statsPublisherEnabled>true</statsPublisherEnabled>
++        <username>admin</username>
++        <password>admin</password>
++        <ip>localhost</ip>
++        <port>7611</port>
++    </config>
++    <config>
++        <name>das</name>
++        <statsPublisherEnabled>false</statsPublisherEnabled>
++        <username>admin</username>
++        <password>admin</password>
++        <ip>localhost</ip>
++        <port>7612</port>
++    </config>
 +</thriftClientConfiguration>

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/products/stratos/modules/integration/pom.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/RestConstants.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/StratosTestServerManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/rest/RestClient.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/users/TenantTest.java
----------------------------------------------------------------------
diff --cc products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/users/TenantTest.java
index 437b162,0000000..a1998e1
mode 100644,000000..100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/users/TenantTest.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/users/TenantTest.java
@@@ -1,44 -1,0 +1,44 @@@
 +/*
 + * 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.stratos.integration.tests.users;
 +
 +import org.apache.stratos.integration.tests.RestConstants;
 +import org.apache.stratos.integration.tests.StratosTestServerManager;
 +import org.testng.annotations.Test;
 +
 +import static junit.framework.Assert.assertTrue;
 +
 +/**
 + * Handling users
 + */
 +public class TenantTest extends StratosTestServerManager {
 +    private static final String RESOURCES_PATH = "/user-test";
 +
 +
 +    @Test
 +    public void addUser() {
 +        String tenantId = "tenant-1";
-         boolean addedUser1 = restClient.addEntity(RESOURCES_PATH + "/" +
++        boolean addedUser1 = restClientAdmin.addEntity(RESOURCES_PATH + "/" +
 +                        tenantId + ".json",
 +                RestConstants.USERS, RestConstants.USERS_NAME);
 +        assertTrue(addedUser1);
 +
 +    }
 +}

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/users/UserTest.java
----------------------------------------------------------------------
diff --cc products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/users/UserTest.java
index c15250f,0000000..1b083df
mode 100644,000000..100644
--- a/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/users/UserTest.java
+++ b/products/stratos/modules/integration/src/test/java/org/apache/stratos/integration/tests/users/UserTest.java
@@@ -1,115 -1,0 +1,115 @@@
 +/*
 + * 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.stratos.integration.tests.users;
 +
 +import com.google.gson.reflect.TypeToken;
 +import org.apache.commons.logging.Log;
 +import org.apache.commons.logging.LogFactory;
 +import org.apache.stratos.common.beans.UserInfoBean;
 +import org.apache.stratos.common.beans.cartridge.CartridgeBean;
 +import org.apache.stratos.integration.tests.RestConstants;
 +import org.apache.stratos.integration.tests.StratosTestServerManager;
 +import org.testng.annotations.Test;
 +
 +import java.lang.reflect.Type;
 +import java.util.ArrayList;
 +import java.util.List;
 +
 +import static junit.framework.Assert.*;
 +
 +/**
 + * Handling users
 + */
 +public class UserTest extends StratosTestServerManager {
 +    private static final Log log = LogFactory.getLog(UserTest.class);
 +    private static final String RESOURCES_PATH = "/user-test";
 +
 +    @Test
 +    public void addUser() {
 +        try {
 +            log.info("-------------------------------Started users test case-------------------------------");
 +            String userId = "user-1";
-             boolean addedUser1 = restClient.addEntity(RESOURCES_PATH + "/" +
++            boolean addedUser1 = restClientAdmin.addEntity(RESOURCES_PATH + "/" +
 +                            userId + ".json",
 +                    RestConstants.USERS, RestConstants.USERS_NAME);
 +            assertTrue(addedUser1);
 +
 +            Type listType = new TypeToken<ArrayList<UserInfoBean>>() {
 +            }.getType();
 +
-             List<UserInfoBean> userInfoBeanList = (List<UserInfoBean>) restClient.listEntity(RestConstants.USERS,
++            List<UserInfoBean> userInfoBeanList = (List<UserInfoBean>) restClientAdmin.listEntity(RestConstants.USERS,
 +                    listType, RestConstants.USERS_NAME);
 +
 +            UserInfoBean bean1 = null;
 +            for (UserInfoBean userInfoBean : userInfoBeanList) {
 +                if (userInfoBean.getUserName().equals(userId)) {
 +                    bean1 = userInfoBean;
 +                }
 +            }
 +            assertNotNull(bean1);
 +            /*assertEquals(bean1.getEmail(), "foo@bar.com");
 +            assertEquals(bean1.getFirstName(), "Frank");
 +            assertEquals(bean1.getRole(), "admin");
 +            assertEquals(bean1.getLastName(), "Myers");
 +            assertEquals(bean1.getCredential(), "kim12345");*/
 +
-             boolean updatedUser1 = restClient.updateEntity(RESOURCES_PATH + "/" +
++            boolean updatedUser1 = restClientAdmin.updateEntity(RESOURCES_PATH + "/" +
 +                            userId + "-v1.json",
 +                    RestConstants.USERS, RestConstants.USERS_NAME);
 +            assertTrue(updatedUser1);
 +
-             userInfoBeanList = (List<UserInfoBean>) restClient.listEntity(RestConstants.USERS,
++            userInfoBeanList = (List<UserInfoBean>) restClientAdmin.listEntity(RestConstants.USERS,
 +                    listType, RestConstants.USERS_NAME);
 +
 +            for (UserInfoBean userInfoBean : userInfoBeanList) {
 +                if (userInfoBean.getUserName().equals(userId)) {
 +                    bean1 = userInfoBean;
 +                }
 +            }
 +            assertNotNull(bean1);
 +            /*assertEquals(bean1.getEmail(), "user-1@bar.com");
 +            assertEquals(bean1.getFirstName(), "Frankn");
 +            assertEquals(bean1.getRole(), "admin");
 +            assertEquals(bean1.getLastName(), "Myersn");
 +            assertEquals(bean1.getCredential(), "kim123456");*/
 +
-             boolean removedUser1 = restClient.removeEntity(RestConstants.USERS,
++            boolean removedUser1 = restClientAdmin.removeEntity(RestConstants.USERS,
 +                            userId, RestConstants.USERS_NAME);
 +            assertTrue(removedUser1);
 +
-             userInfoBeanList = (List<UserInfoBean>) restClient.listEntity(RestConstants.USERS,
++            userInfoBeanList = (List<UserInfoBean>) restClientAdmin.listEntity(RestConstants.USERS,
 +                    listType, RestConstants.USERS_NAME);
 +
 +            bean1 = null;
 +            for (UserInfoBean userInfoBean : userInfoBeanList) {
 +                if (userInfoBean.getUserName().equals(userId)) {
 +                    bean1 = userInfoBean;
 +                }
 +            }
 +            assertNull(bean1);
 +
 +            log.info("-------------------------Ended users test case-------------------------");
 +
 +        } catch (Exception e) {
 +            log.error("An error occurred while handling  application bursting", e);
 +            assertTrue("An error occurred while handling  application bursting", false);
 +        }
 +
 +    }
 +}

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
----------------------------------------------------------------------
diff --cc products/stratos/modules/integration/src/test/resources/stratos-testing.xml
index e8a48d2,ede5ff3..bb58de5
--- a/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
+++ b/products/stratos/modules/integration/src/test/resources/stratos-testing.xml
@@@ -21,71 -21,65 +21,59 @@@
  <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
  
  <suite name="StratosIntegrationSuite">
-     <test name="UserTest">
-         <classes>
-             <class name="org.apache.stratos.integration.tests.users.UserTest" />
-         </classes>
-     </test>
-     <test name="CartridgeTest">
-         <classes>
-             <class name="org.apache.stratos.integration.tests.group.CartridgeTest" />
-         </classes>
-     </test>
-     <test name="CartridgeGroupTest" >
-         <classes>
-             <class name="org.apache.stratos.integration.tests.group.CartridgeGroupTest" />
-         </classes>
-     </test>
-     <test name="NetworkPartitionTest">
-         <classes>
-             <class name="org.apache.stratos.integration.tests.policies.NetworkPartitionTest" />
-         </classes>
-     </test>
-     <test name="ApplicationPolicyTest">
-         <classes>
-             <class name="org.apache.stratos.integration.tests.policies.ApplicationPolicyTest" />
-         </classes>
-     </test>
-     <test name="DeploymentPolicyTest">
-         <classes>
-             <class name="org.apache.stratos.integration.tests.policies.DeploymentPolicyTest" />
-         </classes>
-     </test>
-     <test name="AutoscalingPolicyTest">
-         <classes>
-             <class name="org.apache.stratos.integration.tests.policies.AutoscalingPolicyTest" />
-         </classes>
-     </test>
-     <test name="SampleApplicationsTest">
-         <classes>
-             <class name="org.apache.stratos.integration.tests.application.SampleApplicationsTest" />
-         </classes>
-     </test>
-     <test name="ApplicationUpdateTest">
-         <classes>
-             <class name="org.apache.stratos.integration.tests.application.ApplicationUpdateTest" />
-         </classes>
-     </test>
-     <test name="SingleClusterScalingTest">
-         <classes>
-             <class name="org.apache.stratos.integration.tests.application.SingleClusterScalingTest" />
-         </classes>
-     </test>
-     <test name="ApplicationBurstingTest">
-         <classes>
-             <class name="org.apache.stratos.integration.tests.application.ApplicationBurstingTest" />
-         </classes>
-     </test>
-     <test name="PartitionRoundRobinClusterTest">
-         <classes>
-             <class name="org.apache.stratos.integration.tests.application.PartitionRoundRobinClusterTest" />
-         </classes>
-     </test>
-     <test name="GroupStartupOrderTest">
-         <classes>
-             <class name="org.apache.stratos.integration.tests.application.GroupStartupOrderTest" />
-         </classes>
-     </test>
+ 
+    <test name="CartridgeTest">
+        <classes>
+            <class name="org.apache.stratos.integration.tests.group.CartridgeTest" />
+        </classes>
+    </test>
+    <test name="CartridgeGroupTest" >
+        <classes>
+            <class name="org.apache.stratos.integration.tests.group.CartridgeGroupTest" />
+        </classes>
+    </test>
+ 
+    <test name="NetworkPartitionTest">
+        <classes>
+            <class name="org.apache.stratos.integration.tests.policies.NetworkPartitionTest" />
+        </classes>
+    </test>
+    <test name="ApplicationPolicyTest">
+        <classes>
+            <class name="org.apache.stratos.integration.tests.policies.ApplicationPolicyTest" />
+        </classes>
+    </test>
+    <test name="DeploymentPolicyTest">
+        <classes>
+            <class name="org.apache.stratos.integration.tests.policies.DeploymentPolicyTest" />
+        </classes>
+    </test>
+    <test name="AutoscalingPolicyTest">
+        <classes>
+            <class name="org.apache.stratos.integration.tests.policies.AutoscalingPolicyTest" />
+        </classes>
+    </test>
+    <test name="SampleApplicationsTest">
+        <classes>
+            <class name="org.apache.stratos.integration.tests.application.SampleApplicationsTest" />
+        </classes>
+    </test>
+   <test name="ApplicationBurstingTest">
+       <classes>
+           <class name="org.apache.stratos.integration.tests.application.ApplicationBurstingTest" />
+       </classes>
+   </test>
 -
 -  <test name="ApplicationUpdateTest">
 -       <classes>
 -           <class name="org.apache.stratos.integration.tests.application.ApplicationUpdateTest" />
 -       </classes>
 -   </test>
+    <test name="SingleClusterScalingTest">
+        <classes>
+            <class name="org.apache.stratos.integration.tests.application.SingleClusterScalingTest" />
+        </classes>
+    </test>
+    <test name="PartitionRoundRobinClusterTest">
+        <classes>
+            <class name="org.apache.stratos.integration.tests.application.PartitionRoundRobinClusterTest" />
+        </classes>
+    </test>
+ 
      <test name="GroupTerminationBehaviorTest">
          <classes>
              <class name="org.apache.stratos.integration.tests.application.GroupTerminationBehaviorTest" />

http://git-wip-us.apache.org/repos/asf/stratos/blob/2c34f816/samples/cartridges/kubernetes/php.json
----------------------------------------------------------------------
diff --cc samples/cartridges/kubernetes/php.json
index 6fa8399,260fb22..128b6da
--- a/samples/cartridges/kubernetes/php.json
+++ b/samples/cartridges/kubernetes/php.json
@@@ -23,7 -22,7 +23,7 @@@
      "iaasProvider": [
          {
              "type": "kubernetes",
-             "imageId": "stratos/php:4.2.0",
 -            "imageId": "stratos/php:4.1.0",
++            "imageId": "stratos/php:4.1.",
              "networkInterfaces": [
              ],
              "property": [