soapbindingannotationtest.java

来自「Xfire文件 用于开发web service 的一个开源工具 很好用的」· Java 代码 · 共 84 行

JAVA
84
字号
package org.codehaus.xfire.annotations.soap;import junit.framework.TestCase;import org.codehaus.xfire.soap.SoapConstants;public class SOAPBindingAnnotationTest        extends TestCase{    private SOAPBindingAnnotation soapBindingAnnotation;    protected void setUp()            throws Exception    {        soapBindingAnnotation = new SOAPBindingAnnotation();    }    public void testSetStyle()            throws Exception    {        try        {            soapBindingAnnotation.setStyle(999);            fail("No IllegalArgumentException thrown");        }        catch (IllegalArgumentException e)        {            // expected behavior        }    }    public void testSetUse()            throws Exception    {        try        {            soapBindingAnnotation.setUse(999);            fail("No IllegalArgumentException thrown");        }        catch (IllegalArgumentException e)        {            // expected behavior        }    }    public void testSetParameterStyle()            throws Exception    {        try        {            soapBindingAnnotation.setParameterStyle(999);            fail("No IllegalArgumentException thrown");        }        catch (IllegalArgumentException e)        {            // expected behavior        }    }    public void testGetStyleString()            throws Exception    {        soapBindingAnnotation.setParameterStyle(SOAPBindingAnnotation.PARAMETER_STYLE_WRAPPED);        soapBindingAnnotation.setStyle(SOAPBindingAnnotation.STYLE_DOCUMENT);        assertEquals(SoapConstants.STYLE_WRAPPED, soapBindingAnnotation.getStyleString());        soapBindingAnnotation.setParameterStyle(SOAPBindingAnnotation.PARAMETER_STYLE_BARE);        assertEquals(SoapConstants.STYLE_DOCUMENT, soapBindingAnnotation.getStyleString());        soapBindingAnnotation.setStyle(SOAPBindingAnnotation.STYLE_RPC);        assertEquals(SoapConstants.STYLE_RPC, soapBindingAnnotation.getStyleString());    }    public void testGetUseString()            throws Exception    {        soapBindingAnnotation.setUse(SOAPBindingAnnotation.USE_ENCODED);        assertEquals(SoapConstants.USE_ENCODED, soapBindingAnnotation.getUseString());        soapBindingAnnotation.setUse(SOAPBindingAnnotation.USE_LITERAL);        assertEquals(SoapConstants.USE_LITERAL, soapBindingAnnotation.getUseString());    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?