1
2
3
4
5
6
7
8
9
10
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.WsdlProject;
19 import com.eviware.soapui.impl.wsdl.teststeps.HttpTestRequestInterface;
20 import com.eviware.soapui.impl.wsdl.teststeps.HttpTestRequestStep;
21 import com.eviware.soapui.support.components.JPropertiesTable;
22 import com.eviware.soapui.support.types.StringList;
23
24 /***
25 * PanelBuilder for HttpTestRequest
26 *
27 * @author Ole.Matzura
28 */
29
30 public class HttpTestRequestPanelBuilder extends EmptyPanelBuilder<HttpTestRequestStep>
31 {
32 public HttpTestRequestPanelBuilder()
33 {
34 }
35
36 public HttpTestRequestDesktopPanel buildDesktopPanel( HttpTestRequestStep testStep )
37 {
38 return new HttpTestRequestDesktopPanel( testStep );
39 }
40
41 public boolean hasDesktopPanel()
42 {
43 return true;
44 }
45
46 public JPanel buildOverviewPanel( HttpTestRequestStep testStep )
47 {
48 HttpTestRequestInterface<?> request = testStep.getTestRequest();
49 JPropertiesTable<HttpTestRequestInterface<?>> table = new JPropertiesTable<HttpTestRequestInterface<?>>(
50 "REST TestRequest Properties" );
51
52
53 table.addProperty( "Name", "name", true );
54 table.addProperty( "Description", "description", true );
55
56 table.addProperty( "Encoding", "encoding", new String[] { null, "UTF-8", "iso-8859-1" } );
57
58
59
60
61
62
63 table.addProperty( "Endpoint", "endpoint", true );
64 table.addProperty( "Timeout", "timeout", true );
65
66 table.addProperty( "Bind Address", "bindAddress", true );
67 table.addProperty( "Follow Redirects", "followRedirects", JPropertiesTable.BOOLEAN_OPTIONS );
68
69
70
71
72
73
74
75 table.addProperty( "Username", "username", true );
76 table.addProperty( "Password", "password", true );
77 table.addProperty( "Domain", "domain", true );
78
79 StringList keystores = new StringList( ( ( WsdlProject )request.getTestStep().getTestCase().getTestSuite()
80 .getProject() ).getWssContainer().getCryptoNames() );
81 keystores.add( "" );
82 table.addProperty( "SSL Keystore", "sslKeystore", keystores.toStringArray() );
83
84 table.addProperty( "Strip whitespaces", "stripWhitespaces", JPropertiesTable.BOOLEAN_OPTIONS );
85 table.addProperty( "Remove Empty Content", "removeEmptyContent", JPropertiesTable.BOOLEAN_OPTIONS );
86 table.addProperty( "Entitize Properties", "entitizeProperties", JPropertiesTable.BOOLEAN_OPTIONS );
87
88
89 table.addProperty( "Pretty Print", "prettyPrint", JPropertiesTable.BOOLEAN_OPTIONS );
90 table.addProperty( "Dump File", "dumpFile", true ).setDescription( "Dumps response message to specified file" );
91 table.addProperty( "Max Size", "maxSize", true ).setDescription( "The maximum number of bytes to receive" );
92 table.setPropertyObject( request );
93
94 return table;
95 }
96
97 public boolean hasOverviewPanel()
98 {
99 return true;
100 }
101 }