1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.rendering.macro.test

File AbstractTestScriptEngineFactory.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart2.png
81% of files have more coverage

Code metrics

0
24
26
1
198
142
26
1.08
0.92
26
1

Classes

Class Line # Actions
AbstractTestScriptEngineFactory 38 24 0% 26 42
0.1616%
 

Contributing tests

This file is covered by 8 tests. .

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
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    * For writing test engines.
34    *
35    * @version $Id: 432d000ad8027909e5d8f12ed1c48a3a1bcbde71 $
36    * @since 7.1M1
37    */
 
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   
 
46  16 toggle public AbstractTestScriptEngineFactory(String shortName, String languageName)
47    {
48  16 this.shortName = shortName;
49  16 this.languageName = languageName;
50    }
51   
 
52  0 toggle @Override
53    public String getEngineName()
54    {
55  0 return "Test Scripting Engine";
56    }
57   
 
58  0 toggle @Override
59    public String getEngineVersion()
60    {
61  0 return VERSION;
62    }
63   
 
64  0 toggle @Override
65    public List<String> getExtensions()
66    {
67  0 return null;
68    }
69   
 
70  0 toggle @Override
71    public List<String> getMimeTypes()
72    {
73  0 return null;
74    }
75   
 
76  6 toggle @Override
77    public List<String> getNames()
78    {
79  6 return Arrays.asList(this.shortName, this.languageName);
80    }
81   
 
82  0 toggle @Override
83    public String getLanguageName()
84    {
85  0 return this.languageName;
86    }
87   
 
88  0 toggle @Override
89    public String getLanguageVersion()
90    {
91  0 return VERSION;
92    }
93   
 
94  0 toggle @Override
95    public Object getParameter(String key)
96    {
97  0 return null;
98    }
99   
 
100  0 toggle @Override
101    public String getMethodCallSyntax(String obj, String m, String... args)
102    {
103  0 return null;
104    }
105   
 
106  0 toggle @Override
107    public String getOutputStatement(String toDisplay)
108    {
109  0 return null;
110    }
111   
 
112  0 toggle @Override
113    public String getProgram(String... statements)
114    {
115  0 return null;
116    }
117   
 
118  2 toggle @Override
119    public ScriptEngine getScriptEngine()
120    {
121  2 return this;
122    }
123   
 
124  0 toggle @Override
125    public Object eval(Reader reader, ScriptContext context) throws ScriptException
126    {
127  0 return null;
128    }
129   
 
130  0 toggle @Override
131    public Object eval(String script) throws ScriptException
132    {
133  0 return null;
134    }
135   
 
136  0 toggle @Override
137    public Object eval(Reader reader) throws ScriptException
138    {
139  0 return null;
140    }
141   
 
142  0 toggle @Override
143    public Object eval(String script, Bindings n) throws ScriptException
144    {
145  0 return null;
146    }
147   
 
148  0 toggle @Override
149    public Object eval(Reader reader, Bindings n) throws ScriptException
150    {
151  0 return null;
152    }
153   
 
154  0 toggle @Override
155    public void put(String key, Object value)
156    {
157    }
158   
 
159  0 toggle @Override
160    public Object get(String key)
161    {
162  0 return null;
163    }
164   
 
165  0 toggle @Override
166    public Bindings getBindings(int scope)
167    {
168  0 return null;
169    }
170   
 
171  2 toggle @Override
172    public void setBindings(Bindings bindings, int scope)
173    {
174    }
175   
 
176  0 toggle @Override
177    public Bindings createBindings()
178    {
179  0 return null;
180    }
181   
 
182  0 toggle @Override
183    public ScriptContext getContext()
184    {
185  0 return null;
186    }
187   
 
188  0 toggle @Override
189    public void setContext(ScriptContext context)
190    {
191    }
192   
 
193  0 toggle @Override
194    public ScriptEngineFactory getFactory()
195    {
196  0 return null;
197    }
198    }