Clover Coverage Report - ARESTC 0.1.5
Coverage timestamp: Tue Aug 10 2010 10:22:22 CEST
../../../../../img/srcFileCovDistChart7.png 69% of files have more coverage
8   80   5   2.67
0   34   0.62   3
3     1.67  
1    
 
  DummyTransformer       Line # 41 8 0% 5 4 63.6% 0.6363636
 
  (1)
 
1    /*
2    *
3    * (C)opyright 2010, Nikolaos Georgosopoulos
4    *
5    * This file is part of ARESTC.
6   
7    ARESTC is free software: you can redistribute it and/or modify
8    it under the terms of the Lesser General Public License as published by
9    the Free Software Foundation, either version 3 of the License, or
10    (at your option) any later version.
11   
12    ARESTC is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15    GNU General Public License for more details.
16   
17    You should have received a copy of the Lesser General Public License
18    along with ARESTC. If not, see <http://www.gnu.org/licenses/>.
19   
20    */
21    package net.sf.arestc.core.commands;
22   
23    import java.io.IOException;
24    import java.net.MalformedURLException;
25   
26    import net.sf.arestc.core.BaseCommand;
27    import net.sf.arestc.core.CommandException;
28    import net.sf.arestc.core.ConnectorCommand;
29    import net.sf.arestc.core.ConnectorContext;
30    import net.sf.arestc.core.ConnectorRequest;
31   
32    import org.apache.commons.io.IOUtils;
33    import org.apache.log4j.Logger;
34   
35    // TODO: Auto-generated Javadoc
36    /**
37    * The Class DummyTransformer.
38    *
39    * @author georgosn
40    */
 
41    public class DummyTransformer extends BaseCommand {
42   
43    /** The Constant LOGGER. */
44    private static final Logger LOGGER = Logger.getLogger(CallServer.class
45    .getName());
46   
47    /**
48    * Instantiates a new dummy transformer.
49    */
 
50  0 toggle public DummyTransformer() {
51  0 super();
52    }
53   
 
54  1 toggle public DummyTransformer(final ConnectorCommand next) {
55  1 super(next);
56    }
57   
58    /*
59    * (non-Javadoc)
60    *
61    * @see
62    * net.sf.arestc.core.BaseCommand#process(net.sf.arestc.core.ConnectorRequest
63    * , net.sf.arestc.core.ConnectorContext)
64    */
 
65  1 toggle @Override
66    public ConnectorContext process(final ConnectorRequest request,
67    final ConnectorContext context) throws CommandException {
68  1 try {
69  1 final String name = request.getServiceName();
70  1 context.setReturnedBody(IOUtils.toString(this.getClass()
71    .getClassLoader().getResourceAsStream(name)));
72    } catch (final MalformedURLException e) {
73  0 LOGGER.error("Error occured in process:", e);
74    } catch (final IOException e) {
75  0 LOGGER.error("Error occured in process:", e);
76    }
77  1 return super.process(request, context);
78    }
79   
80    }