now i just use the RunScenarioModelNew to develop to avoid affect

Xiaoran's development, after this work done, I'll restore it to
RunScenarioModel
This commit is contained in:
coderfengyun 2013-12-10 13:58:05 +08:00
parent 0a2cfcddd2
commit 5cb67729fb
7 changed files with 22 additions and 23 deletions

View File

@ -11,20 +11,20 @@ import javax.xml.bind.Marshaller;
import org.bench4q.master.helper.MarshalHelper;
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.RunScenarioModelNew;
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 RunScenarioModelNew runScenarioModel;
private List<ChildrenUrl> childrenUrls = new ArrayList<ChildrenUrl>();
public RunScenarioModel getRunScenarioModel() {
public RunScenarioModelNew getRunScenarioModel() {
return runScenarioModel;
}
private void setRunScenarioModel(RunScenarioModel runScenarioModel) {
private void setRunScenarioModel(RunScenarioModelNew runScenarioModel) {
this.runScenarioModel = runScenarioModel;
}
@ -36,7 +36,7 @@ public class Bench4qTestScriptAdapter implements IScriptAdapter {
this.childrenUrls = childrenUrls;
}
public Bench4qTestScriptAdapter(RunScenarioModel runScenarioModel) {
public Bench4qTestScriptAdapter(RunScenarioModelNew runScenarioModel) {
this.runScenarioModel = runScenarioModel;
this.setChildrenUrls(new ArrayList<ChildrenUrl>());
}
@ -149,11 +149,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);
}
}

View File

@ -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 org.bench4q.share.models.agent.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 {

View File

@ -3,13 +3,13 @@ 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.RunScenarioModelNew;
import org.bench4q.share.models.agent.scriptrecord.BehaviorBaseModel;
import org.bench4q.share.models.agent.scriptrecord.UsePluginModel;
public interface IScriptAdapter {
public abstract RunScenarioModel getRunScenarioModel();
public abstract RunScenarioModelNew getRunScenarioModel();
public abstract void appendUsePluginsToScenario(
List<UsePluginModel> usePluginModels);

View File

@ -30,7 +30,7 @@ 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.RunScenarioModelNew;
import org.bench4q.share.models.agent.scriptrecord.BehaviorBaseModel;
public abstract class AbstractCodeGenerator implements IScriptGenerator,
@ -114,7 +114,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;
@ -124,7 +124,6 @@ public abstract class AbstractCodeGenerator implements IScriptGenerator,
setTestPath(path);
if (runScenarioModel == null) {
runScenarioModel = new RunScenarioModel();
}
try {

View File

@ -16,12 +16,12 @@ 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.bench4q.share.models.agent.RunScenarioModelNew;
import org.junit.Test;
public class TestCodeGenerator {
private Bench4qTestScriptAdapter scriptAdapter = new Bench4qTestScriptAdapter(
new RunScenarioModel());
new RunScenarioModelNew());
private Bench4qCodeGenerator codeGenerator = new Bench4qCodeGenerator(
this.scriptAdapter);

View File

@ -9,7 +9,7 @@ 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.RunScenarioModelNew;
import org.bench4q.share.models.agent.scriptrecord.BatchBehavior;
import org.bench4q.share.models.agent.scriptrecord.UserBehaviorModel;
import org.junit.Test;
@ -31,7 +31,7 @@ public class TestParentRequest {
}
public TestParentRequest() {
this.setAdapater(new Bench4qTestScriptAdapter(new RunScenarioModel()));
this.setAdapater(new Bench4qTestScriptAdapter(new RunScenarioModelNew()));
}
@Test
@ -58,7 +58,7 @@ public class TestParentRequest {
createUserBehavior(independentUrl));
this.getAdapater().insertUserBehaviorsToScenario(
createUserBehavior(independentUrl2));
RunScenarioModel runScenarioModel = this.getAdapater()
RunScenarioModelNew runScenarioModel = this.getAdapater()
.getRunScenarioModel();
assertNotNull(runScenarioModel);
assertNotNull(runScenarioModel.getBatches());
@ -93,7 +93,7 @@ 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());

View File

@ -7,7 +7,7 @@ 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.RunScenarioModelNew;
import org.bench4q.share.models.agent.scriptrecord.UserBehaviorModel;
public abstract class TestRecordBase {
@ -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()));
}