1
2
3
4
5
6
7
8
9
10
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.rest.panels.request.AbstractRestRequestDesktopPanel;
17 import com.eviware.soapui.impl.wsdl.teststeps.HttpTestRequestStep;
18 import com.eviware.soapui.impl.wsdl.teststeps.RestTestRequest;
19 import com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep;
20 import com.eviware.soapui.support.components.JPropertiesTable;
21
22 import javax.swing.*;
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 AbstractRestRequestDesktopPanel buildDesktopPanel( HttpTestRequestStep testStep )
37 {
38 return testStep instanceof RestTestRequestStep ? new RestTestRequestDesktopPanel( (RestTestRequestStep) testStep ) :
39 new HttpTestRequestDesktopPanel( testStep );
40 }
41
42 public boolean hasDesktopPanel()
43 {
44 return true;
45 }
46
47 public JPanel buildOverviewPanel( HttpTestRequestStep testStep )
48 {
49 RestTestRequest request = testStep.getTestRequest();
50 JPropertiesTable<RestTestRequest> table = new JPropertiesTable<RestTestRequest>( "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 if( request.getOperation() != null )
59 table.addProperty( "Endpoint", "endpoint", request.getInterface().getEndpoints() );
60
61 table.addProperty( "Path", "path", true );
62
63 table.addProperty( "Bind Address", "bindAddress", true );
64
65 if( request.getOperation() != null )
66 {
67 table.addProperty( "Service", "service" );
68 table.addProperty( "Resource", "path" );
69 }
70
71
72 table.addProperty( "Username", "username", true );
73 table.addProperty( "Password", "password", true );
74 table.addProperty( "Domain", "domain", true );
75
76
77 table.addProperty( "Pretty Print", "prettyPrint", JPropertiesTable.BOOLEAN_OPTIONS );
78 table.addProperty( "Dump File", "dumpFile", true ).setDescription( "Dumps response message to specified file" );
79 table.addProperty( "Max Size", "maxSize", true ).setDescription( "The maximum number of bytes to receive" );
80 table.setPropertyObject( request );
81
82 return table;
83 }
84
85 public boolean hasOverviewPanel()
86 {
87 return true;
88 }
89 }