Package com.rallydev.rest.util

Examples of com.rallydev.rest.util.Fetch


    @Test
    public void shouldConstructTheCorrectUrl() {
        JsonObject body = new JsonObject();
        CreateRequest req = new CreateRequest("Defect", body);
        req.setFetch(new Fetch("Name", "Description"));
        Assert.assertEquals(req.toUrl(), "/defect/create.js?fetch=Name%2CDescription");
    }
View Full Code Here


        try {
            //Get a story with defects
            System.out.println("\nQuerying for stories with defects...");
            QueryRequest storiesWithDefects = new QueryRequest("hierarchicalrequirement");
            storiesWithDefects.setQueryFilter(new QueryFilter("Defects.ObjectID", "!=", null));
            storiesWithDefects.setFetch(new Fetch("FormattedID", "Name", "Defects"));
            QueryResponse storiesWithDefectsResponse = restApi.query(storiesWithDefects);
            JsonObject story = storiesWithDefectsResponse.getResults().get(0).getAsJsonObject();
            System.out.println(String.format("Found: %s - %s", story.get("FormattedID").getAsString(), story.get("Name").getAsString()));

            //Inspect the defects collection
            JsonObject defectInfo = story.getAsJsonObject("Defects");
            int defectCount = defectInfo.get("Count").getAsInt();
            System.out.println(String.format("\nTotal defects: %d", defectCount));

            //Query the defects collection
            QueryRequest defectRequest = new QueryRequest(defectInfo);
            defectRequest.setFetch(new Fetch("FormattedID", "Name", "State", "Priority"));

            QueryResponse queryResponse = restApi.query(defectRequest);
            if (queryResponse.wasSuccessful()) {
                for (JsonElement result : queryResponse.getResults()) {
                    JsonObject defect = result.getAsJsonObject();
View Full Code Here

    @Test
    public void shouldConstructTheCorrectUrl() {
        JsonObject body = new JsonObject();
        UpdateRequest req= new UpdateRequest("/defect/1234.js", body);
        req.setFetch(new Fetch("Name", "Description"));
        Assert.assertEquals(req.toUrl(), "/defect/1234.js?fetch=Name%2CDescription");
    }
View Full Code Here

    }

    @Test
    public void shouldReturnCorrectUrlWithFetchParams() {
        GetRequest req = new GetRequest("https://rally1.rallydev.com/slm/webservice/1.32/defect/1234.js");
        req.setFetch(new Fetch("Name", "Description"));
        Assert.assertEquals(req.toUrl(), "/defect/1234.js?fetch=Name%2CDescription");
    }
View Full Code Here

    @Test
    public void shouldCreateCorrectQueryWithFetch() {

        QueryRequest q = new QueryRequest("Defect");
        q.setFetch(new Fetch("Name", "Description"));
        Assert.assertTrue(q.toUrl().contains("fetch=Name%2CDescription"));
    }
View Full Code Here

        QueryRequest q = new QueryRequest("Defect");
        q.setProject("/project/1234");
        q.setProject("/workspace/2345");
        q.setScopedDown(false);
        q.setScopedUp(true);
        q.setFetch(new Fetch("Name", "Description"));
        q.setQueryFilter(new QueryFilter("State", "=", "Fixed"));
        q.setPageSize(5);
        q.setOrder("Name");
        q.setStart(10);
        q.addParam("foo", "Bar");
View Full Code Here

            System.out.println("Querying for top 5 highest priority unfixed defects...");

            QueryRequest defects = new QueryRequest("defect");

            defects.setFetch(new Fetch("FormattedID", "Name", "State", "Priority"));
            defects.setQueryFilter(new QueryFilter("State", "<", "Fixed"));
            defects.setOrder("Priority ASC,FormattedID ASC");

            //Return up to 5, 1 per page
            defects.setPageSize(1);
View Full Code Here

        try {
            //Get a story with defects
            System.out.println("\nQuerying for stories with defects...");
            QueryRequest storiesWithDefects = new QueryRequest("hierarchicalrequirement");
            storiesWithDefects.setQueryFilter(new QueryFilter("Defects.ObjectID", "!=", null));
            storiesWithDefects.setFetch(new Fetch("FormattedID", "Name", "Defects:summary[Priority;State]"));
            QueryResponse storiesWithDefectsResponse = restApi.query(storiesWithDefects);
            JsonObject story = storiesWithDefectsResponse.getResults().get(0).getAsJsonObject();
            System.out.println(String.format("Found: %s - %s", story.get("FormattedID").getAsString(), story.get("Name").getAsString()));

            System.out.println(String.format("\nSummarizing defects..."));
View Full Code Here

TOP

Related Classes of com.rallydev.rest.util.Fetch

Copyright © 2018 www.massapicom. 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.