test and remove bugs

test and remove bugs
This commit is contained in:
coderfengyun 2014-05-07 14:43:38 +08:00
parent 8eb5ba5a54
commit ad4dcf7b52
8 changed files with 18 additions and 108 deletions

View File

@ -197,10 +197,13 @@ public class TestPlan implements IAggregate {
this.getTestPlanRunId() + " start to run "); this.getTestPlanRunId() + " start to run ");
this.setLastRunningTime(new Date()); this.setLastRunningTime(new Date());
if (!applyForLoad()) { if (!applyForLoad()) {
Logger.getLogger(TestPlan.class).info("applying the load fails");
this.failTimes++; this.failTimes++;
return; return;
} }
if (!distributeScriptAndParams()) { if (!distributeScriptAndParams()) {
Logger.getLogger(TestPlan.class).info(
"distributeScriptAndParams fails");
this.failTimes++; this.failTimes++;
return; return;
} }

View File

@ -17,7 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@Component @Component
public class TestResultSave{ public class TestResultSave {
private SessionHelper sessionHelper; private SessionHelper sessionHelper;
private TestPlanRepository testPlanRepository; private TestPlanRepository testPlanRepository;
private Logger logger = Logger.getLogger(TestResultSave.class); private Logger logger = Logger.getLogger(TestResultSave.class);
@ -43,7 +43,7 @@ public class TestResultSave{
this.sessionHelper = sessionHelper; this.sessionHelper = sessionHelper;
} }
public void update(TestPlan testPlan, List<Object> messages) { public void update(TestPlan testPlan, List<Object> messages) {
Session session = this.getSessionHelper().openSession(); Session session = this.getSessionHelper().openSession();
TestPlan testPlanFromRepo = this.getTestPlanRepository() TestPlan testPlanFromRepo = this.getTestPlanRepository()
.doGetTestPlanBy(session, .doGetTestPlanBy(session,
@ -57,15 +57,15 @@ public class TestResultSave{
TestPlan testPlanFromRepo) { TestPlan testPlanFromRepo) {
for (Object message : messages) { for (Object message : messages) {
if(message==null) if (message == null)
return; return;
if (message instanceof MonitorResult) { if (message instanceof MonitorResult) {
updateTestplanMonitorResult((MonitorResult) message, updateTestplanMonitorResult((MonitorResult) message,
testPlanFromRepo); testPlanFromRepo);
} } else if (message instanceof TestPlanScriptResult) {
else if(message instanceof TestPlanScriptResult){ updateTestPlanScriptResult((TestPlanScriptResult) message,
updateTestPlanScriptResult((TestPlanScriptResult)message, testPlanFromRepo); testPlanFromRepo);
} }
} }
@ -75,7 +75,8 @@ public class TestResultSave{
TestPlan testPlanFromRepo) { TestPlan testPlanFromRepo) {
try { try {
TestPlanScript testPlanScriptFromRepo = testPlanFromRepo TestPlanScript testPlanScriptFromRepo = testPlanFromRepo
.extracSpecifiedScript(message.getTestPlanScript().getScriptId()); .extracSpecifiedScript(message.getTestPlanScript()
.getScriptId());
testPlanScriptFromRepo.getTestPlanScriptResults().add(message); testPlanScriptFromRepo.getTestPlanScriptResults().add(message);
} catch (Exception e) { } catch (Exception e) {
logger.info(ExceptionLog.getStackTrace(e)); logger.info(ExceptionLog.getStackTrace(e));

View File

@ -39,7 +39,7 @@ public class Test_TestPlanController extends TestBase_MakeUpTestPlan {
private TestPlanModel testPlanBusinessModel = new TestPlanModel(); private TestPlanModel testPlanBusinessModel = new TestPlanModel();
private String _url = TestBase.BASE_URL + "/testPlan"; private String _url = TestBase.BASE_URL + "/testPlan";
private int scriptSumNum; private int scriptSumNum;
public static int SCRIPTID1 = 3; public static int SCRIPTID1 = 26;
private static int SCRIPTID2 = 2; private static int SCRIPTID2 = 2;
private static String Monitor_Host_Name = "133.133.12.3"; private static String Monitor_Host_Name = "133.133.12.3";
private static String monitor_port = "5556"; private static String monitor_port = "5556";
@ -312,6 +312,5 @@ public class Test_TestPlanController extends TestBase_MakeUpTestPlan {
this.httpRequester.sendGet(this._url + "/getTestPlanReport", params, this.httpRequester.sendGet(this._url + "/getTestPlanReport", params,
this.makeAccessTockenMap(this.getAccessTocken())); this.makeAccessTockenMap(this.getAccessTocken()));
} }
} }

View File

@ -1,93 +1 @@
<html><!--###PHBoeHBhZ2U+PHRpbWVTdGFtcD4xMC8xMi8yMDEzIDA4OjM3OjQzPC90aW1lU3RhbXA+PHRpbWVUaWxsQ0NCTlJlZnJlc2g+MTgwPC90aW1lVGlsbENDQk5SZWZyZXNoPjwvcGh4cGFnZT4=###--><head><link href="http://phx.corporate-ir.net/HttpCombiner.ashx?s=RisenCSS&amp;v=B94A18012C20431FA6ADC43CFC76EDB2" type="text/css" rel="stylesheet" /><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Baidu | Business Overview</title><script language="JavaScript" src="http://media.corporate-ir.net/media_files/irol/global_js/phoenix.js"></script><link rel="stylesheet" type="text/css" href="client/18/188488/css/ccbnIR.css" /><script type="text/javascript"><!-- <html><body></body></html
var iframeids=["myframe"]
var iframehide="yes"
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers
function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}
function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}
function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}
function loadintoIframe(url){
if (document.getElementById)
document.getElementById("myframe").src=url
}
if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller
//-->
</script><script language="Javascript"><!--
function emailPage()
{
var loc = top.location;
var to = "";
var subject = top.document.title;
var body = document.location.href;
// BUILD MAIL MESSAGE COMPONENTS
var doc = "mailto:" + to +
"?subject=" + escape(subject) +
"&body=" + escape(body);
// POP UP EMAIL MESSAGE WINDOW
window.location = doc;
}
//-->
</script><script src="http://phx.corporate-ir.net/HttpCombiner.ashx?s=RisenJS&v=B94A18012C20431FA6ADC43CFC76EDB2" type="text/javascript"></script><script type="text/javascript">Phx.AjaxToken = 'b11f528329bbcb978c6263efe73939aa2452db019b4dead38bbb2a9ddfa7cb25';</script><script type="text/javascript">var s_CCSWebHostingAccount = "trcgclientweb2090";</script><script type="text/javascript" src="./WebSideStory/s_code.js"></script></head><body><table width="100%" border="0" cellspacing="0" cellpadding="0" class="BGLogo"><tr><td width="181" height="99" align="center" nowrap="nowrap">?????<a href="http://www.baidu.com"><img src="http://media.corporate-ir.net/media_files/irol/18/188488/images/logo.gif" border="0" align="absmiddle" /></a></td><td align="right" class="Banner" id="ObjBanner">?<script><!--
if (screen.width<= 800) document.getElementById("ObjBanner").style.backgroundImage = "url(http://media.corporate-ir.net/media_files/irol/18/188488/images/banner800.jpg)";//-->
</script></td></tr></table><table width="100%" border="0" cellspacing="0" cellpadding="0" class="BGBar"><tr><td width="225" height="29"></td><td class="DottedLine" style="padding-right:30px;"><div align="right"><span class="ccbnLnk"><a class="ccbnLnk" onclick="emailPage()" href="#"><img border="0" src="http://media.corporate-ir.net/media_files/irol/18/188488/images/icon_email.gif" /></a></span><span class="ccbnLnk"><a class="ccbnLnk" onclick="emailPage()" href="#"> Send????</a></span><span class="ccbnLnk"><a Class="ccbnLnk"Target="_blank" href="phoenix.zhtml?c=188488&p=irol-homeprofile_pf"><img src="http://media.corporate-ir.net/media_files/irol/18/188488/images/icon_print.gif" alt="Printer Friendly Version" border="0" /></a>?</span><span class="ccbnLnk"><a Class="ccbnLnk"Target="_blank" href="phoenix.zhtml?c=188488&p=irol-homeprofile_pf">Print????</a></span><span class="ccbnLnk"><A HREF="phoenix.zhtml?c=188488&p=rssSubscription&t=&id=&" NAME=""Class="ccbnLnk"><img src="http://media.corporate-ir.net/media_files/irol/global_images/toolkit_rss.gif" border="0" alt="RSS" /></A>?</span><span class="ccbnLnk"><A HREF="phoenix.zhtml?c=188488&p=rssSubscription&t=&id=&" NAME=""Class="ccbnLnk">RSS</A></span></div></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="225" valign="top"><table width="198" border="0" cellspacing="0" cellpadding="0"><tr><td width="198" class="MTitle">Corporate Information</td></tr></table><table width="198" border="0" cellpadding="0" cellspacing="0" class="MIBoxMargin"><tr><td width="198" class="MItem"><a href="phoenix.zhtml?c=188488&amp;p=irol-homeprofile">Business Overview</a></td></tr><tr><td class="MItem"><a href="phoenix.zhtml?c=188488&amp;p=irol-products">Products</a></td></tr><tr><td class="MItem"><a href="phoenix.zhtml?c=188488&amp;p=irol-govmanage">Management</a></td></tr><tr><td class="MItem"><a href="phoenix.zhtml?c=188488&amp;p=irol-govboard">Board of Directors</a></td></tr><tr><td class="MItem"><a href="phoenix.zhtml?c=188488&amp;p=irol-govhighlights">Corporate Governance</a></td></tr></table><table width="198" border="0" cellspacing="0" cellpadding="0"><tr><td width="198" class="MTitle">Investor Relations</td></tr></table><table width="198" border="0" cellpadding="0" cellspacing="0" class="MIBoxMargin"><tr><td width="198" class="MItem"><a href="phoenix.zhtml?c=188488&amp;p=irol-irhome">Fact Sheet</a></td></tr><tr><td class="MItem"><a href="phoenix.zhtml?c=188488&amp;p=irol-news&amp;nyo=0">Press Releases</a></td></tr><tr><td class="MItem"><a href="phoenix.zhtml?c=188488&amp;p=irol-reportsAnnual">Financial Reports</a></td></tr><tr><td class="MItem"><a href="phoenix.zhtml?c=188488&amp;p=irol-presentations">Webcasts</a></td></tr><tr><td class="MItem"><a href="phoenix.zhtml?c=188488&amp;p=irol-stockquote">Stock Information</a></td></tr><tr><td class="MItem"><a href="phoenix.zhtml?c=188488&amp;p=irol-sec">SEC Filings</a></td></tr><tr><td class="MItem"><a href="phoenix.zhtml?c=188488&amp;p=irol-analysts">Analyst Coverage</a></td></tr><tr><td class="MItem"><a href="phoenix.zhtml?c=188488&amp;p=irol-calendar">IR Calendar</a></td></tr><tr><td class="MItem"><a href="phoenix.zhtml?c=188488&amp;p=irol-faq">Investor FAQs</a></td></tr></table><table width="198" border="0" cellspacing="0" cellpadding="0"><tr><td width="198" class="MTitle">Contact Baidu</td></tr></table><table width="198" border="0" cellpadding="0" cellspacing="0" class="MIBoxMargin"><tr><td width="198" class="MItem"><a href="phoenix.zhtml?c=188488&amp;p=irol-contacts">IR Contacts</a></td></tr><tr><td class="MItem"><a href="phoenix.zhtml?c=188488&amp;p=irol-inforeq">Request Information</a></td></tr><tr><td class="MItem"><a href="phoenix.zhtml?c=188488&amp;p=irol-alerts">Email Alert</a></td></tr></table><table width="198" border="0" cellspacing="0" cellpadding="0"><tr align="center"><td width="198" align="center"><a href="http://www.baidu.com"><img src="http://media.corporate-ir.net/media_files/irol/18/188488/images/back1.gif" alt="back to baidu" width="164" border="0" /></a></td></tr></table></td><td valign="top"><br /><h1>The Baidu Story</h1><br /><br /><span class="ccbnTxt"><p>Our name was inspired by a poem written more than 800 years ago during the Song Dynasty. The poem compares the search for a retreating beauty amid chaotic glamour with the search for one's dream while confronted by life's many obstacles. "…hundreds and thousands of times, for her I searched in chaos, suddenly, I turned by chance, to where the lights were waning, and there she stood." Baidu, whose literal meaning is “hundreds of times”, represents a persistent search for the ideal. <br><br>
Baidu was founded in 2000 by Internet pioneer Robin Li, creator of visionary search technology Hyperlink Analysis, with the mission of providing the best way for people to find what theyre looking for online. Over the past decade we have strived to fulfill this mission by listening carefully to our users needs and wants. To provide intelligent, relevant search results for the tens of billions of queries that are entered into our search platform every day, we focus on powering the best technology optimized for up-to-date local tastes and preferences. Our deep understanding of Chinese language and culture is central to our success and this kind of knowledge allows us to tailor our search technology for our users needs. Just to cite one example, we believe there are at least 38 ways of saying "I" in the Chinese language. It is important that we recognize these nuances to effectively address our users requests.
<br><br>
We provide our users with many channels to find and share information. In addition to our core web search product, we power many popular community-based products, such as Baidu PostBar, the worlds first and largest Chinese-language query-based searchable online community platform, Baidu Knows, the worlds largest Chinese-language interactive knowledge-sharing platform, and Baidu Encyclopedia, the worlds largest user-generated Chinese-language encyclopedia, to name but a few. Beyond these marquee products we also offer dozens of helpful vertical search-based products, such as Maps, Image Search, Video Search, News Search, and many more. We power these through our cutting-edge technology, continually innovating to enhance these services. Our new Box Computing Open Platform brings users deep-linked content and even applications they can use directly through their search box. We believe that Box Computing will dramatically improve peoples search experience and become ubiquitous across all Internet devices including computers and mobile platforms.
<br><br>
In addition to serving individual users, we also serve as a media platform for online marketing customers. Our business model is mainly based on a performance-oriented marketing platform for businesses to cost effectively reach relevant Internet users. We offer performance-based online marketing services and display advertisements through both Baidu organic websites and our affiliated websites (our Union business). Our affiliated websites lead traffic to us through integrating a Baidu search box into their sites and/or by displaying relevant contextual promotional links for our customers. The majority of our revenue is derived from performance-based online marketing services and our customers pay on a cost per click basis that is, our customers only pay when their paid-link is clicked through and they get the “lead”. Our goal is to give our customers an online marketing platform that has a wide range of functions which they can use to meet their marketing needs and an extensive selection of tools for managing their accounts as well as data for analyzing and optimizing ROI.
<br><br>
To best serve our customers, our sales efforts consist of direct sales teams in first tier cities and third-party distributors in lower tier cities. This allows us to better penetrate each market and tailor our support and personal interaction based on customers needs. Today, our online marketing platform serves hundreds of thousands of small- and medium-sized enterprises (SMEs) and many branded multinational customers. The measurable ROI offered by our online marketing platform has made it one of the most effective marketing platforms for companies targeting the Chinese market. We will continue to strive to provide an extra level of value-added sales and customer service to address a wide range of customer needs. Our focus is to help the market continue to develop and educate the many companies who dont understand the benefits of search engine marketing so that we can help them grow their businesses.
<br><br>
You dont need us to tell you that Chinas Internet space is booming. With the worlds largest Internet user population 564 million as of end of 2012 and a long way to go to reach internet penetration levels of developed countries, Chinas internet is growing in both influence and sophistication. And as more and more Chinese come online, Baidu continues to innovate to meet their increasingly diverse tastes. With our goal of best serving the needs of our users and customers with intelligent and relevant solutions, we look forward to a robust future. </p>
</span></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td><img src="http://media.corporate-ir.net/media_files/irol/global_images/spacer.gif" width="10" height="50" /></td></tr></table><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td height="27" align="center" style="border-top:1px solid #D6D6D6; font-family:Arial; font-size:12px;">Copyright ? <script language="JavaScript">
var year="";
mydate=new Date();
myyear= mydate.getYear();
year=(myyear > 200) ? myyear : 1900 + myyear;
document.write(year);
</script> Baidu, Inc. All Rights Reserved.</td></tr></table></body></html

View File

@ -49,7 +49,7 @@ public abstract class AbstractCodeGenerator implements IScriptGenerator,
private String testName; private String testName;
private boolean ignoreNextResponse; private boolean ignoreNextResponse;
private Pattern[] namePatterns; private Pattern[] namePatterns;
private LinkedList<BehaviorModel> outstandingInserts; private LinkedList<BehaviorModel> outstandingInserts = new LinkedList<BehaviorModel>();
private Thread insertThread; private Thread insertThread;
private String charset; private String charset;
private long timeElapsedSinceLastestRequest; private long timeElapsedSinceLastestRequest;
@ -384,7 +384,6 @@ public abstract class AbstractCodeGenerator implements IScriptGenerator,
} }
public void run() { public void run() {
this.outstandingInserts = new LinkedList<BehaviorModel>();
try { try {
while (!(Thread.interrupted())) { while (!(Thread.interrupted())) {
synchronized (this.outstandingInserts) { synchronized (this.outstandingInserts) {

View File

@ -70,7 +70,7 @@ public class CommunicateWithMaster {
inputStream.close(); inputStream.close();
masterAddress = prop.getProperty("masterAddress"); masterAddress = prop.getProperty("masterAddress");
} catch (Exception e1) { } catch (Exception e1) {
masterAddress = "133.133.12.1:7979"; masterAddress = "133.133.12.1:7979/";
} }
} }

View File

@ -22,7 +22,7 @@ import org.springframework.stereotype.Component;
@Component @Component
public class ScriptService extends BaseService { public class ScriptService extends BaseService {
private String baseUrl = "RecordScript"; private String baseUrl = "script";
public String getBaseUrl() { public String getBaseUrl() {
return baseUrl; return baseUrl;
@ -299,6 +299,7 @@ public class ScriptService extends BaseService {
batchModel.setId(behaviorModel.getId()); batchModel.setId(behaviorModel.getId());
return batchModel; return batchModel;
} }
public OperateScriptServerResponseModel uploadScript(String accessToken, public OperateScriptServerResponseModel uploadScript(String accessToken,
String scenarioModel, String scriptName) String scenarioModel, String scriptName)
throws CustomGenericException { throws CustomGenericException {
@ -308,5 +309,4 @@ public class ScriptService extends BaseService {
OperateScriptServerResponseModel.class, "upload script"); OperateScriptServerResponseModel.class, "upload script");
} }
} }

View File

@ -1 +1 @@
masterAddress=133.133.12.1:7979/ masterAddress=127.0.0.1:7979/