View Javadoc

    1   /*
    2    *  soapUI, copyright (C) 2004-2007 eviware.com
    3    *
    4    *  soapUI is free software; you can redistribute it and/or modify it under the
    5    *  terms of version 2.1 of the GNU Lesser General Public License as published by
    6    *  the Free Software Foundation.
    7    *
    8    *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
    9    *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    10   *  See the GNU Lesser General Public License for more details at gnu.org.
    11   */
    12
    13  package com.eviware.soapui.impl.wsdl.loadtest;
    14
    15  import java.util.Collection;
    16  import java.util.Collections;
    17  import java.util.HashMap;
    18  import java.util.Map;
    19  import java.util.Set;
    20
    21  import com.eviware.soapui.model.testsuite.LoadTestRunContext;
    22  import com.eviware.soapui.model.testsuite.LoadTestRunner;
    23
    24  /***
    25   * LoadTestRunContext implementation for WsdlLoadTests
    26   *
    27   * @author Ole.Matzura
    28   */
    29
    30  public class WsdlLoadTestContext implements LoadTestRunContext, Map<String,Object>
    31  {
    32  	private Map<String,Object> properties = Collections.synchronizedMap( new HashMap<String,Object>() );
    33  	private final WsdlLoadTestRunner runner;
    34
    35  	public WsdlLoadTestContext(WsdlLoadTestRunner runner)
    36  	{
    37  		this.runner = runner;
    38  	}
    39
    40  	public Object getProperty(String name)
    41  	{
    42  		return properties.get( name );
    43  	}
    44
    45  	public void setProperty(String name, Object value)
    46  	{
    47  		properties.put( name, value );
    48  	}
    49
    50  	public Map getProperties()
    51  	{
    52  		return properties;
    53  	}
    54
    55  	public boolean hasProperty(String name)
    56  	{
    57  		return properties.containsKey( name );
    58  	}
    59
    60  	public LoadTestRunner getLoadTestRunner()
    61  	{
    62  		return runner;
    63  	}
    64
    65  	public void clear()
    66  	{
    67  		properties.clear();
    68  	}
    69
    70  	public boolean containsKey( Object arg0 )
    71  	{
    72  		return properties.containsKey( arg0 );
    73  	}
    74
    75  	public boolean containsValue( Object arg0 )
    76  	{
    77  		return properties.containsValue( arg0 );
    78  	}
    79
    80  	public Set<Entry<String, Object>> entrySet()
    81  	{
    82  		return properties.entrySet();
    83  	}
    84
    85  	public boolean equals( Object arg0 )
    86  	{
    87  		return properties.equals( arg0 );
    88  	}
    89
    90  	public Object get( Object arg0 )
    91  	{
    92  		return properties.get( arg0 );
    93  	}
    94
    95  	public int hashCode()
    96  	{
    97  		return properties.hashCode();
    98  	}
    99
    100 	public boolean isEmpty()
    101 	{
    102 		return properties.isEmpty();
    103 	}
    104
    105 	public Set<String> keySet()
    106 	{
    107 		return properties.keySet();
    108 	}
    109
    110 	public Object put( String arg0, Object arg1 )
    111 	{
    112 		return properties.put( arg0, arg1 );
    113 	}
    114
    115 	public void putAll( Map<? extends String, ? extends Object> arg0 )
    116 	{
    117 		properties.putAll( arg0 );
    118 	}
    119
    120 	public Object remove( Object arg0 )
    121 	{
    122 		return properties.remove( arg0 );
    123 	}
    124
    125 	public int size()
    126 	{
    127 		return properties.size();
    128 	}
    129
    130 	public Collection<Object> values()
    131 	{
    132 		return properties.values();
    133 	}
    134
    135
    136 }