Examples of GroupDef


Examples of org.rhq.modules.integrationTests.restApi.d.GroupDef

    }

    @Test
    public void testCreateDefinitionWithoutName() throws Exception {

        GroupDef gd = new GroupDef();
        gd.setDescription("Just testing");
        List<String> list = new ArrayList<String>();
        list.add("groupby resource");
        list.add("resource.name");
        gd.setExpression(list);

        given()
            .contentType(ContentType.JSON)
            .header("Accept","application/json")
            .body(gd)
View Full Code Here

Examples of org.rhq.modules.integrationTests.restApi.d.GroupDef

    }

    @Test
    public void testCreateDefinitionWithNegativeRecalcInterval() throws Exception {

        GroupDef gd = new GroupDef();
        gd.setDescription("Just testing");
        List<String> list = new ArrayList<String>();
        list.add("groupby resource");
        list.add("resource.name");
        gd.setExpression(list);
        gd.setRecalcInterval(-5);

        given()
            .contentType(ContentType.JSON)
            .header("Accept","application/json")
            .body(gd)
View Full Code Here

Examples of org.rhq.modules.integrationTests.restApi.d.GroupDef

    }

    @Test
    public void testCreateEmptyDefinition() throws Exception {

        GroupDef gd = new GroupDef();
        gd.setName("li la lu");
        gd.setDescription("Just testing");
        List<String> list = new ArrayList<String>();
        gd.setExpression(list);

        given()
            .contentType(ContentType.JSON)
            .header("Accept","application/json")
            .body(gd)
View Full Code Here

Examples of org.rhq.modules.integrationTests.restApi.d.GroupDef

    }

    @Test
    public void testCreateDefinitionAllExpressionsEmpty() throws Exception {

        GroupDef gd = new GroupDef();
        gd.setName("li la lu");
        gd.setDescription("Just testing");
        List<String> list = new ArrayList<String>();
        list.add("");
        list.add(" ");
        list.add(null);
        gd.setExpression(list);

        given()
            .contentType(ContentType.JSON)
            .header("Accept","application/json")
            .body(gd)
View Full Code Here

Examples of org.rhq.modules.integrationTests.restApi.d.GroupDef

    }

    @Test
    public void testCreateDefinitionAlmostAllExpressionsEmpty() throws Exception {

        GroupDef gd = new GroupDef();
        gd.setName("li la lu2");
        gd.setDescription("Just testing");
        List<String> list = new ArrayList<String>();
        list.add("");
        list.add(" ");
        list.add(null);
        list.add("resource.availability = DOWN");
        gd.setExpression(list);

        Response response =
        given()
            .contentType(ContentType.JSON)
            .header("Accept","application/json")
View Full Code Here

Examples of org.rhq.modules.integrationTests.restApi.d.GroupDef

    }

    @Test
    public void testCreateRetrieveDeleteDefinition() throws Exception {

        GroupDef gd = new GroupDef("-x-test-def");
        gd.setDescription("Just testing");
        List<String> list = new ArrayList<String>();
        list.add("groupby resource.type.plugin");
        list.add("groupby resource.type.name");
        gd.setExpression(list);

        Response response =
        given()
            .contentType(ContentType.JSON)
            .header("Accept","application/json")
View Full Code Here

Examples of org.rhq.modules.integrationTests.restApi.d.GroupDef

    }

    @Test
    public void testUpdateUnknownGroupDefinition() throws Exception {

        GroupDef gd = new GroupDef("-x-test-def");
        gd.setDescription("Just testing");

        given()
            .contentType(ContentType.JSON)
            .header("Accept","application/json")
            .body(gd)
View Full Code Here

Examples of org.rhq.modules.integrationTests.restApi.d.GroupDef

    }

    @Test
    public void testCreateUpdateRecalcDeleteDefinition() throws Exception {

        GroupDef gd = new GroupDef("-x-test-def2");
        gd.setDescription("Just testing");
        List<String> list = new ArrayList<String>();
        list.add("groupby resource.trait[partitionName]");
        list.add("resource.type.plugin = JBossAS");
        list.add("resource.type.name = JBossAS Server");
        gd.setExpression(list);

        Response response =
        given()
            .contentType(ContentType.JSON)
            .header("Accept","application/json")
            .body(gd)
        .expect()
            .statusCode(201)
            .log().ifError()
        .when()
            .post("/group/definitions");


        String location = response.getHeader("Location");
        int defintionId = Integer.parseInt(location.substring(location.lastIndexOf("/")+1));

        try {
            gd.setDescription("Hulla");
            list = new ArrayList<String>(1);
            list.add("groupby resource.pluginConfiguration[productType]");
            gd.setExpression(list);

            given()
                .contentType(ContentType.JSON)
                .header("Accept", "application/json")
                .body(gd)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.