PageRenderTime 11ms CodeModel.GetById 2ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/ws-tester-engine/src/main/scala/com/googlecode/wstester/handlers/OneShotTestHandler.scala

http://ws-tester.googlecode.com/
Scala | 29 lines | 20 code | 3 blank | 6 comment | 0 complexity | 59989112914beca8b61b17047df86367 MD5 | raw file
 1package com.googlecode.wstester.handlers
 2
 3import xml.XML
 4import com.googlecode.wstester.config.RequestConfig
 5import com.googlecode.wstester.config.utils.{PlainXML}
 6import utils.Send
 7
 8/**
 9 * Created by IntelliJ IDEA.
10 * User: pablo
11 * Date: 2010-07-14
12 * Time: 12:13:34
13 */
14
15class OneShotTestHandler(var requestConfig : RequestConfig, var testDirName: String) {
16  def performRequest = {
17    requestConfig.requestType match {
18      case t: PlainXML => {
19        val request = XML.load(testDirName+"/"+requestConfig.requestFileName);
20        val requesthandler = new RequestHandler(request.toString);
21        requesthandler.targetURL = requestConfig.targetUrl;
22        requesthandler.soapAction = requestConfig.soapAction;
23        requesthandler.start;
24        requesthandler ! Send;
25      }
26      case _ => throw new IllegalArgumentException("Unknown request type");
27    }
28  }
29}