Exemplo n.º 1
0
        protected ChangeRequest MakeChangeRequest(String mediaType)
        {
            CREATED_CHANGE_REQUEST_URI = null;

            ChangeRequest changeRequest = new ChangeRequest();

            changeRequest.AddContributor(new Uri("http://myserver/mycmapp/users/bob"));
            changeRequest.AddCreator(new Uri("http://myserver/mycmapp/users/bob"));
            changeRequest.AddDctermsType(ChangeManagement.Type.Defect.ToString());
            changeRequest.SetDescription("Invalid installation instructions indicating invalid patches to be applied.");
            changeRequest.SetDiscussedBy(new Uri("http://example.com/bugs/2314/discussion"));
            changeRequest.SetInstanceShape(new Uri("http://example.com/shapes/defect"));
            changeRequest.AddRelatedChangeRequest(new Link(new Uri("http://myserver/mycmapp/bugs/1235"), "Bug 1235"));
            changeRequest.SetSeverity(Severity.Major.ToString());
            changeRequest.SetShortTitle("Bug 2314");
            changeRequest.SetStatus("InProgress");
            changeRequest.AddSubject("doc");
            changeRequest.AddSubject("install");
            changeRequest.SetTitle("Invalid installation instructions");
            changeRequest.AddTracksRequirement(new Link(new Uri("http://myserver/reqtool/req/34ef31af")));
            changeRequest.AddTracksRequirement(new Link(new Uri("http://remoteserver/reqrepo/project1/req456"), "Requirement 456"));

            String creation = GetCreation(mediaType, Constants.TYPE_CHANGE_REQUEST);

            OslcRestClient oslcRestClient = new OslcRestClient(FORMATTERS,
                                                               creation,
                                                               mediaType);

            ChangeRequest addedChangeRequest = oslcRestClient.AddOslcResource(changeRequest);

            CREATED_CHANGE_REQUEST_URI = addedChangeRequest.GetAbout();

            return(addedChangeRequest);
        }