|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TransformForGET | Line # 33 | 7 | 0% | 3 | 1 | 91.7% |
0.9166667
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (5) | |||
| Result | |||
|
0.8333333
|
net.sf.arestc.core.OverallDesignTest.testFileDownload
net.sf.arestc.core.OverallDesignTest.testFileDownload
|
1 PASS | |
|
0.8333333
|
net.sf.arestc.core.OverallDesignTest.testRepositoryDelete
net.sf.arestc.core.OverallDesignTest.testRepositoryDelete
|
1 PASS | |
|
0.8333333
|
net.sf.arestc.core.OverallDesignTest.testRepositoryRetrieval
net.sf.arestc.core.OverallDesignTest.testRepositoryRetrieval
|
1 PASS | |
|
0.6666667
|
net.sf.arestc.core.OverallDesignTest.testTicketRetrieval
net.sf.arestc.core.OverallDesignTest.testTicketRetrieval
|
1 PASS | |
|
0.6666667
|
net.sf.arestc.core.OverallDesignTest.testTicketRetrievalWithTicketer
net.sf.arestc.core.OverallDesignTest.testTicketRetrievalWithTicketer
|
1 PASS | |
| 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 it under the | |
| 8 | * terms of the Lesser General Public License as published by the Free Software | |
| 9 | * Foundation, either version 3 of the License, or (at your option) any later | |
| 10 | * version. | |
| 11 | * | |
| 12 | * ARESTC is distributed in the hope that it will be useful, but WITHOUT ANY | |
| 13 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | |
| 14 | * A PARTICULAR PURPOSE. See the GNU General Public License for more details. | |
| 15 | * | |
| 16 | * You should have received a copy of the Lesser General Public License along | |
| 17 | * with ARESTC. If not, see <http://www.gnu.org/licenses/>. | |
| 18 | */ | |
| 19 | package net.sf.arestc.core.commands; | |
| 20 | ||
| 21 | import net.sf.arestc.core.CommandException; | |
| 22 | import net.sf.arestc.core.ConnectorContext; | |
| 23 | import net.sf.arestc.core.ConnectorRequest; | |
| 24 | ||
| 25 | import org.apache.commons.httpclient.auth.AuthScope; | |
| 26 | ||
| 27 | // TODO: Auto-generated Javadoc | |
| 28 | /** | |
| 29 | * The Class TransformForGET. | |
| 30 | * | |
| 31 | * @author georgosn | |
| 32 | */ | |
| 33 | public class TransformForGET extends TransformToServiceCall { | |
| 34 | ||
| 35 | /* | |
| 36 | * (non-Javadoc) | |
| 37 | * | |
| 38 | * @see | |
| 39 | * net.sf.arestc.core.commands.TransformToServiceCall#process(net.sf.arestc | |
| 40 | * .core.ConnectorRequest, net.sf.arestc.core.ConnectorContext) | |
| 41 | */ | |
| 42 | 7 |
@Override |
| 43 | public ConnectorContext process(final ConnectorRequest request, | |
| 44 | final ConnectorContext context) throws CommandException { | |
| 45 | ||
| 46 | 7 | if (getValidator().validateRequest(request, context)) { |
| 47 | ||
| 48 | 7 | prepareQuery(request, context); |
| 49 | ||
| 50 | 7 | context.setMethod(context.getService().getMethod() |
| 51 | .getMethod(context.getServiceUri().toString())); | |
| 52 | 7 | if (context.getService().isAuthenticationRequired()) { |
| 53 | 3 | request.setCredentials(context.getAdminAuthentication(context |
| 54 | .getService())); | |
| 55 | 3 | context.getClient() |
| 56 | .getState() | |
| 57 | .setCredentials( | |
| 58 | new AuthScope( | |
| 59 | context.getServiceUri().getHost(), | |
| 60 | context.getServiceUri().getPort(), | |
| 61 | AuthScope.ANY_REALM, context | |
| 62 | .getServiceUri().getScheme()), | |
| 63 | request.getCredentials()); | |
| 64 | } | |
| 65 | } | |
| 66 | ||
| 67 | 7 | return super.process(request, context); |
| 68 | } | |
| 69 | } | |
|
||||||||||||