Examples of TestCase


Examples of au.com.rayh.report.TestCase

    }

    @Test
    public void shouldAddErrorToTestCase() throws Exception {
        parser.currentTestSuite = new TestSuite("host", "PisClientTestCase", new Date());
        parser.currentTestCase = new TestCase("PisClientTestCase", "testThatFails");
        String line = "/Users/ray/Development/Projects/Java/xcodebuild-hudson-plugin/work/jobs/PBS Streamer/workspace/PisClientTestCase.m:21: error: -[PisClientTestCase testThatFails] : \"((nil) != nil)\" should be true. This always fails";
        parser.handleLine(line);
        assertEquals(1, parser.currentTestCase.getFailures().size());
        assertEquals("/Users/ray/Development/Projects/Java/xcodebuild-hudson-plugin/work/jobs/PBS Streamer/workspace/PisClientTestCase.m:21", parser.currentTestCase.getFailures().get(0).getLocation());
        assertEquals("\"((nil) != nil)\" should be true. This always fails", parser.currentTestCase.getFailures().get(0).getMessage());
View Full Code Here

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

     * @param map
     * @return Test Case.
     */
    @SuppressWarnings("unchecked")
    public static final TestCase getTestCase(Map<String, Object> map) {
        TestCase testCase = null;
        if (map != null && map.size() > 0) {
            // IMPORTANT: http://mantis.testlink.org/view.php?id=4784
            // Different methods to recover test cases use different parameter
            // names for the id, some uses "id" and others "testcase_id".
            Object o = map.get(TestLinkResponseParams.TEST_CASE_ID.toString());
            if (o == null) {
                o = map.get(TestLinkResponseParams.ID.toString());
            }

            if (o != null) {
                Integer id = Integer.parseInt(o.toString());

                if (id > 0) {
                    testCase = new TestCase();
                    testCase.setId(id);
                    testCase.setVersionId(getInteger(map, TestLinkResponseParams.TEST_CASE_VERSION_ID.toString()));
                    testCase.setVersion(getInteger(map, TestLinkResponseParams.VERSION.toString()));
                    testCase.setPreconditions(getString(map, TestLinkResponseParams.PRECONDITIONS.toString()));
                    testCase.setSummary(getString(map, TestLinkResponseParams.SUMMARY.toString()));
                    testCase.setParentId(getInteger(map, TestLinkResponseParams.PARENT_ID.toString()));
                    testCase.setOrder(getInteger(map, TestLinkResponseParams.ORDER.toString()));
                    testCase.setExecutionOrder(getInteger(map, TestLinkResponseParams.EXECUTION_ORDER.toString()));
                    // the name of the test case is not always in the same parameter
                    String testCaseName = getString(map, TestLinkResponseParams.TCASE_NAME.toString());
                    if (testCaseName == null) {
                        testCaseName = getString(map, TestLinkResponseParams.NAME.toString());
                    }
                    testCase.setName(testCaseName);

                    Platform platform = null;
                    String platformName = getString(map, TestLinkResponseParams.PLATFORM_NAME.toString());
                    Integer platformId = getInteger(map, TestLinkResponseParams.PLATFORM_ID.toString());
                    if (platformName != null || platformId != null) { // sometimes TL may return only one or the other
                        platform = new Platform();
                        platform.setId(platformId);
                        platform.setName(platformName);
                    }
                    testCase.setPlatform(platform);

                    testCase.setFeatureId(getInteger(map, TestLinkResponseParams.FEATURE_ID.toString()));

                    // IMPORTANT: the full external id (composed by
                    // prefix-external_id) come on
                    // different parameters depending of what methods was used.
                    //
                    // In 'getTestCase' -> 'full_tc_external_id'
                    // In 'getTestCasesForTestSuite' -> 'external_id'
                    // In 'getTestCasesForTestPlan' does not come (ToDo: add)
                    String fullExternalId = getString(map, TestLinkResponseParams.FULL_TEST_CASE_EXTERNAL_ID.toString());
                    if (fullExternalId == null) {
                        fullExternalId = getString(map, TestLinkResponseParams.FULL_TEST_CASE_EXTERNAL_ID2.toString());
                        if (fullExternalId == null) {
                            fullExternalId = getString(map, TestLinkResponseParams.EXTERNAL_ID.toString());
                        }
                    }
                    testCase.setFullExternalId(fullExternalId);

                    Integer executionTypeValue = getInteger(map, TestLinkResponseParams.EXECUTION_TYPE.toString());
                    ExecutionType execution = ExecutionType.getExecutionType(executionTypeValue);
                    testCase.setExecutionType(execution);
                    ExecutionStatus executionStatus = ExecutionStatus.NOT_RUN;
                    String executionStatusText = getString(map, TestLinkResponseParams.EXEC_STATUS.toString());
                    if (StringUtils.isNotBlank(executionStatusText)) {
                        executionStatus = ExecutionStatus.getExecutionStatus(executionStatusText.charAt(0));
                    }
                    testCase.setExecutionStatus(executionStatus);
                    testCase.setTestProjectId(getInteger(map, TestLinkParams.TEST_PROJECT_ID.toString()));
                    testCase.setTestSuiteId(getInteger(map, TestLinkParams.TEST_SUITE_ID2.toString()));
                    // inconsistent
                    // parameter
                    // name
                    // TODO: check if TL 2.0 allows it
                    // CustomField[] customFields = (CustomField[])getArray(map,
                    // TestLinkResponseParams.customFields.toString());
                    // if ( customFields != null )
                    // {
                    // for (int i = 0; i < customFields.length; i++)
                    // {
                    // CustomField customField = customFields[i];
                    // testCase.getCustomFields().add( customField );
                    // }
                    // }
                    Object[] stepsArray = (Object[]) getArray(map, TestLinkResponseParams.STEPS.toString());
                    if (stepsArray != null && stepsArray.length > 0) {
                        for (Object stepObject : stepsArray) {
                            Map<String, Object> stepMap = (Map<String, Object>) stepObject;
                            TestCaseStep step = Util.getTestCaseStep(stepMap);
                            testCase.getSteps().add(step);
                        }
                    }
                }

            }
View Full Code Here

Examples of ch.powerunit.report.Testcase

  public void notifyStart(TestContext<T> context) {
    String setName = context.getSetName()
        + (context.getParameterName() == null ? "" : context
            .getParameterName());
    Testsuite ts = result.get(setName);
    Testcase tc = new Testcase();
    tc.setName(context.getLocalTestName()
        + (context.getParameterName() == null ? "" : ("["
            + context.getParameterName() + "]")));
    tc.setClassname(context.getTestSuiteObject().getClass()
        .getCanonicalName());
    resultcase.get(setName).put(context.getFullTestName(), tc);
    ts.getTestcase().add(tc);
    tc.setTime(System.currentTimeMillis());

  }
View Full Code Here

Examples of com.buschmais.jqassistant.plugin.junit4.impl.schema.Testcase

        int errors = 0;
        for (Map.Entry<Result<? extends Rule>, Long> entry : results.entrySet()) {
            // TestCase
            Result<? extends Rule> result = entry.getKey();
            long time = entry.getValue().longValue();
            Testcase testcase = new Testcase();
            Rule rule = result.getRule();
            testcase.setName(rule.getId());
            testcase.setClassname(group.getId());
            testcase.setTime(Long.toString(time));
            List<Map<String, Object>> rows = result.getRows();
            if (rule instanceof Concept && rows.isEmpty()) {
                Failure failure = new Failure();
                failure.setMessage(rule.getDescription());
                failure.setContent("The concept returned an empty result.");
                testcase.getFailure().add(failure);
                failures++;
            } else if (rule instanceof Constraint && !rows.isEmpty()) {
                Error error = new Error();
                error.setMessage(rule.getDescription());
                StringBuilder sb = new StringBuilder();
                for (Map<String, Object> row : rows) {
                    for (Map.Entry<String, Object> rowEntry : row.entrySet()) {
                        sb.append(rowEntry.getKey());
                        sb.append("=");
                        sb.append(rowEntry.getValue());
                    }
                }
                error.setContent(sb.toString());
                testcase.getError().add(error);
                errors++;
            }
            tests++;
            testsuite.getTestcase().add(testcase);
        }
View Full Code Here

Examples of com.consol.citrus.TestCase

    /** Default package to search for Xml test case files */
    private String packageName = "com.consol.citrus.tests";

    @Override
    public Message dispatchMessage(final Message request, String mappingName) {
        final TestCase test;
        final TestContext testContext;

        try {
            testContext = testContextFactory.getObject();
            test = getTestCase(testContext, mappingName);
        } catch (NoSuchBeanDefinitionException e) {
            throw new CitrusRuntimeException("Unable to find test builder with name '" +
                    mappingName + "' in Spring bean context", e);
        }

        taskExecutor.execute(new Runnable() {
            public void run() {
                prepareExecution(request, test);
                test.execute(testContext);
            }
        });

        return endpointAdapterDelegate.handleMessage(request);
    }
View Full Code Here

Examples of com.consol.citrus.model.testcase.core.Testcase

        TestCaseData testCase = new TestCaseData();
        testCase.setName(testName);
        testCase.setPackageName(packageName);
        testCase.setType(type);

        Testcase testModel;
        if (type.equals(TestCaseType.XML)) {
            testModel = getXmlTestModel(project, packageName, testName);
        } else if (type.equals(TestCaseType.JAVA)) {
            testModel = getJavaTestModel(packageName, testName);
        } else {
            throw new CitrusAdminRuntimeException("Unsupported test case type: " + type);
        }

        if (testModel.getVariables() != null) {
            for (Variables.Variable variable : testModel.getVariables().getVariables()) {
                testCase.getVariables().put(variable.getName(), variable.getValue());
            }
        }

        testCase.setDescription(testModel.getDescription());
        testCase.setMetaInfo(testModel.getMetaInfo());

        for (Object actionType : testModel.getActions().getActionsAndSendsAndReceives()) {
            boolean converterFound = false;
            for (TestActionConverter testActionConverter : actionConverter) {
                if (testActionConverter.getModelClass().isInstance(actionType)) {
                    testCase.addTestAction(testActionConverter.convert(actionType));
                    converterFound = true;
View Full Code Here

Examples of com.darkhonor.rage.model.TestCase

     */
    @Ignore("Not ready yet")
    @Test
    public void testGradeTestCase() {
        System.out.println("gradeTestCase");
        TestCase tc = null;
        Response response = null;
        boolean verbatim = false;
        boolean exclusions = false;
        boolean expResult = false;
        boolean result = RageLib.gradeTestCase(tc, response, verbatim, exclusions);
View Full Code Here

Examples of com.eastidea.qaforum.entity.TestCase

  TestSuiteHome testSuiteHome;

  @Override
  public String persist() {
    String rt = super.persist();
    TestCase testCase = this.instance;
    testCase.setCaseNo(testCase.getCaseNo()
        + new DecimalFormat("000000").format(testCase.getId()));
    rt = super.update();
    return rt;
  }
View Full Code Here

Examples of com.eviware.soapui.junit.Testcase

    testsuiteDoc.getTestsuite().setSystemErr( systemerr );
  }

  public Testcase addTestCase( String name, double time )
  {
    Testcase testcase = testsuiteDoc.getTestsuite().addNewTestcase();
    testcase.setName( name );
    testcase.setTime( String.valueOf( time / 1000 ) );
    noofTestCases++ ;
    totalTime += time;
    return testcase;
  }
View Full Code Here

Examples of com.eviware.soapui.model.testsuite.TestCase

      Project project = findProject( projectFilePath, workspace );

      project = openProject( projectFilePath, workspace, project );

      TestSuite testSuite = project.getTestSuiteByName( testSuiteName );
      TestCase testCase = testSuite.getTestCaseByName( testCaseName );

      showModelItem( testCase );
      bringToFront();
    }
    catch( Exception e )
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.