當前位置: 首頁>>代碼示例>>Java>>正文


Java Sets類代碼示例

本文整理匯總了Java中org.mockito.internal.util.collections.Sets的典型用法代碼示例。如果您正苦於以下問題:Java Sets類的具體用法?Java Sets怎麽用?Java Sets使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Sets類屬於org.mockito.internal.util.collections包,在下文中一共展示了Sets類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getPersonalNamespaces_withForceListAll

import org.mockito.internal.util.collections.Sets; //導入依賴的package包/類
@Test
public void getPersonalNamespaces_withForceListAll() throws Exception {
    when(storeConfig.subscribedFoldersOnly()).thenReturn(true);
    ImapConnection imapConnection = mock(ImapConnection.class);
    List<ImapResponse> imapResponses = Arrays.asList(
            createImapResponse("* LIST (\\HasNoChildren) \".\" \"INBOX\""),
            createImapResponse("* LIST (\\Noselect \\HasChildren) \".\" \"Folder\""),
            createImapResponse("* LIST (\\HasNoChildren) \".\" \"Folder.SubFolder\""),
            createImapResponse("6 OK Success")
    );
    when(imapConnection.executeSimpleCommand("LIST \"\" \"*\"")).thenReturn(imapResponses);
    imapStore.enqueueImapConnection(imapConnection);

    List<? extends Folder> result = imapStore.getFolders(true);

    assertNotNull(result);
    assertEquals(Sets.newSet("INBOX", "Folder.SubFolder"), extractFolderIds(result));
}
 
開發者ID:philipwhiuk,項目名稱:q-mail,代碼行數:19,代碼來源:ImapStoreTest.java

示例2: getPersonalNamespaces_withPathPrefix

import org.mockito.internal.util.collections.Sets; //導入依賴的package包/類
@Test
public void getPersonalNamespaces_withPathPrefix() throws Exception {
    when(storeConfig.getStoreUri()).thenReturn("imap://user:[email protected]/0%7CpathPrefix/");
    imapStore = new TestImapStore(storeConfig, trustedSocketFactory, connectivityManager, oauth2TokenProvider);

    ImapConnection imapConnection = mock(ImapConnection.class);
    List<ImapResponse> imapResponses = Arrays.asList(
            createImapResponse("* LIST (\\HasNoChildren) \".\" \"pathPrefix/INBOX\""),
            createImapResponse("* LIST (\\Noselect \\HasChildren) \".\" \"pathPrefix/.Folder\""),
            createImapResponse("* LIST (\\HasNoChildren) \".\" \"pathPrefix/.Folder.SubFolder\""),
            createImapResponse("6 OK Success")
    );
    when(imapConnection.executeSimpleCommand("LIST \"\" \"pathPrefix/*\"")).thenReturn(imapResponses);
    imapStore.enqueueImapConnection(imapConnection);

    List<? extends Folder> result = imapStore.getFolders(true);

    assertNotNull(result);
    assertEquals(Sets.newSet("INBOX", "Folder.SubFolder"), extractFolderIds(result));
}
 
開發者ID:philipwhiuk,項目名稱:q-mail,代碼行數:21,代碼來源:ImapStoreTest.java

示例3: getPersonalNamespaces_withoutForceListAllAndWithoutSubscribedFoldersOnly

import org.mockito.internal.util.collections.Sets; //導入依賴的package包/類
@Test
public void getPersonalNamespaces_withoutForceListAllAndWithoutSubscribedFoldersOnly() throws Exception {
    when(storeConfig.subscribedFoldersOnly()).thenReturn(false);
    ImapConnection imapConnection = mock(ImapConnection.class);
    List<ImapResponse> imapResponses = Arrays.asList(
            createImapResponse("* LIST (\\HasNoChildren) \".\" \"INBOX\""),
            createImapResponse("* LIST (\\Noselect \\HasChildren) \".\" \"Folder\""),
            createImapResponse("* LIST (\\HasNoChildren) \".\" \"Folder.SubFolder\""),
            createImapResponse("6 OK Success")
    );
    when(imapConnection.executeSimpleCommand("LIST \"\" \"*\"")).thenReturn(imapResponses);
    imapStore.enqueueImapConnection(imapConnection);

    List<? extends Folder> result = imapStore.getFolders(false);

    assertNotNull(result);
    assertEquals(Sets.newSet("INBOX", "Folder.SubFolder"), extractFolderIds(result));
}
 
