Package com.eviware.soapui.security

Source Code of com.eviware.soapui.security.GroovySecurityScanTest

/*
*  soapUI, copyright (C) 2004-2011 eviware.com
*
*  soapUI is free software; you can redistribute it and/or modify it under the
*  terms of version 2.1 of the GNU Lesser General Public License as published by
*  the Free Software Foundation.
*
*  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
*  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*  See the GNU Lesser General Public License for more details at gnu.org.
*/

package com.eviware.soapui.security;

import org.junit.Before;
import org.junit.Test;

import com.eviware.soapui.config.SecurityScanConfig;
import com.eviware.soapui.security.scan.GroovySecurityScan;

/**
* @author nebojsa.tasic
*
*/
public class GroovySecurityScanTest extends AbstractSecurityTestCaseWithMockService
{

  /**
   *
   * @throws java.lang.Exception
   */
  @Before
  public void setUp() throws Exception
  {
    super.setUp();
    testStepName = "SEK to USD Test";
    securityCheckType = GroovySecurityScan.TYPE;
    securityCheckName = GroovySecurityScan.TYPE;
  }

  protected void addSecurityScanConfig( SecurityScanConfig securityScanConfig )
  {
    GroovySecurityScan gsc = new GroovySecurityScan( testStep, securityScanConfig, null, null );
    gsc.setExecuteScript( "println('');println \"this is print from GroovySecurityScan on test step '${testStep.name}'\";println('')" );
  }

  @Test
  public void testLogTestEnded()
  {
    // SecurityTestRunnerImpl testRunner = new SecurityTestRunnerImpl(
    // createSecurityTest() );
    //
    // testRunner.start( false );
    //
    // assertTrue( "Groovy Security Scan Failed due to wrong Log message",
    // testRunner.getSecurityTest()
    // .getSecurityTestLog().getElementAt( 0 ).getMessage().startsWith(
    // "SecurityTest ended" ) );

  }

  @Test
  public void testFinished()
  {
    // SecurityTestRunnerImpl testRunner = new SecurityTestRunnerImpl(
    // createSecurityTest() );
    //
    // testRunner.start( false );
    //
    // assertTrue( "Test Step failed so as GroovySecurityScan",
    // !testRunner.getStatus().equals(
    // TestRunner.Status.FINISHED ) );

  }

}
TOP

Related Classes of com.eviware.soapui.security.GroovySecurityScanTest

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.