You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by la...@apache.org on 2015/04/07 09:35:11 UTC

[2/6] stratos git commit: Formatting cloud controller code

http://git-wip-us.apache.org/repos/asf/stratos/blob/de76b388/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java
index 400b389..d96638e 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/CloudControllerUtil.java
@@ -52,12 +52,12 @@ import java.util.Properties;
 
 
 public class CloudControllerUtil {
-	private static final Log log = LogFactory.getLog(CloudControllerUtil.class);
+    private static final Log log = LogFactory.getLog(CloudControllerUtil.class);
 
     public static Iaas createIaasInstance(IaasProvider iaasProvider)
             throws InvalidIaasProviderException {
         try {
-            if(iaasProvider.getClassName() == null) {
+            if (iaasProvider.getClassName() == null) {
                 String msg = "You have not specified a class which represents the iaas of type: ["
                         + iaasProvider.getType() + "].";
                 log.error(msg);
@@ -82,40 +82,40 @@ public class CloudControllerUtil {
         }
         Cartridge cartridge = new Cartridge();
 
-	    // populate cartridge
-	    cartridge.setType(config.getType());
-	    cartridge.setDisplayName(config.getDisplayName());
-	    cartridge.setDescription(config.getDescription());
-	    cartridge.setHostName(config.getHostName());
-	    String[] deploymentDirs = config.getDeploymentDirs();
-	    cartridge.setDeploymentDirs(deploymentDirs);
-	    cartridge.setProvider(config.getProvider());
-	    cartridge.setCategory(config.getCategory());
-	    cartridge.setVersion(config.getVersion());
-	    cartridge.setBaseDir(config.getBaseDir());
-        
+        // populate cartridge
+        cartridge.setType(config.getType());
+        cartridge.setDisplayName(config.getDisplayName());
+        cartridge.setDescription(config.getDescription());
+        cartridge.setHostName(config.getHostName());
+        String[] deploymentDirs = config.getDeploymentDirs();
+        cartridge.setDeploymentDirs(deploymentDirs);
+        cartridge.setProvider(config.getProvider());
+        cartridge.setCategory(config.getCategory());
+        cartridge.setVersion(config.getVersion());
+        cartridge.setBaseDir(config.getBaseDir());
+
         if (config.getPortMappings() != null) {
-			cartridge.setPortMappings(config.getPortMappings());
-		}
-        
-        if(config.getPersistence() != null){
-        	cartridge.setPersistence(config.getPersistence());
+            cartridge.setPortMappings(config.getPortMappings());
+        }
+
+        if (config.getPersistence() != null) {
+            cartridge.setPersistence(config.getPersistence());
         }
         cartridge.setMultiTenant(config.isMultiTenant());
         cartridge.setTenantPartitions(config.getTenantPartitions());
         cartridge.setLoadBalancingIPType(getLoadBalancingIPTypeStringFromEnum(LoadBalancingIPType.Private));
-        if(StringUtils.isNotBlank(config.getLoadBalancingIPType())) {
-            if(config.getLoadBalancingIPType().equals("public")) {
+        if (StringUtils.isNotBlank(config.getLoadBalancingIPType())) {
+            if (config.getLoadBalancingIPType().equals("public")) {
                 cartridge.setLoadBalancingIPType(getLoadBalancingIPTypeStringFromEnum(LoadBalancingIPType.Public));
             }
         }
 
         if (config.getMetadataKeys() == null) {
-			cartridge.setMetadataKeys(new String[0]);
-		} else {
-			cartridge.setMetadataKeys(config.getMetadataKeys());
-		}
-        
+            cartridge.setMetadataKeys(new String[0]);
+        } else {
+            cartridge.setMetadataKeys(config.getMetadataKeys());
+        }
+
         org.apache.stratos.common.Properties props = config.getProperties();
         if (props != null) {
             for (Property prop : props.getProperties()) {
@@ -174,7 +174,7 @@ public class CloudControllerUtil {
                     if (imageId != null) {
                         iaasProvider.setImage(imageId);
                     }
-                    
+
                     byte[] payload = iaasConfig.getPayload();
                     if (payload != null) {
                         iaasProvider.setPayload(payload);
@@ -186,7 +186,7 @@ public class CloudControllerUtil {
                             iaasProvider.addProperty(prop.getName(), String.valueOf(prop.getValue()));
                         }
                     }
-                    
+
                     NetworkInterfaces networkInterfaces = iaasConfig.getNetworkInterfaces();
                     if (networkInterfaces != null && networkInterfaces.getNetworkInterfaces() != null) {
                         iaasProvider.setNetworkInterfaces(networkInterfaces.getNetworkInterfaces());
@@ -197,20 +197,21 @@ public class CloudControllerUtil {
             }
         }
 
-        if(config.getExportingProperties() != null){
+        if (config.getExportingProperties() != null) {
             cartridge.setExportingProperties(config.getExportingProperties());
         }
 
         return cartridge;
     }
 
-    public static void sleep(long time){
-    	try {
-    		Thread.sleep(time);
-    	} catch (InterruptedException ignore) {}
-    	
+    public static void sleep(long time) {
+        try {
+            Thread.sleep(time);
+        } catch (InterruptedException ignore) {
+        }
+
     }
-	
+
     public static String getProperty(org.apache.stratos.common.Properties properties, String key, String defaultValue) {
         Properties props = toJavaUtilProperties(properties);
 
@@ -219,7 +220,7 @@ public class CloudControllerUtil {
 
     public static String getProperty(Properties properties, String key, String defaultValue) {
         if (key != null && properties != null) {
-            for (Iterator<Entry<Object, Object>> iterator = properties.entrySet().iterator(); iterator.hasNext();) {
+            for (Iterator<Entry<Object, Object>> iterator = properties.entrySet().iterator(); iterator.hasNext(); ) {
                 Entry<Object, Object> type = iterator.next();
                 String propName = type.getKey().toString();
                 String propValue = type.getValue().toString();
@@ -243,7 +244,7 @@ public class CloudControllerUtil {
     }
 
     public static org.apache.stratos.common.Properties addProperty(org.apache.stratos.common.Properties properties,
-            String key, String value) {
+                                                                   String key, String value) {
         Property property = new Property();
         property.setName(key);
         property.setValue(value);
@@ -252,20 +253,21 @@ public class CloudControllerUtil {
         newProperties.setProperties(ArrayUtils.add(properties.getProperties(), property));
         return newProperties;
     }
-	
-	/**
-	 * Converts org.apache.stratos.messaging.util.Properties to java.util.Properties
-	 * @param properties org.apache.stratos.messaging.util.Properties
-	 * @return java.util.Properties
-	 */
+
+    /**
+     * Converts org.apache.stratos.messaging.util.Properties to java.util.Properties
+     *
+     * @param properties org.apache.stratos.messaging.util.Properties
+     * @return java.util.Properties
+     */
     public static Properties toJavaUtilProperties(
-        org.apache.stratos.common.Properties properties) {
+            org.apache.stratos.common.Properties properties) {
         Properties javaUtilsProperties = new Properties();
 
         if (properties != null && properties.getProperties() != null) {
 
             for (Property property : properties.getProperties()) {
-                if((property != null) && (property.getValue() != null)) {
+                if ((property != null) && (property.getValue() != null)) {
                     javaUtilsProperties.put(property.getName(), property.getValue());
                 }
             }
@@ -274,14 +276,14 @@ public class CloudControllerUtil {
 
         return javaUtilsProperties;
     }
-    
+
     public static void persistTopology(Topology topology) {
-      try {
-          RegistryManager.getInstance().persist(CloudControllerConstants.TOPOLOGY_RESOURCE, topology);
-      } catch (RegistryException e) {
-          String msg = "Failed to persist the Topology in registry. ";
-          log.fatal(msg, e);
-      }
+        try {
+            RegistryManager.getInstance().persist(CloudControllerConstants.TOPOLOGY_RESOURCE, topology);
+        } catch (RegistryException e) {
+            String msg = "Failed to persist the Topology in registry. ";
+            log.fatal(msg, e);
+        }
     }
 
     public static Topology retrieveTopology() {
@@ -295,31 +297,31 @@ public class CloudControllerUtil {
         }
     }
 
-	
-	public static void handleException(String msg, Exception e){
-		log.error(msg, e);
-		throw new CloudControllerException(msg, e);
-	}
-	
-	public static void handleException(String msg){
-		log.error(msg);
-		throw new CloudControllerException(msg);
-	}
-
-	public static String getPartitionIds(Partition[] partitions) {
-		StringBuilder str = new StringBuilder("");
-		for (Partition partition : partitions) {
-			str.append(partition.getId()+", ");
-		}
-		
-		String partitionStr = str.length() == 0 ? str.toString() : str.substring(0, str.length()-2);
-		return "[" +partitionStr+ "]";
-	}
-	
-	public static void validateKubernetesCluster(KubernetesCluster kubernetesCluster) throws InvalidKubernetesClusterException {
+
+    public static void handleException(String msg, Exception e) {
+        log.error(msg, e);
+        throw new CloudControllerException(msg, e);
+    }
+
+    public static void handleException(String msg) {
+        log.error(msg);
+        throw new CloudControllerException(msg);
+    }
+
+    public static String getPartitionIds(Partition[] partitions) {
+        StringBuilder str = new StringBuilder("");
+        for (Partition partition : partitions) {
+            str.append(partition.getId() + ", ");
+        }
+
+        String partitionStr = str.length() == 0 ? str.toString() : str.substring(0, str.length() - 2);
+        return "[" + partitionStr + "]";
+    }
+
+    public static void validateKubernetesCluster(KubernetesCluster kubernetesCluster) throws InvalidKubernetesClusterException {
         CloudControllerContext context = CloudControllerContext.getInstance();
-	    
-	    if (kubernetesCluster == null) {
+
+        if (kubernetesCluster == null) {
             throw new InvalidKubernetesClusterException("Kubernetes cluster can not be null");
         }
         if (StringUtils.isEmpty(kubernetesCluster.getClusterId())) {
@@ -386,8 +388,8 @@ public class CloudControllerUtil {
             throw new InvalidKubernetesClusterException(e.getMessage());
         }
     }
-	
-	private static void validateKubernetesHosts(KubernetesHost[] kubernetesHosts) throws InvalidKubernetesHostException {
+
+    private static void validateKubernetesHosts(KubernetesHost[] kubernetesHosts) throws InvalidKubernetesHostException {
         if (kubernetesHosts == null || kubernetesHosts.length == 0) {
             return;
         }
@@ -430,18 +432,16 @@ public class CloudControllerUtil {
     public static String getLoadBalancingIPTypeStringFromEnum(LoadBalancingIPType loadBalancingIPType) {
         if (loadBalancingIPType == LoadBalancingIPType.Private) {
             return CloudControllerConstants.LOADBALANCING_IP_TYPE_PRIVATE;
-        }
-        else if (loadBalancingIPType == LoadBalancingIPType.Public) {
+        } else if (loadBalancingIPType == LoadBalancingIPType.Public) {
             return CloudControllerConstants.LOADBALANCING_IP_TYPE_PUBLIE;
         }
         return null;
     }
 
     public static LoadBalancingIPType getLoadBalancingIPTypeEnumFromString(String loadBalancingIPType) {
-        if(loadBalancingIPType.equals(CloudControllerConstants.LOADBALANCING_IP_TYPE_PUBLIE)) {
+        if (loadBalancingIPType.equals(CloudControllerConstants.LOADBALANCING_IP_TYPE_PUBLIE)) {
             return LoadBalancingIPType.Public;
-        }
-        else if(loadBalancingIPType.equals(CloudControllerConstants.LOADBALANCING_IP_TYPE_PRIVATE)) {
+        } else if (loadBalancingIPType.equals(CloudControllerConstants.LOADBALANCING_IP_TYPE_PRIVATE)) {
             return LoadBalancingIPType.Private;
         }
         return null;

http://git-wip-us.apache.org/repos/asf/stratos/blob/de76b388/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/ComputeServiceBuilderUtil.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/ComputeServiceBuilderUtil.java b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/ComputeServiceBuilderUtil.java
index af985b2..85ab3c8 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/ComputeServiceBuilderUtil.java
+++ b/components/org.apache.stratos.cloud.controller/src/main/java/org/apache/stratos/cloud/controller/util/ComputeServiceBuilderUtil.java
@@ -43,9 +43,9 @@ import java.util.Properties;
  * This class is responsible for creating a JClouds specific ComputeService object.
  */
 public class ComputeServiceBuilderUtil {
-    
+
     private static final Log log = LogFactory.getLog(ComputeServiceBuilderUtil.class);
-    
+
     public static byte[] getUserData(String payloadFileName) {
         byte[] bytes = null;
         try {
@@ -64,7 +64,7 @@ public class ComputeServiceBuilderUtil {
         return bytes;
     }
 
-    
+
     public static ComputeService buildDefaultComputeService(IaasProvider iaasProvider) {
 
         Properties properties = new Properties();
@@ -76,18 +76,18 @@ public class ComputeServiceBuilderUtil {
 
         // set modules
         Iterable<Module> modules =
-            ImmutableSet.<Module> of(new SshjSshClientModule(), new SLF4JLoggingModule(),
-                                     new EnterpriseConfigurationModule());
+                ImmutableSet.<Module>of(new SshjSshClientModule(), new SLF4JLoggingModule(),
+                        new EnterpriseConfigurationModule());
 
         // build context
         ContextBuilder builder =
-            ContextBuilder.newBuilder(iaasProvider.getProvider())
-                          .credentials(iaasProvider.getIdentity(), iaasProvider.getCredential()).modules(modules)
-                          .overrides(properties);
+                ContextBuilder.newBuilder(iaasProvider.getProvider())
+                        .credentials(iaasProvider.getIdentity(), iaasProvider.getCredential()).modules(modules)
+                        .overrides(properties);
 
         return builder.buildView(ComputeServiceContext.class).getComputeService();
     }
-    
+
     public static String extractRegion(IaasProvider iaas) {
         String region;
         // try to find region
@@ -99,19 +99,18 @@ public class ComputeServiceBuilderUtil {
         }
         return region;
     }
-    
-	public static String extractZone(IaasProvider iaas) {
 
-		return iaas.getProperty(CloudControllerConstants.AVAILABILITY_ZONE);
-	}
-	
-    /** Returns the contents of the file in a byte array
+    public static String extractZone(IaasProvider iaas) {
+
+        return iaas.getProperty(CloudControllerConstants.AVAILABILITY_ZONE);
+    }
+
+    /**
+     * Returns the contents of the file in a byte array
      *
-     * @param file
-     *            - Input File
+     * @param file - Input File
      * @return Bytes from the file
-     * @throws java.io.IOException
-     *             , if retrieving the file contents failed.
+     * @throws java.io.IOException , if retrieving the file contents failed.
      */
     public static byte[] getBytesFromFile(File file) throws IOException {
         if (!file.exists()) {
@@ -124,7 +123,7 @@ public class ComputeServiceBuilderUtil {
         try {
             // Get the size of the file
             long length = file.length();
-            
+
             // You cannot create an array using a long type.
             // It needs to be an int type.
             // Before converting to an int type, check
@@ -142,7 +141,7 @@ public class ComputeServiceBuilderUtil {
             int offset = 0;
             int numRead;
             while (offset < bytes.length &&
-                (numRead = is.read(bytes, offset, bytes.length - offset)) >= 0) {
+                    (numRead = is.read(bytes, offset, bytes.length - offset)) >= 0) {
                 offset += numRead;
             }
 
@@ -153,16 +152,15 @@ public class ComputeServiceBuilderUtil {
         } finally {
             // Close the input stream and return bytes
             is.close();
-         }
-        
+        }
+
         return bytes;
     }
-    
+
     /**
      * handles the exception
-     * 
-     * @param msg
-     *            exception message
+     *
+     * @param msg exception message
      */
     private static void handleException(String msg) {
         log.error(msg);
@@ -171,17 +169,15 @@ public class ComputeServiceBuilderUtil {
 
     /**
      * handles the exception
-     * 
-     * @param msg
-     *            exception message
-     * @param e
-     *            exception
+     *
+     * @param msg exception message
+     * @param e   exception
      */
     private static void handleException(String msg, Exception e) {
         log.error(msg, e);
         throw new CloudControllerException(msg, e);
 
     }
-    
-    
+
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/stratos/blob/de76b388/components/org.apache.stratos.cloud.controller/src/main/resources/META-INF/component.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/resources/META-INF/component.xml b/components/org.apache.stratos.cloud.controller/src/main/resources/META-INF/component.xml
index 1dc3a01..1e68714 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/resources/META-INF/component.xml
+++ b/components/org.apache.stratos.cloud.controller/src/main/resources/META-INF/component.xml
@@ -18,7 +18,7 @@
   -->
 <component xmlns="http://products.wso2.org/carbon">
     <deployers>
-    	<deployer>
+        <deployer>
             <directory>../../conf</directory>
             <extension>xml</extension>
             <class>org.apache.stratos.cloud.controller.deployers.CloudControllerDeployer</class>

http://git-wip-us.apache.org/repos/asf/stratos/blob/de76b388/components/org.apache.stratos.cloud.controller/src/main/resources/cartridge.xsd
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/resources/cartridge.xsd b/components/org.apache.stratos.cloud.controller/src/main/resources/cartridge.xsd
index 83833e5..d797048 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/resources/cartridge.xsd
+++ b/components/org.apache.stratos.cloud.controller/src/main/resources/cartridge.xsd
@@ -17,133 +17,134 @@
     specific language governing permissions and limitations
     under the License.
 -->
-<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
-  <xs:element name="cartridge">
-    <xs:annotation>
-      <xs:documentation>You can have 1..n cartridge elements.</xs:documentation>
-    </xs:annotation>
-    <xs:complexType>
-    	<xs:choice maxOccurs="unbounded">
-    		<xs:element name="property" maxOccurs="unbounded"
-    			minOccurs="0">
-    			<xs:annotation>
-    				<xs:documentation>
-    					cartridge element can have 0..n properties, and
-    					they'll be overwritten by the properties
-    					specified under iaasProvider child elements of
-    					cartridge element.
-    				</xs:documentation>
-    			</xs:annotation>
-    			<xs:complexType>
-    				<xs:simpleContent>
-    					<xs:extension base="xs:string">
-    						<xs:attribute type="xs:string" name="name" />
-    						<xs:attribute type="xs:string" name="value" />
-    					</xs:extension>
-    				</xs:simpleContent>
-    			</xs:complexType>
-    		</xs:element>
-    		<xs:element name="displayName" maxOccurs="1" minOccurs="0" />
-    		<xs:element name="description" maxOccurs="1" minOccurs="0" />
-    		<xs:element name="iaasProvider" maxOccurs="unbounded"
-    			minOccurs="1">
-    			<xs:annotation>
-    				<xs:documentation>
-    					A cartridge element should add a reference to an
-    					existing IaaS provider (specified in the above
-    					&amp;lt;iaasProviders&amp;gt; section) or it can
-    					create a completely new IaaS Provider (which
-    					should have a unique "type" attribute.
-    				</xs:documentation>
-    			</xs:annotation>
-    			<xs:complexType>
-    				<xs:choice maxOccurs="unbounded">
-                        <xs:element type="xs:string" name="scaleUpOrder"
-    						minOccurs="0" maxOccurs="1" />
-                        <xs:element type="xs:string" name="scaleDownOrder"
-    						minOccurs="0" maxOccurs="1" />
-    					<xs:element type="xs:string" name="imageId"
-    						minOccurs="0" maxOccurs="1" />
-    					<xs:element name="property"
-    						maxOccurs="unbounded" minOccurs="0">
-    						<xs:complexType>
-    							<xs:simpleContent>
-    								<xs:extension base="xs:string">
-    									<xs:attribute type="xs:string"
-    										name="name" />
-    									<xs:attribute type="xs:string"
-    										name="value" />
-    								</xs:extension>
-    							</xs:simpleContent>
-    						</xs:complexType>
-    					</xs:element>
-    				</xs:choice>
-    				<xs:attribute type="xs:string" name="type" />
-    			</xs:complexType>
-    		</xs:element>
-    		<xs:element name="deployment" maxOccurs="1" minOccurs="1">
-    			<xs:complexType>
-    				<xs:choice maxOccurs="unbounded">
-    					<xs:element name="dir" maxOccurs="unbounded"
-    						minOccurs="0" type="xs:string">
-    					</xs:element>
-    				</xs:choice>
-    				<xs:attribute name="baseDir" type="xs:string">
-    				</xs:attribute>
-    			</xs:complexType>
-    		</xs:element>
-    		<xs:element name="portMapping" maxOccurs="1"
-    			minOccurs="1">
-    			<xs:complexType>
-    				<xs:choice maxOccurs="unbounded">
-    					<xs:element name="http" maxOccurs="1"
-    						minOccurs="1">
-    						<xs:complexType>
-    							<xs:attribute name="port"
-    								type="xs:string" />
-    							<xs:attribute name="proxyPort"
-    								type="xs:string" />
-    						</xs:complexType>
-    					</xs:element>
-    					<xs:element name="https" maxOccurs="1"
-    						minOccurs="0">
-    						<xs:complexType>
-    							<xs:attribute name="port"
-    								type="xs:string" />
-    							<xs:attribute name="proxyPort"
-    								type="xs:string" />
-    						</xs:complexType>
-    					</xs:element>
-    				</xs:choice>
-    			</xs:complexType>
-    		</xs:element>
-    		<xs:element name="appTypes" maxOccurs="1"
-    			minOccurs="1">
-    			<xs:complexType>
-    				<xs:choice maxOccurs="unbounded">
-    					<xs:element name="appType" maxOccurs="unbounded"
-    						minOccurs="1">
-    						<xs:complexType>
-                                    <xs:attribute name="name" type="xs:string" use="required" />
+<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
+           xmlns:xs="http://www.w3.org/2001/XMLSchema">
+    <xs:element name="cartridge">
+        <xs:annotation>
+            <xs:documentation>You can have 1..n cartridge elements.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+            <xs:choice maxOccurs="unbounded">
+                <xs:element name="property" maxOccurs="unbounded"
+                            minOccurs="0">
+                    <xs:annotation>
+                        <xs:documentation>
+                            cartridge element can have 0..n properties, and
+                            they'll be overwritten by the properties
+                            specified under iaasProvider child elements of
+                            cartridge element.
+                        </xs:documentation>
+                    </xs:annotation>
+                    <xs:complexType>
+                        <xs:simpleContent>
+                            <xs:extension base="xs:string">
+                                <xs:attribute type="xs:string" name="name"/>
+                                <xs:attribute type="xs:string" name="value"/>
+                            </xs:extension>
+                        </xs:simpleContent>
+                    </xs:complexType>
+                </xs:element>
+                <xs:element name="displayName" maxOccurs="1" minOccurs="0"/>
+                <xs:element name="description" maxOccurs="1" minOccurs="0"/>
+                <xs:element name="iaasProvider" maxOccurs="unbounded"
+                            minOccurs="1">
+                    <xs:annotation>
+                        <xs:documentation>
+                            A cartridge element should add a reference to an
+                            existing IaaS provider (specified in the above
+                            &amp;lt;iaasProviders&amp;gt; section) or it can
+                            create a completely new IaaS Provider (which
+                            should have a unique "type" attribute.
+                        </xs:documentation>
+                    </xs:annotation>
+                    <xs:complexType>
+                        <xs:choice maxOccurs="unbounded">
+                            <xs:element type="xs:string" name="scaleUpOrder"
+                                        minOccurs="0" maxOccurs="1"/>
+                            <xs:element type="xs:string" name="scaleDownOrder"
+                                        minOccurs="0" maxOccurs="1"/>
+                            <xs:element type="xs:string" name="imageId"
+                                        minOccurs="0" maxOccurs="1"/>
+                            <xs:element name="property"
+                                        maxOccurs="unbounded" minOccurs="0">
+                                <xs:complexType>
+                                    <xs:simpleContent>
+                                        <xs:extension base="xs:string">
+                                            <xs:attribute type="xs:string"
+                                                          name="name"/>
+                                            <xs:attribute type="xs:string"
+                                                          name="value"/>
+                                        </xs:extension>
+                                    </xs:simpleContent>
+                                </xs:complexType>
+                            </xs:element>
+                        </xs:choice>
+                        <xs:attribute type="xs:string" name="type"/>
+                    </xs:complexType>
+                </xs:element>
+                <xs:element name="deployment" maxOccurs="1" minOccurs="1">
+                    <xs:complexType>
+                        <xs:choice maxOccurs="unbounded">
+                            <xs:element name="dir" maxOccurs="unbounded"
+                                        minOccurs="0" type="xs:string">
+                            </xs:element>
+                        </xs:choice>
+                        <xs:attribute name="baseDir" type="xs:string">
+                        </xs:attribute>
+                    </xs:complexType>
+                </xs:element>
+                <xs:element name="portMapping" maxOccurs="1"
+                            minOccurs="1">
+                    <xs:complexType>
+                        <xs:choice maxOccurs="unbounded">
+                            <xs:element name="http" maxOccurs="1"
+                                        minOccurs="1">
+                                <xs:complexType>
+                                    <xs:attribute name="port"
+                                                  type="xs:string"/>
+                                    <xs:attribute name="proxyPort"
+                                                  type="xs:string"/>
+                                </xs:complexType>
+                            </xs:element>
+                            <xs:element name="https" maxOccurs="1"
+                                        minOccurs="0">
+                                <xs:complexType>
+                                    <xs:attribute name="port"
+                                                  type="xs:string"/>
+                                    <xs:attribute name="proxyPort"
+                                                  type="xs:string"/>
+                                </xs:complexType>
+                            </xs:element>
+                        </xs:choice>
+                    </xs:complexType>
+                </xs:element>
+                <xs:element name="appTypes" maxOccurs="1"
+                            minOccurs="1">
+                    <xs:complexType>
+                        <xs:choice maxOccurs="unbounded">
+                            <xs:element name="appType" maxOccurs="unbounded"
+                                        minOccurs="1">
+                                <xs:complexType>
+                                    <xs:attribute name="name" type="xs:string" use="required"/>
                                     <xs:attribute name="appSpecificMapping"
-    								type="xs:string" />
-    						</xs:complexType>
-    					</xs:element>
-    				</xs:choice>
-    			</xs:complexType>
-    		</xs:element>
-    	</xs:choice>
-    	<xs:attribute type="xs:string" name="type" />
-    	<xs:attribute type="xs:string" name="host" />
-    	<xs:attribute type="xs:string" name="provider" />
-    	<xs:attribute type="xs:string" name="version" />
-    	<xs:attribute type="xs:boolean" name="multiTenant" />
-    </xs:complexType>
-  </xs:element>
+                                                  type="xs:string"/>
+                                </xs:complexType>
+                            </xs:element>
+                        </xs:choice>
+                    </xs:complexType>
+                </xs:element>
+            </xs:choice>
+            <xs:attribute type="xs:string" name="type"/>
+            <xs:attribute type="xs:string" name="host"/>
+            <xs:attribute type="xs:string" name="provider"/>
+            <xs:attribute type="xs:string" name="version"/>
+            <xs:attribute type="xs:boolean" name="multiTenant"/>
+        </xs:complexType>
+    </xs:element>
 
-  <!-- <xs:complexType name="deploymentType">
-  	<xs:sequence>
-  		<xs:element name="dir" type="xs:string" maxOccurs="1" minOccurs="1"></xs:element>
-  	</xs:sequence>
-  </xs:complexType> -->
+    <!-- <xs:complexType name="deploymentType">
+        <xs:sequence>
+            <xs:element name="dir" type="xs:string" maxOccurs="1" minOccurs="1"></xs:element>
+        </xs:sequence>
+    </xs:complexType> -->
 </xs:schema>

http://git-wip-us.apache.org/repos/asf/stratos/blob/de76b388/components/org.apache.stratos.cloud.controller/src/main/resources/cartridges.xsd
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/resources/cartridges.xsd b/components/org.apache.stratos.cloud.controller/src/main/resources/cartridges.xsd
index 894125d..23632cb 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/resources/cartridges.xsd
+++ b/components/org.apache.stratos.cloud.controller/src/main/resources/cartridges.xsd
@@ -17,144 +17,146 @@
     specific language governing permissions and limitations
     under the License.
 -->
-<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
-  <xs:element name="cartridges" >
-    <xs:annotation>
-      <xs:documentation>Use below section to specify properties that are needed in order to start Cartridges.</xs:documentation>
-    </xs:annotation>
-    <xs:complexType>
-    <xs:sequence>
-      <xs:choice maxOccurs="unbounded">
-        <xs:element name="cartridge" maxOccurs="unbounded" minOccurs="1">
-          <xs:annotation>
-            <xs:documentation>You can have 1..n cartridge elements.</xs:documentation>
-          </xs:annotation>
-          <xs:complexType>
-            <xs:choice maxOccurs="unbounded">
-            	<xs:element name="property" maxOccurs="unbounded"
-            		minOccurs="0">
-            		<xs:annotation>
-            			<xs:documentation>
-            				cartridge element can have 0..n properties,
-            				and they'll be overwritten by the properties
-            				specified under iaasProvider child elements
-            				of cartridge element.
-            			</xs:documentation>
-            		</xs:annotation>
-            		<xs:complexType>
-            			<xs:simpleContent>
-            				<xs:extension base="xs:string">
-            					<xs:attribute type="xs:string"
-            						name="name" />
-            					<xs:attribute type="xs:string"
-            						name="value" />
-            				</xs:extension>
-            			</xs:simpleContent>
-            		</xs:complexType>
-            	</xs:element>
-            	<xs:element name="displayName" maxOccurs="1"
-            		minOccurs="0" />
-            	<xs:element name="description" maxOccurs="1"
-            		minOccurs="0" />
-            	<xs:element name="iaasProvider" maxOccurs="unbounded"
-            		minOccurs="1">
-            		<xs:annotation>
-            			<xs:documentation>
-            				A cartridge element should add a reference
-            				to an existing IaaS provider (specified in
-            				the above &amp;lt;iaasProviders&amp;gt;
-            				section) or it can create a completely new
-            				IaaS Provider (which should have a unique
-            				"type" attribute.
-            			</xs:documentation>
-            		</xs:annotation>
-            		<xs:complexType>
-            			<xs:choice maxOccurs="unbounded">
-                            <xs:element type="xs:string" name="scaleUpOrder"
-    						    minOccurs="0" maxOccurs="1" />
-                            <xs:element type="xs:string" name="scaleDownOrder"
-    						    minOccurs="0" maxOccurs="1" />
-            				<xs:element type="xs:string" name="imageId"
-            					minOccurs="0" maxOccurs="1" />
-            				<xs:element name="property"
-            					maxOccurs="unbounded" minOccurs="0">
-            					<xs:complexType>
-            						<xs:simpleContent>
-            							<xs:extension
-            								base="xs:string">
-            								<xs:attribute
-            									type="xs:string" name="name" />
-            								<xs:attribute
-            									type="xs:string" name="value" />
-            							</xs:extension>
-            						</xs:simpleContent>
-            					</xs:complexType>
-            				</xs:element>
-            			</xs:choice>
-            			<xs:attribute type="xs:string" name="type" />
-            		</xs:complexType>
-            	</xs:element>
-            	<xs:element name="deployment" maxOccurs="1">
-            		<xs:complexType>
-            			<xs:choice maxOccurs="unbounded">
-            				<xs:element name="dir" maxOccurs="unbounded"
-            					minOccurs="0" type="xs:string">
-            				</xs:element>
-            			</xs:choice>
-            			<xs:attribute name="baseDir" type="xs:string">
-            			</xs:attribute>
-            		</xs:complexType>
-            	</xs:element>
-            	<xs:element name="portMapping" maxOccurs="1"
-            		minOccurs="1">
-            		<xs:complexType>
-            			<xs:choice maxOccurs="unbounded">
-            				<xs:element name="http" maxOccurs="1"
-            					minOccurs="1">
-            					<xs:complexType>
-            						<xs:attribute name="port"
-            							type="xs:string" />
-            						<xs:attribute name="proxyPort"
-            							type="xs:string" />
-            					</xs:complexType>
-            				</xs:element>
-            				<xs:element name="https" maxOccurs="1"
-            					minOccurs="0">
-            					<xs:complexType>
-            						<xs:attribute name="port"
-            							type="xs:string" />
-            						<xs:attribute name="proxyPort"
-            							type="xs:string" />
-            					</xs:complexType>
-            				</xs:element>
-            			</xs:choice>
-            		</xs:complexType>
-            	</xs:element>
-            	<xs:element name="appTypes" maxOccurs="1"
-    			minOccurs="1">
-    			<xs:complexType>
-    				<xs:choice maxOccurs="unbounded">
-    					<xs:element name="appType" maxOccurs="unbounded"
-    						minOccurs="1">
-    						<xs:complexType>
-                                    <xs:attribute name="name" type="xs:string" use="required" />
-                                    <xs:attribute name="appSpecificMapping"
-    								type="xs:string" />
-    						</xs:complexType>
-    					</xs:element>
-    				</xs:choice>
-    			</xs:complexType>
-    		</xs:element>
-            </xs:choice>
-            <xs:attribute type="xs:string" name="type"/>
-            <xs:attribute type="xs:string" name="host" />
-            <xs:attribute type="xs:string" name="provider" />
-            <xs:attribute type="xs:string" name="version" />
-            <xs:attribute type="xs:boolean" name="multiTenant" />
-          </xs:complexType>
-        </xs:element>
-      </xs:choice>
-      </xs:sequence>
-    </xs:complexType>
-  </xs:element>
+<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
+           xmlns:xs="http://www.w3.org/2001/XMLSchema">
+    <xs:element name="cartridges">
+        <xs:annotation>
+            <xs:documentation>Use below section to specify properties that are needed in order to start Cartridges.
+            </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+            <xs:sequence>
+                <xs:choice maxOccurs="unbounded">
+                    <xs:element name="cartridge" maxOccurs="unbounded" minOccurs="1">
+                        <xs:annotation>
+                            <xs:documentation>You can have 1..n cartridge elements.</xs:documentation>
+                        </xs:annotation>
+                        <xs:complexType>
+                            <xs:choice maxOccurs="unbounded">
+                                <xs:element name="property" maxOccurs="unbounded"
+                                            minOccurs="0">
+                                    <xs:annotation>
+                                        <xs:documentation>
+                                            cartridge element can have 0..n properties,
+                                            and they'll be overwritten by the properties
+                                            specified under iaasProvider child elements
+                                            of cartridge element.
+                                        </xs:documentation>
+                                    </xs:annotation>
+                                    <xs:complexType>
+                                        <xs:simpleContent>
+                                            <xs:extension base="xs:string">
+                                                <xs:attribute type="xs:string"
+                                                              name="name"/>
+                                                <xs:attribute type="xs:string"
+                                                              name="value"/>
+                                            </xs:extension>
+                                        </xs:simpleContent>
+                                    </xs:complexType>
+                                </xs:element>
+                                <xs:element name="displayName" maxOccurs="1"
+                                            minOccurs="0"/>
+                                <xs:element name="description" maxOccurs="1"
+                                            minOccurs="0"/>
+                                <xs:element name="iaasProvider" maxOccurs="unbounded"
+                                            minOccurs="1">
+                                    <xs:annotation>
+                                        <xs:documentation>
+                                            A cartridge element should add a reference
+                                            to an existing IaaS provider (specified in
+                                            the above &amp;lt;iaasProviders&amp;gt;
+                                            section) or it can create a completely new
+                                            IaaS Provider (which should have a unique
+                                            "type" attribute.
+                                        </xs:documentation>
+                                    </xs:annotation>
+                                    <xs:complexType>
+                                        <xs:choice maxOccurs="unbounded">
+                                            <xs:element type="xs:string" name="scaleUpOrder"
+                                                        minOccurs="0" maxOccurs="1"/>
+                                            <xs:element type="xs:string" name="scaleDownOrder"
+                                                        minOccurs="0" maxOccurs="1"/>
+                                            <xs:element type="xs:string" name="imageId"
+                                                        minOccurs="0" maxOccurs="1"/>
+                                            <xs:element name="property"
+                                                        maxOccurs="unbounded" minOccurs="0">
+                                                <xs:complexType>
+                                                    <xs:simpleContent>
+                                                        <xs:extension
+                                                                base="xs:string">
+                                                            <xs:attribute
+                                                                    type="xs:string" name="name"/>
+                                                            <xs:attribute
+                                                                    type="xs:string" name="value"/>
+                                                        </xs:extension>
+                                                    </xs:simpleContent>
+                                                </xs:complexType>
+                                            </xs:element>
+                                        </xs:choice>
+                                        <xs:attribute type="xs:string" name="type"/>
+                                    </xs:complexType>
+                                </xs:element>
+                                <xs:element name="deployment" maxOccurs="1">
+                                    <xs:complexType>
+                                        <xs:choice maxOccurs="unbounded">
+                                            <xs:element name="dir" maxOccurs="unbounded"
+                                                        minOccurs="0" type="xs:string">
+                                            </xs:element>
+                                        </xs:choice>
+                                        <xs:attribute name="baseDir" type="xs:string">
+                                        </xs:attribute>
+                                    </xs:complexType>
+                                </xs:element>
+                                <xs:element name="portMapping" maxOccurs="1"
+                                            minOccurs="1">
+                                    <xs:complexType>
+                                        <xs:choice maxOccurs="unbounded">
+                                            <xs:element name="http" maxOccurs="1"
+                                                        minOccurs="1">
+                                                <xs:complexType>
+                                                    <xs:attribute name="port"
+                                                                  type="xs:string"/>
+                                                    <xs:attribute name="proxyPort"
+                                                                  type="xs:string"/>
+                                                </xs:complexType>
+                                            </xs:element>
+                                            <xs:element name="https" maxOccurs="1"
+                                                        minOccurs="0">
+                                                <xs:complexType>
+                                                    <xs:attribute name="port"
+                                                                  type="xs:string"/>
+                                                    <xs:attribute name="proxyPort"
+                                                                  type="xs:string"/>
+                                                </xs:complexType>
+                                            </xs:element>
+                                        </xs:choice>
+                                    </xs:complexType>
+                                </xs:element>
+                                <xs:element name="appTypes" maxOccurs="1"
+                                            minOccurs="1">
+                                    <xs:complexType>
+                                        <xs:choice maxOccurs="unbounded">
+                                            <xs:element name="appType" maxOccurs="unbounded"
+                                                        minOccurs="1">
+                                                <xs:complexType>
+                                                    <xs:attribute name="name" type="xs:string" use="required"/>
+                                                    <xs:attribute name="appSpecificMapping"
+                                                                  type="xs:string"/>
+                                                </xs:complexType>
+                                            </xs:element>
+                                        </xs:choice>
+                                    </xs:complexType>
+                                </xs:element>
+                            </xs:choice>
+                            <xs:attribute type="xs:string" name="type"/>
+                            <xs:attribute type="xs:string" name="host"/>
+                            <xs:attribute type="xs:string" name="provider"/>
+                            <xs:attribute type="xs:string" name="version"/>
+                            <xs:attribute type="xs:boolean" name="multiTenant"/>
+                        </xs:complexType>
+                    </xs:element>
+                </xs:choice>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
 </xs:schema>

http://git-wip-us.apache.org/repos/asf/stratos/blob/de76b388/components/org.apache.stratos.cloud.controller/src/main/resources/service.xsd
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/resources/service.xsd b/components/org.apache.stratos.cloud.controller/src/main/resources/service.xsd
index 6d4335f..3cd8524 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/resources/service.xsd
+++ b/components/org.apache.stratos.cloud.controller/src/main/resources/service.xsd
@@ -17,48 +17,49 @@
     specific language governing permissions and limitations
     under the License.
 -->
-<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
-        <xs:element name="service">
-          <xs:annotation>
+<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
+           xmlns:xs="http://www.w3.org/2001/XMLSchema">
+    <xs:element name="service">
+        <xs:annotation>
             <xs:documentation>you can have 0..n service elements</xs:documentation>
-          </xs:annotation>
-          <xs:complexType>
-          	<xs:choice maxOccurs="unbounded">
-          		<xs:element name="cartridge">
-          			<xs:annotation>
-          				<xs:documentation>
-          					this element's value should be a reference
-          					to an existing cartridge
-          				</xs:documentation>
-          			</xs:annotation>
-          			<xs:complexType>
-          				<xs:simpleContent>
-          					<xs:extension base="xs:string">
-          						<xs:attribute type="xs:string"
-          							name="type" />
-          					</xs:extension>
-          				</xs:simpleContent>
-          			</xs:complexType>
-          		</xs:element>
-          		<xs:element name="payload" type="xs:string" maxOccurs="1" minOccurs="0"></xs:element>
-          		<xs:element name="host" type="xs:string" maxOccurs="1" minOccurs="0"></xs:element>
-          		<xs:element name="property"
-    						maxOccurs="unbounded" minOccurs="0">
-    						<xs:complexType>
-    							<xs:simpleContent>
-    								<xs:extension base="xs:string">
-    									<xs:attribute type="xs:string"
-    										name="name" />
-    									<xs:attribute type="xs:string"
-    										name="value" />
-    								</xs:extension>
-    							</xs:simpleContent>
-    						</xs:complexType>
-    					</xs:element>
-          	</xs:choice>
-          	<xs:attribute type="xs:string" name="domain" />
-              <xs:attribute type="xs:string" name="policyName" />
-          	<xs:attribute type="xs:string" name="tenantRange" />
-          </xs:complexType>
-        </xs:element>
+        </xs:annotation>
+        <xs:complexType>
+            <xs:choice maxOccurs="unbounded">
+                <xs:element name="cartridge">
+                    <xs:annotation>
+                        <xs:documentation>
+                            this element's value should be a reference
+                            to an existing cartridge
+                        </xs:documentation>
+                    </xs:annotation>
+                    <xs:complexType>
+                        <xs:simpleContent>
+                            <xs:extension base="xs:string">
+                                <xs:attribute type="xs:string"
+                                              name="type"/>
+                            </xs:extension>
+                        </xs:simpleContent>
+                    </xs:complexType>
+                </xs:element>
+                <xs:element name="payload" type="xs:string" maxOccurs="1" minOccurs="0"></xs:element>
+                <xs:element name="host" type="xs:string" maxOccurs="1" minOccurs="0"></xs:element>
+                <xs:element name="property"
+                            maxOccurs="unbounded" minOccurs="0">
+                    <xs:complexType>
+                        <xs:simpleContent>
+                            <xs:extension base="xs:string">
+                                <xs:attribute type="xs:string"
+                                              name="name"/>
+                                <xs:attribute type="xs:string"
+                                              name="value"/>
+                            </xs:extension>
+                        </xs:simpleContent>
+                    </xs:complexType>
+                </xs:element>
+            </xs:choice>
+            <xs:attribute type="xs:string" name="domain"/>
+            <xs:attribute type="xs:string" name="policyName"/>
+            <xs:attribute type="xs:string" name="tenantRange"/>
+        </xs:complexType>
+    </xs:element>
 </xs:schema>

http://git-wip-us.apache.org/repos/asf/stratos/blob/de76b388/components/org.apache.stratos.cloud.controller/src/main/resources/services.xsd
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/main/resources/services.xsd b/components/org.apache.stratos.cloud.controller/src/main/resources/services.xsd
index 77b18ca..87db993 100644
--- a/components/org.apache.stratos.cloud.controller/src/main/resources/services.xsd
+++ b/components/org.apache.stratos.cloud.controller/src/main/resources/services.xsd
@@ -17,53 +17,56 @@
     specific language governing permissions and limitations
     under the License.
 -->
-<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
-  <xs:element name="services">
-    <xs:annotation>
-      <xs:documentation>Here you specify the service domains related details.</xs:documentation>
-    </xs:annotation>
-    <xs:complexType>
-      <xs:choice maxOccurs="unbounded">
-        <xs:element name="service" maxOccurs="unbounded" minOccurs="1">
-          <xs:annotation>
-            <xs:documentation>you can have 0..n service elements</xs:documentation>
-          </xs:annotation>
-          <xs:complexType>
+<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
+           xmlns:xs="http://www.w3.org/2001/XMLSchema">
+    <xs:element name="services">
+        <xs:annotation>
+            <xs:documentation>Here you specify the service domains related details.</xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
             <xs:choice maxOccurs="unbounded">
-              <xs:element name="cartridge">
-                <xs:annotation>
-                  <xs:documentation>this element's value should be a reference to an existing cartridge</xs:documentation>
-                </xs:annotation>
-                <xs:complexType>
-                  <xs:simpleContent>
-                    <xs:extension base="xs:string">
-                      <xs:attribute type="xs:string" name="type"/>
-                    </xs:extension>
-                  </xs:simpleContent>
-                </xs:complexType>
-              </xs:element>
-              <xs:element name="payload" type="xs:string" maxOccurs="1" minOccurs="0"></xs:element>
-              <xs:element name="host" type="xs:string" maxOccurs="1" minOccurs="0"></xs:element>
-              <xs:element name="property"
-    						maxOccurs="unbounded" minOccurs="0">
-    						<xs:complexType>
-    							<xs:simpleContent>
-    								<xs:extension base="xs:string">
-    									<xs:attribute type="xs:string"
-    										name="name" />
-    									<xs:attribute type="xs:string"
-    										name="value" />
-    								</xs:extension>
-    							</xs:simpleContent>
-    						</xs:complexType>
-    					</xs:element>
+                <xs:element name="service" maxOccurs="unbounded" minOccurs="1">
+                    <xs:annotation>
+                        <xs:documentation>you can have 0..n service elements</xs:documentation>
+                    </xs:annotation>
+                    <xs:complexType>
+                        <xs:choice maxOccurs="unbounded">
+                            <xs:element name="cartridge">
+                                <xs:annotation>
+                                    <xs:documentation>this element's value should be a reference to an existing
+                                        cartridge
+                                    </xs:documentation>
+                                </xs:annotation>
+                                <xs:complexType>
+                                    <xs:simpleContent>
+                                        <xs:extension base="xs:string">
+                                            <xs:attribute type="xs:string" name="type"/>
+                                        </xs:extension>
+                                    </xs:simpleContent>
+                                </xs:complexType>
+                            </xs:element>
+                            <xs:element name="payload" type="xs:string" maxOccurs="1" minOccurs="0"></xs:element>
+                            <xs:element name="host" type="xs:string" maxOccurs="1" minOccurs="0"></xs:element>
+                            <xs:element name="property"
+                                        maxOccurs="unbounded" minOccurs="0">
+                                <xs:complexType>
+                                    <xs:simpleContent>
+                                        <xs:extension base="xs:string">
+                                            <xs:attribute type="xs:string"
+                                                          name="name"/>
+                                            <xs:attribute type="xs:string"
+                                                          name="value"/>
+                                        </xs:extension>
+                                    </xs:simpleContent>
+                                </xs:complexType>
+                            </xs:element>
+                        </xs:choice>
+                        <xs:attribute type="xs:string" name="domain"/>
+                        <xs:attribute type="xs:string" name="tenantRange"/>
+                        <xs:attribute type="xs:string" name="policyName"/>
+                    </xs:complexType>
+                </xs:element>
             </xs:choice>
-            <xs:attribute type="xs:string" name="domain"/>
-            <xs:attribute type="xs:string" name="tenantRange" />
-              <xs:attribute type="xs:string" name="policyName" />
-          </xs:complexType>
-        </xs:element>
-      </xs:choice>
-    </xs:complexType>
-  </xs:element>
+        </xs:complexType>
+    </xs:element>
 </xs:schema>

http://git-wip-us.apache.org/repos/asf/stratos/blob/de76b388/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/cartridge/autoscaler/service/axiom/AxiomValidationTest.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/cartridge/autoscaler/service/axiom/AxiomValidationTest.java b/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/cartridge/autoscaler/service/axiom/AxiomValidationTest.java
index 16c59b6..c9d30c1 100644
--- a/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/cartridge/autoscaler/service/axiom/AxiomValidationTest.java
+++ b/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/cartridge/autoscaler/service/axiom/AxiomValidationTest.java
@@ -27,7 +27,7 @@ import org.xml.sax.SAXParseException;
 import junit.framework.TestCase;
 
 public class AxiomValidationTest extends TestCase {
-    
+
     File xmlSchemaCartridges = new File("src/main/resources/cartridges.xsd");
     File xmlSchemaCartridge = new File("src/main/resources/cartridge.xsd");
     private String dir = "src/test/resources/";
@@ -35,80 +35,80 @@ public class AxiomValidationTest extends TestCase {
     public AxiomValidationTest(String name) {
         super(name);
     }
-    
+
     protected void setUp() throws Exception {
         super.setUp();
     }
 
     public final void testCartridgeValidation() throws Exception {
-        OMElement elt = AxiomXpathParserUtil.parse(new File(dir+"cartridges-1.xml"));
-        
+        OMElement elt = AxiomXpathParserUtil.parse(new File(dir + "cartridges-1.xml"));
+
         // schema 1 - cartridges 
         AxiomXpathParserUtil.validate(elt, xmlSchemaCartridges);
-        
-        elt = AxiomXpathParserUtil.parse(new File(dir+"cartridges-5.xml"));
+
+        elt = AxiomXpathParserUtil.parse(new File(dir + "cartridges-5.xml"));
         AxiomXpathParserUtil.validate(elt, xmlSchemaCartridges);
-        
-        elt = AxiomXpathParserUtil.parse(new File(dir+"cartridges-6.xml"));
+
+        elt = AxiomXpathParserUtil.parse(new File(dir + "cartridges-6.xml"));
         AxiomXpathParserUtil.validate(elt, xmlSchemaCartridges);
-        
-        elt = AxiomXpathParserUtil.parse(new File(dir+"cartridges-7.xml"));
+
+        elt = AxiomXpathParserUtil.parse(new File(dir + "cartridges-7.xml"));
         AxiomXpathParserUtil.validate(elt, xmlSchemaCartridges);
-        
-        elt = AxiomXpathParserUtil.parse(new File(dir+"cartridges-9.xml"));
+
+        elt = AxiomXpathParserUtil.parse(new File(dir + "cartridges-9.xml"));
         AxiomXpathParserUtil.validate(elt, xmlSchemaCartridges);
-        
-        elt = AxiomXpathParserUtil.parse(new File(dir+"cartridges-2.xml"));
+
+        elt = AxiomXpathParserUtil.parse(new File(dir + "cartridges-2.xml"));
         // schema 2 - cartridge
         AxiomXpathParserUtil.validate(elt, xmlSchemaCartridge);
-        
-        elt = AxiomXpathParserUtil.parse(new File(dir+"cartridges-8.xml"));
+
+        elt = AxiomXpathParserUtil.parse(new File(dir + "cartridges-8.xml"));
         AxiomXpathParserUtil.validate(elt, xmlSchemaCartridge);
     }
-    
+
     public final void testCartridgeInvalidation() {
-        OMElement elt1 = AxiomXpathParserUtil.parse(new File(dir+"cartridges-1.xml"));
-        OMElement elt2 = AxiomXpathParserUtil.parse(new File(dir+"cartridges-2.xml"));
-        OMElement elt3 = AxiomXpathParserUtil.parse(new File(dir+"cartridges-3.xml"));
-        OMElement elt4 = AxiomXpathParserUtil.parse(new File(dir+"cartridges-4.xml"));
-        
-     // schema 1 - cartridges 
+        OMElement elt1 = AxiomXpathParserUtil.parse(new File(dir + "cartridges-1.xml"));
+        OMElement elt2 = AxiomXpathParserUtil.parse(new File(dir + "cartridges-2.xml"));
+        OMElement elt3 = AxiomXpathParserUtil.parse(new File(dir + "cartridges-3.xml"));
+        OMElement elt4 = AxiomXpathParserUtil.parse(new File(dir + "cartridges-4.xml"));
+
+        // schema 1 - cartridges
         try {
             AxiomXpathParserUtil.validate(elt2, xmlSchemaCartridges);
         } catch (Exception e) {
             assertEquals(SAXParseException.class, e.getClass());
         }
-        
+
         try {
             AxiomXpathParserUtil.validate(elt3, xmlSchemaCartridges);
         } catch (Exception e) {
 
             assertEquals(SAXParseException.class, e.getClass());
         }
-        
+
         try {
             AxiomXpathParserUtil.validate(elt4, xmlSchemaCartridges);
         } catch (Exception e) {
 
             assertEquals(SAXParseException.class, e.getClass());
         }
-        
+
         // schema 2 - cartridge
-        
+
         try {
             AxiomXpathParserUtil.validate(elt1, xmlSchemaCartridge);
         } catch (Exception e) {
 
             assertEquals(SAXParseException.class, e.getClass());
         }
-        
+
         try {
             AxiomXpathParserUtil.validate(elt3, xmlSchemaCartridge);
         } catch (Exception e) {
 
             assertEquals(SAXParseException.class, e.getClass());
         }
-        
+
         try {
             AxiomXpathParserUtil.validate(elt4, xmlSchemaCartridge);
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/stratos/blob/de76b388/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/cartridge/autoscaler/service/axiom/AxiomXpathParserTest.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/cartridge/autoscaler/service/axiom/AxiomXpathParserTest.java b/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/cartridge/autoscaler/service/axiom/AxiomXpathParserTest.java
index 93683d6..49709eb 100644
--- a/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/cartridge/autoscaler/service/axiom/AxiomXpathParserTest.java
+++ b/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/cartridge/autoscaler/service/axiom/AxiomXpathParserTest.java
@@ -42,22 +42,22 @@ public class AxiomXpathParserTest extends TestCase {
 
         CloudControllerConfigParser.parse(docElt);
     }
-    
-    public void testGetMatchingNodes(){
+
+    public void testGetMatchingNodes() {
         List<OMNode> list = AxiomXpathParserUtil.getMatchingNodes("/cloudController/iaasProviders/iaasProvider/provider", docElt);
         assertEquals(1, list.size());
         assertEquals(1, CloudControllerConfig.getInstance().getIaasProviders().size());
     }
-    
+
     public void testDataPublisherConfig() {
-		assertEquals(true, CloudControllerConfig.getInstance().isBAMDataPublisherEnabled());
-		assertEquals("nirmal", CloudControllerConfig.getInstance().getDataPubConfig().getBamUsername());
-		assertEquals("nirmal", CloudControllerConfig.getInstance().getDataPubConfig().getBamPassword());
-	}
-    
+        assertEquals(true, CloudControllerConfig.getInstance().isBAMDataPublisherEnabled());
+        assertEquals("nirmal", CloudControllerConfig.getInstance().getDataPubConfig().getBamUsername());
+        assertEquals("nirmal", CloudControllerConfig.getInstance().getDataPubConfig().getBamPassword());
+    }
+
     public void testTopologySynchParser() {
-		assertNotNull(CloudControllerConfig.getInstance().getTopologyConfig());
-		assertEquals("1 * * * * ? *", CloudControllerConfig.getInstance().getTopologyConfig().getProperty("cron"));
-	}
+        assertNotNull(CloudControllerConfig.getInstance().getTopologyConfig());
+        assertEquals("1 * * * * ? *", CloudControllerConfig.getInstance().getTopologyConfig().getProperty("cron"));
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/de76b388/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/cartridge/autoscaler/service/axiom/CloudControllerContextTest.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/cartridge/autoscaler/service/axiom/CloudControllerContextTest.java b/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/cartridge/autoscaler/service/axiom/CloudControllerContextTest.java
index 91be61b..164e239 100644
--- a/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/cartridge/autoscaler/service/axiom/CloudControllerContextTest.java
+++ b/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/cartridge/autoscaler/service/axiom/CloudControllerContextTest.java
@@ -30,7 +30,7 @@ public class CloudControllerContextTest extends TestCase {
     public CloudControllerContextTest(String name) {
         super(name);
     }
-    
+
     protected void setUp() throws Exception {
         super.setUp();
     }
@@ -42,48 +42,50 @@ public class CloudControllerContextTest extends TestCase {
         ServiceReferenceHolder.getInstance().setDistributedObjectProvider(new HazelcastDistributedObjectProvider());
         ServiceReferenceHolder.getInstance().setAxisConfiguration(axisConfiguration);
 
-    	CloudControllerContext cloudControllerContext = CloudControllerContext.getInstance();
+        CloudControllerContext cloudControllerContext = CloudControllerContext.getInstance();
+
+        Thread t1 = new Thread(new MemberAdder(cloudControllerContext));
+        t1.start();
+        t1.join();
+        assertEquals(2, cloudControllerContext.getMemberContextsOfClusterId("cluster-1").size());
 
-		Thread t1 = new Thread(new MemberAdder(cloudControllerContext));
-    	t1.start();
-    	t1.join();
-    	assertEquals(2, cloudControllerContext.getMemberContextsOfClusterId("cluster-1").size());
+        Thread t2 = new Thread(new MemberRemover(cloudControllerContext));
+        t2.start();
+        t2.join();
+        assertEquals(1, cloudControllerContext.getMemberContextsOfClusterId("cluster-1").size());
 
-		Thread t2 = new Thread(new MemberRemover(cloudControllerContext));
-    	t2.start();
-    	t2.join();
-    	assertEquals(1, cloudControllerContext.getMemberContextsOfClusterId("cluster-1").size());
-    	
     }
 
     class MemberAdder implements Runnable {
-    	
-    	private CloudControllerContext dataHolder;
-    	public MemberAdder(CloudControllerContext data) {
-    		this.dataHolder = data;
-    	}
-    	@Override
-    	public void run() {
-    		MemberContext ctxt1 = new MemberContext("application-1", "cartridge-1", "cluster-1", "member-1");
-    		MemberContext ctxt2 = new MemberContext("application-1", "cartridge-1", "cluster-1", "member-2");
-    		MemberContext ctxt3 = new MemberContext("application-1", "cartridge-1", "cluster-2", "member-3");
-    		dataHolder.addMemberContext(ctxt1);
-    		dataHolder.addMemberContext(ctxt2);
-    		dataHolder.addMemberContext(ctxt3);
-    	}
+
+        private CloudControllerContext dataHolder;
+
+        public MemberAdder(CloudControllerContext data) {
+            this.dataHolder = data;
+        }
+
+        @Override
+        public void run() {
+            MemberContext ctxt1 = new MemberContext("application-1", "cartridge-1", "cluster-1", "member-1");
+            MemberContext ctxt2 = new MemberContext("application-1", "cartridge-1", "cluster-1", "member-2");
+            MemberContext ctxt3 = new MemberContext("application-1", "cartridge-1", "cluster-2", "member-3");
+            dataHolder.addMemberContext(ctxt1);
+            dataHolder.addMemberContext(ctxt2);
+            dataHolder.addMemberContext(ctxt3);
+        }
     }
-    
+
     class MemberRemover implements Runnable {
-    	
-    	private CloudControllerContext dataHolder;
 
-		public MemberRemover(CloudControllerContext cloudControllerContext) {
-    		this.dataHolder = cloudControllerContext;
-    	}
+        private CloudControllerContext dataHolder;
+
+        public MemberRemover(CloudControllerContext cloudControllerContext) {
+            this.dataHolder = cloudControllerContext;
+        }
 
-		@Override
-    	public void run() {
-    		dataHolder.removeMemberContext("cluster-1", "member-1");
-    	}
+        @Override
+        public void run() {
+            dataHolder.removeMemberContext("cluster-1", "member-1");
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/stratos/blob/de76b388/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-1.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-1.xml b/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-1.xml
index 60930fe..2d31871 100644
--- a/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-1.xml
+++ b/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-1.xml
@@ -21,35 +21,35 @@
 -->
 
 <!-- Use below section to specify properties that are needed in order to start Cartridges.  -->
-	<cartridges>
-	
-		<!-- You can have 1..n cartridge elements. -->
-		<cartridge type="php" host="abc.com" provider="carbon">
-			<!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties
-				 specified under iaasProvider child elements of cartridge element. -->
-			<property name="ss" value="slsls"/>
-			<property name="ss" value="slsls"/>
-			<description>This is a php cartridge.</description>
-			<deployment baseDir="xyz">
-				<dir>abc</dir>
-			</deployment>
-			<!-- A cartridge element should add a reference to an existing IaaS provider (specified
-				 in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
-				 Provider (which should have a unique "type" attribute. -->
-			<iaasProvider type="openstack" >
-				<imageId>nova/xxxxxxxxxx</imageId>
-				<property name="keyPair" value="aa"/>
-				<property name="instanceType" value="1"/>
-				<property name="payload" value="resources/as.txt"/>
-			</iaasProvider>
-			<iaasProvider type="ec2" >
-				<imageId>xxxxxxxxxx</imageId>
-				<property name="keyPair" value="aa"/>
-				<property name="securityGroups" value="manager,cep,mb,default"/>
-				<property name="instanceType" value="m1.large"/>
-				<property name="payload" value="resources/as-ec2.txt"/>
-			</iaasProvider>
-			
-		</cartridge>
-	
-	</cartridges>
+<cartridges>
+
+    <!-- You can have 1..n cartridge elements. -->
+    <cartridge type="php" host="abc.com" provider="carbon">
+        <!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties
+             specified under iaasProvider child elements of cartridge element. -->
+        <property name="ss" value="slsls"/>
+        <property name="ss" value="slsls"/>
+        <description>This is a php cartridge.</description>
+        <deployment baseDir="xyz">
+            <dir>abc</dir>
+        </deployment>
+        <!-- A cartridge element should add a reference to an existing IaaS provider (specified
+             in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
+             Provider (which should have a unique "type" attribute. -->
+        <iaasProvider type="openstack">
+            <imageId>nova/xxxxxxxxxx</imageId>
+            <property name="keyPair" value="aa"/>
+            <property name="instanceType" value="1"/>
+            <property name="payload" value="resources/as.txt"/>
+        </iaasProvider>
+        <iaasProvider type="ec2">
+            <imageId>xxxxxxxxxx</imageId>
+            <property name="keyPair" value="aa"/>
+            <property name="securityGroups" value="manager,cep,mb,default"/>
+            <property name="instanceType" value="m1.large"/>
+            <property name="payload" value="resources/as-ec2.txt"/>
+        </iaasProvider>
+
+    </cartridge>
+
+</cartridges>

http://git-wip-us.apache.org/repos/asf/stratos/blob/de76b388/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-2.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-2.xml b/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-2.xml
index 0872097..ac89e87 100644
--- a/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-2.xml
+++ b/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-2.xml
@@ -20,36 +20,36 @@
 
 -->
 
-	<!-- You can have 1..n cartridge elements. -->
-		<cartridge type="php">
-			<!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties
-				 specified under iaasProvider child elements of cartridge element. -->
-			<property name="ss" value="slsls"/>
-			
-			<!-- A cartridge element should add a reference to an existing IaaS provider (specified
-				 in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
-				 Provider (which should have a unique "type" attribute. -->
-			<iaasProvider type="openstack" >
-				<imageId>nova/xxxxxxxxxx</imageId>
-				<property name="keyPair" value="aa"/>
-				<property name="instanceType" value="1"/>
-				<property name="payload" value="resources/as.txt"/>
-			</iaasProvider>
-			<iaasProvider type="ec2" >
-				<imageId>xxxxxxxxxx</imageId>
-				<property name="keyPair" value="aa"/>
-				<property name="securityGroups" value="manager,cep,mb,default"/>
-				<property name="instanceType" value="m1.large"/>
-				<property name="payload" value="resources/as-ec2.txt"/>
-			</iaasProvider>
-			
-			<deployment>
-				<dir>abc/def</dir>
-			</deployment>
-			
-			<appTypes>
-				<appType name="axis2services" appSpecificMapping="true"/>
-				<appType name="webapps" appSpecificMapping="false"/>
-			</appTypes>
-		</cartridge>
+<!-- You can have 1..n cartridge elements. -->
+<cartridge type="php">
+    <!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties
+         specified under iaasProvider child elements of cartridge element. -->
+    <property name="ss" value="slsls"/>
+
+    <!-- A cartridge element should add a reference to an existing IaaS provider (specified
+         in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
+         Provider (which should have a unique "type" attribute. -->
+    <iaasProvider type="openstack">
+        <imageId>nova/xxxxxxxxxx</imageId>
+        <property name="keyPair" value="aa"/>
+        <property name="instanceType" value="1"/>
+        <property name="payload" value="resources/as.txt"/>
+    </iaasProvider>
+    <iaasProvider type="ec2">
+        <imageId>xxxxxxxxxx</imageId>
+        <property name="keyPair" value="aa"/>
+        <property name="securityGroups" value="manager,cep,mb,default"/>
+        <property name="instanceType" value="m1.large"/>
+        <property name="payload" value="resources/as-ec2.txt"/>
+    </iaasProvider>
+
+    <deployment>
+        <dir>abc/def</dir>
+    </deployment>
+
+    <appTypes>
+        <appType name="axis2services" appSpecificMapping="true"/>
+        <appType name="webapps" appSpecificMapping="false"/>
+    </appTypes>
+</cartridge>
 	

http://git-wip-us.apache.org/repos/asf/stratos/blob/de76b388/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-3.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-3.xml b/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-3.xml
index b3da31f..d6bb7d0 100644
--- a/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-3.xml
+++ b/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-3.xml
@@ -21,18 +21,18 @@
 -->
 
 <!-- Use below section to specify properties that are needed in order to start Cartridges.  -->
-	<cartridges>
-	
-		<!-- You can have 1..n cartridge elements. -->
-		<cartridge type="php">
-		
-			<!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties
-				 specified under iaasProvider child elements of cartridge element. -->
-			<property name="ss" value="slsls"/>
-			
-			<deployment>
-				<dir>abc</dir>
-			</deployment>
-		</cartridge>
-	
-	</cartridges>
+<cartridges>
+
+    <!-- You can have 1..n cartridge elements. -->
+    <cartridge type="php">
+
+        <!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties
+             specified under iaasProvider child elements of cartridge element. -->
+        <property name="ss" value="slsls"/>
+
+        <deployment>
+            <dir>abc</dir>
+        </deployment>
+    </cartridge>
+
+</cartridges>

http://git-wip-us.apache.org/repos/asf/stratos/blob/de76b388/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-4.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-4.xml b/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-4.xml
index 285d99d..496e373 100644
--- a/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-4.xml
+++ b/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-4.xml
@@ -21,34 +21,34 @@
 -->
 
 <!-- Use below section to specify properties that are needed in order to start Cartridges.  -->
-	<cartridges>
-	
-		<!-- You can have 1..n cartridge elements. -->
-		<cartridge>
-			<!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties
-				 specified under iaasProvider child elements of cartridge element. -->
-			<property name="ss" value="slsls"/>
-			<!-- A cartridge element should add a reference to an existing IaaS provider (specified
-				 in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
-				 Provider (which should have a unique "type" attribute. -->
-			<iaasProvider type="openstack" >
-				<imageId>nova/xxxxxxxxxx</imageId>
-				<property name="keyPair" value="aa"/>
-				<property name="instanceType" value="1"/>
-				<property name="payload" value="resources/as.txt"/>
-			</iaasProvider>
-			<iaasProvider type="ec2" >
-				<imageId>xxxxxxxxxx</imageId>
-				<property name="keyPair" value="aa"/>
-				<property name="securityGroups" value="manager,cep,mb,default"/>
-				<property name="instanceType" value="m1.large"/>
-				<property name="payload" value="resources/as-ec2.txt"/>
-			</iaasProvider>
-
-			<deployment>
-				<dir>abc</dir>
-				<dir>def</dir>
-			</deployment>
-		</cartridge>
-	
-	</cartridges>
+<cartridges>
+
+    <!-- You can have 1..n cartridge elements. -->
+    <cartridge>
+        <!-- cartridge element can have 0..n properties, and they'll be overwritten by the properties
+             specified under iaasProvider child elements of cartridge element. -->
+        <property name="ss" value="slsls"/>
+        <!-- A cartridge element should add a reference to an existing IaaS provider (specified
+             in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
+             Provider (which should have a unique "type" attribute. -->
+        <iaasProvider type="openstack">
+            <imageId>nova/xxxxxxxxxx</imageId>
+            <property name="keyPair" value="aa"/>
+            <property name="instanceType" value="1"/>
+            <property name="payload" value="resources/as.txt"/>
+        </iaasProvider>
+        <iaasProvider type="ec2">
+            <imageId>xxxxxxxxxx</imageId>
+            <property name="keyPair" value="aa"/>
+            <property name="securityGroups" value="manager,cep,mb,default"/>
+            <property name="instanceType" value="m1.large"/>
+            <property name="payload" value="resources/as-ec2.txt"/>
+        </iaasProvider>
+
+        <deployment>
+            <dir>abc</dir>
+            <dir>def</dir>
+        </deployment>
+    </cartridge>
+
+</cartridges>

http://git-wip-us.apache.org/repos/asf/stratos/blob/de76b388/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-5.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-5.xml b/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-5.xml
index cb7efe6..65dadaa 100644
--- a/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-5.xml
+++ b/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-5.xml
@@ -21,31 +21,31 @@
 -->
 
 <!-- Use below section to specify properties that are needed in order to start Cartridges.  -->
-	<cartridges>
-	
-		<!-- You can have 1..n cartridge elements. -->
-		<cartridge type="php">
-			
-			<!-- A cartridge element should add a reference to an existing IaaS provider (specified
-				 in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
-				 Provider (which should have a unique "type" attribute. -->
-			<iaasProvider type="openstack" >
-				<imageId>nova/xxxxxxxxxx</imageId>
-				<property name="keyPair" value="aa"/>
-				<property name="instanceType" value="1"/>
-				<property name="payload" value="resources/as.txt"/>
-			</iaasProvider>
-			<iaasProvider type="ec2" >
-				<imageId>xxxxxxxxxx</imageId>
-				<property name="keyPair" value="aa"/>
-				<property name="securityGroups" value="manager,cep,mb,default"/>
-				<property name="instanceType" value="m1.large"/>
-				<property name="payload" value="resources/as-ec2.txt"/>
-			</iaasProvider>
-			
-			<deployment>
-				<dir>abc</dir>
-			</deployment>
-		</cartridge>
-	
-	</cartridges>
+<cartridges>
+
+    <!-- You can have 1..n cartridge elements. -->
+    <cartridge type="php">
+
+        <!-- A cartridge element should add a reference to an existing IaaS provider (specified
+             in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
+             Provider (which should have a unique "type" attribute. -->
+        <iaasProvider type="openstack">
+            <imageId>nova/xxxxxxxxxx</imageId>
+            <property name="keyPair" value="aa"/>
+            <property name="instanceType" value="1"/>
+            <property name="payload" value="resources/as.txt"/>
+        </iaasProvider>
+        <iaasProvider type="ec2">
+            <imageId>xxxxxxxxxx</imageId>
+            <property name="keyPair" value="aa"/>
+            <property name="securityGroups" value="manager,cep,mb,default"/>
+            <property name="instanceType" value="m1.large"/>
+            <property name="payload" value="resources/as-ec2.txt"/>
+        </iaasProvider>
+
+        <deployment>
+            <dir>abc</dir>
+        </deployment>
+    </cartridge>
+
+</cartridges>

http://git-wip-us.apache.org/repos/asf/stratos/blob/de76b388/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-6.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-6.xml b/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-6.xml
index 15ca74a..6f42c4e 100644
--- a/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-6.xml
+++ b/components/org.apache.stratos.cloud.controller/src/test/resources/cartridges-6.xml
@@ -21,21 +21,21 @@
 -->
 
 <!-- Use below section to specify properties that are needed in order to start Cartridges.  -->
-	<cartridges>
-	
-		<!-- You can have 1..n cartridge elements. -->
-		<cartridge type="php">
-			
-			<!-- A cartridge element should add a reference to an existing IaaS provider (specified
-				 in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
-				 Provider (which should have a unique "type" attribute. -->
-			<iaasProvider type="openstack" >
-				<imageId>nova/xxxxxxxxxx</imageId>
-			</iaasProvider>
-		
-			<deployment>
-				<dir>abc</dir>
-			</deployment>
-		</cartridge>
-	
-	</cartridges>
+<cartridges>
+
+    <!-- You can have 1..n cartridge elements. -->
+    <cartridge type="php">
+
+        <!-- A cartridge element should add a reference to an existing IaaS provider (specified
+             in the above &lt;iaasProviders&gt; section) or it can create a completely new IaaS
+             Provider (which should have a unique "type" attribute. -->
+        <iaasProvider type="openstack">
+            <imageId>nova/xxxxxxxxxx</imageId>
+        </iaasProvider>
+
+        <deployment>
+            <dir>abc</dir>
+        </deployment>
+    </cartridge>
+
+</cartridges>