View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2008 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.panels.teststeps;
14  
15  import com.eviware.soapui.impl.EmptyPanelBuilder;
16  import com.eviware.soapui.impl.wsdl.WsdlRequest;
17  import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequest;
18  import com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep;
19  import com.eviware.soapui.support.components.JPropertiesTable;
20  import com.eviware.soapui.support.types.StringList;
21  
22  import javax.swing.*;
23  
24  /***
25   * PanelBuilder for WsdlTestRequest
26   * 
27   * @author Ole.Matzura
28   */
29  
30  public class WsdlTestRequestPanelBuilder extends EmptyPanelBuilder<WsdlTestRequestStep>
31  {
32     public WsdlTestRequestPanelBuilder()
33     {
34     }
35  
36     public WsdlTestRequestDesktopPanel buildDesktopPanel(WsdlTestRequestStep testStep)
37     {
38        return new WsdlTestRequestDesktopPanel(testStep);
39     }
40  
41     public boolean hasDesktopPanel()
42     {
43        return true;
44     }
45     
46     public JPanel buildOverviewPanel(WsdlTestRequestStep testStep)
47     {
48     	WsdlTestRequest request = testStep.getTestRequest();
49     	JPropertiesTable<WsdlTestRequest> table = new JPropertiesTable<WsdlTestRequest>( "TestRequest Properties" );
50     	
51     	// basic properties
52     	table.addProperty( "Name", "name", true );
53     	table.addProperty( "Description", "description", true );
54     	table.addProperty( "Message Size", "contentLength", false );
55     	table.addProperty( "Encoding", "encoding", new String[] {null, "UTF-8", "iso-8859-1" } );
56     	table.addProperty( "Endpoint", "endpoint", request.getInterface().getEndpoints() );
57     	table.addProperty( "Bind Address", "bindAddress", true );
58  
59     	table.addProperty( "Interface", "interfaceName" );
60     	table.addProperty( "Operation", "operationName" );
61     	
62     	// security / authentication
63     	table.addProperty( "Username", "username", true );
64     	table.addProperty( "Password", "password", true );
65     	table.addProperty( "Domain", "domain", true );
66     	table.addProperty( "WSS-Password Type", "wssPasswordType", 
67     			new String[] {WsdlRequest.PW_TYPE_NONE, WsdlRequest.PW_TYPE_TEXT, WsdlRequest.PW_TYPE_DIGEST});
68     	table.addProperty( "WSS TimeToLive", "wssTimeToLive", true );
69  
70        StringList keystores = new StringList( request.getOperation().getInterface().getProject().getWssContainer().getCryptoNames() );
71  		keystores.add( 0, null );
72  		table.addProperty( "SSL Keystore", "sslKeystore", keystores.toStringArray() );
73  //   	
74  //   	StringList outgoingNames = new StringList( request.getOperation().getInterface().getProject().getWssContainer().getOutgoingNames());
75  //   	outgoingNames.add( "" );
76  //		table.addProperty( "WSS Outgoing", "outgoingWss", outgoingNames.toStringArray() );
77  //		StringList incomingNames = new StringList( request.getOperation().getInterface().getProject().getWssContainer().getIncomingNames() );
78  //		incomingNames.add( "" );
79  		
80  		table.addProperty( "Skip SOAP Action", "skipSoapAction", JPropertiesTable.BOOLEAN_OPTIONS );
81     	
82     	// mtom / attachments
83     	table.addProperty( "Enable MTOM", "mtomEnabled", JPropertiesTable.BOOLEAN_OPTIONS );
84     	table.addProperty( "Force MTOM", "forceMtom", JPropertiesTable.BOOLEAN_OPTIONS );
85     	table.addProperty( "Inline Response Attachments", "inlineResponseAttachments", 
86     			JPropertiesTable.BOOLEAN_OPTIONS );
87     	table.addProperty( "Expand MTOM Attachments", "expandMtomResponseAttachments", 
88  	   			JPropertiesTable.BOOLEAN_OPTIONS );
89     	table.addProperty( "Disable multiparts", "multipartEnabled", JPropertiesTable.BOOLEAN_OPTIONS );
90     	table.addProperty( "Encode Attachments", "encodeAttachments", JPropertiesTable.BOOLEAN_OPTIONS );
91     	
92     	// preprocessing
93     	table.addProperty( "Enable Inline Files", "inlineFilesEnabled", JPropertiesTable.BOOLEAN_OPTIONS ).
94  			setDescription( "Enables inline file references in elements with binary content; file:<path>" );
95     	table.addProperty( "Strip whitespaces", "stripWhitespaces", JPropertiesTable.BOOLEAN_OPTIONS );
96     	table.addProperty( "Remove Empty Content", "removeEmptyContent", JPropertiesTable.BOOLEAN_OPTIONS );
97     	
98     	// post-processing
99     	table.addProperty( "Pretty Print", "prettyPrint", JPropertiesTable.BOOLEAN_OPTIONS );
100    	table.addProperty( "Dump File", "dumpFile", true ).setDescription("Dumps response message to specified file" );
101    	table.addProperty( "Max Size", "maxSize", true ).setDescription("The maximum number of bytes to receive" );
102 
103    	table.addProperty( "WS-Addressing", "wsAddressing", JPropertiesTable.BOOLEAN_OPTIONS );
104    	
105    	table.setPropertyObject( request );
106    	
107    	return table;
108    }
109 
110    public boolean hasOverviewPanel()
111    {
112       return true;
113    }
114 }