LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2012 Google Inc. All Rights Reserved. | 1 // Copyright 2012 Google Inc. All Rights Reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 .setPermitGroups(groups("chinese1 Members", "chinese1 Owners", | 484 .setPermitGroups(groups("chinese1 Members", "chinese1 Owners", |
485 "chinese1 Visitors", "GDC-PSL\\group")).build(), | 485 "chinese1 Visitors", "GDC-PSL\\group")).build(), |
486 response.getAcl()); | 486 response.getAcl()); |
487 } | 487 } |
488 | 488 |
489 @Test | 489 @Test |
490 public void testGetDocContentSiteCollectionWithClaims() throws Exception { | 490 public void testGetDocContentSiteCollectionWithClaims() throws Exception { |
491 String permissions = "<permission memberid='11' mask='756052856929' />" | 491 String permissions = "<permission memberid='11' mask='756052856929' />" |
492 + "<permission memberid='12' mask='756052856929' />" | 492 + "<permission memberid='12' mask='756052856929' />" |
493 + "<permission memberid='13' mask='756052856929' />" | 493 + "<permission memberid='13' mask='756052856929' />" |
494 + "<permission memberid='14' mask='756052856929' /></permissions>"; | 494 + "<permission memberid='14' mask='756052856929' />" |
| 495 + "<permission memberid='15' mask='756052856929' />"········ |
| 496 + "<permission memberid='19' mask='756052856929' /></permissions>"; |
495 SoapFactory siteDataFactory = MockSoapFactory.blank() | 497 SoapFactory siteDataFactory = MockSoapFactory.blank() |
496 .endpoint(AUTH_ENDPOINT, new MockAuthenticationSoap()) | 498 .endpoint(AUTH_ENDPOINT, new MockAuthenticationSoap()) |
497 .endpoint(VS_ENDPOINT, MockSiteData.blank() | 499 .endpoint(VS_ENDPOINT, MockSiteData.blank() |
498 .register(VS_CONTENT_EXCHANGE) | 500 .register(VS_CONTENT_EXCHANGE) |
499 .register(SITES_SITECOLLECTION_SAW_EXCHANGE)) | 501 .register(SITES_SITECOLLECTION_SAW_EXCHANGE)) |
500 .endpoint(SITES_SITECOLLECTION_ENDPOINT, MockSiteData.blank() | 502 .endpoint(SITES_SITECOLLECTION_ENDPOINT, MockSiteData.blank() |
501 .register(SITES_SITECOLLECTION_URLSEG_EXCHANGE) | 503 .register(SITES_SITECOLLECTION_URLSEG_EXCHANGE) |
502 .register(SITES_SITECOLLECTION_S_CONTENT_EXCHANGE | 504 .register(SITES_SITECOLLECTION_S_CONTENT_EXCHANGE |
503 .replaceInContent("</permissions>", permissions)) | 505 .replaceInContent("</permissions>", permissions)) |
504 .register(SITES_SITECOLLECTION_SC_CONTENT_EXCHANGE | 506 .register(SITES_SITECOLLECTION_SC_CONTENT_EXCHANGE |
505 .replaceInContent("</permissions>", permissions))); | 507 .replaceInContent("</permissions>", permissions))); |
506 | 508 |
507 ···· | 509 ···· |
508 adaptor = new SharePointAdaptor(siteDataFactory, | 510 adaptor = new SharePointAdaptor(siteDataFactory, |
509 new UnsupportedHttpClient(), executorFactory); | 511 new UnsupportedHttpClient(), executorFactory); |
510 adaptor.init(new MockAdaptorContext(config, pusher)); | 512 adaptor.init(new MockAdaptorContext(config, pusher)); |
511 ByteArrayOutputStream baos = new ByteArrayOutputStream(); | 513 ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
512 GetContentsRequest request = new GetContentsRequest( | 514 GetContentsRequest request = new GetContentsRequest( |
513 new DocId("http://localhost:1/sites/SiteCollection")); | 515 new DocId("http://localhost:1/sites/SiteCollection")); |
514 GetContentsResponse response = new GetContentsResponse(baos); | 516 GetContentsResponse response = new GetContentsResponse(baos); |
515 adaptor.getDocContent(request, response); | 517 adaptor.getDocContent(request, response); |
516 assertEquals(new Acl.Builder() | 518 assertEquals(new Acl.Builder() |
517 .setEverythingCaseInsensitive() | 519 .setEverythingCaseInsensitive() |
518 .setInheritFrom(new DocId("")) | 520 .setInheritFrom(new DocId("")) |
519 .setInheritanceType(Acl.InheritanceType.PARENT_OVERRIDES) | 521 .setInheritanceType(Acl.InheritanceType.PARENT_OVERRIDES) |
520 .setPermitUsers(users("GDC-PSL\\spuser1", "GSA-CONNECTORS\\User1")) | 522 .setPermitUsers(users("GDC-PSL\\spuser1", "GSA-CONNECTORS\\User1", |
| 523 "membershipprovider:user2007")) |
521 .setPermitGroups(groups("chinese1 Members", "chinese1 Owners", | 524 .setPermitGroups(groups("chinese1 Members", "chinese1 Owners", |
522 "chinese1 Visitors", "GSA-CONNECTORS\\domain users", | 525 "chinese1 Visitors", "GSA-CONNECTORS\\domain users", |
523 "Everyone", "NT AUTHORITY\\authenticated users")).build(), | 526 "Everyone", "NT AUTHORITY\\authenticated users", |
| 527 "roleprovider:super")).build(), |
524 response.getAcl()); | 528 response.getAcl()); |
525 } | 529 } |
526 | 530 |
527 @Test | 531 @Test |
528 public void testGetDocContentSiteCollectionWithOutOfDateMemberCache() | 532 public void testGetDocContentSiteCollectionWithOutOfDateMemberCache() |
529 throws Exception { | 533 throws Exception { |
530 ReferenceSiteData siteData = new ReferenceSiteData(); | 534 ReferenceSiteData siteData = new ReferenceSiteData(); |
531 SoapFactory siteDataFactory = MockSoapFactory.blank() | 535 SoapFactory siteDataFactory = MockSoapFactory.blank() |
532 .endpoint(AUTH_ENDPOINT, new MockAuthenticationSoap()) | 536 .endpoint(AUTH_ENDPOINT, new MockAuthenticationSoap()) |
533 .endpoint(VS_ENDPOINT, MockSiteData.blank() | 537 .endpoint(VS_ENDPOINT, MockSiteData.blank() |
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2120 | 2124 |
2121 public SiteAndWebExchange(String strUrl, long getSiteAndWebResult, | 2125 public SiteAndWebExchange(String strUrl, long getSiteAndWebResult, |
2122 String strSite, String strWeb) { | 2126 String strSite, String strWeb) { |
2123 this.strUrl = strUrl; | 2127 this.strUrl = strUrl; |
2124 this.getSiteAndWebResult = getSiteAndWebResult; | 2128 this.getSiteAndWebResult = getSiteAndWebResult; |
2125 this.strSite = strSite; | 2129 this.strSite = strSite; |
2126 this.strWeb = strWeb; | 2130 this.strWeb = strWeb; |
2127 } | 2131 } |
2128 } | 2132 } |
2129 } | 2133 } |
LEFT | RIGHT |