From bfa9e7966dabf26c8bfd6324b819e147a13789da Mon Sep 17 00:00:00 2001 From: coderfengyun Date: Thu, 19 Dec 2013 16:38:50 +0800 Subject: [PATCH] use the new RunScenarioModel, and can pass the old tests as well as my newest added one --- .../master/helper/RunScenarioModelHelper.java | 39 +++++++++ .../httpcapture/Bench4qTestScriptAdapter.java | 83 ++++++++++++++----- .../scriptrecord/httpcapture/HttpCapture.java | 4 +- .../httpcapture/IScriptAdapter.java | 7 +- .../generator/AbstractCodeGenerator.java | 9 +- src/test/java/ModelTest/Page.java | 4 + .../java/ModelTest/RunScenarioModelNew.java | 1 + .../TestBench4qTestScriptAdapter.java | 46 ++++++++++ .../test/recordscript/TestCodeGenerator.java | 5 +- .../test/recordscript/TestParentRequest.java | 58 +++++++------ .../test/recordscript/TestRecordBase.java | 4 +- 11 files changed, 202 insertions(+), 58 deletions(-) create mode 100644 src/main/java/org/bench4q/master/helper/RunScenarioModelHelper.java create mode 100644 src/test/java/org/bench4q/master/test/recordscript/TestBench4qTestScriptAdapter.java diff --git a/src/main/java/org/bench4q/master/helper/RunScenarioModelHelper.java b/src/main/java/org/bench4q/master/helper/RunScenarioModelHelper.java new file mode 100644 index 00000000..e1d4b6d8 --- /dev/null +++ b/src/main/java/org/bench4q/master/helper/RunScenarioModelHelper.java @@ -0,0 +1,39 @@ +package org.bench4q.master.helper; + +import java.util.ArrayList; +import java.util.List; + +import org.bench4q.share.models.agent.ParameterModel; +import org.bench4q.share.models.agent.scriptrecord.BatchBehavior; +import org.bench4q.share.models.agent.scriptrecord.UserBehaviorModel; + +import ModelTest.Page; +import ModelTest.RunScenarioModelNew; + +public class RunScenarioModelHelper { + public static List getBatches( + RunScenarioModelNew runScenarioModelNew) { + List result = new ArrayList(); + for (Page page : runScenarioModelNew.getPages()) { + result.addAll(page.getBatches()); + } + return result; + } + + public static UserBehaviorModel createUserBehaviorModel(int id, String use, + String name, List parameterModels) { + UserBehaviorModel userBehaviorModel = new UserBehaviorModel(); + userBehaviorModel.setUse(use); + userBehaviorModel.setId(id); + userBehaviorModel.setName(name); + userBehaviorModel.setParameters(parameterModels); + return userBehaviorModel; + } + + public static ParameterModel createParameterModel(String key, String value) { + ParameterModel parameterModel = new ParameterModel(); + parameterModel.setKey(key); + parameterModel.setValue(value); + return parameterModel; + } +} diff --git a/src/main/java/org/bench4q/master/scriptrecord/httpcapture/Bench4qTestScriptAdapter.java b/src/main/java/org/bench4q/master/scriptrecord/httpcapture/Bench4qTestScriptAdapter.java index ae92fb2a..e34a7821 100644 --- a/src/main/java/org/bench4q/master/scriptrecord/httpcapture/Bench4qTestScriptAdapter.java +++ b/src/main/java/org/bench4q/master/scriptrecord/httpcapture/Bench4qTestScriptAdapter.java @@ -8,23 +8,30 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; +import org.apache.log4j.Logger; import org.bench4q.master.helper.MarshalHelper; +import org.bench4q.master.helper.RunScenarioModelHelper; import org.bench4q.master.scriptrecord.httpcapture.generator.ChildrenUrl; import org.bench4q.share.models.agent.ParameterModel; -import org.bench4q.share.models.agent.RunScenarioModel; import org.bench4q.share.models.agent.scriptrecord.BatchBehavior; import org.bench4q.share.models.agent.scriptrecord.BehaviorBaseModel; import org.bench4q.share.models.agent.scriptrecord.UsePluginModel; -public class Bench4qTestScriptAdapter implements IScriptAdapter { - private RunScenarioModel runScenarioModel; - private List childrenUrls = new ArrayList(); +import ModelTest.Page; +import ModelTest.RunScenarioModelNew; - public RunScenarioModel getRunScenarioModel() { +public class Bench4qTestScriptAdapter implements IScriptAdapter { + private int pageCount; + private RunScenarioModelNew runScenarioModel; + private List childrenUrls = new ArrayList(); + private static Logger logger = Logger + .getLogger(Bench4qTestScriptAdapter.class); + + public RunScenarioModelNew getRunScenarioModel() { return runScenarioModel; } - private void setRunScenarioModel(RunScenarioModel runScenarioModel) { + private void setRunScenarioModel(RunScenarioModelNew runScenarioModel) { this.runScenarioModel = runScenarioModel; } @@ -36,27 +43,46 @@ public class Bench4qTestScriptAdapter implements IScriptAdapter { this.childrenUrls = childrenUrls; } - public Bench4qTestScriptAdapter(RunScenarioModel runScenarioModel) { + private int getPageCount() { + return pageCount; + } + + private void setPageCount(int pageCount) { + this.pageCount = pageCount; + } + + public Bench4qTestScriptAdapter(RunScenarioModelNew runScenarioModel) { this.runScenarioModel = runScenarioModel; this.setChildrenUrls(new ArrayList()); + this.setPageCount(0); + initWithOnePage(); + } + + private void initWithOnePage() { + addPage(); } public void appendUsePluginsToScenario(List usePluginModels) { this.runScenarioModel.setUsePlugins(usePluginModels); } + public void addPage() { + this.setPageCount(this.getPageCount() + 1); + this.getRunScenarioModel().getPages().add(new Page()); + assert (pageCountEqualWithPageSizeInScenario()); + } + public void insertUserBehaviorsToScenario(BehaviorBaseModel model) { - List batches = this.getRunScenarioModel().getBatches(); + List batches = this.getCurrentPage().getBatches(); int parentBatchId = -1; assert (batches != null); parentBatchId = getUrlParentBatch(model); if (isIndependent(parentBatchId)) { - batches.add(createBatchBehavior(model, batches.size())); + batches.add(createBatchBehaviorWithProperBatchId(model)); return; } if (isChildBatchAbsent(batches, parentBatchId)) { - BatchBehavior batchBehavior = createBatchBehavior(model, - batches.size()); + BatchBehavior batchBehavior = createBatchBehaviorWithProperBatchId(model); batchBehavior.setParentId(parentBatchId); batches.add(batchBehavior); batches.get(parentBatchId).setChildId(batches.size() - 1); @@ -66,10 +92,25 @@ public class Bench4qTestScriptAdapter implements IScriptAdapter { .add(model); } - private BatchBehavior createBatchBehavior(BehaviorBaseModel model, - int batchId) { + private Page getCurrentPage() { + if (!pageCountEqualWithPageSizeInScenario()) { + logger.error("The page count is not equal with the size of scenario pages"); + return new Page(); + } + return this.getRunScenarioModel().getPages() + .get(this.getPageCount() - 1); + } + + private boolean pageCountEqualWithPageSizeInScenario() { + return this.getPageCount() == this.getRunScenarioModel().getPages() + .size(); + } + + private BatchBehavior createBatchBehaviorWithProperBatchId( + BehaviorBaseModel model) { BatchBehavior batchBehavior = new BatchBehavior(); - batchBehavior.setId(batchId); + batchBehavior.setId(RunScenarioModelHelper.getBatches( + this.runScenarioModel).size()); batchBehavior.setParentId(-1); batchBehavior.setChildId(-1); List behaviors = new ArrayList(); @@ -117,10 +158,10 @@ public class Bench4qTestScriptAdapter implements IScriptAdapter { } public int getParentBatchIdWithParentUrl(String url) { - for (int batchId = 0; batchId < this.getRunScenarioModel().getBatches() - .size(); batchId++) { - BatchBehavior batch = this.getRunScenarioModel().getBatches() - .get(batchId); + List batchesInScenario = RunScenarioModelHelper + .getBatches(this.getRunScenarioModel()); + for (int batchId = 0; batchId < batchesInScenario.size(); batchId++) { + BatchBehavior batch = batchesInScenario.get(batchId); for (BehaviorBaseModel behavior : batch.getBehaviors()) { for (ParameterModel parameter : behavior.getParameters()) { if (parameter.getKey().equals("url") @@ -149,11 +190,11 @@ public class Bench4qTestScriptAdapter implements IScriptAdapter { public void setText(String text) { if (text.isEmpty()) { - this.setRunScenarioModel(new RunScenarioModel()); + this.setRunScenarioModel(new RunScenarioModelNew()); return; } - this.runScenarioModel = (RunScenarioModel) MarshalHelper.unmarshal( - RunScenarioModel.class, text); + this.runScenarioModel = (RunScenarioModelNew) MarshalHelper.unmarshal( + RunScenarioModelNew.class, text); } } diff --git a/src/main/java/org/bench4q/master/scriptrecord/httpcapture/HttpCapture.java b/src/main/java/org/bench4q/master/scriptrecord/httpcapture/HttpCapture.java index 7fbec5b1..fcd7911e 100644 --- a/src/main/java/org/bench4q/master/scriptrecord/httpcapture/HttpCapture.java +++ b/src/main/java/org/bench4q/master/scriptrecord/httpcapture/HttpCapture.java @@ -8,7 +8,7 @@ import java.util.concurrent.Executors; import javax.swing.JTextArea; import org.apache.log4j.Logger; -import org.bench4q.share.models.agent.RunScenarioModel; +import ModelTest.RunScenarioModelNew; public class HttpCapture { private int localport; @@ -93,7 +93,7 @@ public class HttpCapture { e.printStackTrace(); } this.currentTest = new Test(this.proxy, new Bench4qTestScriptAdapter( - new RunScenarioModel()), generator); + new RunScenarioModelNew()), generator); } public void startProxyServer() throws IOException, Utils.UserException { diff --git a/src/main/java/org/bench4q/master/scriptrecord/httpcapture/IScriptAdapter.java b/src/main/java/org/bench4q/master/scriptrecord/httpcapture/IScriptAdapter.java index 0e0fe428..0688df84 100644 --- a/src/main/java/org/bench4q/master/scriptrecord/httpcapture/IScriptAdapter.java +++ b/src/main/java/org/bench4q/master/scriptrecord/httpcapture/IScriptAdapter.java @@ -3,13 +3,14 @@ package org.bench4q.master.scriptrecord.httpcapture; import java.util.List; import org.bench4q.master.scriptrecord.httpcapture.generator.ChildrenUrl; -import org.bench4q.share.models.agent.RunScenarioModel; import org.bench4q.share.models.agent.scriptrecord.BehaviorBaseModel; import org.bench4q.share.models.agent.scriptrecord.UsePluginModel; +import ModelTest.RunScenarioModelNew; + public interface IScriptAdapter { - public abstract RunScenarioModel getRunScenarioModel(); + public abstract RunScenarioModelNew getRunScenarioModel(); public abstract void appendUsePluginsToScenario( List usePluginModels); @@ -26,4 +27,6 @@ public interface IScriptAdapter { public abstract int getParentBatchIdWithParentUrl(String url); public abstract boolean isInChildrenUrl(String url); + + public abstract void addPage(); } diff --git a/src/main/java/org/bench4q/master/scriptrecord/httpcapture/generator/AbstractCodeGenerator.java b/src/main/java/org/bench4q/master/scriptrecord/httpcapture/generator/AbstractCodeGenerator.java index dbfe757f..32042b73 100644 --- a/src/main/java/org/bench4q/master/scriptrecord/httpcapture/generator/AbstractCodeGenerator.java +++ b/src/main/java/org/bench4q/master/scriptrecord/httpcapture/generator/AbstractCodeGenerator.java @@ -29,9 +29,10 @@ import org.bench4q.master.scriptrecord.httpcapture.Param; import org.bench4q.master.scriptrecord.httpcapture.ProxyServer; import org.bench4q.master.scriptrecord.httpcapture.Utils; import org.bench4q.master.scriptrecord.httpcapture.Utils.UserException; -import org.bench4q.share.models.agent.RunScenarioModel; import org.bench4q.share.models.agent.scriptrecord.BehaviorBaseModel; +import ModelTest.RunScenarioModelNew; + public abstract class AbstractCodeGenerator implements IScriptGenerator, ProxyServer.Observer, Runnable { private Config config = Config.getConfig(); @@ -130,7 +131,7 @@ public abstract class AbstractCodeGenerator implements IScriptGenerator, public boolean doSave(String path, String fileName) { String name = fileName; int dotPos = fileName.indexOf("."); - RunScenarioModel runScenarioModel = this.scriptAdapter + RunScenarioModelNew runScenarioModel = this.scriptAdapter .getRunScenarioModel(); FileWriter fileWriter; @@ -330,6 +331,9 @@ public abstract class AbstractCodeGenerator implements IScriptGenerator, public void processResponse(HttpRequestHeader header, byte[] requestBody, byte[] response) throws Exception { + if (isFirstRequest()) { + + } if (this.ignoreNextResponse) { log.debug("Ignoring response"); this.ignoreNextResponse = false; @@ -369,7 +373,6 @@ public abstract class AbstractCodeGenerator implements IScriptGenerator, while (!(Thread.interrupted())) { synchronized (this.outstandingInserts) { this.outstandingInserts.wait(); - while (this.outstandingInserts.size() > 0) { BehaviorBaseModel behaviorModel = this.outstandingInserts .removeFirst(); diff --git a/src/test/java/ModelTest/Page.java b/src/test/java/ModelTest/Page.java index 204d3021..0cc4cae4 100644 --- a/src/test/java/ModelTest/Page.java +++ b/src/test/java/ModelTest/Page.java @@ -1,5 +1,6 @@ package ModelTest; +import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlElement; @@ -22,4 +23,7 @@ public class Page { this.batches = batches; } + public Page() { + this.setBatches(new ArrayList()); + } } diff --git a/src/test/java/ModelTest/RunScenarioModelNew.java b/src/test/java/ModelTest/RunScenarioModelNew.java index 5ef8c6fe..968f238b 100644 --- a/src/test/java/ModelTest/RunScenarioModelNew.java +++ b/src/test/java/ModelTest/RunScenarioModelNew.java @@ -46,5 +46,6 @@ public class RunScenarioModelNew { public RunScenarioModelNew() { this.setUsePlugins(new ArrayList()); + this.setPages(new ArrayList()); } } diff --git a/src/test/java/org/bench4q/master/test/recordscript/TestBench4qTestScriptAdapter.java b/src/test/java/org/bench4q/master/test/recordscript/TestBench4qTestScriptAdapter.java new file mode 100644 index 00000000..9e90d099 --- /dev/null +++ b/src/test/java/org/bench4q/master/test/recordscript/TestBench4qTestScriptAdapter.java @@ -0,0 +1,46 @@ +package org.bench4q.master.test.recordscript; + +import static org.junit.Assert.*; + +import java.util.ArrayList; +import java.util.List; + +import org.bench4q.master.helper.RunScenarioModelHelper; +import org.bench4q.master.scriptrecord.httpcapture.Bench4qTestScriptAdapter; +import org.bench4q.share.models.agent.ParameterModel; +import org.junit.Test; + +import ModelTest.RunScenarioModelNew; + +public class TestBench4qTestScriptAdapter { + private Bench4qTestScriptAdapter bench4qTestScriptAdapter; + + private Bench4qTestScriptAdapter getBench4qTestScriptAdapter() { + return bench4qTestScriptAdapter; + } + + private void setBench4qTestScriptAdapter( + Bench4qTestScriptAdapter bench4qTestScriptAdapter) { + this.bench4qTestScriptAdapter = bench4qTestScriptAdapter; + } + + public TestBench4qTestScriptAdapter() { + this.setBench4qTestScriptAdapter(new Bench4qTestScriptAdapter( + new RunScenarioModelNew())); + } + + @Test + public void testInsertUserBehaviorsToScenario() { + List params = new ArrayList(); + params.add(RunScenarioModelHelper.createParameterModel("url", + "www.baidu.com")); + this.getBench4qTestScriptAdapter().insertUserBehaviorsToScenario( + RunScenarioModelHelper.createUserBehaviorModel(0, "http", + "get", params)); + assertEquals( + 1, + RunScenarioModelHelper.getBatches( + this.getBench4qTestScriptAdapter() + .getRunScenarioModel()).size()); + } +} diff --git a/src/test/java/org/bench4q/master/test/recordscript/TestCodeGenerator.java b/src/test/java/org/bench4q/master/test/recordscript/TestCodeGenerator.java index 089d3415..4151d84e 100644 --- a/src/test/java/org/bench4q/master/test/recordscript/TestCodeGenerator.java +++ b/src/test/java/org/bench4q/master/test/recordscript/TestCodeGenerator.java @@ -17,12 +17,13 @@ import org.bench4q.master.scriptrecord.httpcapture.generator.Bench4qCodeGenerato import org.bench4q.master.scriptrecord.httpcapture.generator.ContentDecoder; import org.bench4q.master.scriptrecord.httpcapture.generator.IScriptGenerator; import org.bench4q.master.scriptrecord.httpcapture.generator.ResponseParser; -import org.bench4q.share.models.agent.RunScenarioModel; import org.junit.Test; +import ModelTest.RunScenarioModelNew; + public class TestCodeGenerator extends TestRecordBase { private Bench4qTestScriptAdapter scriptAdapter = new Bench4qTestScriptAdapter( - new RunScenarioModel()); + new RunScenarioModelNew()); private Bench4qCodeGenerator codeGenerator = new Bench4qCodeGenerator( this.scriptAdapter); public static String dealWithSerie = "RecordScriptTestCase/gzip/gzipBaiduIR"; diff --git a/src/test/java/org/bench4q/master/test/recordscript/TestParentRequest.java b/src/test/java/org/bench4q/master/test/recordscript/TestParentRequest.java index ff6c452c..cf506c62 100644 --- a/src/test/java/org/bench4q/master/test/recordscript/TestParentRequest.java +++ b/src/test/java/org/bench4q/master/test/recordscript/TestParentRequest.java @@ -5,15 +5,17 @@ import static org.junit.Assert.*; import java.util.ArrayList; import java.util.List; +import org.bench4q.master.helper.RunScenarioModelHelper; import org.bench4q.master.scriptrecord.httpcapture.Bench4qTestScriptAdapter; import org.bench4q.master.scriptrecord.httpcapture.IScriptAdapter; import org.bench4q.master.scriptrecord.httpcapture.generator.ChildrenUrl; import org.bench4q.share.models.agent.ParameterModel; -import org.bench4q.share.models.agent.RunScenarioModel; import org.bench4q.share.models.agent.scriptrecord.BatchBehavior; import org.bench4q.share.models.agent.scriptrecord.UserBehaviorModel; import org.junit.Test; +import ModelTest.RunScenarioModelNew; + public class TestParentRequest { private IScriptAdapter adapater; private static String parentUrl = "www.apache.com"; @@ -31,7 +33,7 @@ public class TestParentRequest { } public TestParentRequest() { - this.setAdapater(new Bench4qTestScriptAdapter(new RunScenarioModel())); + this.setAdapater(new Bench4qTestScriptAdapter(new RunScenarioModelNew())); } @Test @@ -39,11 +41,11 @@ public class TestParentRequest { this.getAdapater().insertUserBehaviorsToScenario( createUserBehavior(parentUrl)); assertNotNull(this.getAdapater().getRunScenarioModel()); - assertNotNull(this.getAdapater().getRunScenarioModel().getBatches()); - assertNotNull(this.getAdapater().getRunScenarioModel().getBatches() - .get(0)); - assertTrue(this.getAdapater().getRunScenarioModel().getBatches().get(0) - .getId() == 0); + List batches = RunScenarioModelHelper.getBatches(this + .getAdapater().getRunScenarioModel()); + assertNotNull(batches); + assertNotNull(batches.get(0)); + assertTrue(batches.get(0).getId() == 0); } @@ -58,17 +60,19 @@ public class TestParentRequest { createUserBehavior(independentUrl)); this.getAdapater().insertUserBehaviorsToScenario( createUserBehavior(independentUrl2)); - RunScenarioModel runScenarioModel = this.getAdapater() + RunScenarioModelNew runScenarioModel = this.getAdapater() .getRunScenarioModel(); assertNotNull(runScenarioModel); - assertNotNull(runScenarioModel.getBatches()); - assertTrue(runScenarioModel.getBatches().size() == 3); - assertTrue(runScenarioModel.getBatches().get(1).getBehaviors().size() == 1); - assertTrue(runScenarioModel.getBatches().get(2).getBehaviors().size() == 1); - assertTrue(runScenarioModel.getBatches().get(1).getBehaviors().get(0) - .getParameters().get(0).getValue().equals(independentUrl)); - assertTrue(runScenarioModel.getBatches().get(2).getBehaviors().get(0) - .getParameters().get(0).getValue().equals(independentUrl2)); + List batches = RunScenarioModelHelper + .getBatches(runScenarioModel); + assertNotNull(batches); + assertTrue(batches.size() == 3); + assertTrue(batches.get(1).getBehaviors().size() == 1); + assertTrue(batches.get(2).getBehaviors().size() == 1); + assertTrue(batches.get(1).getBehaviors().get(0).getParameters().get(0) + .getValue().equals(independentUrl)); + assertTrue(batches.get(2).getBehaviors().get(0).getParameters().get(0) + .getValue().equals(independentUrl2)); } private UserBehaviorModel createUserBehavior(String url) { @@ -93,13 +97,14 @@ public class TestParentRequest { .add(createChildrenUrl(childUrl, 0)); this.getAdapater().insertUserBehaviorsToScenario( createUserBehavior(childUrl)); - RunScenarioModel runScenarioModel = this.getAdapater() + RunScenarioModelNew runScenarioModel = this.getAdapater() .getRunScenarioModel(); assertNotNull(runScenarioModel); - assertNotNull(runScenarioModel.getBatches()); - assertNotNull(runScenarioModel.getBatches().get(0)); - assertNotNull(runScenarioModel.getBatches().get(1)); - List batches = runScenarioModel.getBatches(); + List batches = RunScenarioModelHelper + .getBatches(runScenarioModel); + assertNotNull(batches); + assertNotNull(batches.get(0)); + assertNotNull(batches.get(1)); assertTrue(batches.get(1).getId() == 1); assertEquals(batches.get(0).getChildId(), batches.get(1).getId()); assertEquals(batches.get(1).getParentId(), batches.get(0).getId()); @@ -124,8 +129,8 @@ public class TestParentRequest { createUserBehavior(childUrl)); this.getAdapater().insertUserBehaviorsToScenario( createUserBehavior(independentUrl)); - List batches = this.getAdapater().getRunScenarioModel() - .getBatches(); + List batches = RunScenarioModelHelper.getBatches(this + .getAdapater().getRunScenarioModel()); assertTrue(batches.get(1).getBehaviors().size() == 1); assertTrue(batches.get(2).getBehaviors().size() == 1); assertTrue(batches.get(1).getBehaviors().get(0).getParameters().get(0) @@ -148,8 +153,8 @@ public class TestParentRequest { createUserBehavior(childUrl)); this.getAdapater().insertUserBehaviorsToScenario( createUserBehavior(childUrl2)); - List batches = this.getAdapater().getRunScenarioModel() - .getBatches(); + List batches = RunScenarioModelHelper.getBatches(this + .getAdapater().getRunScenarioModel()); System.out.println(batches.size()); assertTrue(batches.size() == 2); assertTrue(batches.get(0).getBehaviors().get(0).getParameters().get(0) @@ -176,7 +181,8 @@ public class TestParentRequest { createUserBehavior(independentUrl)); this.getAdapater().insertUserBehaviorsToScenario( createUserBehavior(independentUrl2)); - assertTrue(this.getAdapater().getRunScenarioModel().getBatches().size() == 4); + assertTrue(RunScenarioModelHelper.getBatches( + this.getAdapater().getRunScenarioModel()).size() == 4); } @Test diff --git a/src/test/java/org/bench4q/master/test/recordscript/TestRecordBase.java b/src/test/java/org/bench4q/master/test/recordscript/TestRecordBase.java index 93d8e9d4..0b414083 100644 --- a/src/test/java/org/bench4q/master/test/recordscript/TestRecordBase.java +++ b/src/test/java/org/bench4q/master/test/recordscript/TestRecordBase.java @@ -7,8 +7,8 @@ import org.bench4q.master.scriptrecord.httpcapture.Bench4qTestScriptAdapter; import org.bench4q.master.scriptrecord.httpcapture.IScriptAdapter; import org.bench4q.master.scriptrecord.httpcapture.generator.Bench4qCodeGenerator; import org.bench4q.share.models.agent.ParameterModel; -import org.bench4q.share.models.agent.RunScenarioModel; import org.bench4q.share.models.agent.scriptrecord.UserBehaviorModel; +import ModelTest.RunScenarioModelNew; public abstract class TestRecordBase { private IScriptAdapter adapter; @@ -34,7 +34,7 @@ public abstract class TestRecordBase { } protected void init() { - this.setAdpater(new Bench4qTestScriptAdapter(new RunScenarioModel())); + this.setAdpater(new Bench4qTestScriptAdapter(new RunScenarioModelNew())); this.setCodeGenerator(new Bench4qCodeGenerator(this.getAdpater())); }