Package com.testlink.api.domain

Examples of com.testlink.api.domain.TestProject


    public static void main(String args[]) {

        try {
            TestLinkAPIClient client = new TestLinkAPIClient("http://demo.testlink.org/latest/lib/api/xmlrpc/v1/xmlrpc.php", "4f4c8d5e2bc5b573556b89d0db9b34e6");
            TestProject project = client.getTestProjectByName("ctftest");
            client.createTestSuite(project.getId(), "artf102345", "created from API");
        } catch (TestLinkAPIException e) {
            e.printStackTrace();
        }
        //System.out.println(client.testMiscService.about());
    }
View Full Code Here


        super(xmlRpcClient, devKey);
    }

    public TestProject getTestProjectByName(String projectName)
            throws TestLinkAPIException {
        TestProject testProject = null;

        try {
            Map<String, Object> executionData = new HashMap<String, Object>();
            executionData.put(Params.TEST_PROJECT_NAME.toString(), projectName);
            Object response = this.executeXmlRpcCall(
View Full Code Here

     * @return Created Test Project object.
     */
    public TestProject createTestProject(String testProjectName,
                                            String testProjectPrefix, String notes)
            throws TestLinkAPIException {
        TestProject testProject = null;

        Integer id = 0;

        testProject = new TestProject(id, testProjectName, notes, testProjectPrefix);

        try {
            Map<String, Object> executionData = getTestProjectMap(testProject);
            Object response = this.executeXmlRpcCall(
                    Methods.CREATE_TEST_PROJECT.toString(), executionData);
            Object[] responseArray = TestLinkHelper.castToArray(response);
            Map<String, Object> responseMap = (Map<String, Object>) responseArray[0];

            id = TestLinkHelper.getInteger(responseMap, Params.ID.toString());
            testProject.setId(id);
        } catch (XmlRpcException xmlrpcex) {
            throw new TestLinkAPIException("Error creating test project: "
                    + xmlrpcex.getMessage(), xmlrpcex);
        }

View Full Code Here

     * @param map Map with properties of a Test Project.
     * @return Test Project.
     */
    @SuppressWarnings("unchecked")
    private TestProject getTestProject(Map<String, Object> map) {
        TestProject testProject = null;
        if (map != null && map.size() > 0) {
            Object o = map.get(Params.ID.toString());
            if (o != null) {
                Integer id = Integer.parseInt(o.toString());

                if (id > 0) {
                    testProject = new TestProject();
                    testProject.setId(id);

                    testProject.setName(TestLinkHelper.getString(map, Params.NAME.toString()));
                }
            }
        }
        return testProject;
    }
View Full Code Here

   private String getTargetId(String artifactId) {
        String suiteId = null;
        try {
            TestLinkAPIClient client = new TestLinkAPIClient(testLinkServiceEndpoint, testLinkApiKey);
            TestProject project = client.getTestProjectByName("ctftest");
            TestSuite suite = client.createTestSuite(project.getId(), artifactId, "created from API");
            suiteId = suite.getId().toString();
        } catch (TestLinkAPIException e) {
            System.out.println(e.getMessage());
            log.info(e.getMessage());
        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.testlink.api.domain.TestProject

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.