1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.rendering.macro.test; |
21 |
|
|
22 |
|
import java.io.Reader; |
23 |
|
import java.util.Arrays; |
24 |
|
import java.util.List; |
25 |
|
|
26 |
|
import javax.script.Bindings; |
27 |
|
import javax.script.ScriptContext; |
28 |
|
import javax.script.ScriptEngine; |
29 |
|
import javax.script.ScriptEngineFactory; |
30 |
|
import javax.script.ScriptException; |
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
@version |
36 |
|
@since |
37 |
|
|
|
|
| 16% |
Uncovered Elements: 42 (50) |
Complexity: 26 |
Complexity Density: 1.08 |
|
38 |
|
public abstract class AbstractTestScriptEngineFactory implements ScriptEngineFactory, ScriptEngine |
39 |
|
{ |
40 |
|
private static final String VERSION = "1.0"; |
41 |
|
|
42 |
|
private String shortName; |
43 |
|
|
44 |
|
private String languageName; |
45 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
46 |
16 |
public AbstractTestScriptEngineFactory(String shortName, String languageName)... |
47 |
|
{ |
48 |
16 |
this.shortName = shortName; |
49 |
16 |
this.languageName = languageName; |
50 |
|
} |
51 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
52 |
0 |
@Override... |
53 |
|
public String getEngineName() |
54 |
|
{ |
55 |
0 |
return "Test Scripting Engine"; |
56 |
|
} |
57 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
58 |
0 |
@Override... |
59 |
|
public String getEngineVersion() |
60 |
|
{ |
61 |
0 |
return VERSION; |
62 |
|
} |
63 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
64 |
0 |
@Override... |
65 |
|
public List<String> getExtensions() |
66 |
|
{ |
67 |
0 |
return null; |
68 |
|
} |
69 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
70 |
0 |
@Override... |
71 |
|
public List<String> getMimeTypes() |
72 |
|
{ |
73 |
0 |
return null; |
74 |
|
} |
75 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
76 |
6 |
@Override... |
77 |
|
public List<String> getNames() |
78 |
|
{ |
79 |
6 |
return Arrays.asList(this.shortName, this.languageName); |
80 |
|
} |
81 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
82 |
0 |
@Override... |
83 |
|
public String getLanguageName() |
84 |
|
{ |
85 |
0 |
return this.languageName; |
86 |
|
} |
87 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
88 |
0 |
@Override... |
89 |
|
public String getLanguageVersion() |
90 |
|
{ |
91 |
0 |
return VERSION; |
92 |
|
} |
93 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
94 |
0 |
@Override... |
95 |
|
public Object getParameter(String key) |
96 |
|
{ |
97 |
0 |
return null; |
98 |
|
} |
99 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
100 |
0 |
@Override... |
101 |
|
public String getMethodCallSyntax(String obj, String m, String... args) |
102 |
|
{ |
103 |
0 |
return null; |
104 |
|
} |
105 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
106 |
0 |
@Override... |
107 |
|
public String getOutputStatement(String toDisplay) |
108 |
|
{ |
109 |
0 |
return null; |
110 |
|
} |
111 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
112 |
0 |
@Override... |
113 |
|
public String getProgram(String... statements) |
114 |
|
{ |
115 |
0 |
return null; |
116 |
|
} |
117 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
118 |
2 |
@Override... |
119 |
|
public ScriptEngine getScriptEngine() |
120 |
|
{ |
121 |
2 |
return this; |
122 |
|
} |
123 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
124 |
0 |
@Override... |
125 |
|
public Object eval(Reader reader, ScriptContext context) throws ScriptException |
126 |
|
{ |
127 |
0 |
return null; |
128 |
|
} |
129 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
130 |
0 |
@Override... |
131 |
|
public Object eval(String script) throws ScriptException |
132 |
|
{ |
133 |
0 |
return null; |
134 |
|
} |
135 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
136 |
0 |
@Override... |
137 |
|
public Object eval(Reader reader) throws ScriptException |
138 |
|
{ |
139 |
0 |
return null; |
140 |
|
} |
141 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
142 |
0 |
@Override... |
143 |
|
public Object eval(String script, Bindings n) throws ScriptException |
144 |
|
{ |
145 |
0 |
return null; |
146 |
|
} |
147 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
148 |
0 |
@Override... |
149 |
|
public Object eval(Reader reader, Bindings n) throws ScriptException |
150 |
|
{ |
151 |
0 |
return null; |
152 |
|
} |
153 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
154 |
0 |
@Override... |
155 |
|
public void put(String key, Object value) |
156 |
|
{ |
157 |
|
} |
158 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
159 |
0 |
@Override... |
160 |
|
public Object get(String key) |
161 |
|
{ |
162 |
0 |
return null; |
163 |
|
} |
164 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
165 |
0 |
@Override... |
166 |
|
public Bindings getBindings(int scope) |
167 |
|
{ |
168 |
0 |
return null; |
169 |
|
} |
170 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
171 |
2 |
@Override... |
172 |
|
public void setBindings(Bindings bindings, int scope) |
173 |
|
{ |
174 |
|
} |
175 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
176 |
0 |
@Override... |
177 |
|
public Bindings createBindings() |
178 |
|
{ |
179 |
0 |
return null; |
180 |
|
} |
181 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
182 |
0 |
@Override... |
183 |
|
public ScriptContext getContext() |
184 |
|
{ |
185 |
0 |
return null; |
186 |
|
} |
187 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
188 |
0 |
@Override... |
189 |
|
public void setContext(ScriptContext context) |
190 |
|
{ |
191 |
|
} |
192 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
193 |
0 |
@Override... |
194 |
|
public ScriptEngineFactory getFactory() |
195 |
|
{ |
196 |
0 |
return null; |
197 |
|
} |
198 |
|
} |