Package com.eviware.soapui.model.testsuite

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


    {
      assertable.addAssertionsListener( this );

      for( int c = 0; c < assertable.getAssertionCount(); c++ )
      {
        TestAssertion assertion = assertable.getAssertionAt( c );
        addAssertion( assertion );
      }
    }
View Full Code Here


    {
      items.clear();

      for( int c = 0; c < assertable.getAssertionCount(); c++ )
      {
        TestAssertion assertion = assertable.getAssertionAt( c );
        assertion.removePropertyChangeListener( this );
      }

      assertable.removeAssertionsListener( this );
    }
View Full Code Here

    public void assertionMoved( TestAssertion newAssertion, int ix, int offset )
    {
      synchronized( this )
      {
        // int ix = items.indexOf( assertion );
        TestAssertion assertion = ( TestAssertion )items.get( ix );
        // if first selected can't move up and if last selected can't move
        // down
        if( ( ix == 0 && offset == -1 ) || ( ix == items.size() - 1 && offset == 1 ) )
        {
          return;
        }

        assertion.removePropertyChangeListener( this );
        items.remove( ix );
        fireIntervalRemoved( this, ix, ix );

        // remove associated errors
        while( ix < items.size() && items.get( ix ) instanceof AssertionError )
View Full Code Here

    {
      int ix = assertionList.getSelectedIndex();
      if( ix == -1 )
        return;

      TestAssertion assertion = assertionListModel.getAssertionAt( ix );
      if( assertion.isConfigurable() )
      {
        assertion.configure();
      }
      else
        Toolkit.getDefaultToolkit().beep();
    }
View Full Code Here

    {
      int ix = assertionList.getSelectedIndex();
      if( ix == -1 )
        return;

      TestAssertion assertion = assertionListModel.getAssertionAt( ix );
      if( UISupport.confirm( "Remove assertion [" + assertion.getName() + "]", "Remove Assertion" ) )
      {
        assertable.removeAssertion( assertion );
      }
    }
View Full Code Here

    }

    public void actionPerformed( ActionEvent e )
    {
      int ix = assertionList.getSelectedIndex();
      TestAssertion assertion = assertionListModel.getAssertionAt( ix );
      if( ix != -1 )
      {
        assertion = assertable.moveAssertion( ix, -1 );
      }
      assertionList.setSelectedValue( assertion, true );
View Full Code Here

    }

    public void actionPerformed( ActionEvent e )
    {
      int ix = assertionList.getSelectedIndex();
      TestAssertion assertion = assertionListModel.getAssertionAt( ix );
      if( ix != -1 )
      {
        assertion = assertable.moveAssertion( ix, 1 );
      }
      assertionList.setSelectedValue( assertion, true );
View Full Code Here

          assertionListPopup.addSeparator();
          assertionListPopup.add( new ShowOnlineHelpAction( getHelpUrl()) );
          return;
        }

        TestAssertion assertion = assertionListModel.getAssertionAt( ix );
        ActionSupport.addActions( ActionListBuilder.buildActions( assertion ), assertionListPopup );
      }

      public void popupMenuWillBecomeInvisible( PopupMenuEvent e )
      {
      }

      public void popupMenuCanceled( PopupMenuEvent e )
      {
      }
    } );

    assertionList.setComponentPopupMenu( assertionListPopup );

    assertionList.addMouseListener( new MouseAdapter()
    {

      public void mouseClicked( MouseEvent e )
      {
        if( e.getClickCount() < 2 )
          return;

        int ix = assertionList.getSelectedIndex();
        if( ix == -1 )
          return;

        Object obj = assertionList.getModel().getElementAt( ix );
        if( obj instanceof TestAssertion )
        {
          TestAssertion assertion = ( TestAssertion )obj;
          if( assertion.isConfigurable() )
            assertion.configure();

          return;
        }

        if( obj instanceof AssertionError )
        {
          AssertionError error = ( AssertionError )obj;
          if( error.getLineNumber() >= 0 )
          {
            selectError( error );
          }
          else
            Toolkit.getDefaultToolkit().beep();
        }
        else
          Toolkit.getDefaultToolkit().beep();
      }
    } );

    assertionList.addKeyListener( new KeyAdapter()
    {
      public void keyPressed( KeyEvent e )
      {
        int ix = assertionList.getSelectedIndex();
        if( ix == -1 )
          return;

        TestAssertion assertion = assertionListModel.getAssertionAt( ix );
        if( e.getKeyChar() == KeyEvent.VK_ENTER )
        {
          if( assertion.isConfigurable() )
            assertion.configure();
        }
        else
        {
          ActionList actions = ActionListBuilder.buildActions( assertion );
          if( actions != null )
View Full Code Here

        moveAssertionUpAction.setEnabled( ix >= 0 );
        moveAssertionDownAction.setEnabled( ix >= 0 );

        if( ix == -1 )
          return;
        TestAssertion assertion = assertionListModel.getAssertionAt( ix );
        configureAssertionAction.setEnabled( assertion != null && assertion.isConfigurable() );
      }
    } );

    return toolbar;
  }
View Full Code Here

    {
      setEnabled( list.isEnabled() );

      if( value instanceof TestAssertion )
      {
        TestAssertion assertion = ( TestAssertion )value;
        setText( assertion.getLabel() + " - " + assertion.getStatus().toString() );
        setIcon( assertion.getIcon() );

        if( assertion.isDisabled() && isEnabled() )
          setEnabled( false );
      }
      else if( value instanceof AssertionError )
      {
        AssertionError assertion = ( AssertionError )value;
        setText( " -> " + assertion.toString() );
        setIcon( null );
      }
      else if( value instanceof String )
      {
        setText( value.toString() );
View Full Code Here

TOP

Related Classes of com.eviware.soapui.model.testsuite.TestAssertion

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.