|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ServiceConnectionData | Line # 27 | 9 | 0% | 6 | 0 | 100% |
1.0
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (36) | |||
| Result | |||
|
1.0
|
net.sf.arestc.core.OverallDesignTest.testTicketRetrievalWithTicketer
net.sf.arestc.core.OverallDesignTest.testTicketRetrievalWithTicketer
|
1 PASS | |
|
0.8666667
|
net.sf.arestc.core.validations.RequestValidatorTest.testValidateRequestNotNullServiceParams
net.sf.arestc.core.validations.RequestValidatorTest.testValidateRequestNotNullServiceParams
|
1 PASS | |
|
0.8666667
|
net.sf.arestc.core.validations.RequestValidatorTest.testValidateRequestAuthenticationUserCred
net.sf.arestc.core.validations.RequestValidatorTest.testValidateRequestAuthenticationUserCred
|
1 PASS | |
|
0.8666667
|
net.sf.arestc.core.validations.RequestValidatorTest.testValidateRequestNullServiceParams
net.sf.arestc.core.validations.RequestValidatorTest.testValidateRequestNullServiceParams
|
1 PASS | |
|
0.8666667
|
net.sf.arestc.configuration.services.BaseServiceTest.testGetServiceURL
net.sf.arestc.configuration.services.BaseServiceTest.testGetServiceURL
|
1 PASS | |
|
0.8666667
|
net.sf.arestc.core.validations.RequestValidatorTest.testValidateRequestFullParams
net.sf.arestc.core.validations.RequestValidatorTest.testValidateRequestFullParams
|
1 PASS | |
|
0.8666667
|
net.sf.arestc.core.validations.RequestValidatorTest.testValidateRequestFullServiceParams
net.sf.arestc.core.validations.RequestValidatorTest.testValidateRequestFullServiceParams
|
1 PASS | |
|
0.8666667
|
net.sf.arestc.core.validations.RequestValidatorTest.testValidateRequestAuthenticationAdminNoCred
net.sf.arestc.core.validations.RequestValidatorTest.testValidateRequestAuthenticationAdminNoCred
|
1 PASS | |
|
0.8666667
|
net.sf.arestc.core.validations.RequestValidatorTest.testValidateRequestAuthenticationUserNoCred
net.sf.arestc.core.validations.RequestValidatorTest.testValidateRequestAuthenticationUserNoCred
|
1 PASS | |
|
0.8666667
|
net.sf.arestc.core.validations.RequestValidatorTest.testValidateRequestAuthenticationNoCred
net.sf.arestc.core.validations.RequestValidatorTest.testValidateRequestAuthenticationNoCred
|
1 PASS | |
|
0.8666667
|
net.sf.arestc.core.validations.RequestValidatorTest.testValidateRequestAuthenticationAdminAdminCred
net.sf.arestc.core.validations.RequestValidatorTest.testValidateRequestAuthenticationAdminAdminCred
|
1 PASS | |
|
0.6666667
|
net.sf.arestc.core.OverallDesignTest.testFileDownload
net.sf.arestc.core.OverallDesignTest.testFileDownload
|
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.testRepositoryRetrieval
net.sf.arestc.core.OverallDesignTest.testRepositoryRetrieval
|
1 PASS | |
|
0.6666667
|
net.sf.arestc.core.OverallDesignTest.testFileUpload
net.sf.arestc.core.OverallDesignTest.testFileUpload
|
1 PASS | |
|
0.6666667
|
net.sf.arestc.core.OverallDesignTest.testRepositoryDelete
net.sf.arestc.core.OverallDesignTest.testRepositoryDelete
|
1 PASS | |
|
0.6666667
|
net.sf.arestc.core.OverallDesignTest.testRepositoryMultiPost
net.sf.arestc.core.OverallDesignTest.testRepositoryMultiPost
|
1 PASS | |
|
0.6666667
|
net.sf.arestc.core.OverallDesignTest.testRepositoryCreate
net.sf.arestc.core.OverallDesignTest.testRepositoryCreate
|
1 PASS | |
|
0.6
|
net.sf.arestc.configuration.ServicesConfigurationFactoryTest.testConfigureString
net.sf.arestc.configuration.ServicesConfigurationFactoryTest.testConfigureString
|
1 PASS | |
|
0.6
|
net.sf.arestc.configuration.ServicesConfigurationFactoryTest.testConfigure
net.sf.arestc.configuration.ServicesConfigurationFactoryTest.testConfigure
|
1 PASS | |
|
0.33333334
|
net.sf.arestc.configuration.services.BaseServiceTest.testGetAuthenticatingUser
net.sf.arestc.configuration.services.BaseServiceTest.testGetAuthenticatingUser
|
1 PASS | |
|
0.33333334
|
net.sf.arestc.configuration.services.BaseServiceTest.testIsAuthenticationRequired
net.sf.arestc.configuration.services.BaseServiceTest.testIsAuthenticationRequired
|
1 PASS | |
|
0.33333334
|
net.sf.arestc.core.validations.RequestValidatorTest.testValidateRequestNullParameters
net.sf.arestc.core.validations.RequestValidatorTest.testValidateRequestNullParameters
|
1 PASS | |
|
0.33333334
|
net.sf.arestc.configuration.services.BaseServiceTest.testGetAdminPassword
net.sf.arestc.configuration.services.BaseServiceTest.testGetAdminPassword
|
1 PASS | |
|
0.33333334
|
net.sf.arestc.core.OverallDesignTest.testLoadResponseFromFile
net.sf.arestc.core.OverallDesignTest.testLoadResponseFromFile
|
1 PASS | |
|
0.33333334
|
net.sf.arestc.configuration.services.BaseServiceTest.testGetAdminUser
net.sf.arestc.configuration.services.BaseServiceTest.testGetAdminUser
|
1 PASS | |
|
0.33333334
|
net.sf.arestc.configuration.services.BaseServiceTest.testGetURLParameters
net.sf.arestc.configuration.services.BaseServiceTest.testGetURLParameters
|
1 PASS | |
|
0.13333334
|
net.sf.arestc.configuration.services.BaseServiceTest.testGetMethod
net.sf.arestc.configuration.services.BaseServiceTest.testGetMethod
|
1 PASS | |
|
0.13333334
|
net.sf.arestc.core.commands.ChainBuilderTest.testGetDefaultChainForLogin
net.sf.arestc.core.commands.ChainBuilderTest.testGetDefaultChainForLogin
|
1 PASS | |
|
0.13333334
|
net.sf.arestc.core.commands.ChainBuilderTest.testGetDefaultChainForNodeRetrieve
net.sf.arestc.core.commands.ChainBuilderTest.testGetDefaultChainForNodeRetrieve
|
1 PASS | |
|
0.13333334
|
net.sf.arestc.core.commands.ChainBuilderTest.testGetDefaultChainForNodeDelete
net.sf.arestc.core.commands.ChainBuilderTest.testGetDefaultChainForNodeDelete
|
1 PASS | |
|
0.13333334
|
net.sf.arestc.core.commands.ChainBuilderTest.testGetDefaultChainForDownloadFile
net.sf.arestc.core.commands.ChainBuilderTest.testGetDefaultChainForDownloadFile
|
1 PASS | |
|
0.13333334
|
net.sf.arestc.core.commands.ChainBuilderTest.testGetDefaultChainForUploadMultipart
net.sf.arestc.core.commands.ChainBuilderTest.testGetDefaultChainForUploadMultipart
|
1 PASS | |
|
0.13333334
|
net.sf.arestc.configuration.services.BaseServiceTest.testGetContextPath
net.sf.arestc.configuration.services.BaseServiceTest.testGetContextPath
|
1 PASS | |
|
0.13333334
|
net.sf.arestc.core.commands.ChainBuilderTest.testGetDefaultChainForUploadFile
net.sf.arestc.core.commands.ChainBuilderTest.testGetDefaultChainForUploadFile
|
1 PASS | |
|
0.13333334
|
net.sf.arestc.core.commands.ChainBuilderTest.testGetDefaultChainForNodeCreate
net.sf.arestc.core.commands.ChainBuilderTest.testGetDefaultChainForNodeCreate
|
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.services; | |
| 20 | ||
| 21 | import java.text.MessageFormat; | |
| 22 | ||
| 23 | // TODO: Auto-generated Javadoc | |
| 24 | /** | |
| 25 | * The Class ServiceConnectionData. | |
| 26 | */ | |
| 27 | public class ServiceConnectionData { | |
| 28 | ||
| 29 | /** The Constant URL_FORMAT. */ | |
| 30 | private static final String URL_FORMAT = "{0}:{1,number,####}/{2}"; | |
| 31 | /** The context path. */ | |
| 32 | private final String contextPath; | |
| 33 | /** The method. */ | |
| 34 | private final HTTPMethods method; | |
| 35 | /** The server. */ | |
| 36 | private final String server; | |
| 37 | /** The port. */ | |
| 38 | private final int port; | |
| 39 | ||
| 40 | /** | |
| 41 | * Instantiates a new service connection data. | |
| 42 | * | |
| 43 | * @param server | |
| 44 | * the server | |
| 45 | * @param port | |
| 46 | * the port | |
| 47 | * @param contextPath | |
| 48 | * the context path | |
| 49 | * @param method | |
| 50 | * the method | |
| 51 | */ | |
| 52 | 280 |
public ServiceConnectionData(final String server, final int port, |
| 53 | final String contextPath, final HTTPMethods method) { | |
| 54 | 280 | this.contextPath = contextPath; |
| 55 | 280 | this.method = method; |
| 56 | 280 | this.server = server; |
| 57 | 280 | this.port = port; |
| 58 | ||
| 59 | } | |
| 60 | ||
| 61 | /** | |
| 62 | * Gets the context path. | |
| 63 | * | |
| 64 | * @return the context path | |
| 65 | */ | |
| 66 | 33 |
public String getContextPath() { |
| 67 | 33 | return contextPath; |
| 68 | } | |
| 69 | ||
| 70 | /** | |
| 71 | * Gets the method. | |
| 72 | * | |
| 73 | * @return the method | |
| 74 | */ | |
| 75 | 40 |
public HTTPMethods getMethod() { |
| 76 | 40 | return method; |
| 77 | } | |
| 78 | ||
| 79 | /** | |
| 80 | * Gets the port. | |
| 81 | * | |
| 82 | * @return the port | |
| 83 | */ | |
| 84 | 30 |
public int getPort() { |
| 85 | 30 | return port; |
| 86 | } | |
| 87 | ||
| 88 | /** | |
| 89 | * Gets the real path. | |
| 90 | * | |
| 91 | * @return the real path | |
| 92 | */ | |
| 93 | 30 |
public String getRealPath() { |
| 94 | 30 | return MessageFormat.format(URL_FORMAT, new Object[] { getServer(), |
| 95 | getPort(), getContextPath() }); | |
| 96 | } | |
| 97 | ||
| 98 | /** | |
| 99 | * Gets the server. | |
| 100 | * | |
| 101 | * @return the server | |
| 102 | */ | |
| 103 | 30 |
public String getServer() { |
| 104 | 30 | return server; |
| 105 | } | |
| 106 | ||
| 107 | } | |
|
||||||||||||