Package br.eti.kinoshita.testlinkjavaapi.model

Examples of br.eti.kinoshita.testlinkjavaapi.model.TestPlan


   * @param map
   * @return Test Plan.
   */
  public static final TestPlan getTestPlan( Map<String, Object> map )
  {
    TestPlan testPlan = null;
    if ( map != null && map.size() > 0 )
    {
      Object o = map.get( TestLinkResponseParams.id.toString());
      if ( o != null )
      {
        Integer id = Integer.parseInt( o.toString() );
       
        if ( id > 0 )
        {
          testPlan = new TestPlan();
          testPlan.setId( id );
         
          testPlan.setName( getString(map, TestLinkResponseParams.name.toString()) );
          testPlan.setProjectName( getString(map, TestLinkResponseParams.projectName.toString() ) );
          testPlan.setNotes( getString(map, TestLinkResponseParams.notes.toString() ) );
         
          testPlan.setActive( getBoolean(map, TestLinkResponseParams.active.toString()));
          testPlan.setPublic( getBoolean(map, TestLinkResponseParams.isPublic.toString()));
        }
       
      }     
    }
    return testPlan;
View Full Code Here


    /**
     * @param map
     * @return Test Plan.
     */
    public static final TestPlan getTestPlan(Map<String, Object> map) {
        TestPlan testPlan = null;
        if (map != null && map.size() > 0) {
            Object o = map.get(TestLinkResponseParams.ID.toString());
            if (o != null) {
                Integer id = Integer.parseInt(o.toString());

                if (id > 0) {
                    testPlan = new TestPlan();
                    testPlan.setId(id);

                    testPlan.setName(getString(map, TestLinkResponseParams.NAME.toString()));
                    testPlan.setProjectName(getString(map, TestLinkResponseParams.PROJECT_NAME.toString()));
                    testPlan.setNotes(getString(map, TestLinkResponseParams.NOTES.toString()));

                    testPlan.setActive(getBoolean(map, TestLinkResponseParams.ACTIVE.toString()));
                    testPlan.setPublic(getBoolean(map, TestLinkResponseParams.IS_PUBLIC.toString()));
                }

            }
        }
        return testPlan;
View Full Code Here

          executionData);
      Object[] responseArray = Util.castToArray(response);
      testPlans = new TestPlan[responseArray.length];
      for (int i = 0; i < responseArray.length; i++) {
        Map<String, Object> planMap = (Map<String, Object>) responseArray[i];
        TestPlan testPlan = Util.getTestPlan(planMap);
        testPlans[i] = testPlan;
      }

    } catch (XmlRpcException xmlrpcex) {
      throw new TestLinkAPIException("Error retrieving test plans: "
View Full Code Here

    @Test
    public void testRetrieveTestCaseForBuild() {
  try {
      this.loadXMLRPCMockData("tl.getTestPlanByName.xml");
      TestPlan plan = this.api.getTestPlanByName("Sample plan",
        "Sample project");

      this.loadXMLRPCMockData("tl.getLatestBuildForTestPlan.xml");
      Build build = this.api.getLatestBuildForTestPlan(plan.getId());

      Assert.assertNotNull(build);

      this.loadXMLRPCMockData("tl.getTestCasesForTestPlan.xml");
      TestCase[] tcs = this.api.getTestCasesForTestPlan(plan.getId(),
        null, null, null, null, Boolean.TRUE, null, null, null,
        null, null);

      for (TestCase tc : tcs) {
    Assert.assertNotNull(tc.getExecutionStatus());
    if (tc.getExecutionStatus() != ExecutionStatus.NOT_RUN) {
        this.loadXMLRPCMockData("tl.getLastExecutionResult.xml");
        Execution execution = this.api.getLastExecutionResult(
          plan.getId(), tc.getId(), null);
        Assert.assertNotNull(execution);
    }
      }
  } catch (TestLinkAPIException e) {
      Assert.fail("" + e.getMessage(), e);
View Full Code Here

    @Test(dataProvider = "testPlanData")
    public void testCreateTestPlan(String testProjectName, String notes,
      Boolean isActive, Boolean isPublic) {
  this.loadXMLRPCMockData("tl.createTestPlan.xml");

  TestPlan testPlan = null;

  try {
      testPlan = api.createTestPlan(
        "Sample plan " + System.currentTimeMillis(),
        testProjectName, notes, isActive, isPublic);
  } catch (TestLinkAPIException e) {
      Assert.fail(e.getMessage(), e);
  }

  Assert.assertNotNull(testPlan);

  Assert.assertTrue(testPlan.getId() > 0);
    }
View Full Code Here

    @Test(dataProvider = "testPlanData")
    public void testGetTestPlanByName(String testPlanName,
      String testProjectName) {
  this.loadXMLRPCMockData("tl.getTestPlanByName.xml");

  TestPlan testPlan = null;

  try {
      testPlan = this.api
        .getTestPlanByName(testPlanName, testProjectName);
  } catch (Exception e) {
      Assert.fail(e.getMessage(), e);
  }

  Assert.assertNotNull(testPlan);

  Assert.assertTrue(testPlan.getId() > 0);

  Assert.assertTrue(testPlan.getName() != null
    && testPlan.getName().length() > 0);

    }
View Full Code Here

    }

    protected TestPlan createTestPlan(String planName, String projectName,
            String notes, Boolean isActive, Boolean isPublic)
            throws TestLinkAPIException {
        TestPlan testPlan = null;

        Integer id = 0;

        testPlan = new TestPlan(id, planName, projectName, notes, isActive,
                isPublic);

        try {
            Map<String, Object> executionData = Util.getTestPlanMap(testPlan);
            Object response = this.executeXmlRpcCall(
                    TestLinkMethods.CREATE_TEST_PLAN.toString(), executionData);
            Object[] responseArray = (Object[]) response;
            Map<String, Object> responseMap = (Map<String, Object>) responseArray[0];

            id = Util.getInteger(responseMap,
                    TestLinkResponseParams.ID.toString());
            testPlan.setId(id);
        } catch (XmlRpcException xmlrpcex) {
            throw new TestLinkAPIException("Error creating test plan: "
                    + xmlrpcex.getMessage(), xmlrpcex);
        }
View Full Code Here

     * @return Test Plane.
     * @throws TestLinkAPIException
     */
    protected TestPlan getTestPlanByName(String planName, String projectName)
            throws TestLinkAPIException {
        TestPlan testPlan = null;

        try {
            Map<String, Object> executionData = new HashMap<String, Object>();
            executionData.put(TestLinkParams.TEST_PLAN_NAME.toString(),
                    planName);
View Full Code Here

    /**
     * @param map
     * @return Test Plan.
     */
    public static final TestPlan getTestPlan(Map<String, Object> map) {
  TestPlan testPlan = null;
  if (map != null && map.size() > 0) {
      Object o = map.get(TestLinkResponseParams.ID.toString());
      if (o != null) {
    Integer id = Integer.parseInt(o.toString());

    if (id > 0) {
        testPlan = new TestPlan();
        testPlan.setId(id);

        testPlan.setName(getString(map,
          TestLinkResponseParams.NAME.toString()));
        testPlan.setProjectName(getString(map,
          TestLinkResponseParams.PROJECT_NAME.toString()));
        testPlan.setNotes(getString(map,
          TestLinkResponseParams.NOTES.toString()));

        testPlan.setActive(getBoolean(map,
          TestLinkResponseParams.ACTIVE.toString()));
        testPlan.setPublic(getBoolean(map,
          TestLinkResponseParams.IS_PUBLIC.toString()));
    }

      }
  }
View Full Code Here

    }

    protected TestPlan createTestPlan(String planName, String projectName,
      String notes, Boolean isActive, Boolean isPublic)
      throws TestLinkAPIException {
  TestPlan testPlan = null;

  Integer id = 0;

  testPlan = new TestPlan(id, planName, projectName, notes, isActive,
    isPublic);

  try {
      Map<String, Object> executionData = Util.getTestPlanMap(testPlan);
      Object response = this.executeXmlRpcCall(
        TestLinkMethods.CREATE_TEST_PLAN.toString(), executionData);
      Object[] responseArray = (Object[]) response;
      Map<String, Object> responseMap = (Map<String, Object>) responseArray[0];

      id = Util.getInteger(responseMap,
        TestLinkResponseParams.ID.toString());
      testPlan.setId(id);
  } catch (XmlRpcException xmlrpcex) {
      throw new TestLinkAPIException("Error creating test plan: "
        + xmlrpcex.getMessage(), xmlrpcex);
  }
View Full Code Here

TOP

Related Classes of br.eti.kinoshita.testlinkjavaapi.model.TestPlan

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.