Search in sources :

Example 1 with TestScenarioGroup

use of jp.ossc.nimbus.service.test.TestScenarioGroup in project nimbus by nimbus-org.

the class ConsoleTestEstimateReporterService method report.

public void report(TestController controller) {
    try {
        TestScenarioGroup[] groups = controller.getScenarioGroups();
        for (int index = 0; index < groups.length; index++) {
            String scenarioGroupId = groups[index].getScenarioGroupId();
            TestScenarioGroup testScenarioGroup = controller.getScenarioGroup(scenarioGroupId);
            TestScenario[] testScenarios = controller.getScenarios(scenarioGroupId);
            TestScenarioGroup.TestScenarioGroupResource testScenarioGroupResource = testScenarioGroup.getTestScenarioGroupResource();
            if (testScenarioGroupResource == null) {
                continue;
            }
            System.out.println(scenarioGroupId + ":" + new BigDecimal(testScenarioGroupResource.getExpectedCost() / rate).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
            for (int index2 = 0; index2 < testScenarios.length; index2++) {
                TestScenario testScenario = testScenarios[index2];
                TestScenario.TestScenarioResource testScenarioResource = testScenario.getTestScenarioResource();
                if (testScenarioResource == null) {
                    continue;
                }
                System.out.println("  " + testScenario.getScenarioId() + ":" + new BigDecimal(testScenarioResource.getExpectedCost() / rate).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
            }
        }
    } catch (Exception e) {
        ServiceManagerFactory.getLogger().write("CTR__00001", e);
        return;
    }
}
Also used : TestScenario(jp.ossc.nimbus.service.test.TestScenario) TestScenarioGroup(jp.ossc.nimbus.service.test.TestScenarioGroup) BigDecimal(java.math.BigDecimal)

Example 2 with TestScenarioGroup

use of jp.ossc.nimbus.service.test.TestScenarioGroup in project nimbus by nimbus-org.

the class HtmlTestCaseProgressReporterService method report.

public void report(TestController controller) {
    PrintWriter pw = null;
    try {
        TestScenarioGroup[] groups = controller.getScenarioGroups();
        pw = new PrintWriter(new BufferedWriter(new FileWriter(new File(outputPath, "index.html"))));
        pw.println("<html>");
        pw.println("<head><title>TestCase Create Progress</title></head>");
        pw.println("<body>");
        pw.println("<table border=\"1\" cellspacing=\"0\" cellpadding=\"3\" width=\"100%\">");
        pw.println("<tr bgcolor=\"#cccccc\">");
        pw.println("<th colspan=\"8\" scope=\"colgroup\">ScenarioGroup</th>");
        pw.println("<th colspan=\"8\" scope=\"colgroup\">Scenario</th>");
        pw.println("<th colspan=\"8\" scope=\"colgroup\">TestCase</th>");
        pw.println("</tr>");
        pw.println("<tr bgcolor=\"#cccccc\">");
        pw.println("<th scope=\"col\">ID</th>");
        pw.println("<th scope=\"col\">説明</th>");
        pw.println("<th scope=\"col\">作成担当者</th>");
        pw.println("<th scope=\"col\">開始予定日</th>");
        pw.println("<th scope=\"col\">開始日</th>");
        pw.println("<th scope=\"col\">終了予定日</th>");
        pw.println("<th scope=\"col\">終了日</th>");
        pw.println("<th scope=\"col\">進捗</th>");
        pw.println("<th scope=\"col\">ID</th>");
        pw.println("<th scope=\"col\">説明</th>");
        pw.println("<th scope=\"col\">作成担当者</th>");
        pw.println("<th scope=\"col\">開始予定日</th>");
        pw.println("<th scope=\"col\">開始日</th>");
        pw.println("<th scope=\"col\">終了予定日</th>");
        pw.println("<th scope=\"col\">終了日</th>");
        pw.println("<th scope=\"col\">進捗</th>");
        pw.println("<th scope=\"col\">ID</th>");
        pw.println("<th scope=\"col\">説明</th>");
        pw.println("<th scope=\"col\">作成担当者</th>");
        pw.println("<th scope=\"col\">開始予定日</th>");
        pw.println("<th scope=\"col\">開始日</th>");
        pw.println("<th scope=\"col\">終了予定日</th>");
        pw.println("<th scope=\"col\">終了日</th>");
        pw.println("<th scope=\"col\">進捗</th>");
        pw.println("</tr>");
        for (int index = 0; index < groups.length; index++) {
            TestScenarioGroup.TestScenarioGroupResource resource = groups[index].getTestScenarioGroupResource();
            if (resource != null) {
                reportScenarioGroup(pw, controller, groups[index]);
            }
        }
        pw.println("</body>");
        pw.println("</html>");
        pw.flush();
    } catch (Exception e) {
        ServiceManagerFactory.getLogger().write("CTR__00001", e);
        return;
    } finally {
        if (pw != null) {
            pw.close();
        }
    }
}
Also used : TestScenarioGroupResource(jp.ossc.nimbus.service.test.TestScenarioGroup.TestScenarioGroupResource) TestScenarioGroup(jp.ossc.nimbus.service.test.TestScenarioGroup) FileWriter(java.io.FileWriter) File(java.io.File) IOException(java.io.IOException) PrintWriter(java.io.PrintWriter) BufferedWriter(java.io.BufferedWriter)

Example 3 with TestScenarioGroup

use of jp.ossc.nimbus.service.test.TestScenarioGroup in project nimbus by nimbus-org.

the class CSVTestEstimateReporterService method report.

public void report(TestController controller) {
    PrintWriter pw = null;
    try {
        TestScenarioGroup[] groups = controller.getScenarioGroups();
        pw = new PrintWriter(new BufferedWriter(new FileWriter(outputFile)));
        pw.println("scenrioGroup" + "," + "scenario" + "," + "cost");
        for (int index = 0; index < groups.length; index++) {
            String scenarioGroupId = groups[index].getScenarioGroupId();
            TestScenarioGroup testScenarioGroup = controller.getScenarioGroup(scenarioGroupId);
            TestScenarioGroup.TestScenarioGroupResource testScenarioGroupResource = testScenarioGroup.getTestScenarioGroupResource();
            if (testScenarioGroupResource == null) {
                continue;
            }
            TestScenario[] testScenarios = controller.getScenarios(scenarioGroupId);
            pw.println(scenarioGroupId + "," + "" + "," + new BigDecimal(testScenarioGroupResource.getExpectedCost() / rate).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
            for (int index2 = 0; index2 < testScenarios.length; index2++) {
                TestScenario testScenario = testScenarios[index2];
                TestScenario.TestScenarioResource testScenarioResource = testScenario.getTestScenarioResource();
                if (testScenarioResource == null) {
                    continue;
                }
                pw.println("" + "," + testScenario.getScenarioId() + "," + new BigDecimal(testScenarioResource.getExpectedCost() / rate).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
            }
        }
        pw.flush();
    } catch (Exception e) {
        ServiceManagerFactory.getLogger().write("CTR__00001", e);
        return;
    } finally {
        if (pw != null) {
            pw.close();
        }
    }
}
Also used : TestScenario(jp.ossc.nimbus.service.test.TestScenario) TestScenarioGroup(jp.ossc.nimbus.service.test.TestScenarioGroup) FileWriter(java.io.FileWriter) BigDecimal(java.math.BigDecimal) BufferedWriter(java.io.BufferedWriter) PrintWriter(java.io.PrintWriter)

Example 4 with TestScenarioGroup

use of jp.ossc.nimbus.service.test.TestScenarioGroup in project nimbus by nimbus-org.

the class ScenarioTestView method setupScenarioCombobox.

private void setupScenarioCombobox(String keyword) throws Exception {
    this.scenarioCombobox.removeAllItems();
    TestScenarioGroup currentScenarioGroup = this.testController.getCurrentScenarioGroup();
    if (currentScenarioGroup == null) {
        this.scenarioCombobox.setEnabled(false);
        return;
    }
    this.scenarioCombobox.setEnabled(true);
    // テストシナリオのコンボボックスを設定
    TestScenario[] testScenarioArray = this.testController.getScenarios(currentScenarioGroup.getScenarioGroupId());
    if (testScenarioArray != null) {
        for (int i = 0; i < testScenarioArray.length; i++) {
            String scenarioId = testScenarioArray[i].getScenarioId();
            if (keyword == null || keyword.length() == 0 || scenarioId.indexOf(keyword) >= 0) {
                this.scenarioCombobox.addItem(scenarioId);
            }
            // 開始状態の場合
            if (testScenarioArray[i] != null && testScenarioArray[i].getStatus() != null && testScenarioArray[i].getStatus().getState() == Status.STARTED) {
                String selectScenarioGroupId = currentScenarioGroup.getScenarioGroupId();
                String selectScenarioId = testScenarioArray[i].getScenarioId();
                TestCase[] testCaseArray = this.testController.getTestCases(selectScenarioGroupId, selectScenarioId);
                List testCaseList = new ArrayList();
                for (int t = 0; t < testCaseArray.length; t++) {
                    testCaseList.add(testCaseArray[t]);
                }
                this.testCasePanel.initialize();
                this.testCasePanel.setScenarioGroupId(selectScenarioGroupId);
                this.testCasePanel.setScenarioId(selectScenarioId);
                this.testCasePanel.setTestCaseList(testCaseList);
                this.testCasePanel.addTestCaseControlListener(new TestCaseControlListenerImpl());
                this.testCasePanel.setUserId(userId);
            }
        }
    }
}
Also used : TestCase(jp.ossc.nimbus.service.test.TestCase) TestScenario(jp.ossc.nimbus.service.test.TestScenario) TestScenarioGroup(jp.ossc.nimbus.service.test.TestScenarioGroup) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Example 5 with TestScenarioGroup

use of jp.ossc.nimbus.service.test.TestScenarioGroup in project nimbus by nimbus-org.

the class ScenarioTestView method scenarioGroupStartAction.

/**
 * シナリオグループ開始ボタンの押下アクション
 * @throws Exception
 */
private void scenarioGroupStartAction() throws Exception {
    String selectScenarioGroupId = this.scenarioGroupCombobox.getSelectedItem().toString();
    TestScenarioGroup obj = testController.getCurrentScenarioGroup();
    if (obj != null && obj.getStatus() != null && obj.getStatus().getUserId() != null) {
        int result = JOptionPane.showConfirmDialog(this, "シナリオグループは既に開始されていますが、リセットして再度開始しますか?", "確認", JOptionPane.OK_CANCEL_OPTION);
        if (JOptionPane.OK_OPTION != result) {
            return;
        }
    }
    // シナリオグループの開始
    this.testController.startScenarioGroup(this.userId, selectScenarioGroupId);
    // シナリオの検索、シナリオ一覧をコンボボックスに設定
    this.scenarioCombobox.setEnabled(true);
    // シナリオコンボボックスを設定
    this.setupScenarioCombobox(null);
    // シナリオ系コンポーネントの設定(初期化)
    this.setupScenarioComponents();
    // テストケース表示パネルの初期化
    this.testCasePanel.initialize();
}
Also used : TestScenarioGroup(jp.ossc.nimbus.service.test.TestScenarioGroup)

Aggregations

TestScenarioGroup (jp.ossc.nimbus.service.test.TestScenarioGroup)13 TestScenario (jp.ossc.nimbus.service.test.TestScenario)8 TestCase (jp.ossc.nimbus.service.test.TestCase)5 BufferedWriter (java.io.BufferedWriter)4 FileWriter (java.io.FileWriter)4 IOException (java.io.IOException)4 PrintWriter (java.io.PrintWriter)3 Iterator (java.util.Iterator)3 Map (java.util.Map)3 File (java.io.File)2 FileOutputStream (java.io.FileOutputStream)2 BigDecimal (java.math.BigDecimal)2 SimpleDateFormat (java.text.SimpleDateFormat)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 OutputStreamWriter (java.io.OutputStreamWriter)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 Set (java.util.Set)1 TreeSet (java.util.TreeSet)1