[507] | 1 | package gov.hhs.fha.nhinc.common.connectionmanager;
|
---|
| 2 |
|
---|
| 3 | import gov.hhs.fha.nhinc.common.nhinccommon.HomeCommunitiesType;
|
---|
| 4 | import gov.hhs.fha.nhinc.common.nhinccommon.HomeCommunityType;
|
---|
| 5 |
|
---|
| 6 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.BusinessEntitiesType;
|
---|
| 7 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.BusinessServiceType;
|
---|
| 8 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.BusinessEntityType;
|
---|
| 9 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.ConnectionInfoEndpointType;
|
---|
| 10 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.ConnectionInfoEndpointsType;
|
---|
| 11 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.ConnectionInfoType;
|
---|
| 12 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.ConnectionInfosType;
|
---|
| 13 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.ContactType;
|
---|
| 14 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.ForceRefreshInternalConnectCacheRequestType;
|
---|
| 15 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.ForceRefreshUDDICacheRequestType;
|
---|
| 16 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.GetAllBusinessEntitiesRequestType;
|
---|
| 17 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.GetAllBusinessEntitySetByServiceNameRequestType;
|
---|
| 18 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.GetAllCommunitiesRequestType;
|
---|
| 19 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.GetAllConnectionInfoEndpointSetByServiceNameRequestType;
|
---|
| 20 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.GetAllConnectionInfoSetByServiceNameRequestType;
|
---|
| 21 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.GetAssigningAuthoritiesByHomeCommunityRequestType;
|
---|
| 22 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.GetAssigningAuthoritiesByHomeCommunityResponseType;
|
---|
| 23 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.GetBusinessEntityByServiceNameRequestType;
|
---|
| 24 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.GetBusinessEntityRequestType;
|
---|
| 25 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.GetBusinessEntitySetByServiceNameRequestType;
|
---|
| 26 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.GetBusinessEntitySetRequestType;
|
---|
| 27 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.GetConnectionInfoEndpointByServiceNameRequestType;
|
---|
| 28 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.GetConnectionInfoEndpointSetByServiceNameRequestType;
|
---|
| 29 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.GetConnectionInfoEndpointSetRequestType;
|
---|
| 30 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.HomeCommunitiesWithServiceNameType;
|
---|
| 31 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.HomeCommunityWithServiceNameType;
|
---|
| 32 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.ServiceConnectionInfoEndpointType;
|
---|
| 33 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.ServiceConnectionInfoType;
|
---|
| 34 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.StoreAssigningAuthorityToHomeCommunityMappingRequestType;
|
---|
| 35 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.SuccessOrFailType;
|
---|
| 36 | import gov.hhs.fha.nhinc.common.connectionmanagerinfo.UniformServiceNameType;
|
---|
| 37 |
|
---|
| 38 | import gov.hhs.fha.nhinc.common.nhinccommon.AcknowledgementType;
|
---|
| 39 | import gov.hhs.fha.nhinc.common.nhinccommon.AssigningAuthorityType;
|
---|
| 40 | import gov.hhs.fha.nhinc.connectmgr.ConnectionManagerCache;
|
---|
| 41 |
|
---|
| 42 | import java.util.List;
|
---|
| 43 | import java.util.List;
|
---|
| 44 | import org.junit.After;
|
---|
| 45 | import org.junit.AfterClass;
|
---|
| 46 | import org.junit.Before;
|
---|
| 47 | import org.junit.BeforeClass;
|
---|
| 48 | import org.junit.Test;
|
---|
| 49 | import static org.junit.Assert.*;
|
---|
| 50 |
|
---|
| 51 | /**
|
---|
| 52 | *
|
---|
| 53 | * @author westbergl
|
---|
| 54 | */
|
---|
| 55 | public class CMServiceHelperTest {
|
---|
| 56 |
|
---|
| 57 | public CMServiceHelperTest() {
|
---|
| 58 | }
|
---|
| 59 |
|
---|
| 60 | @BeforeClass
|
---|
| 61 | public static void setUpClass() throws Exception
|
---|
| 62 | {
|
---|
| 63 | // Point to our local copy of the property files for testing purposes.
|
---|
| 64 | // This will pick up the ones in this project.
|
---|
| 65 | //--------------------------------------------------------------------
|
---|
| 66 | ConnectionManagerCache.overrideFileLocations("uddiConnectionInfo.xml", "internalConnectionInfo.xml");
|
---|
| 67 | }
|
---|
| 68 |
|
---|
| 69 | @AfterClass
|
---|
| 70 | public static void tearDownClass() throws Exception
|
---|
| 71 | {
|
---|
| 72 | }
|
---|
| 73 |
|
---|
| 74 | @Before
|
---|
| 75 | public void setUp() {
|
---|
| 76 | }
|
---|
| 77 |
|
---|
| 78 | @After
|
---|
| 79 | public void tearDown() {
|
---|
| 80 | }
|
---|
| 81 |
|
---|
| 82 | /**
|
---|
| 83 | * This method validates the entire contents of a home community for
|
---|
| 84 | * HomeCommunity 1111.1111.1111.1111
|
---|
| 85 | *
|
---|
| 86 | * @param oHomeCommunity The business entity for this home community.
|
---|
| 87 | */
|
---|
| 88 | private void validateHomeCommunity_1111_1111_1111_1111(HomeCommunityType oHomeCommunity)
|
---|
| 89 | {
|
---|
| 90 | assertNotNull(oHomeCommunity);
|
---|
| 91 | assertEquals("1111.1111.1111.1111", oHomeCommunity.getHomeCommunityId());
|
---|
| 92 | assertEquals("Home1", oHomeCommunity.getName());
|
---|
| 93 | assertEquals("Home1 Description", oHomeCommunity.getDescription());
|
---|
| 94 | }
|
---|
| 95 |
|
---|
| 96 | /**
|
---|
| 97 | * This method validates the entire contents of a home community for
|
---|
| 98 | * HomeCommunity 2222.2222.2222.2222
|
---|
| 99 | *
|
---|
| 100 | * @param oHomeCommunity The business entity for this home community.
|
---|
| 101 | */
|
---|
| 102 | private void validateHomeCommunity_2222_2222_2222_2222(HomeCommunityType oHomeCommunity)
|
---|
| 103 | {
|
---|
| 104 | assertNotNull(oHomeCommunity);
|
---|
| 105 | assertEquals("2222.2222.2222.2222", oHomeCommunity.getHomeCommunityId());
|
---|
| 106 | assertEquals("Home2", oHomeCommunity.getName());
|
---|
| 107 | assertEquals("Home2 Description", oHomeCommunity.getDescription());
|
---|
| 108 | }
|
---|
| 109 |
|
---|
| 110 | /**
|
---|
| 111 | * This method validates the entire contents of a home community for
|
---|
| 112 | * HomeCommunity 1111.1111.1111.1111..2
|
---|
| 113 | *
|
---|
| 114 | * @param oHomeCommunity The business entity for this home community.
|
---|
| 115 | */
|
---|
| 116 | private void validateHomeCommunity_1111_1111_1111_1111__2(HomeCommunityType oHomeCommunity)
|
---|
| 117 | {
|
---|
| 118 | assertNotNull(oHomeCommunity);
|
---|
| 119 | assertEquals("1111.1111.1111.1111..2", oHomeCommunity.getHomeCommunityId());
|
---|
| 120 | assertEquals("DuplicateFromUDDI Name", oHomeCommunity.getName());
|
---|
| 121 | assertEquals("DuplicateFromUDDI Description", oHomeCommunity.getDescription());
|
---|
| 122 | }
|
---|
| 123 |
|
---|
| 124 | /**
|
---|
| 125 | * This method validates the entire contents of a home community for
|
---|
| 126 | * HomeCommunity 1111.1111.1111.1111..1
|
---|
| 127 | *
|
---|
| 128 | * @param oHomeCommunity The business entity for this home community.
|
---|
| 129 | */
|
---|
| 130 | private void validateHomeCommunity_1111_1111_1111_1111__1(HomeCommunityType oHomeCommunity)
|
---|
| 131 | {
|
---|
| 132 | assertNotNull(oHomeCommunity);
|
---|
| 133 | assertEquals("1111.1111.1111.1111..1", oHomeCommunity.getHomeCommunityId());
|
---|
| 134 | assertEquals("BusinessName.1.1", oHomeCommunity.getName());
|
---|
| 135 | assertEquals("BusinessDescription.1.1", oHomeCommunity.getDescription());
|
---|
| 136 | }
|
---|
| 137 |
|
---|
| 138 | /**
|
---|
| 139 | * This method validates the entire contents of a connection info for
|
---|
| 140 | * HomeCommunity 1111.1111.1111.1111
|
---|
| 141 | *
|
---|
| 142 | * @param oConnInfo The business entity for this home community.
|
---|
| 143 | * @param sUniformServiceName If this is passed, then it will validate all of the
|
---|
| 144 | * general stuff and only the one specific service and that
|
---|
| 145 | * the service is the only one that exists.
|
---|
| 146 | */
|
---|
| 147 | private void validateConnectionInfoEndpoint_1111_1111_1111_1111(ConnectionInfoEndpointType oConnInfo, String sUniformServiceName)
|
---|
| 148 | {
|
---|
| 149 | assertNotNull(oConnInfo);
|
---|
| 150 | assertNotNull(oConnInfo.getHomeCommunity());
|
---|
| 151 | assertEquals("1111.1111.1111.1111", oConnInfo.getHomeCommunity().getHomeCommunityId());
|
---|
| 152 | assertEquals("Home1", oConnInfo.getHomeCommunity().getName());
|
---|
| 153 | assertEquals("Home1 Description", oConnInfo.getHomeCommunity().getDescription());
|
---|
| 154 |
|
---|
| 155 | assertNotNull(oConnInfo.getServiceConnectionInfoEndpoints());
|
---|
| 156 | assertNotNull(oConnInfo.getServiceConnectionInfoEndpoints().getServiceConnectionInfoEndpoint());
|
---|
| 157 |
|
---|
| 158 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 159 | {
|
---|
| 160 | assertEquals(2, oConnInfo.getServiceConnectionInfoEndpoints().getServiceConnectionInfoEndpoint().size());
|
---|
| 161 | }
|
---|
| 162 | else
|
---|
| 163 | {
|
---|
| 164 | assertEquals(1, oConnInfo.getServiceConnectionInfoEndpoints().getServiceConnectionInfoEndpoint().size());
|
---|
| 165 | }
|
---|
| 166 |
|
---|
| 167 | boolean baFoundService[] = {false, false};
|
---|
| 168 | boolean bMatchedService = false; // Used when we are looking just for one service.
|
---|
| 169 | for (ServiceConnectionInfoEndpointType oService : oConnInfo.getServiceConnectionInfoEndpoints().getServiceConnectionInfoEndpoint())
|
---|
| 170 | {
|
---|
| 171 | if (oService.getServiceName().equals("UnitTestServiceName_3_1"))
|
---|
| 172 | {
|
---|
| 173 | baFoundService[0] = true;
|
---|
| 174 | assertNotNull(oService.getEPR());
|
---|
| 175 | assertNotNull(oService.getEPR().getEndpointReference());
|
---|
| 176 | assertNotNull(oService.getEPR().getEndpointReference().getAddress());
|
---|
| 177 | assertEquals("http://www.service1.com", oService.getEPR().getEndpointReference().getAddress().getValue());
|
---|
| 178 |
|
---|
| 179 | assertNotNull(oService.getEPR().getEndpointReference().getServiceName());
|
---|
| 180 | assertEquals("Port_3_1", oService.getEPR().getEndpointReference().getServiceName().getPortName());
|
---|
| 181 |
|
---|
| 182 | assertNotNull(oService.getEPR().getEndpointReference().getServiceName().getValue());
|
---|
| 183 | assertEquals("urn:unit:test:3:1", oService.getEPR().getEndpointReference().getServiceName().getValue().getNamespaceURI());
|
---|
| 184 | assertEquals("Service_3_1", oService.getEPR().getEndpointReference().getServiceName().getValue().getLocalPart());
|
---|
| 185 | assertEquals("Prefix_3_1", oService.getEPR().getEndpointReference().getServiceName().getValue().getPrefix());
|
---|
| 186 | }
|
---|
| 187 | else if (oService.getServiceName().equals("UnitTestServiceName_4_1"))
|
---|
| 188 | {
|
---|
| 189 | baFoundService[1] = true;
|
---|
| 190 | assertNotNull(oService.getEPR());
|
---|
| 191 | assertNotNull(oService.getEPR().getEndpointReference());
|
---|
| 192 | assertNotNull(oService.getEPR().getEndpointReference().getAddress());
|
---|
| 193 | assertEquals("http://www.service2.com", oService.getEPR().getEndpointReference().getAddress().getValue());
|
---|
| 194 |
|
---|
| 195 | assertNotNull(oService.getEPR().getEndpointReference().getServiceName());
|
---|
| 196 | assertEquals("Port_4_1", oService.getEPR().getEndpointReference().getServiceName().getPortName());
|
---|
| 197 |
|
---|
| 198 | assertNotNull(oService.getEPR().getEndpointReference().getServiceName().getValue());
|
---|
| 199 | assertEquals("urn:unit:test:4:1", oService.getEPR().getEndpointReference().getServiceName().getValue().getNamespaceURI());
|
---|
| 200 | assertEquals("Service_4_1", oService.getEPR().getEndpointReference().getServiceName().getValue().getLocalPart());
|
---|
| 201 | assertEquals("Prefix_4_1", oService.getEPR().getEndpointReference().getServiceName().getValue().getPrefix());
|
---|
| 202 | }
|
---|
| 203 | else
|
---|
| 204 | {
|
---|
| 205 | fail("Found an unexpected service: " + oService.getServiceName());
|
---|
| 206 | }
|
---|
| 207 |
|
---|
| 208 | // We can check this here because if it does not match either of the two specified, we will
|
---|
| 209 | // get an error. So we are guaranteed that we will either fail before we are done, or
|
---|
| 210 | // that everything is in order.
|
---|
| 211 | //------------------------------------------------------------------------------------------
|
---|
| 212 | if ((sUniformServiceName != null) && (sUniformServiceName.equals(oService.getServiceName())))
|
---|
| 213 | {
|
---|
| 214 | bMatchedService = true;
|
---|
| 215 | }
|
---|
| 216 |
|
---|
| 217 |
|
---|
| 218 | } // for (CMBusinessService oService : oEntity.getBusinessServices().getBusinessService())
|
---|
| 219 |
|
---|
| 220 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 221 | {
|
---|
| 222 | assertTrue(baFoundService[0]);
|
---|
| 223 | assertTrue(baFoundService[1]);
|
---|
| 224 | }
|
---|
| 225 | else
|
---|
| 226 | {
|
---|
| 227 | assertTrue(bMatchedService);
|
---|
| 228 | }
|
---|
| 229 |
|
---|
| 230 | }
|
---|
| 231 |
|
---|
| 232 | /**
|
---|
| 233 | * This method validates the entire contents of a ConnectionInfo for
|
---|
| 234 | * HomeCommunity 1111.1111.1111.1111..1
|
---|
| 235 | *
|
---|
| 236 | * @param oEntity The business entity for this home community.
|
---|
| 237 | * @param sUniformServiceName If this is passed, then it will validate all of the
|
---|
| 238 | * general stuff and only the one specific service and that
|
---|
| 239 | * the service is the only one that exists.
|
---|
| 240 | */
|
---|
| 241 | private void validateConnectionInfoEndpoint_1111_1111_1111_1111__1(ConnectionInfoEndpointType oConnInfo, String sUniformServiceName)
|
---|
| 242 | {
|
---|
| 243 | assertNotNull(oConnInfo);
|
---|
| 244 | assertNotNull(oConnInfo.getHomeCommunity());
|
---|
| 245 | assertEquals("1111.1111.1111.1111..1", oConnInfo.getHomeCommunity().getHomeCommunityId());
|
---|
| 246 | assertEquals("BusinessName.1.1", oConnInfo.getHomeCommunity().getName());
|
---|
| 247 | assertEquals("BusinessDescription.1.1", oConnInfo.getHomeCommunity().getDescription());
|
---|
| 248 |
|
---|
| 249 | // Business Services
|
---|
| 250 | //------------------
|
---|
| 251 | assertNotNull(oConnInfo.getServiceConnectionInfoEndpoints());
|
---|
| 252 | assertNotNull(oConnInfo.getServiceConnectionInfoEndpoints().getServiceConnectionInfoEndpoint());
|
---|
| 253 |
|
---|
| 254 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 255 | {
|
---|
| 256 | assertEquals(2, oConnInfo.getServiceConnectionInfoEndpoints().getServiceConnectionInfoEndpoint().size());
|
---|
| 257 | }
|
---|
| 258 | else
|
---|
| 259 | {
|
---|
| 260 | assertEquals(1, oConnInfo.getServiceConnectionInfoEndpoints().getServiceConnectionInfoEndpoint().size());
|
---|
| 261 | }
|
---|
| 262 |
|
---|
| 263 | boolean baFoundService[] = {false, false};
|
---|
| 264 | boolean bMatchedService = false; // Used when we are looking just for one service.
|
---|
| 265 | for (ServiceConnectionInfoEndpointType oService : oConnInfo.getServiceConnectionInfoEndpoints().getServiceConnectionInfoEndpoint())
|
---|
| 266 | {
|
---|
| 267 | if (oService.getServiceName().equals("UnitTestServiceName_1_1"))
|
---|
| 268 | {
|
---|
| 269 | baFoundService[0] = true;
|
---|
| 270 | assertNotNull(oService.getEPR());
|
---|
| 271 | assertNotNull(oService.getEPR().getEndpointReference());
|
---|
| 272 | assertNotNull(oService.getEPR().getEndpointReference().getAddress());
|
---|
| 273 | assertEquals("http://www.test.com:8080/EndpointURL.1.1.1", oService.getEPR().getEndpointReference().getAddress().getValue());
|
---|
| 274 |
|
---|
| 275 | assertNotNull(oService.getEPR().getEndpointReference().getServiceName());
|
---|
| 276 | assertEquals("Port_1_1", oService.getEPR().getEndpointReference().getServiceName().getPortName());
|
---|
| 277 |
|
---|
| 278 | assertNotNull(oService.getEPR().getEndpointReference().getServiceName().getValue());
|
---|
| 279 | assertEquals("urn:unit:test:1:1", oService.getEPR().getEndpointReference().getServiceName().getValue().getNamespaceURI());
|
---|
| 280 | assertEquals("Service_1_1", oService.getEPR().getEndpointReference().getServiceName().getValue().getLocalPart());
|
---|
| 281 | assertEquals("Prefix_1_1", oService.getEPR().getEndpointReference().getServiceName().getValue().getPrefix());
|
---|
| 282 | }
|
---|
| 283 | else if (oService.getServiceName().equals("UnitTestServiceName_1_2"))
|
---|
| 284 | {
|
---|
| 285 | baFoundService[1] = true;
|
---|
| 286 | assertNotNull(oService.getEPR());
|
---|
| 287 | assertNotNull(oService.getEPR().getEndpointReference());
|
---|
| 288 | assertNotNull(oService.getEPR().getEndpointReference().getAddress());
|
---|
| 289 | assertEquals("http://www.test.com:8080/EndpointURL.1.2.1", oService.getEPR().getEndpointReference().getAddress().getValue());
|
---|
| 290 |
|
---|
| 291 | assertNotNull(oService.getEPR().getEndpointReference().getServiceName());
|
---|
| 292 | assertEquals("Port_1_2", oService.getEPR().getEndpointReference().getServiceName().getPortName());
|
---|
| 293 |
|
---|
| 294 | assertNotNull(oService.getEPR().getEndpointReference().getServiceName().getValue());
|
---|
| 295 | assertEquals("urn:unit:test:1:2", oService.getEPR().getEndpointReference().getServiceName().getValue().getNamespaceURI());
|
---|
| 296 | assertEquals("Service_1_2", oService.getEPR().getEndpointReference().getServiceName().getValue().getLocalPart());
|
---|
| 297 | assertEquals("Prefix_1_2", oService.getEPR().getEndpointReference().getServiceName().getValue().getPrefix());
|
---|
| 298 | }
|
---|
| 299 | else
|
---|
| 300 | {
|
---|
| 301 | fail("Found an unexpected service: " + oService.getServiceName());
|
---|
| 302 | }
|
---|
| 303 |
|
---|
| 304 | // We can check this here because if it does not match either of the two specified, we will
|
---|
| 305 | // get an error. So we are guaranteed that we will either fail before we are done, or
|
---|
| 306 | // that everything is in order.
|
---|
| 307 | //------------------------------------------------------------------------------------------
|
---|
| 308 | if ((sUniformServiceName != null) && (sUniformServiceName.equals(oService.getServiceName())))
|
---|
| 309 | {
|
---|
| 310 | bMatchedService = true;
|
---|
| 311 | }
|
---|
| 312 |
|
---|
| 313 |
|
---|
| 314 | } // for (CMBusinessService oService : oEntity.getBusinessServices().getBusinessService())
|
---|
| 315 |
|
---|
| 316 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 317 | {
|
---|
| 318 | assertTrue(baFoundService[0]);
|
---|
| 319 | assertTrue(baFoundService[1]);
|
---|
| 320 | }
|
---|
| 321 | else
|
---|
| 322 | {
|
---|
| 323 | assertTrue(bMatchedService);
|
---|
| 324 | }
|
---|
| 325 | }
|
---|
| 326 |
|
---|
| 327 | /**
|
---|
| 328 | * This method validates the entire contents of a business entity for
|
---|
| 329 | * HomeCommunity 1111.1111.1111.1111..2
|
---|
| 330 | *
|
---|
| 331 | * @param oEntity The business entity for this home community.
|
---|
| 332 | * @param sUniformServiceName If this is passed, then it will validate all of the
|
---|
| 333 | * general stuff and only the one specific service and that
|
---|
| 334 | * the service is the only one that exists.
|
---|
| 335 | */
|
---|
| 336 | private void validateConnectionInfoEndpoint_1111_1111_1111_1111__2(ConnectionInfoEndpointType oConnInfo, String sUniformServiceName)
|
---|
| 337 | {
|
---|
| 338 | assertNotNull(oConnInfo);
|
---|
| 339 | assertNotNull(oConnInfo.getHomeCommunity());
|
---|
| 340 | assertEquals("1111.1111.1111.1111..2", oConnInfo.getHomeCommunity().getHomeCommunityId());
|
---|
| 341 | assertEquals("BusinessName.2.1", oConnInfo.getHomeCommunity().getName());
|
---|
| 342 | assertEquals("BusinessDescription.2.1", oConnInfo.getHomeCommunity().getDescription());
|
---|
| 343 |
|
---|
| 344 | assertNotNull(oConnInfo.getServiceConnectionInfoEndpoints());
|
---|
| 345 | assertNotNull(oConnInfo.getServiceConnectionInfoEndpoints().getServiceConnectionInfoEndpoint());
|
---|
| 346 |
|
---|
| 347 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 348 | {
|
---|
| 349 | assertEquals(4, oConnInfo.getServiceConnectionInfoEndpoints().getServiceConnectionInfoEndpoint().size());
|
---|
| 350 | }
|
---|
| 351 | else
|
---|
| 352 | {
|
---|
| 353 | assertEquals(1, oConnInfo.getServiceConnectionInfoEndpoints().getServiceConnectionInfoEndpoint().size());
|
---|
| 354 | }
|
---|
| 355 |
|
---|
| 356 | boolean baFoundService[] = {false, false, false, false};
|
---|
| 357 | boolean bMatchedService = false; // Used when we are looking just for one service.
|
---|
| 358 | for (ServiceConnectionInfoEndpointType oService : oConnInfo.getServiceConnectionInfoEndpoints().getServiceConnectionInfoEndpoint())
|
---|
| 359 | {
|
---|
| 360 | if (oService.getServiceName().equals("UnitTestServiceName_7_1"))
|
---|
| 361 | {
|
---|
| 362 | baFoundService[0] = true;
|
---|
| 363 | assertNotNull(oService.getEPR());
|
---|
| 364 | assertNotNull(oService.getEPR().getEndpointReference());
|
---|
| 365 | assertNotNull(oService.getEPR().getEndpointReference().getAddress());
|
---|
| 366 | assertEquals("http://www.service5.com", oService.getEPR().getEndpointReference().getAddress().getValue());
|
---|
| 367 |
|
---|
| 368 | assertNotNull(oService.getEPR().getEndpointReference().getServiceName());
|
---|
| 369 | assertEquals("Port_7_1", oService.getEPR().getEndpointReference().getServiceName().getPortName());
|
---|
| 370 |
|
---|
| 371 | assertNotNull(oService.getEPR().getEndpointReference().getServiceName().getValue());
|
---|
| 372 | assertEquals("urn:unit:test:7:1", oService.getEPR().getEndpointReference().getServiceName().getValue().getNamespaceURI());
|
---|
| 373 | assertEquals("Service_7_1", oService.getEPR().getEndpointReference().getServiceName().getValue().getLocalPart());
|
---|
| 374 | assertEquals("Prefix_7_1", oService.getEPR().getEndpointReference().getServiceName().getValue().getPrefix());
|
---|
| 375 | }
|
---|
| 376 | else if (oService.getServiceName().equals("UnitTestServiceName_8_1"))
|
---|
| 377 | {
|
---|
| 378 | baFoundService[1] = true;
|
---|
| 379 | assertNotNull(oService.getEPR());
|
---|
| 380 | assertNotNull(oService.getEPR().getEndpointReference());
|
---|
| 381 | assertNotNull(oService.getEPR().getEndpointReference().getAddress());
|
---|
| 382 | assertEquals("http://www.service6.com", oService.getEPR().getEndpointReference().getAddress().getValue());
|
---|
| 383 |
|
---|
| 384 | assertNotNull(oService.getEPR().getEndpointReference().getServiceName());
|
---|
| 385 | assertEquals("Port_8_1", oService.getEPR().getEndpointReference().getServiceName().getPortName());
|
---|
| 386 |
|
---|
| 387 | assertNotNull(oService.getEPR().getEndpointReference().getServiceName().getValue());
|
---|
| 388 | assertEquals("urn:unit:test:8:1", oService.getEPR().getEndpointReference().getServiceName().getValue().getNamespaceURI());
|
---|
| 389 | assertEquals("Service_8_1", oService.getEPR().getEndpointReference().getServiceName().getValue().getLocalPart());
|
---|
| 390 | assertEquals("Prefix_8_1", oService.getEPR().getEndpointReference().getServiceName().getValue().getPrefix());
|
---|
| 391 | }
|
---|
| 392 | else if (oService.getServiceName().equals("UnitTestServiceName_2_1"))
|
---|
| 393 | {
|
---|
| 394 | baFoundService[2] = true;
|
---|
| 395 | assertNotNull(oService.getEPR());
|
---|
| 396 | assertNotNull(oService.getEPR().getEndpointReference());
|
---|
| 397 | assertNotNull(oService.getEPR().getEndpointReference().getAddress());
|
---|
| 398 | assertEquals("http://www.test.com:8080/EndpointURL.2.1.1", oService.getEPR().getEndpointReference().getAddress().getValue());
|
---|
| 399 |
|
---|
| 400 | assertNotNull(oService.getEPR().getEndpointReference().getServiceName());
|
---|
| 401 | assertEquals("Port_2_1", oService.getEPR().getEndpointReference().getServiceName().getPortName());
|
---|
| 402 |
|
---|
| 403 | assertNotNull(oService.getEPR().getEndpointReference().getServiceName().getValue());
|
---|
| 404 | assertEquals("urn:unit:test:2:1", oService.getEPR().getEndpointReference().getServiceName().getValue().getNamespaceURI());
|
---|
| 405 | assertEquals("Service_2_1", oService.getEPR().getEndpointReference().getServiceName().getValue().getLocalPart());
|
---|
| 406 | assertEquals("Prefix_2_1", oService.getEPR().getEndpointReference().getServiceName().getValue().getPrefix());
|
---|
| 407 | }
|
---|
| 408 | else if (oService.getServiceName().equals("UnitTestServiceName_2_2"))
|
---|
| 409 | {
|
---|
| 410 | baFoundService[3] = true;
|
---|
| 411 | assertNotNull(oService.getEPR());
|
---|
| 412 | assertNotNull(oService.getEPR().getEndpointReference());
|
---|
| 413 | assertNotNull(oService.getEPR().getEndpointReference().getAddress());
|
---|
| 414 | assertEquals("http://www.test.com:8080/EndpointURL.2.2.1", oService.getEPR().getEndpointReference().getAddress().getValue());
|
---|
| 415 |
|
---|
| 416 | assertNotNull(oService.getEPR().getEndpointReference().getServiceName());
|
---|
| 417 | assertEquals("Port_2_2", oService.getEPR().getEndpointReference().getServiceName().getPortName());
|
---|
| 418 |
|
---|
| 419 | assertNotNull(oService.getEPR().getEndpointReference().getServiceName().getValue());
|
---|
| 420 | assertEquals("urn:unit:test:2:2", oService.getEPR().getEndpointReference().getServiceName().getValue().getNamespaceURI());
|
---|
| 421 | assertEquals("Service_2_2", oService.getEPR().getEndpointReference().getServiceName().getValue().getLocalPart());
|
---|
| 422 | assertEquals("Prefix_2_2", oService.getEPR().getEndpointReference().getServiceName().getValue().getPrefix());
|
---|
| 423 | }
|
---|
| 424 | else
|
---|
| 425 | {
|
---|
| 426 | fail("Found an unexpected service: " + oService.getServiceName());
|
---|
| 427 | }
|
---|
| 428 |
|
---|
| 429 | // We can check this here because if it does not match either of the two specified, we will
|
---|
| 430 | // get an error. So we are guaranteed that we will either fail before we are done, or
|
---|
| 431 | // that everything is in order.
|
---|
| 432 | //------------------------------------------------------------------------------------------
|
---|
| 433 | if ((sUniformServiceName != null) && (sUniformServiceName.equals(oService.getServiceName())))
|
---|
| 434 | {
|
---|
| 435 | bMatchedService = true;
|
---|
| 436 | }
|
---|
| 437 |
|
---|
| 438 |
|
---|
| 439 | } // for (CMBusinessService oService : oEntity.getBusinessServices().getBusinessService())
|
---|
| 440 |
|
---|
| 441 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 442 | {
|
---|
| 443 | assertTrue(baFoundService[0]);
|
---|
| 444 | assertTrue(baFoundService[1]);
|
---|
| 445 | assertTrue(baFoundService[2]);
|
---|
| 446 | assertTrue(baFoundService[3]);
|
---|
| 447 | }
|
---|
| 448 | else
|
---|
| 449 | {
|
---|
| 450 | assertTrue(bMatchedService);
|
---|
| 451 | }
|
---|
| 452 | }
|
---|
| 453 |
|
---|
| 454 | /**
|
---|
| 455 | * This method validates the entire contents of a business entity for
|
---|
| 456 | * HomeCommunity 2222.2222.2222.2222
|
---|
| 457 | *
|
---|
| 458 | * @param oConnInfo The business entity for this home community.
|
---|
| 459 | * @param sUniformServiceName If this is passed, then it will validate all of the
|
---|
| 460 | * general stuff and only the one specific service and that
|
---|
| 461 | * the service is the only one that exists.
|
---|
| 462 | *
|
---|
| 463 | */
|
---|
| 464 | private void validateConnectionInfoEndpoint_2222_2222_2222_2222(ConnectionInfoEndpointType oConnInfo, String sUniformServiceName)
|
---|
| 465 | {
|
---|
| 466 | assertNotNull(oConnInfo);
|
---|
| 467 | assertNotNull(oConnInfo.getHomeCommunity());
|
---|
| 468 | assertEquals("2222.2222.2222.2222", oConnInfo.getHomeCommunity().getHomeCommunityId());
|
---|
| 469 | assertEquals("Home2", oConnInfo.getHomeCommunity().getName());
|
---|
| 470 | assertEquals("Home2 Description", oConnInfo.getHomeCommunity().getDescription());
|
---|
| 471 |
|
---|
| 472 | assertNotNull(oConnInfo.getServiceConnectionInfoEndpoints());
|
---|
| 473 | assertNotNull(oConnInfo.getServiceConnectionInfoEndpoints().getServiceConnectionInfoEndpoint());
|
---|
| 474 |
|
---|
| 475 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 476 | {
|
---|
| 477 | assertEquals(2, oConnInfo.getServiceConnectionInfoEndpoints().getServiceConnectionInfoEndpoint().size());
|
---|
| 478 | }
|
---|
| 479 | else
|
---|
| 480 | {
|
---|
| 481 | assertEquals(1, oConnInfo.getServiceConnectionInfoEndpoints().getServiceConnectionInfoEndpoint().size());
|
---|
| 482 | }
|
---|
| 483 |
|
---|
| 484 | boolean baFoundService[] = {false, false};
|
---|
| 485 | boolean bMatchedService = false; // Used when we are looking just for one service.
|
---|
| 486 | for (ServiceConnectionInfoEndpointType oService : oConnInfo.getServiceConnectionInfoEndpoints().getServiceConnectionInfoEndpoint())
|
---|
| 487 | {
|
---|
| 488 | if (oService.getServiceName().equals("UnitTestServiceName_5_1"))
|
---|
| 489 | {
|
---|
| 490 | baFoundService[0] = true;
|
---|
| 491 | assertNotNull(oService.getEPR());
|
---|
| 492 | assertNotNull(oService.getEPR().getEndpointReference());
|
---|
| 493 | assertNotNull(oService.getEPR().getEndpointReference().getAddress());
|
---|
| 494 | assertEquals("http://www.service3.com", oService.getEPR().getEndpointReference().getAddress().getValue());
|
---|
| 495 |
|
---|
| 496 | assertNotNull(oService.getEPR().getEndpointReference().getServiceName());
|
---|
| 497 | assertEquals("Port_5_1", oService.getEPR().getEndpointReference().getServiceName().getPortName());
|
---|
| 498 |
|
---|
| 499 | assertNotNull(oService.getEPR().getEndpointReference().getServiceName().getValue());
|
---|
| 500 | assertEquals("urn:unit:test:5:1", oService.getEPR().getEndpointReference().getServiceName().getValue().getNamespaceURI());
|
---|
| 501 | assertEquals("Service_5_1", oService.getEPR().getEndpointReference().getServiceName().getValue().getLocalPart());
|
---|
| 502 | assertEquals("Prefix_5_1", oService.getEPR().getEndpointReference().getServiceName().getValue().getPrefix());
|
---|
| 503 | }
|
---|
| 504 | else if (oService.getServiceName().equals("UnitTestServiceName_6_1"))
|
---|
| 505 | {
|
---|
| 506 | baFoundService[1] = true;
|
---|
| 507 | assertNotNull(oService.getEPR());
|
---|
| 508 | assertNotNull(oService.getEPR().getEndpointReference());
|
---|
| 509 | assertNotNull(oService.getEPR().getEndpointReference().getAddress());
|
---|
| 510 | assertEquals("http://www.service4.com", oService.getEPR().getEndpointReference().getAddress().getValue());
|
---|
| 511 |
|
---|
| 512 | assertNotNull(oService.getEPR().getEndpointReference().getServiceName());
|
---|
| 513 | assertEquals("Port_6_1", oService.getEPR().getEndpointReference().getServiceName().getPortName());
|
---|
| 514 |
|
---|
| 515 | assertNotNull(oService.getEPR().getEndpointReference().getServiceName().getValue());
|
---|
| 516 | assertEquals("urn:unit:test:6:1", oService.getEPR().getEndpointReference().getServiceName().getValue().getNamespaceURI());
|
---|
| 517 | assertEquals("Service_6_1", oService.getEPR().getEndpointReference().getServiceName().getValue().getLocalPart());
|
---|
| 518 | assertEquals("Prefix_6_1", oService.getEPR().getEndpointReference().getServiceName().getValue().getPrefix());
|
---|
| 519 | }
|
---|
| 520 | else
|
---|
| 521 | {
|
---|
| 522 | fail("Found an unexpected service: " + oService.getServiceName());
|
---|
| 523 | }
|
---|
| 524 |
|
---|
| 525 | // We can check this here because if it does not match either of the two specified, we will
|
---|
| 526 | // get an error. So we are guaranteed that we will either fail before we are done, or
|
---|
| 527 | // that everything is in order.
|
---|
| 528 | //------------------------------------------------------------------------------------------
|
---|
| 529 | if ((sUniformServiceName != null) && (sUniformServiceName.equals(oService.getServiceName())))
|
---|
| 530 | {
|
---|
| 531 | bMatchedService = true;
|
---|
| 532 | }
|
---|
| 533 |
|
---|
| 534 | } // for (CMBusinessService oService : oEntity.getBusinessServices().getBusinessService())
|
---|
| 535 |
|
---|
| 536 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 537 | {
|
---|
| 538 | assertTrue(baFoundService[0]);
|
---|
| 539 | assertTrue(baFoundService[1]);
|
---|
| 540 | }
|
---|
| 541 | else
|
---|
| 542 | {
|
---|
| 543 | assertTrue(bMatchedService);
|
---|
| 544 | }
|
---|
| 545 |
|
---|
| 546 | }
|
---|
| 547 |
|
---|
| 548 |
|
---|
| 549 | /**
|
---|
| 550 | * This method validates the entire contents of a connection info for
|
---|
| 551 | * HomeCommunity 1111.1111.1111.1111
|
---|
| 552 | *
|
---|
| 553 | * @param oConnInfo The business entity for this home community.
|
---|
| 554 | * @param sUniformServiceName If this is passed, then it will validate all of the
|
---|
| 555 | * general stuff and only the one specific service and that
|
---|
| 556 | * the service is the only one that exists.
|
---|
| 557 | */
|
---|
| 558 | private void validateConnectionInfo_1111_1111_1111_1111(ConnectionInfoType oConnInfo, String sUniformServiceName)
|
---|
| 559 | {
|
---|
| 560 | assertNotNull(oConnInfo);
|
---|
| 561 | assertNotNull(oConnInfo.getHomeCommunity());
|
---|
| 562 | assertEquals("1111.1111.1111.1111", oConnInfo.getHomeCommunity().getHomeCommunityId());
|
---|
| 563 | assertEquals("Home1", oConnInfo.getHomeCommunity().getName());
|
---|
| 564 | assertEquals("Home1 Description", oConnInfo.getHomeCommunity().getDescription());
|
---|
| 565 |
|
---|
| 566 | assertNotNull(oConnInfo.getServiceConnectionInfos());
|
---|
| 567 | assertNotNull(oConnInfo.getServiceConnectionInfos().getServiceConnectionInfo());
|
---|
| 568 |
|
---|
| 569 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 570 | {
|
---|
| 571 | assertEquals(2, oConnInfo.getServiceConnectionInfos().getServiceConnectionInfo().size());
|
---|
| 572 | }
|
---|
| 573 | else
|
---|
| 574 | {
|
---|
| 575 | assertEquals(1, oConnInfo.getServiceConnectionInfos().getServiceConnectionInfo().size());
|
---|
| 576 | }
|
---|
| 577 |
|
---|
| 578 | boolean baFoundService[] = {false, false};
|
---|
| 579 | boolean bMatchedService = false; // Used when we are looking just for one service.
|
---|
| 580 | for (ServiceConnectionInfoType oService : oConnInfo.getServiceConnectionInfos().getServiceConnectionInfo())
|
---|
| 581 | {
|
---|
| 582 | if (oService.getServiceName().equals("UnitTestServiceName_3_1"))
|
---|
| 583 | {
|
---|
| 584 | baFoundService[0] = true;
|
---|
| 585 | assertEquals("http://www.service1.com", oService.getUrl());
|
---|
| 586 | assertEquals("", oService.getFile());
|
---|
| 587 | assertEquals("www.service1.com", oService.getHost());
|
---|
| 588 | assertEquals("", oService.getPath());
|
---|
| 589 | assertEquals("-1", oService.getPort());
|
---|
| 590 | assertEquals("http", oService.getProtocol());
|
---|
| 591 | }
|
---|
| 592 | else if (oService.getServiceName().equals("UnitTestServiceName_4_1"))
|
---|
| 593 | {
|
---|
| 594 | baFoundService[1] = true;
|
---|
| 595 | assertEquals("http://www.service2.com", oService.getUrl());
|
---|
| 596 | assertEquals("", oService.getFile());
|
---|
| 597 | assertEquals("www.service2.com", oService.getHost());
|
---|
| 598 | assertEquals("", oService.getPath());
|
---|
| 599 | assertEquals("-1", oService.getPort());
|
---|
| 600 | assertEquals("http", oService.getProtocol());
|
---|
| 601 | }
|
---|
| 602 | else
|
---|
| 603 | {
|
---|
| 604 | fail("Found an unexpected service: " + oService.getServiceName());
|
---|
| 605 | }
|
---|
| 606 |
|
---|
| 607 | // We can check this here because if it does not match either of the two specified, we will
|
---|
| 608 | // get an error. So we are guaranteed that we will either fail before we are done, or
|
---|
| 609 | // that everything is in order.
|
---|
| 610 | //------------------------------------------------------------------------------------------
|
---|
| 611 | if ((sUniformServiceName != null) && (sUniformServiceName.equals(oService.getServiceName())))
|
---|
| 612 | {
|
---|
| 613 | bMatchedService = true;
|
---|
| 614 | }
|
---|
| 615 |
|
---|
| 616 |
|
---|
| 617 | } // for (CMBusinessService oService : oEntity.getBusinessServices().getBusinessService())
|
---|
| 618 |
|
---|
| 619 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 620 | {
|
---|
| 621 | assertTrue(baFoundService[0]);
|
---|
| 622 | assertTrue(baFoundService[1]);
|
---|
| 623 | }
|
---|
| 624 | else
|
---|
| 625 | {
|
---|
| 626 | assertTrue(bMatchedService);
|
---|
| 627 | }
|
---|
| 628 |
|
---|
| 629 | }
|
---|
| 630 |
|
---|
| 631 | /**
|
---|
| 632 | * This method validates the entire contents of a ConnectionInfo for
|
---|
| 633 | * HomeCommunity 1111.1111.1111.1111..1
|
---|
| 634 | *
|
---|
| 635 | * @param oEntity The business entity for this home community.
|
---|
| 636 | * @param sUniformServiceName If this is passed, then it will validate all of the
|
---|
| 637 | * general stuff and only the one specific service and that
|
---|
| 638 | * the service is the only one that exists.
|
---|
| 639 | */
|
---|
| 640 | private void validateConnectionInfo_1111_1111_1111_1111__1(ConnectionInfoType oConnInfo, String sUniformServiceName)
|
---|
| 641 | {
|
---|
| 642 | assertNotNull(oConnInfo);
|
---|
| 643 | assertNotNull(oConnInfo.getHomeCommunity());
|
---|
| 644 | assertEquals("1111.1111.1111.1111..1", oConnInfo.getHomeCommunity().getHomeCommunityId());
|
---|
| 645 | assertEquals("BusinessName.1.1", oConnInfo.getHomeCommunity().getName());
|
---|
| 646 | assertEquals("BusinessDescription.1.1", oConnInfo.getHomeCommunity().getDescription());
|
---|
| 647 |
|
---|
| 648 | // Business Services
|
---|
| 649 | //------------------
|
---|
| 650 | assertNotNull(oConnInfo.getServiceConnectionInfos());
|
---|
| 651 | assertNotNull(oConnInfo.getServiceConnectionInfos().getServiceConnectionInfo());
|
---|
| 652 |
|
---|
| 653 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 654 | {
|
---|
| 655 | assertEquals(2, oConnInfo.getServiceConnectionInfos().getServiceConnectionInfo().size());
|
---|
| 656 | }
|
---|
| 657 | else
|
---|
| 658 | {
|
---|
| 659 | assertEquals(1, oConnInfo.getServiceConnectionInfos().getServiceConnectionInfo().size());
|
---|
| 660 | }
|
---|
| 661 |
|
---|
| 662 | boolean baFoundService[] = {false, false};
|
---|
| 663 | boolean bMatchedService = false; // Used when we are looking just for one service.
|
---|
| 664 | for (ServiceConnectionInfoType oService : oConnInfo.getServiceConnectionInfos().getServiceConnectionInfo())
|
---|
| 665 | {
|
---|
| 666 | if (oService.getServiceName().equals("UnitTestServiceName_1_1"))
|
---|
| 667 | {
|
---|
| 668 | baFoundService[0] = true;
|
---|
| 669 | assertEquals("http://www.test.com:8080/EndpointURL.1.1.1", oService.getUrl());
|
---|
| 670 | assertEquals("/EndpointURL.1.1.1", oService.getFile());
|
---|
| 671 | assertEquals("www.test.com", oService.getHost());
|
---|
| 672 | assertEquals("/EndpointURL.1.1.1", oService.getPath());
|
---|
| 673 | assertEquals("8080", oService.getPort());
|
---|
| 674 | assertEquals("http", oService.getProtocol());
|
---|
| 675 | }
|
---|
| 676 | else if (oService.getServiceName().equals("UnitTestServiceName_1_2"))
|
---|
| 677 | {
|
---|
| 678 | baFoundService[1] = true;
|
---|
| 679 | assertEquals("http://www.test.com:8080/EndpointURL.1.2.1", oService.getUrl());
|
---|
| 680 | assertEquals("/EndpointURL.1.2.1", oService.getFile());
|
---|
| 681 | assertEquals("www.test.com", oService.getHost());
|
---|
| 682 | assertEquals("/EndpointURL.1.2.1", oService.getPath());
|
---|
| 683 | assertEquals("8080", oService.getPort());
|
---|
| 684 | assertEquals("http", oService.getProtocol());
|
---|
| 685 | }
|
---|
| 686 | else
|
---|
| 687 | {
|
---|
| 688 | fail("Found an unexpected service: " + oService.getServiceName());
|
---|
| 689 | }
|
---|
| 690 |
|
---|
| 691 | // We can check this here because if it does not match either of the two specified, we will
|
---|
| 692 | // get an error. So we are guaranteed that we will either fail before we are done, or
|
---|
| 693 | // that everything is in order.
|
---|
| 694 | //------------------------------------------------------------------------------------------
|
---|
| 695 | if ((sUniformServiceName != null) && (sUniformServiceName.equals(oService.getServiceName())))
|
---|
| 696 | {
|
---|
| 697 | bMatchedService = true;
|
---|
| 698 | }
|
---|
| 699 |
|
---|
| 700 |
|
---|
| 701 | } // for (CMBusinessService oService : oEntity.getBusinessServices().getBusinessService())
|
---|
| 702 |
|
---|
| 703 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 704 | {
|
---|
| 705 | assertTrue(baFoundService[0]);
|
---|
| 706 | assertTrue(baFoundService[1]);
|
---|
| 707 | }
|
---|
| 708 | else
|
---|
| 709 | {
|
---|
| 710 | assertTrue(bMatchedService);
|
---|
| 711 | }
|
---|
| 712 | }
|
---|
| 713 |
|
---|
| 714 | /**
|
---|
| 715 | * This method validates the entire contents of a business entity for
|
---|
| 716 | * HomeCommunity 1111.1111.1111.1111..2
|
---|
| 717 | *
|
---|
| 718 | * @param oEntity The business entity for this home community.
|
---|
| 719 | * @param sUniformServiceName If this is passed, then it will validate all of the
|
---|
| 720 | * general stuff and only the one specific service and that
|
---|
| 721 | * the service is the only one that exists.
|
---|
| 722 | */
|
---|
| 723 | private void validateConnectionInfo_1111_1111_1111_1111__2(ConnectionInfoType oConnInfo, String sUniformServiceName)
|
---|
| 724 | {
|
---|
| 725 | assertNotNull(oConnInfo);
|
---|
| 726 | assertNotNull(oConnInfo.getHomeCommunity());
|
---|
| 727 | assertEquals("1111.1111.1111.1111..2", oConnInfo.getHomeCommunity().getHomeCommunityId());
|
---|
| 728 | assertEquals("BusinessName.2.1", oConnInfo.getHomeCommunity().getName());
|
---|
| 729 | assertEquals("BusinessDescription.2.1", oConnInfo.getHomeCommunity().getDescription());
|
---|
| 730 |
|
---|
| 731 | assertNotNull(oConnInfo.getServiceConnectionInfos());
|
---|
| 732 | assertNotNull(oConnInfo.getServiceConnectionInfos().getServiceConnectionInfo());
|
---|
| 733 |
|
---|
| 734 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 735 | {
|
---|
| 736 | assertEquals(4, oConnInfo.getServiceConnectionInfos().getServiceConnectionInfo().size());
|
---|
| 737 | }
|
---|
| 738 | else
|
---|
| 739 | {
|
---|
| 740 | assertEquals(1, oConnInfo.getServiceConnectionInfos().getServiceConnectionInfo().size());
|
---|
| 741 | }
|
---|
| 742 |
|
---|
| 743 | boolean baFoundService[] = {false, false, false, false};
|
---|
| 744 | boolean bMatchedService = false; // Used when we are looking just for one service.
|
---|
| 745 | for (ServiceConnectionInfoType oService : oConnInfo.getServiceConnectionInfos().getServiceConnectionInfo())
|
---|
| 746 | {
|
---|
| 747 | if (oService.getServiceName().equals("UnitTestServiceName_7_1"))
|
---|
| 748 | {
|
---|
| 749 | baFoundService[0] = true;
|
---|
| 750 | assertEquals("http://www.service5.com", oService.getUrl());
|
---|
| 751 | assertEquals("", oService.getFile());
|
---|
| 752 | assertEquals("www.service5.com", oService.getHost());
|
---|
| 753 | assertEquals("", oService.getPath());
|
---|
| 754 | assertEquals("-1", oService.getPort());
|
---|
| 755 | assertEquals("http", oService.getProtocol());
|
---|
| 756 | }
|
---|
| 757 | else if (oService.getServiceName().equals("UnitTestServiceName_8_1"))
|
---|
| 758 | {
|
---|
| 759 | baFoundService[1] = true;
|
---|
| 760 | assertEquals("http://www.service6.com", oService.getUrl());
|
---|
| 761 | assertEquals("", oService.getFile());
|
---|
| 762 | assertEquals("www.service6.com", oService.getHost());
|
---|
| 763 | assertEquals("", oService.getPath());
|
---|
| 764 | assertEquals("-1", oService.getPort());
|
---|
| 765 | assertEquals("http", oService.getProtocol());
|
---|
| 766 | }
|
---|
| 767 | else if (oService.getServiceName().equals("UnitTestServiceName_2_1"))
|
---|
| 768 | {
|
---|
| 769 | baFoundService[2] = true;
|
---|
| 770 | assertEquals("http://www.test.com:8080/EndpointURL.2.1.1", oService.getUrl());
|
---|
| 771 | assertEquals("/EndpointURL.2.1.1", oService.getFile());
|
---|
| 772 | assertEquals("www.test.com", oService.getHost());
|
---|
| 773 | assertEquals("/EndpointURL.2.1.1", oService.getPath());
|
---|
| 774 | assertEquals("8080", oService.getPort());
|
---|
| 775 | assertEquals("http", oService.getProtocol());
|
---|
| 776 | }
|
---|
| 777 | else if (oService.getServiceName().equals("UnitTestServiceName_2_2"))
|
---|
| 778 | {
|
---|
| 779 | baFoundService[3] = true;
|
---|
| 780 | assertEquals("http://www.test.com:8080/EndpointURL.2.2.1", oService.getUrl());
|
---|
| 781 | assertEquals("/EndpointURL.2.2.1", oService.getFile());
|
---|
| 782 | assertEquals("www.test.com", oService.getHost());
|
---|
| 783 | assertEquals("/EndpointURL.2.2.1", oService.getPath());
|
---|
| 784 | assertEquals("8080", oService.getPort());
|
---|
| 785 | assertEquals("http", oService.getProtocol());
|
---|
| 786 | }
|
---|
| 787 |
|
---|
| 788 | else
|
---|
| 789 | {
|
---|
| 790 | fail("Found an unexpected service: " + oService.getServiceName());
|
---|
| 791 | }
|
---|
| 792 |
|
---|
| 793 | // We can check this here because if it does not match either of the two specified, we will
|
---|
| 794 | // get an error. So we are guaranteed that we will either fail before we are done, or
|
---|
| 795 | // that everything is in order.
|
---|
| 796 | //------------------------------------------------------------------------------------------
|
---|
| 797 | if ((sUniformServiceName != null) && (sUniformServiceName.equals(oService.getServiceName())))
|
---|
| 798 | {
|
---|
| 799 | bMatchedService = true;
|
---|
| 800 | }
|
---|
| 801 |
|
---|
| 802 |
|
---|
| 803 | } // for (CMBusinessService oService : oEntity.getBusinessServices().getBusinessService())
|
---|
| 804 |
|
---|
| 805 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 806 | {
|
---|
| 807 | assertTrue(baFoundService[0]);
|
---|
| 808 | assertTrue(baFoundService[1]);
|
---|
| 809 | assertTrue(baFoundService[2]);
|
---|
| 810 | assertTrue(baFoundService[3]);
|
---|
| 811 | }
|
---|
| 812 | else
|
---|
| 813 | {
|
---|
| 814 | assertTrue(bMatchedService);
|
---|
| 815 | }
|
---|
| 816 | }
|
---|
| 817 |
|
---|
| 818 | /**
|
---|
| 819 | * This method validates the entire contents of a business entity for
|
---|
| 820 | * HomeCommunity 2222.2222.2222.2222
|
---|
| 821 | *
|
---|
| 822 | * @param oConnInfo The business entity for this home community.
|
---|
| 823 | * @param sUniformServiceName If this is passed, then it will validate all of the
|
---|
| 824 | * general stuff and only the one specific service and that
|
---|
| 825 | * the service is the only one that exists.
|
---|
| 826 | *
|
---|
| 827 | */
|
---|
| 828 | private void validateConnectionInfo_2222_2222_2222_2222(ConnectionInfoType oConnInfo, String sUniformServiceName)
|
---|
| 829 | {
|
---|
| 830 | assertNotNull(oConnInfo);
|
---|
| 831 | assertNotNull(oConnInfo.getHomeCommunity());
|
---|
| 832 | assertEquals("2222.2222.2222.2222", oConnInfo.getHomeCommunity().getHomeCommunityId());
|
---|
| 833 | assertEquals("Home2", oConnInfo.getHomeCommunity().getName());
|
---|
| 834 | assertEquals("Home2 Description", oConnInfo.getHomeCommunity().getDescription());
|
---|
| 835 |
|
---|
| 836 | assertNotNull(oConnInfo.getServiceConnectionInfos());
|
---|
| 837 | assertNotNull(oConnInfo.getServiceConnectionInfos().getServiceConnectionInfo());
|
---|
| 838 |
|
---|
| 839 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 840 | {
|
---|
| 841 | assertEquals(2, oConnInfo.getServiceConnectionInfos().getServiceConnectionInfo().size());
|
---|
| 842 | }
|
---|
| 843 | else
|
---|
| 844 | {
|
---|
| 845 | assertEquals(1, oConnInfo.getServiceConnectionInfos().getServiceConnectionInfo().size());
|
---|
| 846 | }
|
---|
| 847 |
|
---|
| 848 | boolean baFoundService[] = {false, false};
|
---|
| 849 | boolean bMatchedService = false; // Used when we are looking just for one service.
|
---|
| 850 | for (ServiceConnectionInfoType oService : oConnInfo.getServiceConnectionInfos().getServiceConnectionInfo())
|
---|
| 851 | {
|
---|
| 852 | if (oService.getServiceName().equals("UnitTestServiceName_5_1"))
|
---|
| 853 | {
|
---|
| 854 | baFoundService[0] = true;
|
---|
| 855 | assertEquals("http://www.service3.com", oService.getUrl());
|
---|
| 856 | assertEquals("", oService.getFile());
|
---|
| 857 | assertEquals("www.service3.com", oService.getHost());
|
---|
| 858 | assertEquals("", oService.getPath());
|
---|
| 859 | assertEquals("-1", oService.getPort());
|
---|
| 860 | assertEquals("http", oService.getProtocol());
|
---|
| 861 | }
|
---|
| 862 | else if (oService.getServiceName().equals("UnitTestServiceName_6_1"))
|
---|
| 863 | {
|
---|
| 864 | baFoundService[1] = true;
|
---|
| 865 | assertEquals("http://www.service4.com", oService.getUrl());
|
---|
| 866 | assertEquals("", oService.getFile());
|
---|
| 867 | assertEquals("www.service4.com", oService.getHost());
|
---|
| 868 | assertEquals("", oService.getPath());
|
---|
| 869 | assertEquals("-1", oService.getPort());
|
---|
| 870 | assertEquals("http", oService.getProtocol());
|
---|
| 871 | }
|
---|
| 872 | else
|
---|
| 873 | {
|
---|
| 874 | fail("Found an unexpected service: " + oService.getServiceName());
|
---|
| 875 | }
|
---|
| 876 |
|
---|
| 877 | // We can check this here because if it does not match either of the two specified, we will
|
---|
| 878 | // get an error. So we are guaranteed that we will either fail before we are done, or
|
---|
| 879 | // that everything is in order.
|
---|
| 880 | //------------------------------------------------------------------------------------------
|
---|
| 881 | if ((sUniformServiceName != null) && (sUniformServiceName.equals(oService.getServiceName())))
|
---|
| 882 | {
|
---|
| 883 | bMatchedService = true;
|
---|
| 884 | }
|
---|
| 885 |
|
---|
| 886 | } // for (CMBusinessService oService : oEntity.getBusinessServices().getBusinessService())
|
---|
| 887 |
|
---|
| 888 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 889 | {
|
---|
| 890 | assertTrue(baFoundService[0]);
|
---|
| 891 | assertTrue(baFoundService[1]);
|
---|
| 892 | }
|
---|
| 893 | else
|
---|
| 894 | {
|
---|
| 895 | assertTrue(bMatchedService);
|
---|
| 896 | }
|
---|
| 897 |
|
---|
| 898 | }
|
---|
| 899 |
|
---|
| 900 |
|
---|
| 901 | /**
|
---|
| 902 | * This method validates the entire contents of a business entity for
|
---|
| 903 | * HomeCommunity 1111.1111.1111.1111
|
---|
| 904 | *
|
---|
| 905 | * @param oEntity The business entity for this home community.
|
---|
| 906 | * @param sUniformServiceName If this is passed, then it will validate all of the
|
---|
| 907 | * general stuff and only the one specific service and that
|
---|
| 908 | * the service is the only one that exists.
|
---|
| 909 | */
|
---|
| 910 | private void validateEntity_1111_1111_1111_1111(BusinessEntityType oEntity, String sUniformServiceName)
|
---|
| 911 | {
|
---|
| 912 | assertNotNull(oEntity);
|
---|
| 913 | assertEquals("1111.1111.1111.1111", oEntity.getHomeCommunityId());
|
---|
| 914 |
|
---|
| 915 | assertNotNull(oEntity.getNames());
|
---|
| 916 | assertEquals(1, oEntity.getNames().getBusinessName().size());
|
---|
| 917 | assertEquals("Home1", oEntity.getNames().getBusinessName().get(0));
|
---|
| 918 |
|
---|
| 919 | assertNotNull(oEntity.getDescriptions());
|
---|
| 920 | assertEquals(1, oEntity.getDescriptions().getBusinessDescription().size());
|
---|
| 921 | assertEquals("Home1 Description", oEntity.getDescriptions().getBusinessDescription().get(0));
|
---|
| 922 |
|
---|
| 923 | assertNotNull(oEntity.getBusinessServices());
|
---|
| 924 | assertNotNull(oEntity.getBusinessServices().getBusinessService());
|
---|
| 925 |
|
---|
| 926 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 927 | {
|
---|
| 928 | assertEquals(2, oEntity.getBusinessServices().getBusinessService().size());
|
---|
| 929 | }
|
---|
| 930 | else
|
---|
| 931 | {
|
---|
| 932 | assertEquals(1, oEntity.getBusinessServices().getBusinessService().size());
|
---|
| 933 | }
|
---|
| 934 |
|
---|
| 935 | boolean baFoundService[] = {false, false};
|
---|
| 936 | boolean bMatchedService = false; // Used when we are looking just for one service.
|
---|
| 937 | for (BusinessServiceType oService : oEntity.getBusinessServices().getBusinessService())
|
---|
| 938 | {
|
---|
| 939 | if (oService.getUniformServiceName().equals("UnitTestServiceName_3_1"))
|
---|
| 940 | {
|
---|
| 941 | baFoundService[0] = true;
|
---|
| 942 | assertNotNull(oService.getDescriptions());
|
---|
| 943 | assertEquals(1, oService.getDescriptions().size());
|
---|
| 944 | assertNotNull(oService.getDescriptions().get(0));
|
---|
| 945 | assertNotNull(oService.getDescriptions().get(0).getDescription());
|
---|
| 946 | assertEquals(1, oService.getDescriptions().get(0).getDescription().size());
|
---|
| 947 | assertEquals("Service 1 Description", oService.getDescriptions().get(0).getDescription().get(0));
|
---|
| 948 |
|
---|
| 949 | assertEquals(false, oService.isInternalWebService());
|
---|
| 950 |
|
---|
| 951 | assertNotNull(oService.getBindingTemplates());
|
---|
| 952 | assertNotNull(oService.getBindingTemplates().getBindingTemplate());
|
---|
| 953 | assertEquals(1, oService.getBindingTemplates().getBindingTemplate().size());
|
---|
| 954 | assertEquals("http://www.service1.com", oService.getBindingTemplates().getBindingTemplate().get(0).getEndpointURL());
|
---|
| 955 | }
|
---|
| 956 | else if (oService.getUniformServiceName().equals("UnitTestServiceName_4_1"))
|
---|
| 957 | {
|
---|
| 958 | baFoundService[1] = true;
|
---|
| 959 | assertNotNull(oService.getDescriptions());
|
---|
| 960 | assertEquals(1, oService.getDescriptions().size());
|
---|
| 961 | assertNotNull(oService.getDescriptions().get(0));
|
---|
| 962 | assertNotNull(oService.getDescriptions().get(0).getDescription());
|
---|
| 963 | assertEquals(1, oService.getDescriptions().get(0).getDescription().size());
|
---|
| 964 | assertEquals("Service 2 Description", oService.getDescriptions().get(0).getDescription().get(0));
|
---|
| 965 |
|
---|
| 966 | assertEquals(true, oService.isInternalWebService());
|
---|
| 967 |
|
---|
| 968 | assertNotNull(oService.getBindingTemplates());
|
---|
| 969 | assertNotNull(oService.getBindingTemplates().getBindingTemplate());
|
---|
| 970 | assertEquals(1, oService.getBindingTemplates().getBindingTemplate().size());
|
---|
| 971 | assertEquals("http://www.service2.com", oService.getBindingTemplates().getBindingTemplate().get(0).getEndpointURL());
|
---|
| 972 | }
|
---|
| 973 | else
|
---|
| 974 | {
|
---|
| 975 | fail("Found an unexpected service: " + oService.getUniformServiceName());
|
---|
| 976 | }
|
---|
| 977 |
|
---|
| 978 | // We can check this here because if it does not match either of the two specified, we will
|
---|
| 979 | // get an error. So we are guaranteed that we will either fail before we are done, or
|
---|
| 980 | // that everything is in order.
|
---|
| 981 | //------------------------------------------------------------------------------------------
|
---|
| 982 | if ((sUniformServiceName != null) && (sUniformServiceName.equals(oService.getUniformServiceName())))
|
---|
| 983 | {
|
---|
| 984 | bMatchedService = true;
|
---|
| 985 | }
|
---|
| 986 |
|
---|
| 987 |
|
---|
| 988 | } // for (CMBusinessService oService : oEntity.getBusinessServices().getBusinessService())
|
---|
| 989 |
|
---|
| 990 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 991 | {
|
---|
| 992 | assertTrue(baFoundService[0]);
|
---|
| 993 | assertTrue(baFoundService[1]);
|
---|
| 994 | }
|
---|
| 995 | else
|
---|
| 996 | {
|
---|
| 997 | assertTrue(bMatchedService);
|
---|
| 998 | }
|
---|
| 999 |
|
---|
| 1000 | }
|
---|
| 1001 |
|
---|
| 1002 | /**
|
---|
| 1003 | * This method validates the entire contents of a business entity for
|
---|
| 1004 | * HomeCommunity 1111.1111.1111.1111..1
|
---|
| 1005 | *
|
---|
| 1006 | * @param oEntity The business entity for this home community.
|
---|
| 1007 | * @param sUniformServiceName If this is passed, then it will validate all of the
|
---|
| 1008 | * general stuff and only the one specific service and that
|
---|
| 1009 | * the service is the only one that exists.
|
---|
| 1010 | */
|
---|
| 1011 | private void validateEntity_1111_1111_1111_1111__1(BusinessEntityType oEntity, String sUniformServiceName)
|
---|
| 1012 | {
|
---|
| 1013 | assertNotNull(oEntity);
|
---|
| 1014 | assertEquals("1111.1111.1111.1111..1", oEntity.getHomeCommunityId());
|
---|
| 1015 |
|
---|
| 1016 | assertEquals("BusinessKey.1", oEntity.getBusinessKey());
|
---|
| 1017 |
|
---|
| 1018 | assertNotNull(oEntity.getDiscoveryURLs());
|
---|
| 1019 | assertEquals(2, oEntity.getDiscoveryURLs().getDiscoveryURL().size());
|
---|
| 1020 | assertEquals("URL.1.1", oEntity.getDiscoveryURLs().getDiscoveryURL().get(0));
|
---|
| 1021 | assertEquals("URL.1.2", oEntity.getDiscoveryURLs().getDiscoveryURL().get(1));
|
---|
| 1022 |
|
---|
| 1023 | assertNotNull(oEntity.getNames());
|
---|
| 1024 | assertEquals(2, oEntity.getNames().getBusinessName().size());
|
---|
| 1025 | assertEquals("BusinessName.1.1", oEntity.getNames().getBusinessName().get(0));
|
---|
| 1026 | assertEquals("BusinessName.1.2", oEntity.getNames().getBusinessName().get(1));
|
---|
| 1027 |
|
---|
| 1028 | assertNotNull(oEntity.getDescriptions());
|
---|
| 1029 | assertEquals(2, oEntity.getDescriptions().getBusinessDescription().size());
|
---|
| 1030 | assertEquals("BusinessDescription.1.1", oEntity.getDescriptions().getBusinessDescription().get(0));
|
---|
| 1031 | assertEquals("BusinessDescription.1.2", oEntity.getDescriptions().getBusinessDescription().get(1));
|
---|
| 1032 |
|
---|
| 1033 | assertNotNull(oEntity.getContacts());
|
---|
| 1034 | assertNotNull(oEntity.getContacts().getContact());
|
---|
| 1035 | assertEquals(2, oEntity.getContacts().getContact().size());
|
---|
| 1036 | boolean baFoundContact[] = {false, false};
|
---|
| 1037 | for (ContactType oContact : oEntity.getContacts().getContact())
|
---|
| 1038 | {
|
---|
| 1039 | assertNotNull(oContact.getPersonNames());
|
---|
| 1040 | assertNotNull(oContact.getPersonNames().getPersonName());
|
---|
| 1041 | assertEquals(2, oContact.getPersonNames().getPersonName().size());
|
---|
| 1042 | if (oContact.getPersonNames().getPersonName().get(0).equals("ContactPersonName.1.1.1"))
|
---|
| 1043 | {
|
---|
| 1044 | baFoundContact[0] = true;
|
---|
| 1045 | assertEquals("ContactPersonName.1.1.1", oContact.getPersonNames().getPersonName().get(0));
|
---|
| 1046 | assertEquals("ContactPersonName.1.1.2", oContact.getPersonNames().getPersonName().get(1));
|
---|
| 1047 |
|
---|
| 1048 | assertNotNull(oContact.getDescriptions());
|
---|
| 1049 | assertNotNull(oContact.getDescriptions().getDescription());
|
---|
| 1050 | assertEquals(2, oContact.getDescriptions().getDescription().size());
|
---|
| 1051 | assertEquals("ContactDescription.1.1.1", oContact.getDescriptions().getDescription().get(0));
|
---|
| 1052 | assertEquals("ContactDescription.1.1.2", oContact.getDescriptions().getDescription().get(1));
|
---|
| 1053 |
|
---|
| 1054 | assertNotNull(oContact.getPhones());
|
---|
| 1055 | assertNotNull(oContact.getPhones().getPhone());
|
---|
| 1056 | assertEquals(2, oContact.getPhones().getPhone().size());
|
---|
| 1057 | assertEquals("ContactPhone.1.1.1", oContact.getPhones().getPhone().get(0));
|
---|
| 1058 | assertEquals("ContactPhone.1.1.2", oContact.getPhones().getPhone().get(1));
|
---|
| 1059 |
|
---|
| 1060 | assertNotNull(oContact.getEmails());
|
---|
| 1061 | assertNotNull(oContact.getEmails().getEmail());
|
---|
| 1062 | assertEquals(2, oContact.getEmails().getEmail().size());
|
---|
| 1063 | assertEquals("Email.1.1.1", oContact.getEmails().getEmail().get(0));
|
---|
| 1064 | assertEquals("Email.1.1.2", oContact.getEmails().getEmail().get(1));
|
---|
| 1065 |
|
---|
| 1066 | assertNotNull(oContact.getAddresses());
|
---|
| 1067 | assertNotNull(oContact.getAddresses().getAddress());
|
---|
| 1068 | assertEquals(2, oContact.getAddresses().getAddress().size());
|
---|
| 1069 |
|
---|
| 1070 | assertNotNull(oContact.getAddresses().getAddress().get(0).getAddressLine());
|
---|
| 1071 | assertEquals(2, oContact.getAddresses().getAddress().get(0).getAddressLine().size());
|
---|
| 1072 | assertEquals("AddressLine.1.1.1.1", oContact.getAddresses().getAddress().get(0).getAddressLine().get(0));
|
---|
| 1073 | assertEquals("AddressLine.1.1.1.2", oContact.getAddresses().getAddress().get(0).getAddressLine().get(1));
|
---|
| 1074 |
|
---|
| 1075 | assertNotNull(oContact.getAddresses().getAddress().get(1).getAddressLine());
|
---|
| 1076 | assertEquals(2, oContact.getAddresses().getAddress().get(1).getAddressLine().size());
|
---|
| 1077 | assertEquals("AddressLine.1.1.2.1", oContact.getAddresses().getAddress().get(1).getAddressLine().get(0));
|
---|
| 1078 | assertEquals("AddressLine.1.1.2.2", oContact.getAddresses().getAddress().get(1).getAddressLine().get(1));
|
---|
| 1079 | }
|
---|
| 1080 | else if (oContact.getPersonNames().getPersonName().get(0).equals("ContactPersonName.1.2.1"))
|
---|
| 1081 | {
|
---|
| 1082 | baFoundContact[1] = true;
|
---|
| 1083 |
|
---|
| 1084 | assertEquals("ContactPersonName.1.2.1", oContact.getPersonNames().getPersonName().get(0));
|
---|
| 1085 | assertEquals("ContactPersonName.1.2.2", oContact.getPersonNames().getPersonName().get(1));
|
---|
| 1086 |
|
---|
| 1087 | assertNotNull(oContact.getDescriptions());
|
---|
| 1088 | assertNotNull(oContact.getDescriptions().getDescription());
|
---|
| 1089 | assertEquals(2, oContact.getDescriptions().getDescription().size());
|
---|
| 1090 | assertEquals("ContactDescription.1.2.1", oContact.getDescriptions().getDescription().get(0));
|
---|
| 1091 | assertEquals("ContactDescription.1.2.2", oContact.getDescriptions().getDescription().get(1));
|
---|
| 1092 |
|
---|
| 1093 | assertNotNull(oContact.getPhones());
|
---|
| 1094 | assertNotNull(oContact.getPhones().getPhone());
|
---|
| 1095 | assertEquals(2, oContact.getPhones().getPhone().size());
|
---|
| 1096 | assertEquals("ContactPhone.1.2.1", oContact.getPhones().getPhone().get(0));
|
---|
| 1097 | assertEquals("ContactPhone.1.2.2", oContact.getPhones().getPhone().get(1));
|
---|
| 1098 |
|
---|
| 1099 | assertNotNull(oContact.getEmails());
|
---|
| 1100 | assertNotNull(oContact.getEmails().getEmail());
|
---|
| 1101 | assertEquals(2, oContact.getEmails().getEmail().size());
|
---|
| 1102 | assertEquals("Email.1.2.1", oContact.getEmails().getEmail().get(0));
|
---|
| 1103 | assertEquals("Email.1.2.2", oContact.getEmails().getEmail().get(1));
|
---|
| 1104 |
|
---|
| 1105 | assertNotNull(oContact.getAddresses());
|
---|
| 1106 | assertNotNull(oContact.getAddresses().getAddress());
|
---|
| 1107 | assertEquals(2, oContact.getAddresses().getAddress().size());
|
---|
| 1108 |
|
---|
| 1109 | assertNotNull(oContact.getAddresses().getAddress().get(0).getAddressLine());
|
---|
| 1110 | assertEquals(2, oContact.getAddresses().getAddress().get(0).getAddressLine().size());
|
---|
| 1111 | assertEquals("AddressLine.1.2.1.1", oContact.getAddresses().getAddress().get(0).getAddressLine().get(0));
|
---|
| 1112 | assertEquals("AddressLine.1.2.1.2", oContact.getAddresses().getAddress().get(0).getAddressLine().get(1));
|
---|
| 1113 |
|
---|
| 1114 | assertNotNull(oContact.getAddresses().getAddress().get(1).getAddressLine());
|
---|
| 1115 | assertEquals(2, oContact.getAddresses().getAddress().get(1).getAddressLine().size());
|
---|
| 1116 | assertEquals("AddressLine.1.2.2.1", oContact.getAddresses().getAddress().get(1).getAddressLine().get(0));
|
---|
| 1117 | assertEquals("AddressLine.1.2.2.2", oContact.getAddresses().getAddress().get(1).getAddressLine().get(1));
|
---|
| 1118 | }
|
---|
| 1119 | else
|
---|
| 1120 | {
|
---|
| 1121 | fail("Found unexpected contact: " + oContact.getPersonNames().getPersonName().get(0));
|
---|
| 1122 | }
|
---|
| 1123 | } // for (CMContact oContact : oEntity.getContacts().getContact())
|
---|
| 1124 | assertTrue(baFoundContact[0]);
|
---|
| 1125 | assertTrue(baFoundContact[1]);
|
---|
| 1126 |
|
---|
| 1127 | assertNotNull(oEntity.getStates());
|
---|
| 1128 | assertEquals(2, oEntity.getStates().getState().size());
|
---|
| 1129 | assertEquals("State.1.1", oEntity.getStates().getState().get(0));
|
---|
| 1130 | assertEquals("State.1.2", oEntity.getStates().getState().get(1));
|
---|
| 1131 |
|
---|
| 1132 | assertEquals(true, oEntity.isFederalHIE());
|
---|
| 1133 |
|
---|
| 1134 | assertEquals("http://www.thekey.com.1", oEntity.getPublicKeyURI());
|
---|
| 1135 |
|
---|
| 1136 | assertNotNull(oEntity.getPublicKey());
|
---|
| 1137 | assertEquals(6, oEntity.getPublicKey().length);
|
---|
| 1138 | assertEquals(100, (int) oEntity.getPublicKey()[0]);
|
---|
| 1139 | assertEquals(100, (int) oEntity.getPublicKey()[1]);
|
---|
| 1140 | assertEquals(100, (int) oEntity.getPublicKey()[2]);
|
---|
| 1141 | assertEquals(100, (int) oEntity.getPublicKey()[3]);
|
---|
| 1142 | assertEquals(100, (int) oEntity.getPublicKey()[4]);
|
---|
| 1143 | assertEquals(100, (int) oEntity.getPublicKey()[5]);
|
---|
| 1144 |
|
---|
| 1145 | // Business Services
|
---|
| 1146 | //------------------
|
---|
| 1147 | assertNotNull(oEntity.getBusinessServices());
|
---|
| 1148 | assertNotNull(oEntity.getBusinessServices().getBusinessService());
|
---|
| 1149 |
|
---|
| 1150 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 1151 | {
|
---|
| 1152 | assertEquals(2, oEntity.getBusinessServices().getBusinessService().size());
|
---|
| 1153 | }
|
---|
| 1154 | else
|
---|
| 1155 | {
|
---|
| 1156 | assertEquals(1, oEntity.getBusinessServices().getBusinessService().size());
|
---|
| 1157 | }
|
---|
| 1158 |
|
---|
| 1159 | boolean baFoundService[] = {false, false};
|
---|
| 1160 | boolean bMatchedService = false; // Used when we are looking just for one service.
|
---|
| 1161 |
|
---|
| 1162 | for (BusinessServiceType oService : oEntity.getBusinessServices().getBusinessService())
|
---|
| 1163 | {
|
---|
| 1164 | assertNotNull(oService.getServiceKey());
|
---|
| 1165 | if (oService.getServiceKey().equals("ServiceKey.1.1"))
|
---|
| 1166 | {
|
---|
| 1167 | baFoundService[0] = true;
|
---|
| 1168 |
|
---|
| 1169 | assertNotNull(oService.getNames());
|
---|
| 1170 | assertEquals(2, oService.getNames().size());
|
---|
| 1171 | assertNotNull(oService.getNames().get(0));
|
---|
| 1172 | assertNotNull(oService.getNames().get(0).getName());
|
---|
| 1173 | assertEquals(1, oService.getNames().get(0).getName().size());
|
---|
| 1174 | assertEquals("BindingName.1.1.1", oService.getNames().get(0).getName().get(0));
|
---|
| 1175 | assertNotNull(oService.getNames().get(1));
|
---|
| 1176 | assertNotNull(oService.getNames().get(1).getName());
|
---|
| 1177 | assertEquals(1, oService.getNames().get(1).getName().size());
|
---|
| 1178 | assertEquals("BindingName.1.1.2", oService.getNames().get(1).getName().get(0));
|
---|
| 1179 |
|
---|
| 1180 | assertNotNull(oService.getDescriptions());
|
---|
| 1181 | assertEquals(2, oService.getDescriptions().size());
|
---|
| 1182 | assertNotNull(oService.getDescriptions().get(0));
|
---|
| 1183 | assertNotNull(oService.getDescriptions().get(0).getDescription());
|
---|
| 1184 | assertEquals(1, oService.getDescriptions().get(0).getDescription().size());
|
---|
| 1185 | assertEquals("BindingDescription.1.1.1", oService.getDescriptions().get(0).getDescription().get(0));
|
---|
| 1186 | assertNotNull(oService.getDescriptions().get(1));
|
---|
| 1187 | assertNotNull(oService.getDescriptions().get(1).getDescription());
|
---|
| 1188 | assertEquals(1, oService.getDescriptions().get(1).getDescription().size());
|
---|
| 1189 | assertEquals("BindingDescription.1.1.2", oService.getDescriptions().get(1).getDescription().get(0));
|
---|
| 1190 |
|
---|
| 1191 | assertEquals("UnitTestServiceName_1_1", oService.getUniformServiceName());
|
---|
| 1192 | assertEquals("1.0", oService.getServiceVersion());
|
---|
| 1193 | assertEquals(true, oService.isInternalWebService());
|
---|
| 1194 |
|
---|
| 1195 | assertNotNull(oService.getBindingTemplates());
|
---|
| 1196 | assertNotNull(oService.getBindingTemplates().getBindingTemplate());
|
---|
| 1197 | assertEquals(2, oService.getBindingTemplates().getBindingTemplate().size());
|
---|
| 1198 |
|
---|
| 1199 | assertEquals("BindingKey.1.1.1", oService.getBindingTemplates().getBindingTemplate().get(0).getBindingKey());
|
---|
| 1200 | assertEquals("http://www.test.com:8080/EndpointURL.1.1.1", oService.getBindingTemplates().getBindingTemplate().get(0).getEndpointURL());
|
---|
| 1201 | assertEquals("WSDLURL.1.1.1", oService.getBindingTemplates().getBindingTemplate().get(0).getWsdlURL());
|
---|
| 1202 |
|
---|
| 1203 | assertEquals("BindingKey.1.1.2", oService.getBindingTemplates().getBindingTemplate().get(1).getBindingKey());
|
---|
| 1204 | assertEquals("http://www.test.com:8080/EndpointURL.1.1.2", oService.getBindingTemplates().getBindingTemplate().get(1).getEndpointURL());
|
---|
| 1205 | assertEquals("WSDLURL.1.1.2", oService.getBindingTemplates().getBindingTemplate().get(1).getWsdlURL());
|
---|
| 1206 | }
|
---|
| 1207 | else if (oService.getServiceKey().equals("ServiceKey.1.2"))
|
---|
| 1208 | {
|
---|
| 1209 | baFoundService[1] = true;
|
---|
| 1210 |
|
---|
| 1211 | assertNotNull(oService.getNames());
|
---|
| 1212 | assertEquals(2, oService.getNames().size());
|
---|
| 1213 | assertNotNull(oService.getNames().get(0));
|
---|
| 1214 | assertNotNull(oService.getNames().get(0).getName());
|
---|
| 1215 | assertEquals(1, oService.getNames().get(0).getName().size());
|
---|
| 1216 | assertEquals("BindingName.1.2.1", oService.getNames().get(0).getName().get(0));
|
---|
| 1217 | assertNotNull(oService.getNames().get(1));
|
---|
| 1218 | assertNotNull(oService.getNames().get(1).getName());
|
---|
| 1219 | assertEquals(1, oService.getNames().get(1).getName().size());
|
---|
| 1220 | assertEquals("BindingName.1.2.2", oService.getNames().get(1).getName().get(0));
|
---|
| 1221 |
|
---|
| 1222 | assertNotNull(oService.getDescriptions());
|
---|
| 1223 | assertEquals(2, oService.getDescriptions().size());
|
---|
| 1224 | assertNotNull(oService.getDescriptions().get(0));
|
---|
| 1225 | assertNotNull(oService.getDescriptions().get(0).getDescription());
|
---|
| 1226 | assertEquals(1, oService.getDescriptions().get(0).getDescription().size());
|
---|
| 1227 | assertEquals("BindingDescription.1.2.1", oService.getDescriptions().get(0).getDescription().get(0));
|
---|
| 1228 | assertNotNull(oService.getDescriptions().get(1));
|
---|
| 1229 | assertNotNull(oService.getDescriptions().get(1).getDescription());
|
---|
| 1230 | assertEquals(1, oService.getDescriptions().get(1).getDescription().size());
|
---|
| 1231 | assertEquals("BindingDescription.1.2.2", oService.getDescriptions().get(1).getDescription().get(0));
|
---|
| 1232 |
|
---|
| 1233 | assertEquals("UnitTestServiceName_1_2", oService.getUniformServiceName());
|
---|
| 1234 | assertEquals("1.0", oService.getServiceVersion());
|
---|
| 1235 | assertEquals(true, oService.isInternalWebService());
|
---|
| 1236 |
|
---|
| 1237 | assertNotNull(oService.getBindingTemplates());
|
---|
| 1238 | assertNotNull(oService.getBindingTemplates().getBindingTemplate());
|
---|
| 1239 | assertEquals(2, oService.getBindingTemplates().getBindingTemplate().size());
|
---|
| 1240 |
|
---|
| 1241 | assertEquals("BindingKey.1.2.1", oService.getBindingTemplates().getBindingTemplate().get(0).getBindingKey());
|
---|
| 1242 | assertEquals("http://www.test.com:8080/EndpointURL.1.2.1", oService.getBindingTemplates().getBindingTemplate().get(0).getEndpointURL());
|
---|
| 1243 | assertEquals("WSDLURL.1.2.1", oService.getBindingTemplates().getBindingTemplate().get(0).getWsdlURL());
|
---|
| 1244 |
|
---|
| 1245 | assertEquals("BindingKey.1.2.2", oService.getBindingTemplates().getBindingTemplate().get(1).getBindingKey());
|
---|
| 1246 | assertEquals("http://www.test.com:8080/EndpointURL.1.2.2", oService.getBindingTemplates().getBindingTemplate().get(1).getEndpointURL());
|
---|
| 1247 | assertEquals("WSDLURL.1.2.2", oService.getBindingTemplates().getBindingTemplate().get(1).getWsdlURL());
|
---|
| 1248 |
|
---|
| 1249 | }
|
---|
| 1250 | else
|
---|
| 1251 | {
|
---|
| 1252 | fail("Found an unexpected service: " + oService.getServiceKey());
|
---|
| 1253 | }
|
---|
| 1254 |
|
---|
| 1255 | // We can check this here because if it does not match either of the two specified, we will
|
---|
| 1256 | // get an error. So we are guaranteed that we will either fail before we are done, or
|
---|
| 1257 | // that everything is in order.
|
---|
| 1258 | //------------------------------------------------------------------------------------------
|
---|
| 1259 | if ((sUniformServiceName != null) && (sUniformServiceName.equals(oService.getUniformServiceName())))
|
---|
| 1260 | {
|
---|
| 1261 | bMatchedService = true;
|
---|
| 1262 | }
|
---|
| 1263 |
|
---|
| 1264 |
|
---|
| 1265 | } // for (CMBusinessService oService : oEntity.getBusinessServices().getBusinessService())
|
---|
| 1266 |
|
---|
| 1267 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 1268 | {
|
---|
| 1269 | assertTrue(baFoundService[0]);
|
---|
| 1270 | assertTrue(baFoundService[1]);
|
---|
| 1271 | }
|
---|
| 1272 | else
|
---|
| 1273 | {
|
---|
| 1274 | assertTrue(bMatchedService);
|
---|
| 1275 | }
|
---|
| 1276 | }
|
---|
| 1277 |
|
---|
| 1278 | /**
|
---|
| 1279 | * This method validates the entire contents of a business entity for
|
---|
| 1280 | * HomeCommunity 1111.1111.1111.1111..2
|
---|
| 1281 | *
|
---|
| 1282 | * @param oEntity The business entity for this home community.
|
---|
| 1283 | * @param sUniformServiceName If this is passed, then it will validate all of the
|
---|
| 1284 | * general stuff and only the one specific service and that
|
---|
| 1285 | * the service is the only one that exists.
|
---|
| 1286 | */
|
---|
| 1287 | private void validateEntity_1111_1111_1111_1111__2(BusinessEntityType oEntity, String sUniformServiceName)
|
---|
| 1288 | {
|
---|
| 1289 | assertNotNull(oEntity);
|
---|
| 1290 | assertEquals("1111.1111.1111.1111..2", oEntity.getHomeCommunityId());
|
---|
| 1291 |
|
---|
| 1292 | assertNotNull(oEntity.getDiscoveryURLs());
|
---|
| 1293 | assertEquals(2, oEntity.getDiscoveryURLs().getDiscoveryURL().size());
|
---|
| 1294 | assertEquals("URL.2.1", oEntity.getDiscoveryURLs().getDiscoveryURL().get(0));
|
---|
| 1295 | assertEquals("URL.2.2", oEntity.getDiscoveryURLs().getDiscoveryURL().get(1));
|
---|
| 1296 |
|
---|
| 1297 | assertNotNull(oEntity.getNames());
|
---|
| 1298 | assertEquals(2, oEntity.getNames().getBusinessName().size());
|
---|
| 1299 | assertEquals("BusinessName.2.1", oEntity.getNames().getBusinessName().get(0));
|
---|
| 1300 | assertEquals("BusinessName.2.2", oEntity.getNames().getBusinessName().get(1));
|
---|
| 1301 |
|
---|
| 1302 | assertNotNull(oEntity.getDescriptions());
|
---|
| 1303 | assertEquals(2, oEntity.getDescriptions().getBusinessDescription().size());
|
---|
| 1304 | assertEquals("BusinessDescription.2.1", oEntity.getDescriptions().getBusinessDescription().get(0));
|
---|
| 1305 | assertEquals("BusinessDescription.2.2", oEntity.getDescriptions().getBusinessDescription().get(1));
|
---|
| 1306 |
|
---|
| 1307 | assertNotNull(oEntity.getContacts());
|
---|
| 1308 | assertNotNull(oEntity.getContacts().getContact());
|
---|
| 1309 | assertEquals(2, oEntity.getContacts().getContact().size());
|
---|
| 1310 | boolean baFoundContact[] = {false, false};
|
---|
| 1311 | for (ContactType oContact : oEntity.getContacts().getContact())
|
---|
| 1312 | {
|
---|
| 1313 | assertNotNull(oContact.getPersonNames());
|
---|
| 1314 | assertNotNull(oContact.getPersonNames().getPersonName());
|
---|
| 1315 | assertEquals(2, oContact.getPersonNames().getPersonName().size());
|
---|
| 1316 | if (oContact.getPersonNames().getPersonName().get(0).equals("ContactPersonName.2.1.1"))
|
---|
| 1317 | {
|
---|
| 1318 | baFoundContact[0] = true;
|
---|
| 1319 | assertEquals("ContactPersonName.2.1.1", oContact.getPersonNames().getPersonName().get(0));
|
---|
| 1320 | assertEquals("ContactPersonName.2.1.2", oContact.getPersonNames().getPersonName().get(1));
|
---|
| 1321 |
|
---|
| 1322 | assertNotNull(oContact.getDescriptions());
|
---|
| 1323 | assertNotNull(oContact.getDescriptions().getDescription());
|
---|
| 1324 | assertEquals(2, oContact.getDescriptions().getDescription().size());
|
---|
| 1325 | assertEquals("ContactDescription.2.1.1", oContact.getDescriptions().getDescription().get(0));
|
---|
| 1326 | assertEquals("ContactDescription.2.1.2", oContact.getDescriptions().getDescription().get(1));
|
---|
| 1327 |
|
---|
| 1328 | assertNotNull(oContact.getPhones());
|
---|
| 1329 | assertNotNull(oContact.getPhones().getPhone());
|
---|
| 1330 | assertEquals(2, oContact.getPhones().getPhone().size());
|
---|
| 1331 | assertEquals("ContactPhone.2.1.1", oContact.getPhones().getPhone().get(0));
|
---|
| 1332 | assertEquals("ContactPhone.2.1.2", oContact.getPhones().getPhone().get(1));
|
---|
| 1333 |
|
---|
| 1334 | assertNotNull(oContact.getEmails());
|
---|
| 1335 | assertNotNull(oContact.getEmails().getEmail());
|
---|
| 1336 | assertEquals(2, oContact.getEmails().getEmail().size());
|
---|
| 1337 | assertEquals("Email.2.1.1", oContact.getEmails().getEmail().get(0));
|
---|
| 1338 | assertEquals("Email.2.1.2", oContact.getEmails().getEmail().get(1));
|
---|
| 1339 |
|
---|
| 1340 | assertNotNull(oContact.getAddresses());
|
---|
| 1341 | assertNotNull(oContact.getAddresses().getAddress());
|
---|
| 1342 | assertEquals(2, oContact.getAddresses().getAddress().size());
|
---|
| 1343 |
|
---|
| 1344 | assertNotNull(oContact.getAddresses().getAddress().get(0).getAddressLine());
|
---|
| 1345 | assertEquals(2, oContact.getAddresses().getAddress().get(0).getAddressLine().size());
|
---|
| 1346 | assertEquals("AddressLine.2.1.1.1", oContact.getAddresses().getAddress().get(0).getAddressLine().get(0));
|
---|
| 1347 | assertEquals("AddressLine.2.1.1.2", oContact.getAddresses().getAddress().get(0).getAddressLine().get(1));
|
---|
| 1348 |
|
---|
| 1349 | assertNotNull(oContact.getAddresses().getAddress().get(1).getAddressLine());
|
---|
| 1350 | assertEquals(2, oContact.getAddresses().getAddress().get(1).getAddressLine().size());
|
---|
| 1351 | assertEquals("AddressLine.2.1.2.1", oContact.getAddresses().getAddress().get(1).getAddressLine().get(0));
|
---|
| 1352 | assertEquals("AddressLine.2.1.2.2", oContact.getAddresses().getAddress().get(1).getAddressLine().get(1));
|
---|
| 1353 | }
|
---|
| 1354 | else if (oContact.getPersonNames().getPersonName().get(0).equals("ContactPersonName.2.2.1"))
|
---|
| 1355 | {
|
---|
| 1356 | baFoundContact[1] = true;
|
---|
| 1357 |
|
---|
| 1358 | assertEquals("ContactPersonName.2.2.1", oContact.getPersonNames().getPersonName().get(0));
|
---|
| 1359 | assertEquals("ContactPersonName.2.2.2", oContact.getPersonNames().getPersonName().get(1));
|
---|
| 1360 |
|
---|
| 1361 | assertNotNull(oContact.getDescriptions());
|
---|
| 1362 | assertNotNull(oContact.getDescriptions().getDescription());
|
---|
| 1363 | assertEquals(2, oContact.getDescriptions().getDescription().size());
|
---|
| 1364 | assertEquals("ContactDescription.2.2.1", oContact.getDescriptions().getDescription().get(0));
|
---|
| 1365 | assertEquals("ContactDescription.2.2.2", oContact.getDescriptions().getDescription().get(1));
|
---|
| 1366 |
|
---|
| 1367 | assertNotNull(oContact.getPhones());
|
---|
| 1368 | assertNotNull(oContact.getPhones().getPhone());
|
---|
| 1369 | assertEquals(2, oContact.getPhones().getPhone().size());
|
---|
| 1370 | assertEquals("ContactPhone.2.2.1", oContact.getPhones().getPhone().get(0));
|
---|
| 1371 | assertEquals("ContactPhone.2.2.2", oContact.getPhones().getPhone().get(1));
|
---|
| 1372 |
|
---|
| 1373 | assertNotNull(oContact.getEmails());
|
---|
| 1374 | assertNotNull(oContact.getEmails().getEmail());
|
---|
| 1375 | assertEquals(2, oContact.getEmails().getEmail().size());
|
---|
| 1376 | assertEquals("Email.2.2.1", oContact.getEmails().getEmail().get(0));
|
---|
| 1377 | assertEquals("Email.2.2.2", oContact.getEmails().getEmail().get(1));
|
---|
| 1378 |
|
---|
| 1379 | assertNotNull(oContact.getAddresses());
|
---|
| 1380 | assertNotNull(oContact.getAddresses().getAddress());
|
---|
| 1381 | assertEquals(2, oContact.getAddresses().getAddress().size());
|
---|
| 1382 |
|
---|
| 1383 | assertNotNull(oContact.getAddresses().getAddress().get(0).getAddressLine());
|
---|
| 1384 | assertEquals(2, oContact.getAddresses().getAddress().get(0).getAddressLine().size());
|
---|
| 1385 | assertEquals("AddressLine.2.2.1.1", oContact.getAddresses().getAddress().get(0).getAddressLine().get(0));
|
---|
| 1386 | assertEquals("AddressLine.2.2.1.2", oContact.getAddresses().getAddress().get(0).getAddressLine().get(1));
|
---|
| 1387 |
|
---|
| 1388 | assertNotNull(oContact.getAddresses().getAddress().get(1).getAddressLine());
|
---|
| 1389 | assertEquals(2, oContact.getAddresses().getAddress().get(1).getAddressLine().size());
|
---|
| 1390 | assertEquals("AddressLine.2.2.2.1", oContact.getAddresses().getAddress().get(1).getAddressLine().get(0));
|
---|
| 1391 | assertEquals("AddressLine.2.2.2.2", oContact.getAddresses().getAddress().get(1).getAddressLine().get(1));
|
---|
| 1392 | }
|
---|
| 1393 |
|
---|
| 1394 | else
|
---|
| 1395 | {
|
---|
| 1396 | fail("Found unexpected contact: " + oContact.getPersonNames().getPersonName().get(0));
|
---|
| 1397 | }
|
---|
| 1398 | } // for (CMContact oContact : oEntity.getContacts().getContact())
|
---|
| 1399 | assertTrue(baFoundContact[0]);
|
---|
| 1400 | assertTrue(baFoundContact[1]);
|
---|
| 1401 |
|
---|
| 1402 | assertNotNull(oEntity.getStates());
|
---|
| 1403 | assertEquals(2, oEntity.getStates().getState().size());
|
---|
| 1404 | assertEquals("State.2.1", oEntity.getStates().getState().get(0));
|
---|
| 1405 | assertEquals("State.2.2", oEntity.getStates().getState().get(1));
|
---|
| 1406 |
|
---|
| 1407 | assertEquals(true, oEntity.isFederalHIE());
|
---|
| 1408 |
|
---|
| 1409 | assertEquals("http://www.thekey.com.2", oEntity.getPublicKeyURI());
|
---|
| 1410 |
|
---|
| 1411 | assertNotNull(oEntity.getPublicKey());
|
---|
| 1412 | assertEquals(6, oEntity.getPublicKey().length);
|
---|
| 1413 | assertEquals(100, (int) oEntity.getPublicKey()[0]);
|
---|
| 1414 | assertEquals(100, (int) oEntity.getPublicKey()[1]);
|
---|
| 1415 | assertEquals(100, (int) oEntity.getPublicKey()[2]);
|
---|
| 1416 | assertEquals(100, (int) oEntity.getPublicKey()[3]);
|
---|
| 1417 | assertEquals(100, (int) oEntity.getPublicKey()[4]);
|
---|
| 1418 | assertEquals(100, (int) oEntity.getPublicKey()[5]);
|
---|
| 1419 |
|
---|
| 1420 | assertNotNull(oEntity.getBusinessServices());
|
---|
| 1421 | assertNotNull(oEntity.getBusinessServices().getBusinessService());
|
---|
| 1422 |
|
---|
| 1423 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 1424 | {
|
---|
| 1425 | assertEquals(4, oEntity.getBusinessServices().getBusinessService().size());
|
---|
| 1426 | }
|
---|
| 1427 | else
|
---|
| 1428 | {
|
---|
| 1429 | assertEquals(1, oEntity.getBusinessServices().getBusinessService().size());
|
---|
| 1430 | }
|
---|
| 1431 |
|
---|
| 1432 | boolean baFoundService[] = {false, false, false, false};
|
---|
| 1433 | boolean bMatchedService = false; // Used when we are looking just for one service.
|
---|
| 1434 | for (BusinessServiceType oService : oEntity.getBusinessServices().getBusinessService())
|
---|
| 1435 | {
|
---|
| 1436 | if (oService.getUniformServiceName().equals("UnitTestServiceName_7_1"))
|
---|
| 1437 | {
|
---|
| 1438 | baFoundService[0] = true;
|
---|
| 1439 | assertNotNull(oService.getDescriptions());
|
---|
| 1440 | assertEquals(1, oService.getDescriptions().size());
|
---|
| 1441 | assertNotNull(oService.getDescriptions().get(0));
|
---|
| 1442 | assertNotNull(oService.getDescriptions().get(0).getDescription());
|
---|
| 1443 | assertEquals(1, oService.getDescriptions().get(0).getDescription().size());
|
---|
| 1444 | assertEquals("Service 5 Description", oService.getDescriptions().get(0).getDescription().get(0));
|
---|
| 1445 |
|
---|
| 1446 | assertEquals(false, oService.isInternalWebService());
|
---|
| 1447 |
|
---|
| 1448 | assertNotNull(oService.getBindingTemplates());
|
---|
| 1449 | assertNotNull(oService.getBindingTemplates().getBindingTemplate());
|
---|
| 1450 | assertEquals(1, oService.getBindingTemplates().getBindingTemplate().size());
|
---|
| 1451 | assertEquals("http://www.service5.com", oService.getBindingTemplates().getBindingTemplate().get(0).getEndpointURL());
|
---|
| 1452 | }
|
---|
| 1453 | else if (oService.getUniformServiceName().equals("UnitTestServiceName_8_1"))
|
---|
| 1454 | {
|
---|
| 1455 | baFoundService[1] = true;
|
---|
| 1456 | assertNotNull(oService.getDescriptions());
|
---|
| 1457 | assertEquals(1, oService.getDescriptions().size());
|
---|
| 1458 | assertNotNull(oService.getDescriptions().get(0));
|
---|
| 1459 | assertNotNull(oService.getDescriptions().get(0).getDescription());
|
---|
| 1460 | assertEquals(1, oService.getDescriptions().get(0).getDescription().size());
|
---|
| 1461 | assertEquals("Service 6 Description", oService.getDescriptions().get(0).getDescription().get(0));
|
---|
| 1462 |
|
---|
| 1463 | assertEquals(true, oService.isInternalWebService());
|
---|
| 1464 |
|
---|
| 1465 | assertNotNull(oService.getBindingTemplates());
|
---|
| 1466 | assertNotNull(oService.getBindingTemplates().getBindingTemplate());
|
---|
| 1467 | assertEquals(1, oService.getBindingTemplates().getBindingTemplate().size());
|
---|
| 1468 | assertEquals("http://www.service6.com", oService.getBindingTemplates().getBindingTemplate().get(0).getEndpointURL());
|
---|
| 1469 | }
|
---|
| 1470 | else if (oService.getServiceKey().equals("ServiceKey.2.1"))
|
---|
| 1471 | {
|
---|
| 1472 | baFoundService[2] = true;
|
---|
| 1473 |
|
---|
| 1474 | assertNotNull(oService.getNames());
|
---|
| 1475 | assertEquals(2, oService.getNames().size());
|
---|
| 1476 | assertNotNull(oService.getNames().get(0));
|
---|
| 1477 | assertNotNull(oService.getNames().get(0).getName());
|
---|
| 1478 | assertEquals(1, oService.getNames().get(0).getName().size());
|
---|
| 1479 | assertEquals("BindingName.2.1.1", oService.getNames().get(0).getName().get(0));
|
---|
| 1480 | assertNotNull(oService.getNames().get(1));
|
---|
| 1481 | assertNotNull(oService.getNames().get(1).getName());
|
---|
| 1482 | assertEquals(1, oService.getNames().get(1).getName().size());
|
---|
| 1483 | assertEquals("BindingName.2.1.2", oService.getNames().get(1).getName().get(0));
|
---|
| 1484 |
|
---|
| 1485 | assertNotNull(oService.getDescriptions());
|
---|
| 1486 | assertEquals(2, oService.getDescriptions().size());
|
---|
| 1487 | assertNotNull(oService.getDescriptions().get(0));
|
---|
| 1488 | assertNotNull(oService.getDescriptions().get(0).getDescription());
|
---|
| 1489 | assertEquals(1, oService.getDescriptions().get(0).getDescription().size());
|
---|
| 1490 | assertEquals("BindingDescription.2.1.1", oService.getDescriptions().get(0).getDescription().get(0));
|
---|
| 1491 | assertNotNull(oService.getDescriptions().get(1));
|
---|
| 1492 | assertNotNull(oService.getDescriptions().get(1).getDescription());
|
---|
| 1493 | assertEquals(1, oService.getDescriptions().get(1).getDescription().size());
|
---|
| 1494 | assertEquals("BindingDescription.2.1.2", oService.getDescriptions().get(1).getDescription().get(0));
|
---|
| 1495 |
|
---|
| 1496 | assertEquals("UnitTestServiceName_2_1", oService.getUniformServiceName());
|
---|
| 1497 | assertEquals("1.0", oService.getServiceVersion());
|
---|
| 1498 | assertEquals(true, oService.isInternalWebService());
|
---|
| 1499 |
|
---|
| 1500 | assertNotNull(oService.getBindingTemplates());
|
---|
| 1501 | assertNotNull(oService.getBindingTemplates().getBindingTemplate());
|
---|
| 1502 | assertEquals(2, oService.getBindingTemplates().getBindingTemplate().size());
|
---|
| 1503 |
|
---|
| 1504 | assertEquals("BindingKey.2.1.1", oService.getBindingTemplates().getBindingTemplate().get(0).getBindingKey());
|
---|
| 1505 | assertEquals("http://www.test.com:8080/EndpointURL.2.1.1", oService.getBindingTemplates().getBindingTemplate().get(0).getEndpointURL());
|
---|
| 1506 | assertEquals("WSDLURL.2.1.1", oService.getBindingTemplates().getBindingTemplate().get(0).getWsdlURL());
|
---|
| 1507 |
|
---|
| 1508 | assertEquals("BindingKey.2.1.2", oService.getBindingTemplates().getBindingTemplate().get(1).getBindingKey());
|
---|
| 1509 | assertEquals("http://www.test.com:8080/EndpointURL.2.1.2", oService.getBindingTemplates().getBindingTemplate().get(1).getEndpointURL());
|
---|
| 1510 | assertEquals("WSDLURL.2.1.2", oService.getBindingTemplates().getBindingTemplate().get(1).getWsdlURL());
|
---|
| 1511 | }
|
---|
| 1512 | else if (oService.getServiceKey().equals("ServiceKey.2.2"))
|
---|
| 1513 | {
|
---|
| 1514 | baFoundService[3] = true;
|
---|
| 1515 |
|
---|
| 1516 | assertNotNull(oService.getNames());
|
---|
| 1517 | assertEquals(2, oService.getNames().size());
|
---|
| 1518 | assertNotNull(oService.getNames().get(0));
|
---|
| 1519 | assertNotNull(oService.getNames().get(0).getName());
|
---|
| 1520 | assertEquals(1, oService.getNames().get(0).getName().size());
|
---|
| 1521 | assertEquals("BindingName.2.2.1", oService.getNames().get(0).getName().get(0));
|
---|
| 1522 | assertNotNull(oService.getNames().get(1));
|
---|
| 1523 | assertNotNull(oService.getNames().get(1).getName());
|
---|
| 1524 | assertEquals(1, oService.getNames().get(1).getName().size());
|
---|
| 1525 | assertEquals("BindingName.2.2.2", oService.getNames().get(1).getName().get(0));
|
---|
| 1526 |
|
---|
| 1527 | assertNotNull(oService.getDescriptions());
|
---|
| 1528 | assertEquals(2, oService.getDescriptions().size());
|
---|
| 1529 | assertNotNull(oService.getDescriptions().get(0));
|
---|
| 1530 | assertNotNull(oService.getDescriptions().get(0).getDescription());
|
---|
| 1531 | assertEquals(1, oService.getDescriptions().get(0).getDescription().size());
|
---|
| 1532 | assertEquals("BindingDescription.2.2.1", oService.getDescriptions().get(0).getDescription().get(0));
|
---|
| 1533 | assertNotNull(oService.getDescriptions().get(1));
|
---|
| 1534 | assertNotNull(oService.getDescriptions().get(1).getDescription());
|
---|
| 1535 | assertEquals(1, oService.getDescriptions().get(1).getDescription().size());
|
---|
| 1536 | assertEquals("BindingDescription.2.2.2", oService.getDescriptions().get(1).getDescription().get(0));
|
---|
| 1537 |
|
---|
| 1538 | assertEquals("UnitTestServiceName_2_2", oService.getUniformServiceName());
|
---|
| 1539 | assertEquals("1.0", oService.getServiceVersion());
|
---|
| 1540 | assertEquals(true, oService.isInternalWebService());
|
---|
| 1541 |
|
---|
| 1542 | assertNotNull(oService.getBindingTemplates());
|
---|
| 1543 | assertNotNull(oService.getBindingTemplates().getBindingTemplate());
|
---|
| 1544 | assertEquals(2, oService.getBindingTemplates().getBindingTemplate().size());
|
---|
| 1545 |
|
---|
| 1546 | assertEquals("BindingKey.2.2.1", oService.getBindingTemplates().getBindingTemplate().get(0).getBindingKey());
|
---|
| 1547 | assertEquals("http://www.test.com:8080/EndpointURL.2.2.1", oService.getBindingTemplates().getBindingTemplate().get(0).getEndpointURL());
|
---|
| 1548 | assertEquals("WSDLURL.2.2.1", oService.getBindingTemplates().getBindingTemplate().get(0).getWsdlURL());
|
---|
| 1549 |
|
---|
| 1550 | assertEquals("BindingKey.2.2.2", oService.getBindingTemplates().getBindingTemplate().get(1).getBindingKey());
|
---|
| 1551 | assertEquals("http://www.test.com:8080/EndpointURL.2.2.2", oService.getBindingTemplates().getBindingTemplate().get(1).getEndpointURL());
|
---|
| 1552 | assertEquals("WSDLURL.2.2.2", oService.getBindingTemplates().getBindingTemplate().get(1).getWsdlURL());
|
---|
| 1553 | }
|
---|
| 1554 | else
|
---|
| 1555 | {
|
---|
| 1556 | fail("Found an unexpected service: " + oService.getUniformServiceName());
|
---|
| 1557 | }
|
---|
| 1558 |
|
---|
| 1559 | // We can check this here because if it does not match either of the two specified, we will
|
---|
| 1560 | // get an error. So we are guaranteed that we will either fail before we are done, or
|
---|
| 1561 | // that everything is in order.
|
---|
| 1562 | //------------------------------------------------------------------------------------------
|
---|
| 1563 | if ((sUniformServiceName != null) && (sUniformServiceName.equals(oService.getUniformServiceName())))
|
---|
| 1564 | {
|
---|
| 1565 | bMatchedService = true;
|
---|
| 1566 | }
|
---|
| 1567 |
|
---|
| 1568 |
|
---|
| 1569 | } // for (CMBusinessService oService : oEntity.getBusinessServices().getBusinessService())
|
---|
| 1570 |
|
---|
| 1571 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 1572 | {
|
---|
| 1573 | assertTrue(baFoundService[0]);
|
---|
| 1574 | assertTrue(baFoundService[1]);
|
---|
| 1575 | assertTrue(baFoundService[2]);
|
---|
| 1576 | assertTrue(baFoundService[3]);
|
---|
| 1577 | }
|
---|
| 1578 | else
|
---|
| 1579 | {
|
---|
| 1580 | assertTrue(bMatchedService);
|
---|
| 1581 | }
|
---|
| 1582 | }
|
---|
| 1583 |
|
---|
| 1584 | /**
|
---|
| 1585 | * This method validates the entire contents of a business entity for
|
---|
| 1586 | * HomeCommunity 2222.2222.2222.2222
|
---|
| 1587 | *
|
---|
| 1588 | * @param oEntity The business entity for this home community.
|
---|
| 1589 | * @param sUniformServiceName If this is passed, then it will validate all of the
|
---|
| 1590 | * general stuff and only the one specific service and that
|
---|
| 1591 | * the service is the only one that exists.
|
---|
| 1592 | *
|
---|
| 1593 | */
|
---|
| 1594 | private void validateEntity_2222_2222_2222_2222(BusinessEntityType oEntity, String sUniformServiceName)
|
---|
| 1595 | {
|
---|
| 1596 | assertNotNull(oEntity);
|
---|
| 1597 | assertEquals("2222.2222.2222.2222", oEntity.getHomeCommunityId());
|
---|
| 1598 |
|
---|
| 1599 | assertNotNull(oEntity.getNames());
|
---|
| 1600 | assertEquals(1, oEntity.getNames().getBusinessName().size());
|
---|
| 1601 | assertEquals("Home2", oEntity.getNames().getBusinessName().get(0));
|
---|
| 1602 |
|
---|
| 1603 | assertNotNull(oEntity.getDescriptions());
|
---|
| 1604 | assertEquals(1, oEntity.getDescriptions().getBusinessDescription().size());
|
---|
| 1605 | assertEquals("Home2 Description", oEntity.getDescriptions().getBusinessDescription().get(0));
|
---|
| 1606 |
|
---|
| 1607 | assertNotNull(oEntity.getBusinessServices());
|
---|
| 1608 | assertNotNull(oEntity.getBusinessServices().getBusinessService());
|
---|
| 1609 |
|
---|
| 1610 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 1611 | {
|
---|
| 1612 | assertEquals(2, oEntity.getBusinessServices().getBusinessService().size());
|
---|
| 1613 | }
|
---|
| 1614 | else
|
---|
| 1615 | {
|
---|
| 1616 | assertEquals(1, oEntity.getBusinessServices().getBusinessService().size());
|
---|
| 1617 | }
|
---|
| 1618 |
|
---|
| 1619 | boolean baFoundService[] = {false, false};
|
---|
| 1620 | boolean bMatchedService = false; // Used when we are looking just for one service.
|
---|
| 1621 | for (BusinessServiceType oService : oEntity.getBusinessServices().getBusinessService())
|
---|
| 1622 | {
|
---|
| 1623 | if (oService.getUniformServiceName().equals("UnitTestServiceName_5_1"))
|
---|
| 1624 | {
|
---|
| 1625 | baFoundService[0] = true;
|
---|
| 1626 | assertNotNull(oService.getDescriptions());
|
---|
| 1627 | assertEquals(1, oService.getDescriptions().size());
|
---|
| 1628 | assertNotNull(oService.getDescriptions().get(0));
|
---|
| 1629 | assertNotNull(oService.getDescriptions().get(0).getDescription());
|
---|
| 1630 | assertEquals(1, oService.getDescriptions().get(0).getDescription().size());
|
---|
| 1631 | assertEquals("Service 3 Description", oService.getDescriptions().get(0).getDescription().get(0));
|
---|
| 1632 |
|
---|
| 1633 | assertEquals(false, oService.isInternalWebService());
|
---|
| 1634 |
|
---|
| 1635 | assertNotNull(oService.getBindingTemplates());
|
---|
| 1636 | assertNotNull(oService.getBindingTemplates().getBindingTemplate());
|
---|
| 1637 | assertEquals(1, oService.getBindingTemplates().getBindingTemplate().size());
|
---|
| 1638 | assertEquals("http://www.service3.com", oService.getBindingTemplates().getBindingTemplate().get(0).getEndpointURL());
|
---|
| 1639 | }
|
---|
| 1640 | else if (oService.getUniformServiceName().equals("UnitTestServiceName_6_1"))
|
---|
| 1641 | {
|
---|
| 1642 | baFoundService[1] = true;
|
---|
| 1643 | assertNotNull(oService.getDescriptions());
|
---|
| 1644 | assertEquals(1, oService.getDescriptions().size());
|
---|
| 1645 | assertNotNull(oService.getDescriptions().get(0));
|
---|
| 1646 | assertNotNull(oService.getDescriptions().get(0).getDescription());
|
---|
| 1647 | assertEquals(1, oService.getDescriptions().get(0).getDescription().size());
|
---|
| 1648 | assertEquals("Service 4 Description", oService.getDescriptions().get(0).getDescription().get(0));
|
---|
| 1649 |
|
---|
| 1650 | assertEquals(true, oService.isInternalWebService());
|
---|
| 1651 |
|
---|
| 1652 | assertNotNull(oService.getBindingTemplates());
|
---|
| 1653 | assertNotNull(oService.getBindingTemplates().getBindingTemplate());
|
---|
| 1654 | assertEquals(1, oService.getBindingTemplates().getBindingTemplate().size());
|
---|
| 1655 | assertEquals("http://www.service4.com", oService.getBindingTemplates().getBindingTemplate().get(0).getEndpointURL());
|
---|
| 1656 | }
|
---|
| 1657 | else
|
---|
| 1658 | {
|
---|
| 1659 | fail("Found an unexpected service: " + oService.getUniformServiceName());
|
---|
| 1660 | }
|
---|
| 1661 |
|
---|
| 1662 | // We can check this here because if it does not match either of the two specified, we will
|
---|
| 1663 | // get an error. So we are guaranteed that we will either fail before we are done, or
|
---|
| 1664 | // that everything is in order.
|
---|
| 1665 | //------------------------------------------------------------------------------------------
|
---|
| 1666 | if ((sUniformServiceName != null) && (sUniformServiceName.equals(oService.getUniformServiceName())))
|
---|
| 1667 | {
|
---|
| 1668 | bMatchedService = true;
|
---|
| 1669 | }
|
---|
| 1670 |
|
---|
| 1671 | } // for (CMBusinessService oService : oEntity.getBusinessServices().getBusinessService())
|
---|
| 1672 |
|
---|
| 1673 | if ((sUniformServiceName == null) || (sUniformServiceName.length() <= 0))
|
---|
| 1674 | {
|
---|
| 1675 | assertTrue(baFoundService[0]);
|
---|
| 1676 | assertTrue(baFoundService[1]);
|
---|
| 1677 | }
|
---|
| 1678 | else
|
---|
| 1679 | {
|
---|
| 1680 | assertTrue(bMatchedService);
|
---|
| 1681 | }
|
---|
| 1682 |
|
---|
| 1683 | }
|
---|
| 1684 |
|
---|
| 1685 |
|
---|
| 1686 | /**
|
---|
| 1687 | * Test of getAllCommunities method, of class CMServiceHelper.
|
---|
| 1688 | */
|
---|
| 1689 | @Test
|
---|
| 1690 | public void testGetAllCommunities()
|
---|
| 1691 | {
|
---|
| 1692 | System.out.println("getAllCommunities");
|
---|
| 1693 | GetAllCommunitiesRequestType part1 = new GetAllCommunitiesRequestType();
|
---|
| 1694 | HomeCommunitiesType oResult = CMServiceHelper.getAllCommunities(part1);
|
---|
| 1695 | assertNotNull(oResult);
|
---|
| 1696 | assertNotNull(oResult.getHomeCommunity());
|
---|
| 1697 | assertEquals(4, oResult.getHomeCommunity().size());
|
---|
| 1698 | boolean baFound[] = {false, false, false, false};
|
---|
| 1699 |
|
---|
| 1700 | for (HomeCommunityType oHomeCommunity : oResult.getHomeCommunity())
|
---|
| 1701 | {
|
---|
| 1702 | if (oHomeCommunity.getHomeCommunityId().equals("1111.1111.1111.1111"))
|
---|
| 1703 | {
|
---|
| 1704 | validateHomeCommunity_1111_1111_1111_1111(oHomeCommunity);
|
---|
| 1705 | baFound[0] = true;
|
---|
| 1706 | }
|
---|
| 1707 | else if (oHomeCommunity.getHomeCommunityId().equals("2222.2222.2222.2222"))
|
---|
| 1708 | {
|
---|
| 1709 | validateHomeCommunity_2222_2222_2222_2222(oHomeCommunity);
|
---|
| 1710 | baFound[1] = true;
|
---|
| 1711 | }
|
---|
| 1712 | else if (oHomeCommunity.getHomeCommunityId().equals("1111.1111.1111.1111..2"))
|
---|
| 1713 | {
|
---|
| 1714 | validateHomeCommunity_1111_1111_1111_1111__2(oHomeCommunity);
|
---|
| 1715 | baFound[2] = true;
|
---|
| 1716 | }
|
---|
| 1717 | else if (oHomeCommunity.getHomeCommunityId().equals("1111.1111.1111.1111..1"))
|
---|
| 1718 | {
|
---|
| 1719 | validateHomeCommunity_1111_1111_1111_1111__1(oHomeCommunity);
|
---|
| 1720 | baFound[3] = true;
|
---|
| 1721 | }
|
---|
| 1722 | else
|
---|
| 1723 | {
|
---|
| 1724 | fail("Found an unexpected HomeCommunity. HomeCommunityId:" + oHomeCommunity.getHomeCommunityId());
|
---|
| 1725 | }
|
---|
| 1726 | }
|
---|
| 1727 | assertTrue(baFound[0]);
|
---|
| 1728 | assertTrue(baFound[1]);
|
---|
| 1729 | assertTrue(baFound[2]);
|
---|
| 1730 | assertTrue(baFound[3]);
|
---|
| 1731 | }
|
---|
| 1732 |
|
---|
| 1733 |
|
---|
| 1734 |
|
---|
| 1735 | /**
|
---|
| 1736 | * Test of getAllBusinessEntities method, of class CMServiceHelper.
|
---|
| 1737 | */
|
---|
| 1738 | @Test
|
---|
| 1739 | public void testGetAllBusinessEntities()
|
---|
| 1740 | {
|
---|
| 1741 | System.out.println("getAllBusinessEntities");
|
---|
| 1742 | GetAllBusinessEntitiesRequestType part1 = null;
|
---|
| 1743 | BusinessEntitiesType oEntities = null;
|
---|
| 1744 | oEntities = CMServiceHelper.getAllBusinessEntities(part1);
|
---|
| 1745 | assertNotNull(oEntities);
|
---|
| 1746 | assertNotNull(oEntities.getBusinessEntity());
|
---|
| 1747 | assertEquals(4, oEntities.getBusinessEntity().size());
|
---|
| 1748 | boolean baFound[] = {false, false, false, false};
|
---|
| 1749 |
|
---|
| 1750 | for (BusinessEntityType oEntity : oEntities.getBusinessEntity())
|
---|
| 1751 | {
|
---|
| 1752 | if (oEntity.getHomeCommunityId().equals("1111.1111.1111.1111"))
|
---|
| 1753 | {
|
---|
| 1754 | validateEntity_1111_1111_1111_1111(oEntity, "");
|
---|
| 1755 | baFound[0] = true;
|
---|
| 1756 | }
|
---|
| 1757 | else if (oEntity.getHomeCommunityId().equals("2222.2222.2222.2222"))
|
---|
| 1758 | {
|
---|
| 1759 | validateEntity_2222_2222_2222_2222(oEntity, "");
|
---|
| 1760 | baFound[1] = true;
|
---|
| 1761 | }
|
---|
| 1762 | else if (oEntity.getHomeCommunityId().equals("1111.1111.1111.1111..2"))
|
---|
| 1763 | {
|
---|
| 1764 | validateEntity_1111_1111_1111_1111__2(oEntity, "");
|
---|
| 1765 | baFound[2] = true;
|
---|
| 1766 | }
|
---|
| 1767 | else if (oEntity.getHomeCommunityId().equals("1111.1111.1111.1111..1"))
|
---|
| 1768 | {
|
---|
| 1769 | validateEntity_1111_1111_1111_1111__1(oEntity, "");
|
---|
| 1770 | baFound[3] = true;
|
---|
| 1771 | }
|
---|
| 1772 | else
|
---|
| 1773 | {
|
---|
| 1774 | fail("Found an unexpected entry. HomeCommunityId:" + oEntity.getHomeCommunityId());
|
---|
| 1775 | }
|
---|
| 1776 | }
|
---|
| 1777 | assertTrue(baFound[0]);
|
---|
| 1778 | assertTrue(baFound[1]);
|
---|
| 1779 | assertTrue(baFound[2]);
|
---|
| 1780 | assertTrue(baFound[3]);
|
---|
| 1781 | }
|
---|
| 1782 |
|
---|
| 1783 | /**
|
---|
| 1784 | * Test of getBusinessEntity method, of class CMServiceHelper.
|
---|
| 1785 | */
|
---|
| 1786 | @Test
|
---|
| 1787 | public void testGetBusinessEntity()
|
---|
| 1788 | {
|
---|
| 1789 | System.out.println("getBusinessEntity");
|
---|
| 1790 | GetBusinessEntityRequestType part1 = new GetBusinessEntityRequestType();
|
---|
| 1791 | part1.setHomeCommunity(new HomeCommunityType());
|
---|
| 1792 | part1.getHomeCommunity().setHomeCommunityId("1111.1111.1111.1111");
|
---|
| 1793 | BusinessEntityType oEntity = CMServiceHelper.getBusinessEntity(part1);
|
---|
| 1794 | assertNotNull(oEntity);
|
---|
| 1795 | validateEntity_1111_1111_1111_1111(oEntity, "");
|
---|
| 1796 |
|
---|
| 1797 | part1 = new GetBusinessEntityRequestType();
|
---|
| 1798 | part1.setHomeCommunity(new HomeCommunityType());
|
---|
| 1799 | part1.getHomeCommunity().setHomeCommunityId("1111.1111.1111.1111..2");
|
---|
| 1800 | oEntity = CMServiceHelper.getBusinessEntity(part1);
|
---|
| 1801 | assertNotNull(oEntity);
|
---|
| 1802 | validateEntity_1111_1111_1111_1111__2(oEntity, "");
|
---|
| 1803 |
|
---|
| 1804 | part1 = new GetBusinessEntityRequestType();
|
---|
| 1805 | part1.setHomeCommunity(new HomeCommunityType());
|
---|
| 1806 | part1.getHomeCommunity().setHomeCommunityId("1111.1111.1111.1111..1");
|
---|
| 1807 | oEntity = CMServiceHelper.getBusinessEntity(part1);
|
---|
| 1808 | assertNotNull(oEntity);
|
---|
| 1809 | validateEntity_1111_1111_1111_1111__1(oEntity, "");
|
---|
| 1810 | }
|
---|
| 1811 |
|
---|
| 1812 | /**
|
---|
| 1813 | * Test of getConnectionInfoSet method, of class CMServiceHelper.
|
---|
| 1814 | */
|
---|
| 1815 | @Test
|
---|
| 1816 | public void testGetConnectionInfoSet()
|
---|
| 1817 | {
|
---|
| 1818 | System.out.println("getConnectionInfoSet");
|
---|
| 1819 | HomeCommunitiesType part1 = new HomeCommunitiesType();
|
---|
| 1820 | HomeCommunityType oHomeCommunity = new HomeCommunityType();
|
---|
| 1821 | oHomeCommunity.setHomeCommunityId("1111.1111.1111.1111");
|
---|
| 1822 | part1.getHomeCommunity().add(oHomeCommunity);
|
---|
| 1823 | oHomeCommunity = new HomeCommunityType();
|
---|
| 1824 | oHomeCommunity.setHomeCommunityId("1111.1111.1111.1111..2");
|
---|
| 1825 | part1.getHomeCommunity().add(oHomeCommunity);
|
---|
| 1826 | oHomeCommunity = new HomeCommunityType();
|
---|
| 1827 | oHomeCommunity.setHomeCommunityId("1111.1111.1111.1111..1");
|
---|
| 1828 | part1.getHomeCommunity().add(oHomeCommunity);
|
---|
| 1829 |
|
---|
| 1830 | ConnectionInfosType oConnInfos = CMServiceHelper.getConnectionInfoSet(part1);
|
---|
| 1831 | assertNotNull(oConnInfos);
|
---|
| 1832 | assertNotNull(oConnInfos.getConnectionInfo());
|
---|
| 1833 | assertEquals(3, oConnInfos.getConnectionInfo().size());
|
---|
| 1834 |
|
---|
| 1835 | boolean baFound[] = {false, false, false};
|
---|
| 1836 | for (ConnectionInfoType oConnInfo: oConnInfos.getConnectionInfo())
|
---|
| 1837 | {
|
---|
| 1838 | assertNotNull(oConnInfo.getHomeCommunity());
|
---|
| 1839 | if (oConnInfo.getHomeCommunity().getHomeCommunityId().equals("1111.1111.1111.1111"))
|
---|
| 1840 | {
|
---|
| 1841 | baFound[0] = true;
|
---|
| 1842 | validateConnectionInfo_1111_1111_1111_1111(oConnInfo, "");
|
---|
| 1843 | }
|
---|
| 1844 | else if (oConnInfo.getHomeCommunity().getHomeCommunityId().equals("1111.1111.1111.1111..2"))
|
---|
| 1845 | {
|
---|
| 1846 | baFound[1] = true;
|
---|
| 1847 | validateConnectionInfo_1111_1111_1111_1111__2(oConnInfo, "");
|
---|
| 1848 | }
|
---|
| 1849 | else if (oConnInfo.getHomeCommunity().getHomeCommunityId().equals("1111.1111.1111.1111..1"))
|
---|
| 1850 | {
|
---|
| 1851 | baFound[2] = true;
|
---|
| 1852 | validateConnectionInfo_1111_1111_1111_1111__1(oConnInfo, "");
|
---|
| 1853 | }
|
---|
| 1854 | else
|
---|
| 1855 | {
|
---|
| 1856 | fail("Found an unexpected business entity: " + oConnInfo.getHomeCommunity().getHomeCommunityId());
|
---|
| 1857 | }
|
---|
| 1858 | } // for (CMBusinessEntity oEntity: oEntities.getBusinessEntity())
|
---|
| 1859 |
|
---|
| 1860 | assertTrue(baFound[0]);
|
---|
| 1861 | assertTrue(baFound[1]);
|
---|
| 1862 | assertTrue(baFound[2]);
|
---|
| 1863 | }
|
---|
| 1864 |
|
---|
| 1865 | /**
|
---|
| 1866 | * Test of getConnectionInfoEndpointSet method, of class CMServiceHelper.
|
---|
| 1867 | */
|
---|
| 1868 | @Test
|
---|
| 1869 | public void testGetConnectionInfoEndpointSet()
|
---|
| 1870 | {
|
---|
| 1871 | System.out.println("getConnectionInfoEndpointSet");
|
---|
| 1872 | GetConnectionInfoEndpointSetRequestType part1 = new GetConnectionInfoEndpointSetRequestType();
|
---|
| 1873 | part1.setHomeCommunities(new HomeCommunitiesType());
|
---|
| 1874 | HomeCommunityType oHomeCommunity = new HomeCommunityType();
|
---|
| 1875 | oHomeCommunity.setHomeCommunityId("1111.1111.1111.1111");
|
---|
| 1876 | part1.getHomeCommunities().getHomeCommunity().add(oHomeCommunity);
|
---|
| 1877 | oHomeCommunity = new HomeCommunityType();
|
---|
| 1878 | oHomeCommunity.setHomeCommunityId("1111.1111.1111.1111..2");
|
---|
| 1879 | part1.getHomeCommunities().getHomeCommunity().add(oHomeCommunity);
|
---|
| 1880 | oHomeCommunity = new HomeCommunityType();
|
---|
| 1881 | oHomeCommunity.setHomeCommunityId("1111.1111.1111.1111..1");
|
---|
| 1882 | part1.getHomeCommunities().getHomeCommunity().add(oHomeCommunity);
|
---|
| 1883 | ConnectionInfoEndpointsType oConnInfoEndpoints = CMServiceHelper.getConnectionInfoEndpointSet(part1);
|
---|
| 1884 | assertNotNull(oConnInfoEndpoints);
|
---|
| 1885 | assertNotNull(oConnInfoEndpoints.getConnectionInfoEndpoint());
|
---|
| 1886 | assertEquals(3, oConnInfoEndpoints.getConnectionInfoEndpoint().size());
|
---|
| 1887 |
|
---|
| 1888 | boolean baFound[] = {false, false, false};
|
---|
| 1889 | for (ConnectionInfoEndpointType oConnInfoEndpoint: oConnInfoEndpoints.getConnectionInfoEndpoint())
|
---|
| 1890 | {
|
---|
| 1891 | assertNotNull(oConnInfoEndpoint.getHomeCommunity());
|
---|
| 1892 |
|
---|
| 1893 | if (oConnInfoEndpoint.getHomeCommunity().getHomeCommunityId().equals("1111.1111.1111.1111"))
|
---|
| 1894 | {
|
---|
| 1895 | baFound[0] = true;
|
---|
| 1896 | validateConnectionInfoEndpoint_1111_1111_1111_1111(oConnInfoEndpoint, "");
|
---|
| 1897 | }
|
---|
| 1898 | else if (oConnInfoEndpoint.getHomeCommunity().getHomeCommunityId().equals("1111.1111.1111.1111..2"))
|
---|
| 1899 | {
|
---|
| 1900 | baFound[1] = true;
|
---|
| 1901 | validateConnectionInfoEndpoint_1111_1111_1111_1111__2(oConnInfoEndpoint, "");
|
---|
| 1902 | }
|
---|
| 1903 | else if (oConnInfoEndpoint.getHomeCommunity().getHomeCommunityId().equals("1111.1111.1111.1111..1"))
|
---|
| 1904 | {
|
---|
| 1905 | baFound[2] = true;
|
---|
| 1906 | validateConnectionInfoEndpoint_1111_1111_1111_1111__1(oConnInfoEndpoint, "");
|
---|
| 1907 | }
|
---|
| 1908 | else
|
---|
| 1909 | {
|
---|
| 1910 | fail("Found an unexpected business entity: " + oConnInfoEndpoint.getHomeCommunity().getHomeCommunityId());
|
---|
| 1911 | }
|
---|
| 1912 | } // for (CMBusinessEntity oEntity: oEntities.getBusinessEntity())
|
---|
| 1913 |
|
---|
| 1914 | assertTrue(baFound[0]);
|
---|
| 1915 | assertTrue(baFound[1]);
|
---|
| 1916 | assertTrue(baFound[2]);
|
---|
| 1917 |
|
---|
| 1918 | }
|
---|
| 1919 |
|
---|
| 1920 | /**
|
---|
| 1921 | * Test of getBusinessEntitySet method, of class CMServiceHelper.
|
---|
| 1922 | */
|
---|
| 1923 | @Test
|
---|
| 1924 | public void testGetBusinessEntitySet()
|
---|
| 1925 | {
|
---|
| 1926 | System.out.println("getBusinessEntitySet");
|
---|
| 1927 | GetBusinessEntitySetRequestType part1 = new GetBusinessEntitySetRequestType();
|
---|
| 1928 | part1.setHomeCommunities(new HomeCommunitiesType());
|
---|
| 1929 | HomeCommunityType oHomeCommunity = new HomeCommunityType();
|
---|
| 1930 | part1.getHomeCommunities().getHomeCommunity().add(oHomeCommunity);
|
---|
| 1931 | oHomeCommunity.setHomeCommunityId("1111.1111.1111.1111");
|
---|
| 1932 | oHomeCommunity = new HomeCommunityType();
|
---|
| 1933 | part1.getHomeCommunities().getHomeCommunity().add(oHomeCommunity);
|
---|
| 1934 | oHomeCommunity.setHomeCommunityId("1111.1111.1111.1111..2");
|
---|
| 1935 | oHomeCommunity = new HomeCommunityType();
|
---|
| 1936 | part1.getHomeCommunities().getHomeCommunity().add(oHomeCommunity);
|
---|
| 1937 | oHomeCommunity.setHomeCommunityId("1111.1111.1111.1111..1");
|
---|
| 1938 | BusinessEntitiesType oEntities = CMServiceHelper.getBusinessEntitySet(part1);
|
---|
| 1939 | assertNotNull(oEntities);
|
---|
| 1940 | assertNotNull(oEntities.getBusinessEntity());
|
---|
| 1941 | assertEquals(3, oEntities.getBusinessEntity().size());
|
---|
| 1942 |
|
---|
| 1943 | boolean baFound[] = {false, false, false};
|
---|
| 1944 | for (BusinessEntityType oEntity: oEntities.getBusinessEntity())
|
---|
| 1945 | {
|
---|
| 1946 | if (oEntity.getHomeCommunityId().equals("1111.1111.1111.1111"))
|
---|
| 1947 | {
|
---|
| 1948 | baFound[0] = true;
|
---|
| 1949 | validateEntity_1111_1111_1111_1111(oEntity, "");
|
---|
| 1950 | }
|
---|
| 1951 | else if (oEntity.getHomeCommunityId().equals("1111.1111.1111.1111..2"))
|
---|
| 1952 | {
|
---|
| 1953 | baFound[1] = true;
|
---|
| 1954 | validateEntity_1111_1111_1111_1111__2(oEntity, "");
|
---|
| 1955 | }
|
---|
| 1956 | else if (oEntity.getHomeCommunityId().equals("1111.1111.1111.1111..1"))
|
---|
| 1957 | {
|
---|
| 1958 | baFound[2] = true;
|
---|
| 1959 | validateEntity_1111_1111_1111_1111__1(oEntity, "");
|
---|
| 1960 | }
|
---|
| 1961 | else
|
---|
| 1962 | {
|
---|
| 1963 | fail("Found an unexpected business entity: " + oEntity.getHomeCommunityId());
|
---|
| 1964 | }
|
---|
| 1965 | } // for (CMBusinessEntity oEntity: oEntities.getBusinessEntity())
|
---|
| 1966 |
|
---|
| 1967 | assertTrue(baFound[0]);
|
---|
| 1968 | assertTrue(baFound[1]);
|
---|
| 1969 | assertTrue(baFound[2]);
|
---|
| 1970 |
|
---|
| 1971 | }
|
---|
| 1972 |
|
---|
| 1973 | /**
|
---|
| 1974 | * Test of getConnectionInfoSetByServiceName method, of class CMServiceHelper.
|
---|
| 1975 | */
|
---|
| 1976 | @Test
|
---|
| 1977 | public void testGetConnectionInfoSetByServiceName()
|
---|
| 1978 | {
|
---|
| 1979 | System.out.println("getConnectionInfoSetByServiceName");
|
---|
| 1980 | HomeCommunitiesWithServiceNameType part1 = new HomeCommunitiesWithServiceNameType();
|
---|
| 1981 | part1.setHomeCommunities(new HomeCommunitiesType());
|
---|
| 1982 | HomeCommunityType oHomeCommunity = new HomeCommunityType();
|
---|
| 1983 | oHomeCommunity.setHomeCommunityId("2222.2222.2222.2222");
|
---|
| 1984 | part1.getHomeCommunities().getHomeCommunity().add(oHomeCommunity);
|
---|
| 1985 | oHomeCommunity = new HomeCommunityType();
|
---|
| 1986 | oHomeCommunity.setHomeCommunityId("1111.1111.1111.1111");
|
---|
| 1987 | part1.getHomeCommunities().getHomeCommunity().add(oHomeCommunity);
|
---|
| 1988 | oHomeCommunity = new HomeCommunityType();
|
---|
| 1989 | oHomeCommunity.setHomeCommunityId("1111.1111.1111.1111..2");
|
---|
| 1990 | part1.getHomeCommunities().getHomeCommunity().add(oHomeCommunity);
|
---|
| 1991 | oHomeCommunity = new HomeCommunityType();
|
---|
| 1992 | oHomeCommunity.setHomeCommunityId("1111.1111.1111.1111..1");
|
---|
| 1993 | part1.getHomeCommunities().getHomeCommunity().add(oHomeCommunity);
|
---|
| 1994 | part1.setServiceName("UnitTestServiceName_5_1");
|
---|
| 1995 | ConnectionInfosType oConnInfos = CMServiceHelper.getConnectionInfoSetByServiceName(part1);
|
---|
| 1996 | assertNotNull(oConnInfos);
|
---|
| 1997 | assertNotNull(oConnInfos.getConnectionInfo());
|
---|
| 1998 | assertEquals(1, oConnInfos.getConnectionInfo().size());
|
---|
| 1999 | validateConnectionInfo_2222_2222_2222_2222(oConnInfos.getConnectionInfo().get(0), "UnitTestServiceName_5_1");
|
---|
| 2000 |
|
---|
| 2001 | part1.setServiceName("UnitTestServiceName_1_2");
|
---|
| 2002 | oConnInfos = CMServiceHelper.getConnectionInfoSetByServiceName(part1);
|
---|
| 2003 | assertNotNull(oConnInfos);
|
---|
| 2004 | assertNotNull(oConnInfos.getConnectionInfo());
|
---|
| 2005 | assertEquals(1, oConnInfos.getConnectionInfo().size());
|
---|
| 2006 | validateConnectionInfo_1111_1111_1111_1111__1(oConnInfos.getConnectionInfo().get(0), "UnitTestServiceName_1_2");
|
---|
| 2007 |
|
---|
| 2008 | }
|
---|
| 2009 |
|
---|
| 2010 | /**
|
---|
| 2011 | * Test of getConnectionInfoEndpointSetByServiceName method, of class CMServiceHelper.
|
---|
| 2012 | */
|
---|
| 2013 | @Test
|
---|
| 2014 | public void testGetConnectionInfoEndpointSetByServiceName()
|
---|
| 2015 | {
|
---|
| 2016 | System.out.println("getConnectionInfoEndpointSetByServiceName");
|
---|
| 2017 | GetConnectionInfoEndpointSetByServiceNameRequestType part1 = new GetConnectionInfoEndpointSetByServiceNameRequestType();
|
---|
| 2018 | part1.setHomeCommunitiesWithServiceName(new HomeCommunitiesWithServiceNameType());
|
---|
| 2019 | part1.getHomeCommunitiesWithServiceName().setHomeCommunities(new HomeCommunitiesType());
|
---|
| 2020 | HomeCommunityType oHomeCommunity = new HomeCommunityType();
|
---|
| 2021 | oHomeCommunity.setHomeCommunityId("2222.2222.2222.2222");
|
---|
| 2022 | part1.getHomeCommunitiesWithServiceName().getHomeCommunities().getHomeCommunity().add(oHomeCommunity);
|
---|
| 2023 | oHomeCommunity = new HomeCommunityType();
|
---|
| 2024 | oHomeCommunity.setHomeCommunityId("1111.1111.1111.1111");
|
---|
| 2025 | part1.getHomeCommunitiesWithServiceName().getHomeCommunities().getHomeCommunity().add(oHomeCommunity);
|
---|
| 2026 | oHomeCommunity = new HomeCommunityType();
|
---|
| 2027 | oHomeCommunity.setHomeCommunityId("1111.1111.1111.1111..2");
|
---|
| 2028 | part1.getHomeCommunitiesWithServiceName().getHomeCommunities().getHomeCommunity().add(oHomeCommunity);
|
---|
| 2029 | oHomeCommunity = new HomeCommunityType();
|
---|
| 2030 | oHomeCommunity.setHomeCommunityId("1111.1111.1111.1111..1");
|
---|
| 2031 | part1.getHomeCommunitiesWithServiceName().getHomeCommunities().getHomeCommunity().add(oHomeCommunity);
|
---|
| 2032 | part1.getHomeCommunitiesWithServiceName().setServiceName("UnitTestServiceName_5_1");
|
---|
| 2033 | ConnectionInfoEndpointsType oConnInfoEndpoints = CMServiceHelper.getConnectionInfoEndpointSetByServiceName(part1);
|
---|
| 2034 | assertNotNull(oConnInfoEndpoints);
|
---|
| 2035 | assertNotNull(oConnInfoEndpoints.getConnectionInfoEndpoint());
|
---|
| 2036 | assertEquals(1, oConnInfoEndpoints.getConnectionInfoEndpoint().size());
|
---|
| 2037 | validateConnectionInfoEndpoint_2222_2222_2222_2222(oConnInfoEndpoints.getConnectionInfoEndpoint().get(0), "UnitTestServiceName_5_1");
|
---|
| 2038 |
|
---|
| 2039 | part1.getHomeCommunitiesWithServiceName().setServiceName("UnitTestServiceName_1_2");
|
---|
| 2040 | oConnInfoEndpoints = CMServiceHelper.getConnectionInfoEndpointSetByServiceName(part1);
|
---|
| 2041 | assertNotNull(oConnInfoEndpoints);
|
---|
| 2042 | assertNotNull(oConnInfoEndpoints.getConnectionInfoEndpoint());
|
---|
| 2043 | assertEquals(1, oConnInfoEndpoints.getConnectionInfoEndpoint().size());
|
---|
| 2044 | validateConnectionInfoEndpoint_1111_1111_1111_1111__1(oConnInfoEndpoints.getConnectionInfoEndpoint().get(0), "UnitTestServiceName_1_2");
|
---|
| 2045 | }
|
---|
| 2046 |
|
---|
| 2047 | /**
|
---|
| 2048 | * Test of getBusinessEntitySetByServiceName method, of class CMServiceHelper.
|
---|
| 2049 | */
|
---|
| 2050 | @Test
|
---|
| 2051 | public void testGetBusinessEntitySetByServiceName()
|
---|
| 2052 | {
|
---|
| 2053 | System.out.println("getBusinessEntitySetByServiceName");
|
---|
| 2054 | GetBusinessEntitySetByServiceNameRequestType part1 = new GetBusinessEntitySetByServiceNameRequestType();
|
---|
| 2055 | part1.setHomeCommunitiesWithServiceName(new HomeCommunitiesWithServiceNameType());
|
---|
| 2056 | part1.getHomeCommunitiesWithServiceName().setHomeCommunities(new HomeCommunitiesType());
|
---|
| 2057 | HomeCommunityType oHomeCommunity = new HomeCommunityType();
|
---|
| 2058 | part1.getHomeCommunitiesWithServiceName().getHomeCommunities().getHomeCommunity().add(oHomeCommunity);
|
---|
| 2059 | oHomeCommunity.setHomeCommunityId("2222.2222.2222.2222");
|
---|
| 2060 | oHomeCommunity = new HomeCommunityType();
|
---|
| 2061 | part1.getHomeCommunitiesWithServiceName().getHomeCommunities().getHomeCommunity().add(oHomeCommunity);
|
---|
| 2062 | oHomeCommunity.setHomeCommunityId("1111.1111.1111.1111");
|
---|
| 2063 | oHomeCommunity = new HomeCommunityType();
|
---|
| 2064 | part1.getHomeCommunitiesWithServiceName().getHomeCommunities().getHomeCommunity().add(oHomeCommunity);
|
---|
| 2065 | oHomeCommunity.setHomeCommunityId("1111.1111.1111.1111..2");
|
---|
| 2066 | oHomeCommunity = new HomeCommunityType();
|
---|
| 2067 | part1.getHomeCommunitiesWithServiceName().getHomeCommunities().getHomeCommunity().add(oHomeCommunity);
|
---|
| 2068 | oHomeCommunity.setHomeCommunityId("1111.1111.1111.1111..1");
|
---|
| 2069 | part1.getHomeCommunitiesWithServiceName().setServiceName("UnitTestServiceName_5_1");
|
---|
| 2070 | BusinessEntitiesType oEntities = CMServiceHelper.getBusinessEntitySetByServiceName(part1);
|
---|
| 2071 | assertNotNull(oEntities);
|
---|
| 2072 | assertNotNull(oEntities.getBusinessEntity());
|
---|
| 2073 | assertEquals(1, oEntities.getBusinessEntity().size());
|
---|
| 2074 | validateEntity_2222_2222_2222_2222(oEntities.getBusinessEntity().get(0), "UnitTestServiceName_5_1");
|
---|
| 2075 |
|
---|
| 2076 | part1.getHomeCommunitiesWithServiceName().setServiceName("UnitTestServiceName_1_2");
|
---|
| 2077 | oEntities = CMServiceHelper.getBusinessEntitySetByServiceName(part1);
|
---|
| 2078 | assertNotNull(oEntities);
|
---|
| 2079 | assertNotNull(oEntities.getBusinessEntity());
|
---|
| 2080 | assertEquals(1, oEntities.getBusinessEntity().size());
|
---|
| 2081 | validateEntity_1111_1111_1111_1111__1(oEntities.getBusinessEntity().get(0), "UnitTestServiceName_1_2");
|
---|
| 2082 |
|
---|
| 2083 | }
|
---|
| 2084 |
|
---|
| 2085 | /**
|
---|
| 2086 | * Test of getConnectionInfoByServiceName method, of class CMServiceHelper.
|
---|
| 2087 | */
|
---|
| 2088 | @Test
|
---|
| 2089 | public void testGetConnectionInfoByServiceName()
|
---|
| 2090 | {
|
---|
| 2091 | System.out.println("getConnectionInfoByServiceName");
|
---|
| 2092 | HomeCommunityWithServiceNameType part1 = new HomeCommunityWithServiceNameType();
|
---|
| 2093 | part1.setHomeCommunity(new HomeCommunityType());
|
---|
| 2094 | part1.getHomeCommunity().setHomeCommunityId("1111.1111.1111.1111..1");
|
---|
| 2095 | part1.setServiceName("UnitTestServiceName_1_2");
|
---|
| 2096 | ConnectionInfoType oConnInfo = CMServiceHelper.getConnectionInfoByServiceName(part1);
|
---|
| 2097 | assertNotNull(oConnInfo);
|
---|
| 2098 | validateConnectionInfo_1111_1111_1111_1111__1(oConnInfo, "UnitTestServiceName_1_2");
|
---|
| 2099 |
|
---|
| 2100 | part1.getHomeCommunity().setHomeCommunityId("2222.2222.2222.2222");
|
---|
| 2101 | part1.setServiceName("UnitTestServiceName_5_1");
|
---|
| 2102 | oConnInfo = CMServiceHelper.getConnectionInfoByServiceName(part1);
|
---|
| 2103 | assertNotNull(oConnInfo);
|
---|
| 2104 | validateConnectionInfo_2222_2222_2222_2222(oConnInfo, "UnitTestServiceName_5_1");
|
---|
| 2105 |
|
---|
| 2106 | part1.getHomeCommunity().setHomeCommunityId("1111.1111.1111.1111..2");
|
---|
| 2107 | part1.setServiceName("UnitTestServiceName_8_1");
|
---|
| 2108 | oConnInfo = CMServiceHelper.getConnectionInfoByServiceName(part1);
|
---|
| 2109 | assertNotNull(oConnInfo);
|
---|
| 2110 | validateConnectionInfo_1111_1111_1111_1111__2(oConnInfo, "UnitTestServiceName_8_1");
|
---|
| 2111 | }
|
---|
| 2112 |
|
---|
| 2113 | /**
|
---|
| 2114 | * Test of getConnectionInfoEndpointByServiceName method, of class CMServiceHelper.
|
---|
| 2115 | */
|
---|
| 2116 | @Test
|
---|
| 2117 | public void testGetConnectionInfoEndpointByServiceName()
|
---|
| 2118 | {
|
---|
| 2119 | System.out.println("getConnectionInfoEndpointByServiceName");
|
---|
| 2120 | GetConnectionInfoEndpointByServiceNameRequestType part1 = new GetConnectionInfoEndpointByServiceNameRequestType();
|
---|
| 2121 | part1.setHomeCommunityWithServiceName(new HomeCommunityWithServiceNameType());
|
---|
| 2122 | part1.getHomeCommunityWithServiceName().setHomeCommunity(new HomeCommunityType());
|
---|
| 2123 | part1.getHomeCommunityWithServiceName().getHomeCommunity().setHomeCommunityId("1111.1111.1111.1111..1");
|
---|
| 2124 | part1.getHomeCommunityWithServiceName().setServiceName("UnitTestServiceName_1_2");
|
---|
| 2125 | ConnectionInfoEndpointType oConnInfoEndpoint = CMServiceHelper.getConnectionInfoEndpointByServiceName(part1);
|
---|
| 2126 | assertNotNull(oConnInfoEndpoint);
|
---|
| 2127 | validateConnectionInfoEndpoint_1111_1111_1111_1111__1(oConnInfoEndpoint, "UnitTestServiceName_1_2");
|
---|
| 2128 |
|
---|
| 2129 | part1.getHomeCommunityWithServiceName().getHomeCommunity().setHomeCommunityId("2222.2222.2222.2222");
|
---|
| 2130 | part1.getHomeCommunityWithServiceName().setServiceName("UnitTestServiceName_5_1");
|
---|
| 2131 | oConnInfoEndpoint = CMServiceHelper.getConnectionInfoEndpointByServiceName(part1);
|
---|
| 2132 | assertNotNull(oConnInfoEndpoint);
|
---|
| 2133 | validateConnectionInfoEndpoint_2222_2222_2222_2222(oConnInfoEndpoint, "UnitTestServiceName_5_1");
|
---|
| 2134 |
|
---|
| 2135 | part1.getHomeCommunityWithServiceName().getHomeCommunity().setHomeCommunityId("1111.1111.1111.1111..2");
|
---|
| 2136 | part1.getHomeCommunityWithServiceName().setServiceName("UnitTestServiceName_8_1");
|
---|
| 2137 | oConnInfoEndpoint = CMServiceHelper.getConnectionInfoEndpointByServiceName(part1);
|
---|
| 2138 | assertNotNull(oConnInfoEndpoint);
|
---|
| 2139 | validateConnectionInfoEndpoint_1111_1111_1111_1111__2(oConnInfoEndpoint, "UnitTestServiceName_8_1");
|
---|
| 2140 | }
|
---|
| 2141 |
|
---|
| 2142 | /**
|
---|
| 2143 | * Test of getBusinessEntityByServiceName method, of class CMServiceHelper.
|
---|
| 2144 | */
|
---|
| 2145 | @Test
|
---|
| 2146 | public void testGetBusinessEntityByServiceName()
|
---|
| 2147 | {
|
---|
| 2148 | System.out.println("getBusinessEntityByServiceName");
|
---|
| 2149 | GetBusinessEntityByServiceNameRequestType part1 = new GetBusinessEntityByServiceNameRequestType();
|
---|
| 2150 | part1.setHomeCommunityWithServiceName(new HomeCommunityWithServiceNameType());
|
---|
| 2151 | part1.getHomeCommunityWithServiceName().setHomeCommunity(new HomeCommunityType());
|
---|
| 2152 | part1.getHomeCommunityWithServiceName().getHomeCommunity().setHomeCommunityId("1111.1111.1111.1111..1");
|
---|
| 2153 | part1.getHomeCommunityWithServiceName().setServiceName("UnitTestServiceName_1_2");
|
---|
| 2154 | BusinessEntityType oEntity = CMServiceHelper.getBusinessEntityByServiceName(part1);
|
---|
| 2155 | assertNotNull(oEntity);
|
---|
| 2156 | validateEntity_1111_1111_1111_1111__1(oEntity, "UnitTestServiceName_1_2");
|
---|
| 2157 |
|
---|
| 2158 | part1.getHomeCommunityWithServiceName().getHomeCommunity().setHomeCommunityId("2222.2222.2222.2222");
|
---|
| 2159 | part1.getHomeCommunityWithServiceName().setServiceName("UnitTestServiceName_5_1");
|
---|
| 2160 | oEntity = CMServiceHelper.getBusinessEntityByServiceName(part1);
|
---|
| 2161 | assertNotNull(oEntity);
|
---|
| 2162 | validateEntity_2222_2222_2222_2222(oEntity, "UnitTestServiceName_5_1");
|
---|
| 2163 |
|
---|
| 2164 | part1.getHomeCommunityWithServiceName().getHomeCommunity().setHomeCommunityId("1111.1111.1111.1111..2");
|
---|
| 2165 | part1.getHomeCommunityWithServiceName().setServiceName("UnitTestServiceName_8_1");
|
---|
| 2166 | oEntity = CMServiceHelper.getBusinessEntityByServiceName(part1);
|
---|
| 2167 | assertNotNull(oEntity);
|
---|
| 2168 | validateEntity_1111_1111_1111_1111__2(oEntity, "UnitTestServiceName_8_1");
|
---|
| 2169 |
|
---|
| 2170 | }
|
---|
| 2171 |
|
---|
| 2172 | /**
|
---|
| 2173 | * Test of getAllConnectionInfoSetByServiceName method, of class CMServiceHelper.
|
---|
| 2174 | */
|
---|
| 2175 | @Test
|
---|
| 2176 | public void testGetAllConnectionInfoSetByServiceName()
|
---|
| 2177 | {
|
---|
| 2178 | System.out.println("getAllConnectionInfoSetByServiceName");
|
---|
| 2179 | GetAllConnectionInfoSetByServiceNameRequestType part1 = new GetAllConnectionInfoSetByServiceNameRequestType();
|
---|
| 2180 | part1.setServiceName("UnitTestServiceName_5_1");
|
---|
| 2181 | ConnectionInfosType oConnInfos = CMServiceHelper.getAllConnectionInfoSetByServiceName(part1);
|
---|
| 2182 | assertNotNull(oConnInfos);
|
---|
| 2183 | assertNotNull(oConnInfos.getConnectionInfo());
|
---|
| 2184 | assertEquals(1, oConnInfos.getConnectionInfo().size());
|
---|
| 2185 | validateConnectionInfo_2222_2222_2222_2222(oConnInfos.getConnectionInfo().get(0), "UnitTestServiceName_5_1");
|
---|
| 2186 |
|
---|
| 2187 | part1.setServiceName("UnitTestServiceName_1_2");
|
---|
| 2188 | oConnInfos = CMServiceHelper.getAllConnectionInfoSetByServiceName(part1);
|
---|
| 2189 | assertNotNull(oConnInfos);
|
---|
| 2190 | assertNotNull(oConnInfos.getConnectionInfo());
|
---|
| 2191 | assertEquals(1, oConnInfos.getConnectionInfo().size());
|
---|
| 2192 | validateConnectionInfo_1111_1111_1111_1111__1(oConnInfos.getConnectionInfo().get(0), "UnitTestServiceName_1_2");
|
---|
| 2193 | }
|
---|
| 2194 |
|
---|
| 2195 | /**
|
---|
| 2196 | * Test of getAllConnectionInfoEndpointSetByServiceName method, of class CMServiceHelper.
|
---|
| 2197 | */
|
---|
| 2198 | @Test
|
---|
| 2199 | public void testGetAllConnectionInfoEndpointSetByServiceName()
|
---|
| 2200 | {
|
---|
| 2201 | System.out.println("getAllConnectionInfoEndpointSetByServiceName");
|
---|
| 2202 | GetAllConnectionInfoEndpointSetByServiceNameRequestType part1 = new GetAllConnectionInfoEndpointSetByServiceNameRequestType();
|
---|
| 2203 | part1.setServiceName("UnitTestServiceName_5_1");
|
---|
| 2204 | ConnectionInfoEndpointsType oConnInfoEndpoints = CMServiceHelper.getAllConnectionInfoEndpointSetByServiceName(part1);
|
---|
| 2205 | assertNotNull(oConnInfoEndpoints);
|
---|
| 2206 | assertNotNull(oConnInfoEndpoints.getConnectionInfoEndpoint());
|
---|
| 2207 | assertEquals(1, oConnInfoEndpoints.getConnectionInfoEndpoint().size());
|
---|
| 2208 | validateConnectionInfoEndpoint_2222_2222_2222_2222(oConnInfoEndpoints.getConnectionInfoEndpoint().get(0), "UnitTestServiceName_5_1");
|
---|
| 2209 |
|
---|
| 2210 | part1.setServiceName("UnitTestServiceName_1_2");
|
---|
| 2211 | oConnInfoEndpoints = CMServiceHelper.getAllConnectionInfoEndpointSetByServiceName(part1);
|
---|
| 2212 | assertNotNull(oConnInfoEndpoints);
|
---|
| 2213 | assertNotNull(oConnInfoEndpoints.getConnectionInfoEndpoint());
|
---|
| 2214 | assertEquals(1, oConnInfoEndpoints.getConnectionInfoEndpoint().size());
|
---|
| 2215 | validateConnectionInfoEndpoint_1111_1111_1111_1111__1(oConnInfoEndpoints.getConnectionInfoEndpoint().get(0), "UnitTestServiceName_1_2");
|
---|
| 2216 | }
|
---|
| 2217 |
|
---|
| 2218 | /**
|
---|
| 2219 | * Test of getAllBusinessEntitySetByServiceName method, of class CMServiceHelper.
|
---|
| 2220 | */
|
---|
| 2221 | @Test
|
---|
| 2222 | public void testGetAllBusinessEntitySetByServiceName()
|
---|
| 2223 | {
|
---|
| 2224 | System.out.println("getAllBusinessEntitySetByServiceName");
|
---|
| 2225 | GetAllBusinessEntitySetByServiceNameRequestType part1 = new GetAllBusinessEntitySetByServiceNameRequestType();
|
---|
| 2226 | part1.setServiceName("UnitTestServiceName_5_1");
|
---|
| 2227 | BusinessEntitiesType oEntities = CMServiceHelper.getAllBusinessEntitySetByServiceName(part1);
|
---|
| 2228 | assertNotNull(oEntities);
|
---|
| 2229 | assertNotNull(oEntities.getBusinessEntity());
|
---|
| 2230 | assertEquals(1, oEntities.getBusinessEntity().size());
|
---|
| 2231 | validateEntity_2222_2222_2222_2222(oEntities.getBusinessEntity().get(0), "UnitTestServiceName_5_1");
|
---|
| 2232 |
|
---|
| 2233 | part1.setServiceName("UnitTestServiceName_1_2");
|
---|
| 2234 | oEntities = CMServiceHelper.getAllBusinessEntitySetByServiceName(part1);
|
---|
| 2235 | assertNotNull(oEntities);
|
---|
| 2236 | assertNotNull(oEntities.getBusinessEntity());
|
---|
| 2237 | assertEquals(1, oEntities.getBusinessEntity().size());
|
---|
| 2238 | validateEntity_1111_1111_1111_1111__1(oEntities.getBusinessEntity().get(0), "UnitTestServiceName_1_2");
|
---|
| 2239 | }
|
---|
| 2240 |
|
---|
| 2241 | /**
|
---|
| 2242 | * Test of forceRefreshUDDICache method, of class CMServiceHelper.
|
---|
| 2243 | */
|
---|
| 2244 | @Test
|
---|
| 2245 | public void testForceRefreshUDDICache()
|
---|
| 2246 | {
|
---|
| 2247 | // This now hits the UDDI server. I am not sure we want this to be a unit test.
|
---|
| 2248 | // It is really an integration test - so I am commenting it out.
|
---|
| 2249 | //----------------------------------------------------------------------------------
|
---|
| 2250 |
|
---|
| 2251 | // System.out.println("forceRefreshUDDICache");
|
---|
| 2252 | // ForceRefreshUDDICacheRequestType part1 = new ForceRefreshUDDICacheRequestType();
|
---|
| 2253 | // SuccessOrFailType oResult = CMServiceHelper.forceRefreshUDDICache(part1);
|
---|
| 2254 | // assertTrue(oResult.isSuccess());
|
---|
| 2255 | }
|
---|
| 2256 |
|
---|
| 2257 | /**
|
---|
| 2258 | * Test of forceRefreshInternalConnectCache method, of class CMServiceHelper.
|
---|
| 2259 | */
|
---|
| 2260 | @Test
|
---|
| 2261 | public void testForceRefreshInternalConnectCache()
|
---|
| 2262 | {
|
---|
| 2263 | System.out.println("forceRefreshInternalConnectCache");
|
---|
| 2264 | ForceRefreshInternalConnectCacheRequestType part1 = new ForceRefreshInternalConnectCacheRequestType();
|
---|
| 2265 | SuccessOrFailType oResult = CMServiceHelper.forceRefreshInternalConnectCache(part1);
|
---|
| 2266 | assertTrue(oResult.isSuccess());
|
---|
| 2267 | }
|
---|
| 2268 |
|
---|
| 2269 | @Test
|
---|
| 2270 | public void testStoreAssigningAuthorityToHomeCommunityMapping(){
|
---|
| 2271 | // StoreAssigningAuthorityToHomeCommunityMappingRequestType storeMap = new StoreAssigningAuthorityToHomeCommunityMappingRequestType();
|
---|
| 2272 | // AssigningAuthorityType assingAuthTypeId = new AssigningAuthorityType();
|
---|
| 2273 | // HomeCommunityType hcType = new HomeCommunityType();
|
---|
| 2274 | // hcType.setHomeCommunityId("2.16.840.1.113883.3.200");
|
---|
| 2275 | // assingAuthTypeId.setAssigningAuthorityId("1.3");
|
---|
| 2276 | // storeMap.setAssigningAuthority(assingAuthTypeId);
|
---|
| 2277 | // storeMap.setHomeCommunity(hcType);
|
---|
| 2278 | // AcknowledgementType ack = CMServiceHelper.storeAssigningAuthorityToHomeCommunityMapping(storeMap);
|
---|
| 2279 | // System.out.println("Acknowledgement message -> "+ack.getMessage());
|
---|
| 2280 | // assertNotNull(ack.getMessage());
|
---|
| 2281 | }
|
---|
| 2282 |
|
---|
| 2283 | @Test
|
---|
| 2284 | public void testFormatHomeCommunityId()
|
---|
| 2285 | {
|
---|
| 2286 | String formattedHomeCommunityId = CMTransform.formatHomeCommunityId("urn:id:2.16.840.1.113883.3.200");
|
---|
| 2287 | System.out.println("Formatted Home Community Id->"+formattedHomeCommunityId);
|
---|
| 2288 | assertNotNull(formattedHomeCommunityId);
|
---|
| 2289 | assertEquals(formattedHomeCommunityId, "2.16.840.1.113883.3.200");
|
---|
| 2290 | formattedHomeCommunityId = CMTransform.formatHomeCommunityId("1111.1111.1111.1111.2");
|
---|
| 2291 | System.out.println("Home Community Not required to format just return the same value as input ->"+formattedHomeCommunityId);
|
---|
| 2292 | assertEquals(formattedHomeCommunityId, "1111.1111.1111.1111.2");
|
---|
| 2293 | }
|
---|
| 2294 |
|
---|
| 2295 | @Test
|
---|
| 2296 | public void testGetAssigningAuthoritiesByHomeCommunity()
|
---|
| 2297 | {
|
---|
| 2298 | GetAssigningAuthoritiesByHomeCommunityRequestType request = new GetAssigningAuthoritiesByHomeCommunityRequestType();
|
---|
| 2299 | HomeCommunityType hcType = new HomeCommunityType();
|
---|
| 2300 | hcType.setHomeCommunityId("1.2.3.4.55.500");
|
---|
| 2301 | request.setHomeCommunity(hcType);
|
---|
| 2302 | GetAssigningAuthoritiesByHomeCommunityResponseType response = CMServiceHelper.getAssigningAuthoritiesByHomeCommunity(request);
|
---|
| 2303 | List<AssigningAuthorityType> assingList = response.getAssigningAuthoritiesId().getAssigningAuthority();
|
---|
| 2304 | //assertNotNull(assingList);
|
---|
| 2305 | //assertTrue(assingList.size()==2);
|
---|
| 2306 | }
|
---|
| 2307 | }
|
---|