stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From isu...@apache.org
Subject git commit: test for App with invalid Group
Date Mon, 13 Oct 2014 07:43:28 GMT
Repository: stratos
Updated Branches:
  refs/heads/4.0.0-grouping c80c05d7f -> 983d51ded


test for App with invalid Group


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

Branch: refs/heads/4.0.0-grouping
Commit: 983d51ded39b26826d69379ffc1feda8a3767c2d
Parents: c80c05d
Author: Isuru Haththotuwa <isuruh@apache.org>
Authored: Mon Oct 13 13:12:55 2014 +0530
Committer: Isuru Haththotuwa <isuruh@apache.org>
Committed: Mon Oct 13 13:13:07 2014 +0530

----------------------------------------------------------------------
 .../CompositeApplicationParseTest.java          | 52 ++++++++++++++++++++
 1 file changed, 52 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/983d51de/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/stratos/cloud/controller/application/CompositeApplicationParseTest.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/stratos/cloud/controller/application/CompositeApplicationParseTest.java
b/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/stratos/cloud/controller/application/CompositeApplicationParseTest.java
index d6f7928..7798274 100644
--- a/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/stratos/cloud/controller/application/CompositeApplicationParseTest.java
+++ b/components/org.apache.stratos.cloud.controller/src/test/java/org/apache/stratos/cloud/controller/application/CompositeApplicationParseTest.java
@@ -336,6 +336,58 @@ public class CompositeApplicationParseTest {
         applicationParser.parse(simpleAppCtxt);
     }
 
+    @Test (expected = ApplicationDefinitionException.class)
+    public void testAppWithOneCartridgeAndInvalidGroup () throws ApplicationDefinitionException
{
+
+        ApplicationParser applicationParser = new DefaultApplicationParser();
+        ApplicationContext simpleAppCtxt = new ApplicationContext();
+        // app id
+        simpleAppCtxt.setApplicationId("simpleApp");
+        simpleAppCtxt.setAlias("simpleAppAlias");
+        // tenant info
+        simpleAppCtxt.setTenantId(-1234);
+        // components
+        ComponentContext simpleAppComponentCtxt = new ComponentContext();
+        // top level cartridges
+        SubscribableContext simpleAppSubscribableContext = new SubscribableContext();
+        simpleAppSubscribableContext.setType("php");
+        simpleAppSubscribableContext.setAlias("myphp");
+        simpleAppComponentCtxt.setSubscribableContexts(new SubscribableContext[]{simpleAppSubscribableContext});
+        // top level group
+        GroupContext simpleGroupContext = new GroupContext();
+        // invalid Group 'group11'
+        simpleGroupContext.setName("group11");
+        simpleGroupContext.setAlias("mygroup1");
+        simpleGroupContext.setAutoscalingPolicy("group_autoscaling_policy_1");
+        simpleGroupContext.setDeploymentPolicy("group_deployment_policy_1");
+        SubscribableContext groupSubscribableCtxt = new SubscribableContext();
+        groupSubscribableCtxt.setType("mysql");
+        groupSubscribableCtxt.setAlias("mygroup1mysql");
+        simpleGroupContext.setSubscribableContexts(new SubscribableContext[]{groupSubscribableCtxt});
+        simpleAppComponentCtxt.setGroupContexts(new GroupContext[]{simpleGroupContext});
+        simpleAppCtxt.setComponents(simpleAppComponentCtxt);
+        // subscribable information
+        SubscribableInfoContext simpleAppSubscribableInfoCtxt = new SubscribableInfoContext();
+        simpleAppSubscribableInfoCtxt.setAlias("myphp");
+        simpleAppSubscribableInfoCtxt.setAutoscalingPolicy("deployment_policy_1");
+        simpleAppSubscribableInfoCtxt.setAutoscalingPolicy("autoscale_policy_1");
+        simpleAppSubscribableInfoCtxt.setRepoUrl("www.mygit.com/myphp.git");
+        simpleAppSubscribableInfoCtxt.setPrivateRepo(true);
+        simpleAppSubscribableInfoCtxt.setRepoUsername("admin");
+        simpleAppSubscribableInfoCtxt.setRepoUrl("admin123");
+
+        SubscribableInfoContext simpleAppGroupSubscribableInfoCtxt = new SubscribableInfoContext();
+        simpleAppGroupSubscribableInfoCtxt.setAlias("mygroup1mysql");
+        simpleAppGroupSubscribableInfoCtxt.setAutoscalingPolicy("mysql_autoscaling_policy");
+        simpleAppGroupSubscribableInfoCtxt.setDeploymentPolicy("mysql_deployment_policy");
+
+        simpleAppCtxt.setSubscribableInfoContext(new SubscribableInfoContext[]{simpleAppSubscribableInfoCtxt,
+                simpleAppGroupSubscribableInfoCtxt});
+
+        // parse
+        applicationParser.parse(simpleAppCtxt);
+    }
+
     @Test
     public void testAppWithOneCartridgeAndOneGroupWithDependencies () throws ApplicationDefinitionException
{
 


Mime
View raw message