1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.impl.wsdl.panels.teststeps;
14
15 import java.sql.SQLException;
16 import java.sql.Statement;
17
18 import javax.xml.parsers.ParserConfigurationException;
19 import javax.xml.transform.TransformerConfigurationException;
20 import javax.xml.transform.TransformerException;
21
22 import com.eviware.soapui.model.support.AbstractResponse;
23 import com.eviware.soapui.support.xml.XmlUtils;
24
25 public class JdbcResponse extends AbstractResponse<JdbcRequest>
26 {
27 private String responseContent;
28 private long timeTaken;
29 private long timestamp;
30
31 public JdbcResponse( JdbcRequest request, Statement statement ) throws SQLException, ParserConfigurationException, TransformerConfigurationException, TransformerException
32 {
33 super( request );
34
35 org.w3c.dom.Document xmlDocumentResult = XmlUtils.createJdbcXmlResult( statement );
36 responseContent = XmlUtils.serializePretty( xmlDocumentResult );
37 }
38
39 public String getContentAsString()
40 {
41 return responseContent;
42 }
43
44 public String getContentType()
45 {
46 return "text/xml";
47 }
48
49 public String getRequestContent()
50 {
51 return getRequest().getTestStep().getQuery();
52 }
53
54 public long getTimeTaken()
55 {
56 return timeTaken;
57 }
58
59 public long getTimestamp()
60 {
61 return timestamp;
62 }
63
64 public void setContentAsString( String xml )
65 {
66 responseContent = xml;
67 }
68
69 public void setTimeTaken( long timeTaken )
70 {
71 this.timeTaken = timeTaken;
72 }
73
74 public void setTimestamp( long timestamp )
75 {
76 this.timestamp = timestamp;
77 }
78 }