開發者ID:philipwhiuk,項目名稱:q-mail,代碼行數:19,代碼來源:ImapStoreTest.java

示例4: testVariousPartitionSizes

import org.mockito.internal.util.collections.Sets; //導入依賴的package包/類
public void testVariousPartitionSizes() throws Exception {
    for (int shards = 1; shards <= 4; shards++) {
        for (int partitionSize = 1; partitionSize < shards; partitionSize++) {
            String index = "index_" + shards + "_" + partitionSize;

            client().admin().indices().prepareCreate(index)
                .setSettings(Settings.builder()
                    .put("index.number_of_shards", shards)
                    .put("index.routing_partition_size", partitionSize))
                .addMapping("type", "{\"type\":{\"_routing\":{\"required\":true}}}", XContentType.JSON)
                .execute().actionGet();
            ensureGreen();

            Map<String, Set<String>> routingToDocumentIds = generateRoutedDocumentIds(index);

            verifyGets(index, routingToDocumentIds);
            verifyBroadSearches(index, routingToDocumentIds, shards);
            verifyRoutedSearches(index, routingToDocumentIds, Sets.newSet(partitionSize));
        }
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:22,代碼來源:PartitionedRoutingIT.java

示例5: testParse_tutorCorrectlyFormed

import org.mockito.internal.util.collections.Sets; //導入依賴的package包/類
@Test
public void testParse_tutorCorrectlyFormed() {
    JsonObject mockObject = formMockJson();
    ParsedULCResponse response = DataParse.parse(mockObject);

    // Verify correctly formed Tutor
    Tutor tutor = response.getTutors().get(0);
    assertThat(tutor.getId(), is(4850785));
    assertThat(tutor.getFirstName(), is("Luke"));
    assertThat(tutor.getLastName(), is("Skywalker"));

    assertThat(tutor.getTutorPreferences().getCoursePreferences().get(Rank.PREFER).stream().map(Course::getId).collect(Collectors.toSet()),
            is(Sets.newSet(11995, 11996)));
    assertThat(tutor.getTutorPreferences().getCoursePreferences().get(Rank.WILLING).stream().map(Course::getId).collect(Collectors.toSet()),
            is(Sets.newSet(2749, 2750, 11991, 15599, 15600, 15602, 15606)));

    assertThat(tutor.getTutorPreferences().getShiftPreferences().get(Rank.PREFER).stream().map(Shift::getId).collect(Collectors.toSet()),
            is(Sets.newSet(5)));
    assertThat(tutor.getTutorPreferences().getShiftPreferences().get(Rank.WILLING).stream().map(Shift::getId).collect(Collectors.toSet()),
            is(Sets.newSet(1, 2)));

    assertThat(tutor.getTutorPreferences().getShiftFrequencyPreferences().get(Rank.PREFER), is(1));
    assertThat(tutor.getTutorPreferences().getShiftFrequencyPreferences().get(Rank.WILLING), is(3));

    assertThat(tutor.getTutorStatus(), is(TutorStatus.ACTIVE));
}
 
開發者ID:cocolocomoco21,項目名稱:ULCRS,代碼行數:27,代碼來源:DataParseTest.java

示例6: testAssertConsentDto_Fail_With_To_Ind_To_Org_From_Ind_From_Org

import org.mockito.internal.util.collections.Sets; //導入依賴的package包/類
@Test
public void testAssertConsentDto_Fail_With_To_Ind_To_Org_From_Ind_From_Org() {
    thrown.expect(IllegalArgumentException.class);
    // To Org
    Set<String> mockOrganizationalProvidersDisclosureIsMadeTo = Sets
            .newSet("mockOrganizationalProvidersDisclosureIsMadeTo");
    // To Ind
    Set<String> mockProvidersDisclosureIsMadeTo = Sets
            .newSet("mockProvidersDisclosureIsMadeTo");
    // From Org
    Set<String> mockOrganizationalProvidersPermittedToDisclose = Sets
            .newSet("mockOrganizationalProvidersPermittedToDisclose");
    // From Ind
    Set<String> mockProvidersPermittedToDisclose = Sets
            .newSet("mockProvidersPermittedToDisclose");
    ConsentDto mockConsentDto = new ConsentDto();
    mockConsentDto
            .setOrganizationalProvidersDisclosureIsMadeTo(mockOrganizationalProvidersDisclosureIsMadeTo);
    mockConsentDto
            .setProvidersDisclosureIsMadeTo(mockProvidersDisclosureIsMadeTo);
    mockConsentDto
            .setOrganizationalProvidersPermittedToDisclose(mockOrganizationalProvidersPermittedToDisclose);
    mockConsentDto
            .setProvidersPermittedToDisclose(mockProvidersPermittedToDisclose);
    sut.assertConsentDto(mockConsentDto);
}
 
開發者ID:bhits,項目名稱:pcm-api,代碼行數:27,代碼來源:ConsentOneToOneAssertionTest.java

示例7: testAssertConsentDto_Fail_With_To_Org_From_Ind_From_Org

import org.mockito.internal.util.collections.Sets; //導入依賴的package包/類
@Test
public void testAssertConsentDto_Fail_With_To_Org_From_Ind_From_Org() {
    thrown.expect(IllegalArgumentException.class);
    // To Org
    Set<String> mockOrganizationalProvidersDisclosureIsMadeTo = Sets
            .newSet("mockOrganizationalProvidersDisclosureIsMadeTo");
    // From Org
    Set<String> mockOrganizationalProvidersPermittedToDisclose = Sets
            .newSet("mockOrganizationalProvidersPermittedToDisclose");
    // From Ind
    Set<String> mockProvidersPermittedToDisclose = Sets
            .newSet("mockProvidersPermittedToDisclose");
    ConsentDto mockConsentDto = new ConsentDto();
    mockConsentDto
            .setOrganizationalProvidersDisclosureIsMadeTo(mockOrganizationalProvidersDisclosureIsMadeTo);
    mockConsentDto
            .setOrganizationalProvidersPermittedToDisclose(mockOrganizationalProvidersPermittedToDisclose);
    mockConsentDto
            .setProvidersPermittedToDisclose(mockProvidersPermittedToDisclose);
    sut.assertConsentDto(mockConsentDto);
}
 
開發者ID:bhits,項目名稱:pcm-api,代碼行數:22,代碼來源:ConsentOneToOneAssertionTest.java

示例8: testAssertConsentDto_Fail_With_To_Ind_From_Ind_From_Org

import org.mockito.internal.util.collections.Sets; //導入依賴的package包/類
@Test
public void testAssertConsentDto_Fail_With_To_Ind_From_Ind_From_Org() {
    thrown.expect(IllegalArgumentException.class);
    // To Ind
    Set<String> mockProvidersDisclosureIsMadeTo = Sets
            .newSet("mockProvidersDisclosureIsMadeTo");
    // From Org
    Set<String> mockOrganizationalProvidersPermittedToDisclose = Sets
            .newSet("mockOrganizationalProvidersPermittedToDisclose");
    // From Ind
    Set<String> mockProvidersPermittedToDisclose = Sets
            .newSet("mockProvidersPermittedToDisclose");
    ConsentDto mockConsentDto = new ConsentDto();
    mockConsentDto
            .setProvidersDisclosureIsMadeTo(mockProvidersDisclosureIsMadeTo);
    mockConsentDto
            .setOrganizationalProvidersPermittedToDisclose(mockOrganizationalProvidersPermittedToDisclose);
    mockConsentDto
            .setProvidersPermittedToDisclose(mockProvidersPermittedToDisclose);
    sut.assertConsentDto(mockConsentDto);
}
 
開發者ID:bhits,項目名稱:pcm-api,代碼行數:22,代碼來源:ConsentOneToOneAssertionTest.java

示例9: testAssertConsentDto_Fail_With_To_Ind_To_Org_From_Org

import org.mockito.internal.util.collections.Sets; //導入依賴的package包/類
@Test
public void testAssertConsentDto_Fail_With_To_Ind_To_Org_From_Org() {
    thrown.expect(IllegalArgumentException.class);
    // To Org
    Set<String> mockOrganizationalProvidersDisclosureIsMadeTo = Sets
            .newSet("mockOrganizationalProvidersDisclosureIsMadeTo");
    // To Ind
    Set<String> mockProvidersDisclosureIsMadeTo = Sets
            .newSet("mockProvidersDisclosureIsMadeTo");
    // From Org
    Set<String> mockOrganizationalProvidersPermittedToDisclose = Sets
            .newSet("mockOrganizationalProvidersPermittedToDisclose");
    ConsentDto mockConsentDto = new ConsentDto();
    mockConsentDto
            .setOrganizationalProvidersDisclosureIsMadeTo(mockOrganizationalProvidersDisclosureIsMadeTo);
    mockConsentDto
            .setProvidersDisclosureIsMadeTo(mockProvidersDisclosureIsMadeTo);
    mockConsentDto
            .setOrganizationalProvidersPermittedToDisclose(mockOrganizationalProvidersPermittedToDisclose);
    sut.assertConsentDto(mockConsentDto);
}
 
開發者ID:bhits,項目名稱:pcm-api,代碼行數:22,代碼來源:ConsentOneToOneAssertionTest.java

示例10: testAssertConsentDto_Fail_With_To_Ind_To_Org_From_Ind

import org.mockito.internal.util.collections.Sets; //導入依賴的package包/類
@Test
public void testAssertConsentDto_Fail_With_To_Ind_To_Org_From_Ind() {
    thrown.expect(IllegalArgumentException.class);
    // To Org
    Set<String> mockOrganizationalProvidersDisclosureIsMadeTo = Sets
            .newSet("mockOrganizationalProvidersDisclosureIsMadeTo");
    // To Ind
    Set<String> mockProvidersDisclosureIsMadeTo = Sets
            .newSet("mockProvidersDisclosureIsMadeTo");
    // From Ind
    Set<String> mockProvidersPermittedToDisclose = Sets
            .newSet("mockProvidersPermittedToDisclose");
    ConsentDto mockConsentDto = new ConsentDto();
    mockConsentDto
            .setOrganizationalProvidersDisclosureIsMadeTo(mockOrganizationalProvidersDisclosureIsMadeTo);
    mockConsentDto
            .setProvidersDisclosureIsMadeTo(mockProvidersDisclosureIsMadeTo);
    mockConsentDto
            .setProvidersPermittedToDisclose(mockProvidersPermittedToDisclose);
    sut.assertConsentDto(mockConsentDto);
}
 
開發者ID:bhits,項目名稱:pcm-api,代碼行數:22,代碼來源:ConsentOneToOneAssertionTest.java

示例11: testAssertConsentDto_Success_With_To_Ind_From_Org

import org.mockito.internal.util.collections.Sets; //導入依賴的package包/類
@Test
public void testAssertConsentDto_Success_With_To_Ind_From_Org() {
    // To Ind
    Set<String> mockProvidersDisclosureIsMadeTo = Sets
            .newSet("mockProvidersDisclosureIsMadeTo");
    // From Org
    Set<String> mockOrganizationalProvidersPermittedToDisclose = Sets
            .newSet("mockOrganizationalProvidersPermittedToDisclose");
    ConsentDto mockConsentDto = new ConsentDto();

    mockConsentDto
            .setProvidersDisclosureIsMadeTo(mockProvidersDisclosureIsMadeTo);
    mockConsentDto
            .setOrganizationalProvidersPermittedToDisclose(mockOrganizationalProvidersPermittedToDisclose);
    sut.assertConsentDto(mockConsentDto);
}
 
開發者ID:bhits,項目名稱:pcm-api,代碼行數:17,代碼來源:ConsentOneToOneAssertionTest.java

示例12: testAssertConsentDto_Success_With_To_Org_From_Org

import org.mockito.internal.util.collections.Sets; //導入依賴的package包/類
@Test
public void testAssertConsentDto_Success_With_To_Org_From_Org() {
    // To Org
    Set<String> mockOrganizationalProvidersDisclosureIsMadeTo = Sets
            .newSet("mockOrganizationalProvidersDisclosureIsMadeTo");
    // From Org
    Set<String> mockOrganizationalProvidersPermittedToDisclose = Sets
            .newSet("mockOrganizationalProvidersPermittedToDisclose");
    ConsentDto mockConsentDto = new ConsentDto();
    mockConsentDto
            .setOrganizationalProvidersDisclosureIsMadeTo(mockOrganizationalProvidersDisclosureIsMadeTo);

    mockConsentDto
            .setOrganizationalProvidersPermittedToDisclose(mockOrganizationalProvidersPermittedToDisclose);
    sut.assertConsentDto(mockConsentDto);
}
 
開發者ID:bhits,項目名稱:pcm-api,代碼行數:17,代碼來源:ConsentOneToOneAssertionTest.java

示例13: testAssertConsentDto_Success_With_To_Ind_From_Ind

import org.mockito.internal.util.collections.Sets; //導入依賴的package包/類
@Test
public void testAssertConsentDto_Success_With_To_Ind_From_Ind() {
    // To Ind
    Set<String> mockProvidersDisclosureIsMadeTo = Sets
            .newSet("mockProvidersDisclosureIsMadeTo");

    // From Ind
    Set<String> mockProvidersPermittedToDisclose = Sets
            .newSet("mockProvidersPermittedToDisclose");
    ConsentDto mockConsentDto = new ConsentDto();
    mockConsentDto
            .setProvidersDisclosureIsMadeTo(mockProvidersDisclosureIsMadeTo);
    mockConsentDto
            .setProvidersPermittedToDisclose(mockProvidersPermittedToDisclose);
    sut.assertConsentDto(mockConsentDto);
}
 
開發者ID:bhits,項目名稱:pcm-api,代碼行數:17,代碼來源:ConsentOneToOneAssertionTest.java

示例14: getPersonalNamespaces_withForceListAll

import org.mockito.internal.util.collections.Sets; //導入依賴的package包/類
@Test
public void getPersonalNamespaces_withForceListAll() throws Exception {
    when(storeConfig.subscribedFoldersOnly()).thenReturn(true);
    ImapConnection imapConnection = mock(ImapConnection.class);
    List<ImapResponse> imapResponses = Arrays.asList(
            createImapResponse("* LIST (\\HasNoChildren) \".\" \"INBOX\""),
            createImapResponse("* LIST (\\Noselect \\HasChildren) \".\" \"Folder\""),
            createImapResponse("* LIST (\\HasNoChildren) \".\" \"Folder.SubFolder\""),
            createImapResponse("6 OK Success")
    );
    when(imapConnection.executeSimpleCommand("LIST \"\" \"*\"")).thenReturn(imapResponses);
    imapStore.enqueueImapConnection(imapConnection);

    List<? extends Folder> result = imapStore.getPersonalNamespaces(true);

    assertNotNull(result);
    assertEquals(Sets.newSet("INBOX", "Folder.SubFolder"), extractFolderNames(result));
}
 
開發者ID:scoute-dich,項目名稱:K9-MailClient,代碼行數:19,代碼來源:ImapStoreTest.java

示例15: getPersonalNamespaces_withoutForceListAllAndWithoutSubscribedFoldersOnly

import org.mockito.internal.util.collections.Sets; //導入依賴的package包/類
@Test
public void getPersonalNamespaces_withoutForceListAllAndWithoutSubscribedFoldersOnly() throws Exception {
    when(storeConfig.subscribedFoldersOnly()).thenReturn(false);
    ImapConnection imapConnection = mock(ImapConnection.class);
    List<ImapResponse> imapResponses = Arrays.asList(
            createImapResponse("* LIST (\\HasNoChildren) \".\" \"INBOX\""),
            createImapResponse("* LIST (\\Noselect \\HasChildren) \".\" \"Folder\""),
            createImapResponse("* LIST (\\HasNoChildren) \".\" \"Folder.SubFolder\""),
            createImapResponse("6 OK Success")
    );
    when(imapConnection.executeSimpleCommand("LIST \"\" \"*\"")).thenReturn(imapResponses);
    imapStore.enqueueImapConnection(imapConnection);

    List<? extends Folder> result = imapStore.getPersonalNamespaces(false);

    assertNotNull(result);
    assertEquals(Sets.newSet("INBOX", "Folder.SubFolder"), extractFolderNames(result));
}
 
開發者ID:scoute-dich,項目名稱:K9-MailClient,代碼行數:19,代碼來源:ImapStoreTest.java


注:本文中的org.mockito.internal.util.collections.Sets類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。