litesoft
Diff Revisions
150
vs
151
for /trunk/Java/GWT/Server/src/org/litesoft/testplan/TestPlanParserActionFactoryAction.java
|
@@ -3,10 +3,10 @@ |
3 |
3 |
|
|
4 |
4 |
|
import java.util.*; |
5 |
5 |
|
|
6 |
|
- |
import org.litesoft.xml.*; |
7 |
|
- |
import org.litesoft.GWT.client.dev.ui.inspection.*; |
8 |
6 |
|
import org.litesoft.GWT.client.dev.ui.actions.*; |
|
7 |
+ |
import org.litesoft.GWT.client.dev.ui.inspection.*; |
9 |
8 |
|
import org.litesoft.GWT.client.dev.ui.testplan.*; |
|
9 |
+ |
import org.litesoft.xml.*; |
10 |
10 |
|
|
11 |
11 |
|
public class TestPlanParserActionFactoryAction implements TestPlanActionFactory |
12 |
12 |
|
{ |
|
@@ -14,15 +14,16 @@ |
14 |
14 |
|
|
15 |
15 |
|
private static final SelectionParserJQuery sSelectorParser = new SelectionParserJQuery(); |
16 |
16 |
|
private static final Map<String, ActionParserBase> sActionParsers = new HashMap<String, ActionParserBase>(); |
|
17 |
+ |
|
17 |
18 |
|
{ |
18 |
|
- |
addAction(new ActionParserClick()); |
19 |
|
- |
addAction(new ActionParserKeystrokes()); |
20 |
|
- |
addAction(new ActionParserSetAttribute()); |
|
19 |
+ |
addAction( new ActionParserClick() ); |
|
20 |
+ |
addAction( new ActionParserKeystrokes() ); |
|
21 |
+ |
addAction( new ActionParserSetAttribute() ); |
21 |
22 |
|
} |
22 |
23 |
|
|
23 |
|
- |
private static void addAction(ActionParserBase pAction) |
|
24 |
+ |
private static void addAction( ActionParserBase pAction ) |
24 |
25 |
|
{ |
25 |
|
- |
sActionParsers.put(pAction.getTagName(), pAction); |
|
26 |
+ |
sActionParsers.put( pAction.getTagName(), pAction ); |
26 |
27 |
|
} |
27 |
28 |
|
|
28 |
29 |
|
@Override |
|
@@ -32,22 +33,22 @@ |
32 |
33 |
|
|
33 |
34 |
|
SelectionSpec selector; |
34 |
35 |
|
pParser.getNextStartTag(); |
35 |
|
- |
selector = sSelectorParser.parse(pParser); |
|
36 |
+ |
selector = sSelectorParser.parse( pParser ); |
36 |
37 |
|
|
37 |
38 |
|
ActionSpec action; |
38 |
|
- |
ActionParserBase actionParser = sActionParsers.get(pParser.getNextStartTag()); |
39 |
|
- |
assert0(ActionParserBase.class.getSimpleName() + " parser not found for ", actionParser != null); |
40 |
|
- |
action = actionParser.parse(pParser); |
|
39 |
+ |
ActionParserBase actionParser = sActionParsers.get( pParser.getNextStartTag() ); |
|
40 |
+ |
assert0( ActionParserBase.class.getSimpleName() + " parser not found for ", actionParser != null ); |
|
41 |
+ |
action = actionParser.parse( pParser ); |
41 |
42 |
|
|
42 |
43 |
|
pParser.validateNextIsEndTag( TAG_NAME ); |
43 |
44 |
|
return new GeneralizedTestPlanAction( selector, action ); |
44 |
45 |
|
} |
45 |
46 |
|
|
46 |
|
- |
private static void assert0(String pMessage, boolean pExpression) |
|
47 |
+ |
private static void assert0( String pMessage, boolean pExpression ) |
47 |
48 |
|
{ |
48 |
|
- |
if (! pExpression) |
|
49 |
+ |
if ( !pExpression ) |
49 |
50 |
|
{ |
50 |
|
- |
throw new XML_RuntimeException(pMessage); |
|
51 |
+ |
throw new XML_RuntimeException( pMessage ); |
51 |
52 |
|
} |
52 |
53 |
|
} |
53 |
54 |
|
} |