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