forked from chhrrr/RAP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2. QA automation testing module development 20% 2.1 finish modify interface
- Loading branch information
Bosn
authored and
Bosn
committed
Nov 5, 2012
1 parent
59a6a17
commit f280992
Showing
17 changed files
with
580 additions
and
447 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Rigel Automation Platform | ||
=== | ||
|
||
@version v0.4 - (latest version, in master branch) | ||
@version v0.5 - (latest version, in master branch) | ||
@author Bosn Ma | ||
@weibo http://weibo.com/bosn | ||
@mail [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"isOk":$!isOk, "num":$!num} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
175 changes: 100 additions & 75 deletions
175
src/com/baidu/rigel/rap/mock/web/action/MockAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,100 @@ | ||
package com.baidu.rigel.rap.mock.web.action; | ||
|
||
import com.baidu.rigel.rap.common.ActionBase; | ||
import com.baidu.rigel.rap.mock.service.MockMgr; | ||
|
||
public class MockAction extends ActionBase { | ||
|
||
private static final long serialVersionUID = 1L; | ||
private int id; | ||
private String pattern; | ||
private String content; | ||
private String callback; | ||
private String _c; | ||
|
||
public String get_c() { | ||
return _c; | ||
} | ||
|
||
public void set_c(String _c) { | ||
this._c = _c; | ||
} | ||
|
||
public String getCallback() { | ||
return callback; | ||
} | ||
|
||
public void setCallback(String callback) { | ||
this.callback = callback; | ||
} | ||
|
||
private MockMgr mockMgr; | ||
|
||
public MockMgr getMockMgr() { | ||
return mockMgr; | ||
} | ||
|
||
public void setMockMgr(MockMgr mockMgr) { | ||
this.mockMgr = mockMgr; | ||
} | ||
|
||
public String getContent() { | ||
return content; | ||
} | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
|
||
public void setId(int id) { | ||
this.id = id; | ||
} | ||
|
||
public void setContent(String content) { | ||
this.content = content; | ||
} | ||
|
||
public String getPattern() { | ||
return pattern; | ||
} | ||
|
||
public void setPattern(String pattern) { | ||
this.pattern = pattern; | ||
} | ||
|
||
public String createData() { | ||
if (callback != null && !callback.isEmpty()) { | ||
setContent(callback + "(" + mockMgr.generateData(id, pattern) + ")"); | ||
} else if (_c != null && !_c.isEmpty()) { | ||
setContent(_c + "(" + mockMgr.generateData(id, pattern) + ")"); | ||
} else { | ||
setContent(mockMgr.generateData(id, pattern)); | ||
} | ||
return SUCCESS; | ||
} | ||
} | ||
package com.baidu.rigel.rap.mock.web.action; | ||
|
||
import com.baidu.rigel.rap.common.ActionBase; | ||
import com.baidu.rigel.rap.mock.service.MockMgr; | ||
|
||
public class MockAction extends ActionBase { | ||
|
||
private static final long serialVersionUID = 1L; | ||
private int id; | ||
private String pattern; | ||
private String mockData; | ||
private int actionId; | ||
private int projectId; | ||
private String content; | ||
private String callback; | ||
private String _c; | ||
|
||
public void setMockData(String mockData) { | ||
this.mockData = mockData; | ||
} | ||
|
||
public void setActionId(int actionId) { | ||
this.actionId = actionId; | ||
} | ||
|
||
public void setProjectId(int projectId) { | ||
this.projectId = projectId; | ||
} | ||
|
||
public String get_c() { | ||
return _c; | ||
} | ||
|
||
public void set_c(String _c) { | ||
this._c = _c; | ||
} | ||
|
||
public String getCallback() { | ||
return callback; | ||
} | ||
|
||
public void setCallback(String callback) { | ||
this.callback = callback; | ||
} | ||
|
||
private MockMgr mockMgr; | ||
|
||
public MockMgr getMockMgr() { | ||
return mockMgr; | ||
} | ||
|
||
public void setMockMgr(MockMgr mockMgr) { | ||
this.mockMgr = mockMgr; | ||
} | ||
|
||
public String getContent() { | ||
return content; | ||
} | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
|
||
public void setId(int id) { | ||
this.id = id; | ||
} | ||
|
||
public void setContent(String content) { | ||
this.content = content; | ||
} | ||
|
||
public String getPattern() { | ||
return pattern; | ||
} | ||
|
||
public void setPattern(String pattern) { | ||
this.pattern = pattern; | ||
} | ||
|
||
public String createData() { | ||
if (callback != null && !callback.isEmpty()) { | ||
setContent(callback + "(" + mockMgr.generateData(id, pattern) + ")"); | ||
} else if (_c != null && !_c.isEmpty()) { | ||
setContent(_c + "(" + mockMgr.generateData(id, pattern) + ")"); | ||
} else { | ||
setContent(mockMgr.generateData(id, pattern)); | ||
} | ||
return SUCCESS; | ||
} | ||
|
||
public String modify() { | ||
mockMgr.modify(actionId, mockData); | ||
return SUCCESS; | ||
} | ||
|
||
public String reset() { | ||
setNum(mockMgr.reset(projectId)); | ||
return SUCCESS; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,31 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE struts PUBLIC | ||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" | ||
"http://struts.apache.org/dtds/struts-2.0.dtd"> | ||
|
||
<struts> | ||
|
||
<package name="mock" extends="rap-default" namespace="/mock"> | ||
|
||
<action name="createData" | ||
class="com.baidu.rigel.rap.mock.web.action.MockAction" | ||
method="createData"> | ||
<result name="error" type="velocity">/bcom/contentWithoutEscape.cb.vm | ||
</result> | ||
<result name="success" type="velocity">/bcom/contentWithoutEscape.cb.vm | ||
</result> | ||
</action> | ||
|
||
</package> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE struts PUBLIC | ||
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" | ||
"http://struts.apache.org/dtds/struts-2.0.dtd"> | ||
|
||
<struts> | ||
|
||
<package name="mock" extends="rap-default" namespace="/mock"> | ||
|
||
<action name="modify" class="com.baidu.rigel.rap.mock.web.action.MockAction" | ||
method="modify"> | ||
<result name="error" type="velocity">/bcom/contentWithoutEscape.cb.vm | ||
</result> | ||
<result name="success" type="velocity">/bcom/contentWithoutEscape.cb.vm | ||
</result> | ||
</action> | ||
|
||
<action name="reset" class="com.baidu.rigel.rap.mock.web.action.MockAction" | ||
method="reset"> | ||
<result name="success" type="velocity">/bcom/isOkWithNum.cb.vm | ||
</result> | ||
</action> | ||
|
||
<action name="createData" class="com.baidu.rigel.rap.mock.web.action.MockAction" | ||
method="createData"> | ||
<result name="success" type="velocity">/bcom/isOkWithNum.cb.vm | ||
</result> | ||
</action> | ||
|
||
</package> | ||
</struts> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.