Package br.eti.kinoshita.testlinkjavaapi.model

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


    public void testCreateProject(String notes, Boolean enableRequirements,
      Boolean enableTestPriority, Boolean enableAutomation,
      Boolean enableInventory, Boolean isActive, Boolean isPublic) {
  this.loadXMLRPCMockData("tl.createTestProject.xml");

  TestProject project = null;

  try {
      Random random = new Random(System.currentTimeMillis());

      project = api.createTestProject(
        "Sample project " + System.currentTimeMillis(),
        "" + random.nextInt(9999), notes, enableRequirements,
        enableTestPriority, enableAutomation, enableInventory,
        isActive, isPublic);
  } catch (TestLinkAPIException e) {
      Assert.fail(e.getMessage(), e);
  }

  Assert.assertNotNull(project);

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

  Assert.assertFalse(project.isActive());

    }
View Full Code Here


     *            Map with properties of a Test Project.
     * @return Test Project.
     */
    @SuppressWarnings("unchecked")
    public static final TestProject getTestProject(Map<String, Object> map) {
  TestProject testProject = 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) {
        testProject = new TestProject();
        testProject.setId(id);

        testProject.setName(getString(map,
          TestLinkResponseParams.NAME.toString()));
        testProject.setPrefix(getString(map,
          TestLinkResponseParams.PREFIX.toString()));
        testProject.setNotes(getString(map,
          TestLinkResponseParams.NOTES.toString()));

        Map<String, Object> optMap = (Map<String, Object>) map
          .get(TestLinkResponseParams.OPT.toString());
        testProject.setEnableAutomation(getBoolean(optMap,
          TestLinkResponseParams.AUTOMATION_ENABLED
            .toString()));
        testProject.setEnableRequirements(getBoolean(optMap,
          TestLinkResponseParams.REQUIREMENTS_ENABLED
            .toString()));
        testProject.setEnableTestPriority(getBoolean(optMap,
          TestLinkResponseParams.TEST_PRIORITY_ENABLED
            .toString()));
        testProject
          .setEnableInventory(getBoolean(optMap,
            TestLinkResponseParams.INVENTORY_ENABLED
              .toString()));

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

      }
  }
View Full Code Here

   * @return Test Project.
   */
  @SuppressWarnings("unchecked")
  public static final TestProject getTestProject(Map<String, Object> map)
  {
    TestProject testProject = 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 )
        {
          testProject = new TestProject();
          testProject.setId( id );
         
          testProject.setName( getString(map, TestLinkResponseParams.name.toString()) );
          testProject.setPrefix( getString(map, TestLinkResponseParams.prefix.toString() ) );
          testProject.setNotes( getString(map, TestLinkResponseParams.notes.toString() ) );
         
          Map<String, Object> optMap = (Map<String, Object>)map.get(TestLinkResponseParams.opt.toString());
          testProject.setEnableAutomation( getBoolean(optMap, TestLinkResponseParams.automationEnabled.toString()));
          testProject.setEnableRequirements( getBoolean(optMap, TestLinkResponseParams.requirementsEnabled.toString()));
          testProject.setEnableTestPriority( getBoolean(optMap, TestLinkResponseParams.testPriorityEnabled.toString()));
          testProject.setEnableInventory( getBoolean(optMap, TestLinkResponseParams.inventoryEnabled.toString()));
         
          testProject.setActive( getBoolean(map, TestLinkResponseParams.active.toString()));
          testProject.setPublic( getBoolean(map, TestLinkResponseParams.isPublic.toString()));
        }
       
      }     
    }
    return testProject;
View Full Code Here

    Boolean isActive,
    Boolean isPublic
  )
  throws TestLinkAPIException
  {
    TestProject testProject = null;
   
    Integer id = 0;
   
    testProject = new TestProject(
        id,
        testProjectName,
        testProjectPrefix,
        notes,
        enableRequirements,
        enableTestPriority,
        enableAutomation,
        enableInventory,
        isActive,
        isPublic);
   
    try
    {
      Map<String, Object> executionData = Util.getTestProjectMap(testProject);
      Object response = this.executeXmlRpcCall(
          TestLinkMethods.createTestProject.toString(), executionData);
      Object[] responseArray = (Object[])response;
      Map<String, Object> responseMap = (Map<String, Object>)responseArray[0];
     
      id = Util.getInteger(responseMap, TestLinkResponseParams.id.toString());
      testProject.setId( id );
    }
    catch ( XmlRpcException xmlrpcex )
    {
      throw new TestLinkAPIException(
          "Error creating test project: " + xmlrpcex.getMessage(), xmlrpcex);
View Full Code Here

 
  @SuppressWarnings("unchecked")
  protected TestProject getTestProjectByName(String projectName)
  throws TestLinkAPIException
  {
    TestProject testProject = null;
   
    try
    {
      Map<String, Object> executionData = new HashMap<String, Object>();
      executionData.put(TestLinkParams.testProjectName.toString(), projectName);
View Full Code Here

      Object[] responseArray = (Object[])response;
      projects = new TestProject[responseArray.length];
      for (int i = 0; i < responseArray.length; i++)
      {
        Map<String, Object> projectMap = (Map<String, Object>)responseArray[i];
        TestProject testProject = Util.getTestProject(projectMap);
        projects[i] = testProject;
      }
     
    }
    catch ( XmlRpcException xmlrpcex )
View Full Code Here

TOP

Related Classes of br.eti.kinoshita.testlinkjavaapi.model.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.