-
Notifications
You must be signed in to change notification settings - Fork 2
Projects
Projects are the hub of TestMonitor activities. All data -- like requirements, risks, test cases, test suites, milestones, test runs, test results, and issues -- link to a project.
To get a list of TestMonitor projects, use the list method:
ArrayList<Project> projects = client.projects().list();
This will return a paginated list of projects, limited by the default maximum of 15 records.
You can request a different page and change the record limit simply by passing them as arguments:
ArrayList<Project> projects = client.projects().list(2, 30);
This will retrieve the second page of a list of 30 records, i.e., records 31 through 60.
To get a single TestMonitor project, use the get method, which takes an project ID as parameter:
Project project = client.projects().get(1);
You can access its properties by using its getters:
Project project = client.projects().get(1);
System.out.println(project.getName());
System.out.println(project.getStartDate().toString());
System.out.println(project.getEndDate().toString());
This will output the project name, start- and end date.
Updating a project is just a matter of using the setters and the update method:
Project project = client.projects().get(1);
project.setName("A New Name");
client.projects().update(project);