Package com.darkhonor.rage.model

Examples of com.darkhonor.rage.model.TestCase


     */
    private void btnInputAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInputAddActionPerformed

        if (lstTestCases.getSelectedIndex() != -1)
        {
            TestCase tc = (TestCase) lstTestCases.getSelectedValue();
            String input = "zzzz";
            do  // Error Check to make sure a value is entered
            {
                if ((input != null) && (input.equals("zzzz")))
                {
                    input = JOptionPane.showInputDialog(null,
                            "Enter input for Test Case", "Enter Input",
                            JOptionPane.QUESTION_MESSAGE);
                } else // This is an error time through
                {
                    input = JOptionPane.showInputDialog(null,
                            "ERROR: Enter valid input for test case",
                            "ERROR: Enter Input",
                            JOptionPane.ERROR_MESSAGE);
                }
            } while ((input == null) || (input.equals("")));
            tc.addInput(input);
            modInputList.add(input);
            if (modInputList.getSize() > 0)
            {
                btnInputRemove.setEnabled(true);
            }
View Full Code Here


     * are enabled if they are not already enabled.
     *
     * @param evt   The event to handle
     */
    private void btnTCAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTCAddActionPerformed
        TestCase testCase = new TestCase();
        index++;
        testCase.setId(index);
        String temp;
        do  // Error Check to make sure a value is entered
        {
            temp = JOptionPane.showInputDialog(null,
                    "Enter value for Test Case", "Enter Test Case Value",
                    JOptionPane.QUESTION_MESSAGE);
        } while ((temp == null) || (temp.equals("")));
        BigDecimal value = new BigDecimal(temp);
        testCase.setValue(value);
        questionValue = questionValue.add(value);
        txtValue.setText(questionValue.toPlainString());
        modTCList.addTestCase(testCase);
        if (modTCList.getSize() > 0)
        {
View Full Code Here

            /**
             * Find the selected test case and load the inputs and exclusions to
             * the other windows (clearing the windows first)
             */
            TestCase tc = (TestCase) lstTestCases.getSelectedValue();
            List<String> inputs = tc.getInputs();
            List<String> excludes = tc.getExcludes();
            modInputList.removeAll();
            modInputList.addAll(inputs);
            modExclusionList.removeAll();
            modExclusionList.addAll(excludes);
        }
View Full Code Here

                            {
                                if (tc.getId() != null)
                                {
                                    try
                                    {
                                        TestCase dbTestCase = testCaseDAO.find(tc.getId());
                                        // TestCase exists in the database, update
                                        tc = testCaseDAO.update(tc);
                                    } catch (IllegalArgumentException exTestCase)
                                    {
                                        // TestCase not in data source, just save
View Full Code Here

   
    @Test(expected = IllegalStateException.class)
    public void testUpdateClosedConnection()
    {
        System.out.println("update - Closed Connection");
        TestCase testCase = createSampleTestCase1();
        assertTrue(instance.isOpen());
       
        testCase.setValue(new BigDecimal("1.6"));
        testCase.addInput("9876");
        testCase.setOutputs(new ArrayList<String>());
        testCase.addOutput("Name - Bigfellar");
        testCase.addOutput("Race - Tauren");
        testCase.addExclusion("Orc");
        testCase.addExclusion("Human");
       
        instance.closeConnection();
        assertFalse(instance.isOpen());
        TestCase result = instance.update(testCase);
    }
View Full Code Here

   
    @Test(expected = NullPointerException.class)
    public void testUpdateNullTestCase()
    {
        System.out.println("update - Null TestCase");
        TestCase testCase = null;
        assertTrue(instance.isOpen());
       
        TestCase result = instance.update(testCase);
    }
View Full Code Here

   
    @Test(expected = NullPointerException.class)
    public void testUpdateNullId()
    {
        System.out.println("update - Null id");
        TestCase testCase = createSampleTestCase1();
        assertTrue(instance.isOpen());
       
        testCase.setId(null);
        testCase.setValue(new BigDecimal("1.6"));
        testCase.addInput("9876");
        testCase.setOutputs(new ArrayList<String>());
        testCase.addOutput("Name - Bigfellar");
        testCase.addOutput("Race - Tauren");
        testCase.addExclusion("Orc");
        testCase.addExclusion("Human");
              
        TestCase result = instance.update(testCase);
    }
View Full Code Here

   
    @Test(expected = IllegalArgumentException.class)
    public void testUpdateNotFound()
    {
        System.out.println("update - TestCase not found");
        TestCase testCase = createSampleTestCase1();
        assertTrue(instance.isOpen());
       
        testCase.setId(new Long(42L));
        testCase.setValue(new BigDecimal("1.6"));
        testCase.addInput("9876");
        testCase.setOutputs(new ArrayList<String>());
        testCase.addOutput("Name - Bigfellar");
        testCase.addOutput("Race - Tauren");
        testCase.addExclusion("Orc");
        testCase.addExclusion("Human");
              
        TestCase result = instance.update(testCase);
    }
View Full Code Here

   
    @Test(expected = IllegalArgumentException.class)
    public void testUpdateZeroId()
    {
        System.out.println("update - id = 0");
        TestCase testCase = createSampleTestCase1();
        assertTrue(instance.isOpen());
       
        testCase.setId(new Long(0L));
        testCase.setValue(new BigDecimal("1.6"));
        testCase.addInput("9876");
        testCase.setOutputs(new ArrayList<String>());
        testCase.addOutput("Name - Bigfellar");
        testCase.addOutput("Race - Tauren");
        testCase.addExclusion("Orc");
        testCase.addExclusion("Human");
              
        TestCase result = instance.update(testCase);
    }
View Full Code Here

   
    @Test(expected = IllegalArgumentException.class)
    public void testUpdateNegativeId()
    {
        System.out.println("update - id < 0");
        TestCase testCase = createSampleTestCase1();
        assertTrue(instance.isOpen());
       
        testCase.setId(new Long(-2L));
        testCase.setValue(new BigDecimal("1.6"));
        testCase.addInput("9876");
        testCase.setOutputs(new ArrayList<String>());
        testCase.addOutput("Name - Bigfellar");
        testCase.addOutput("Race - Tauren");
        testCase.addExclusion("Orc");
        testCase.addExclusion("Human");
              
        TestCase result = instance.update(testCase);
    }
View Full Code Here

TOP

Related Classes of com.darkhonor.rage.model.TestCase

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.