org.hamcrest.core.AllOf Java Examples
The following examples show how to use
org.hamcrest.core.AllOf.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SetOfTest.java From cactoos with MIT License | 6 votes |
@Test public void behaveAsSetMergedCollectionsOfLiteralsWithDuplicates() { new Assertion<>( "Must keep unique string literals", new SetOf<String>( new Joined<String>( new IterableOf<>("cc", "ff"), new IterableOf<>("aa", "bb", "cc", "dd") ) ), new AllOf<>( new IterableOf<Matcher<? super SetOf<String>>>( new HasSize(5), new IsCollectionContaining<>(new IsEqual<>("aa")), new IsCollectionContaining<>(new IsEqual<>("bb")), new IsCollectionContaining<>(new IsEqual<>("cc")), new IsCollectionContaining<>(new IsEqual<>("dd")), new IsCollectionContaining<>(new IsEqual<>("ff")) ) ) ).affirm(); }
Example #2
Source File: RecyclerViewTests.java From zulip-android with Apache License 2.0 | 6 votes |
@Test public void sendStreamMessage() { //Wait to make sure the messages are loaded sleep(2000); onView(withId(R.id.recyclerView)).perform(RecyclerViewActions.scrollToHolder(withMessageHolderAndClick(MessageType.STREAM_MESSAGE, R.id.contentView))); sleep(1000); //Fill message EditText ViewInteraction messageInteraction = onView(allOf(withId(R.id.message_et), isDisplayed())); messageInteraction.perform(replaceText(testMessageStream)); //Click Send Button ViewInteraction imageView = onView(allOf(withId(R.id.send_btn), isDisplayed())); imageView.perform(click()); sleep(2000); //Scroll And check the new sent message onView(withId(R.id.recyclerView)).perform(RecyclerViewActions.scrollToHolder(withMessageHolder(testMessageStream, R.id.contentView))); onView(AllOf.allOf(withId(R.id.contentView), withText(testMessageStream))).check(matches(isDisplayed())); checkIfMessagesMatchTheHeaderParent(); checkOrderOfMessagesCurrentList(); }
Example #3
Source File: RecyclerViewTests.java From zulip-android with Apache License 2.0 | 6 votes |
@Test public void sendPrivateMessage() { //Wait to make sure the messages are loaded sleep(2000); onView(withId(R.id.recyclerView)).perform(RecyclerViewActions.scrollToHolder(withMessageHolderAndClick(MessageType.PRIVATE_MESSAGE, R.id.contentView))); sleep(1000); //Fill message EditText ViewInteraction messageInteraction = onView(allOf(withId(R.id.message_et), isDisplayed())); messageInteraction.perform(replaceText(testMessagePrivate)); //Click Send Button ViewInteraction imageView = onView(allOf(withId(R.id.send_btn), isDisplayed())); imageView.perform(click()); sleep(2000); //Scroll And check the new sent message onView(withId(R.id.recyclerView)).perform(RecyclerViewActions.scrollToHolder(withMessageHolder(testMessagePrivate, R.id.contentView))); onView(AllOf.allOf(withId(R.id.contentView), withText(testMessagePrivate))).check(matches(isDisplayed())); checkIfMessagesMatchTheHeaderParent(); checkOrderOfMessagesCurrentList(); }
Example #4
Source File: MultiGettingStarted.java From ehcache3 with Apache License 2.0 | 6 votes |
@Test public void multipleConfigurations() { //tag::multipleManagers[] XmlMultiConfiguration multipleConfiguration = XmlMultiConfiguration .from(getClass().getResource("/configs/docs/multi/multiple-managers.xml")) // <1> .build(); // <2> Configuration fooConfiguration = multipleConfiguration.configuration("foo-manager"); // <3> //end::multipleManagers[] Assert.assertThat(resourceMap(multipleConfiguration.identities().stream().collect( Collectors.toMap(Function.identity(), multipleConfiguration::configuration) )), AllOf.allOf( IsMapContaining.hasEntry(Is.is("foo-manager"), IsMapContaining.hasEntry(Is.is("foo"), IsIterableContainingInAnyOrder.containsInAnyOrder(ResourceType.Core.HEAP, ResourceType.Core.OFFHEAP))), IsMapContaining.hasEntry(Is.is("bar-manager"), IsMapContaining.hasEntry(Is.is("bar"), IsIterableContainingInAnyOrder.containsInAnyOrder(ResourceType.Core.HEAP, ResourceType.Core.OFFHEAP))) )); }
Example #5
Source File: MultiGettingStarted.java From ehcache3 with Apache License 2.0 | 6 votes |
@Test public void multipleVariants() { //tag::multipleVariants[] XmlMultiConfiguration variantConfiguration = XmlMultiConfiguration .from(getClass().getResource("/configs/docs/multi/multiple-variants.xml")) .build(); Configuration fooConfiguration = variantConfiguration.configuration("foo-manager", "offheap"); // <1> //end::multipleVariants[] Assert.assertThat(resourceMap(variantConfiguration.identities().stream().collect( Collectors.toMap(Function.identity(), i -> variantConfiguration.configuration(i, "offheap")) )), AllOf.allOf( IsMapContaining.hasEntry(Is.is("foo-manager"), IsMapContaining.hasEntry(Is.is("foo"), IsIterableContainingInAnyOrder.containsInAnyOrder(ResourceType.Core.HEAP, ResourceType.Core.OFFHEAP))), IsMapContaining.hasEntry(Is.is("bar-manager"), IsMapContaining.hasEntry(Is.is("bar"), IsIterableContainingInAnyOrder.containsInAnyOrder(ResourceType.Core.HEAP))) )); Assert.assertThat(resourceMap(variantConfiguration.identities().stream().collect( Collectors.toMap(Function.identity(), i -> variantConfiguration.configuration(i, "heap")) )), AllOf.allOf( IsMapContaining.hasEntry(Is.is("foo-manager"), IsMapContaining.hasEntry(Is.is("foo"), IsIterableContainingInAnyOrder.containsInAnyOrder(ResourceType.Core.HEAP))), IsMapContaining.hasEntry(Is.is("bar-manager"), IsMapContaining.hasEntry(Is.is("bar"), IsIterableContainingInAnyOrder.containsInAnyOrder(ResourceType.Core.HEAP))) )); }
Example #6
Source File: InputOfTest.java From cactoos with MIT License | 6 votes |
@Test public void readsEncodedArrayOfChars() throws Exception { new Assertion<>( "must read array of encoded chars.", new TextOf( new BytesOf( new InputOf( new char[]{ 'O', ' ', 'q', 'u', 'e', ' ', 's', 'e', 'r', 'a', ' ', 'q', 'u', 'e', ' ', 's', 'e', 'r', 'a', }, StandardCharsets.UTF_8 ) ), StandardCharsets.UTF_8 ), new AllOf<>( new IterableOf<>( new StartsWith("O que sera"), new EndsWith(" que sera") ) ) ).affirm(); }
Example #7
Source File: InputOfTest.java From cactoos with MIT License | 6 votes |
@Test public void readsArrayOfChars() throws Exception { new Assertion<>( "must read array of chars.", new TextOf( new BytesOf( new InputOf( 'H', 'o', 'l', 'd', ' ', 'i', 'n', 'f', 'i', 'n', 'i', 't', 'y' ) ) ), new AllOf<>( new IterableOf<>( new StartsWith("Hold "), new EndsWith("infinity") ) ) ).affirm(); }
Example #8
Source File: InputOfTest.java From cactoos with MIT License | 6 votes |
@Test public void readsStringBuffer() throws Exception { final String starts = "The future "; final String ends = "is now!"; new Assertion<>( "must receive a string buffer", new TextOf( new BytesOf( new InputOf( new StringBuffer(starts) .append(ends) ) ) ), new AllOf<>( new IterableOf<>( new StartsWith(starts), new EndsWith(ends) ) ) ).affirm(); }
Example #9
Source File: InputOfTest.java From cactoos with MIT License | 6 votes |
@Test public void readsStringBuilder() throws Exception { final String starts = "Name it, "; final String ends = "then it exists!"; new Assertion<>( "must receive a string builder", new TextOf( new BytesOf( new InputOf( new StringBuilder(starts) .append(ends) ) ) ), new AllOf<>( new IterableOf<>( new StartsWith(starts), new EndsWith(ends) ) ) ).affirm(); }
Example #10
Source File: InputOfTest.java From cactoos with MIT License | 6 votes |
@Test public void readsStringIntoBytes() throws Exception { new Assertion<>( "must read bytes from Input", new TextOf( new BytesOf( new InputOf("Hello, друг!") ), StandardCharsets.UTF_8 ), new AllOf<>( new IterableOf<>( new StartsWith("Hello, "), new EndsWith("друг!") ) ) ).affirm(); }
Example #11
Source File: InputAsBytesTest.java From cactoos with MIT License | 6 votes |
@Test public void readsInputIntoBytesWithSmallBuffer() throws Exception { new Assertion<>( "must read bytes from Input with a small reading buffer", new TextOf( new InputAsBytes( new InputOf( new BytesOf( new TextOf("Hello, товарищ!") ) ), 2 ), StandardCharsets.UTF_8 ), new AllOf<>( new IterableOf<>( new StartsWith("Hello,"), new EndsWith("товарищ!") ) ) ).affirm(); }
Example #12
Source File: InputAsBytesTest.java From cactoos with MIT License | 6 votes |
@Test public void readsInputIntoBytes() throws Exception { new Assertion<>( "must read bytes from Input", new TextOf( new InputAsBytes( new InputOf( new BytesOf( new TextOf("Hello, друг!") ) ) ), StandardCharsets.UTF_8 ), new AllOf<>( new IterableOf<>( new StartsWith("Hello, "), new EndsWith("друг!") ) ) ).affirm(); }
Example #13
Source File: SetOfTest.java From cactoos with MIT License | 6 votes |
@Test public void behaveAsSetWithOriginalDuplicationsOfTextsInTheMiddle() { new Assertion<>( "Must keep unique TextOf objects", new SetOf<>( new TextOf("12345"), new TextOf("67890"), new TextOf("12345"), new TextOf("00000") ), new AllOf<>( new IterableOf<Matcher<? super SetOf<TextOf>>>( new HasSize(3), new IsCollectionContaining<>( new IsEqual<>(new TextOf("12345")) ), new IsCollectionContaining<>( new IsEqual<>(new TextOf("67890")) ), new IsCollectionContaining<>( new IsEqual<>(new TextOf("00000")) ) ) ) ).affirm(); }
Example #14
Source File: MultiGettingStarted.java From ehcache3 with Apache License 2.0 | 6 votes |
@Test public void multipleRetrieval() { XmlMultiConfiguration multipleConfiguration = XmlMultiConfiguration .from(getClass().getResource("/configs/docs/multi/multiple-managers.xml")) .build(); XmlMultiConfiguration variantConfiguration = XmlMultiConfiguration .from(getClass().getResource("/configs/docs/multi/multiple-variants.xml")) .build(); //tag::multipleRetrieval[] Map<String, Configuration> allConfigurations = multipleConfiguration.identities().stream() // <1> .collect(Collectors.toMap(i -> i, i -> multipleConfiguration.configuration(i))); // <2> Map<String, Configuration> offheapConfigurations = variantConfiguration.identities().stream() .collect(Collectors.toMap(i -> i, i -> variantConfiguration.configuration(i, "offheap"))); // <3> //end::multipleRetrieval[] Assert.assertThat(resourceMap(allConfigurations), AllOf.allOf( IsMapContaining.hasEntry(Is.is("foo-manager"), IsMapContaining.hasEntry(Is.is("foo"), IsIterableContainingInAnyOrder.containsInAnyOrder(ResourceType.Core.HEAP, ResourceType.Core.OFFHEAP))), IsMapContaining.hasEntry(Is.is("bar-manager"), IsMapContaining.hasEntry(Is.is("bar"), IsIterableContainingInAnyOrder.containsInAnyOrder(ResourceType.Core.HEAP, ResourceType.Core.OFFHEAP))) )); Assert.assertThat(resourceMap(offheapConfigurations), AllOf.allOf( IsMapContaining.hasEntry(Is.is("foo-manager"), IsMapContaining.hasEntry(Is.is("foo"), IsIterableContainingInAnyOrder.containsInAnyOrder(ResourceType.Core.HEAP, ResourceType.Core.OFFHEAP))), IsMapContaining.hasEntry(Is.is("bar-manager"), IsMapContaining.hasEntry(Is.is("bar"), IsIterableContainingInAnyOrder.containsInAnyOrder(ResourceType.Core.HEAP))) )); }
Example #15
Source File: SetOfTest.java From cactoos with MIT License | 6 votes |
@Test public void behaveAsSetWithOriginalDuplicationsOfCharsInTheMiddle() { new Assertion<>( "Must keep unique characters", new SetOf<>('a', 'b', 'b', 'c', 'a', 'b', 'd'), new AllOf<>( new IterableOf<Matcher<? super SetOf<Character>>>( new HasSize(4), new IsCollectionContaining<>(new IsEqual<>('a')), new IsCollectionContaining<>(new IsEqual<>('b')), new IsCollectionContaining<>(new IsEqual<>('c')), new IsCollectionContaining<>(new IsEqual<>('d')) ) ) ).affirm(); }
Example #16
Source File: ResultsMatcherTest.java From lib-recur with Apache License 2.0 | 6 votes |
@Test public void test() throws Exception { assertThat(results(DateTime.parse("20180101"), 10), AllOf.<Matcher<RecurrenceRule>>allOf( matches(new RecurrenceRule("FREQ=DAILY;COUNT=10")), mismatches(new RecurrenceRule("FREQ=DAILY;COUNT=9"), "number of instances was <9>"), mismatches(new RecurrenceRule("FREQ=DAILY;COUNT=12"), "number of instances was <12>"), describesAs("number of instances is <10>") )); assertThat(results(DateTime.parse("20180101"), lessThan(20)), AllOf.<Matcher<RecurrenceRule>>allOf( matches(new RecurrenceRule("FREQ=DAILY;COUNT=1")), matches(new RecurrenceRule("FREQ=DAILY;COUNT=19")), mismatches(new RecurrenceRule("FREQ=DAILY;COUNT=20"), "number of instances <20> was equal to <20>"), mismatches(new RecurrenceRule("FREQ=DAILY;COUNT=21"), "number of instances <21> was greater than <20>"), describesAs("number of instances is a value less than <20>") )); }
Example #17
Source File: YearMatcherTest.java From lib-recur with Apache License 2.0 | 6 votes |
@Test public void test() throws Exception { assertThat(inYear(2018), AllOf.<Matcher<DateTime>>allOf( matches(DateTime.parse("20181001T010001Z")), mismatches(DateTime.parse("20210901T005959Z"), "year was <2021>"), mismatches(DateTime.parse("20171101T010000Z"), "year was <2017>"), describesAs("year (<2018>)") )); assertThat(inYear(2018, 2019, 2020), AllOf.<Matcher<DateTime>>allOf( matches(DateTime.parse("20181001T010001Z")), matches(DateTime.parse("20190801T010002Z")), matches(DateTime.parse("20200601T010003Z")), mismatches(DateTime.parse("20110501T005959Z"), "year was <2011>"), mismatches(DateTime.parse("20170701T005958Z"), "year was <2017>"), mismatches(DateTime.parse("20210901T005957Z"), "year was <2021>"), mismatches(DateTime.parse("20301101T010000Z"), "year was <2030>"), describesAs("year (<2018> or <2019> or <2020>)") )); }
Example #18
Source File: WeekDayMatcherTest.java From lib-recur with Apache License 2.0 | 6 votes |
@Test public void test() throws Exception { assertThat(onWeekDay(Weekday.WE), AllOf.<Matcher<DateTime>>allOf( matches(DateTime.parse("20180808T010001Z")), mismatches(DateTime.parse("20180809T005959Z"), "weekday was <TH>"), mismatches(DateTime.parse("20180807T010000Z"), "weekday was <TU>"), describesAs("weekday (<WE>)") )); assertThat(onWeekDay(Weekday.MO, Weekday.WE, Weekday.FR), AllOf.<Matcher<DateTime>>allOf( matches(DateTime.parse("20180808T010001Z")), matches(DateTime.parse("20180806T010002Z")), matches(DateTime.parse("20180810T010003Z")), mismatches(DateTime.parse("20180805T005959Z"), "weekday was <SU>"), mismatches(DateTime.parse("20180804T005958Z"), "weekday was <SA>"), mismatches(DateTime.parse("20180814T005957Z"), "weekday was <TU>"), mismatches(DateTime.parse("20180816T010000Z"), "weekday was <TH>"), describesAs("weekday (<MO> or <WE> or <FR>)") )); }
Example #19
Source File: SolidTest.java From cactoos with MIT License | 6 votes |
@Test @SuppressWarnings("unchecked") public void mapsIterableWithKeyFuncAndValueFunc() { final Solid<String, String> map = new Solid<>( key -> new Sub(new TextOf(key), 0, 1).asString(), value -> new Upper(new TextOf(value)).asString(), new IterableOf<>("aa", "bb") ); MatcherAssert.assertThat( "Functions are not applied to key and value", map, new AllOf<>( new IterableOf<>( new IsMapContaining<>( new IsEqual<>("a"), new IsEqual<>("AA") ), new IsMapContaining<>( new IsEqual<>("b"), new IsEqual<>("BB") ), new MatcherOf<>(m -> m.size() == 2) ) ) ); }
Example #20
Source File: NoNullsTest.java From cactoos with MIT License | 6 votes |
@Test @SuppressWarnings("unchecked") public void entrySet() { MatcherAssert.assertThat( "Can't call #entrySet()", new NoNulls<Integer, Integer>( new HashMap<Integer, Integer>() { { put(1, 1); put(0, 0); } } ), new AllOf<>( new IterableOf<>( new IsMapContaining<>(new IsEqual<>(1), new IsEqual<>(1)), new IsMapContaining<>(new IsEqual<>(0), new IsEqual<>(0)) ) ) ); }
Example #21
Source File: MapOfTest.java From cactoos with MIT License | 6 votes |
@Test @SuppressWarnings("unchecked") public void createsMapFromMapFunctionsAndIterable() { MatcherAssert.assertThat( "Can't create a map from map, functions and iterable.", new MapOf<Integer, Integer>( new FuncOf<Integer, Integer>(0), new FuncOf<Integer, Integer>(0), new MapOf<Integer, Integer>( new MapEntry<Integer, Integer>(1, 1) ), new IterableOf<>(0) ), new AllOf<>( new IterableOf<>( new IsMapContaining<>(new IsEqual<>(0), new IsEqual<>(0)), new IsMapContaining<>(new IsEqual<>(1), new IsEqual<>(1)) ) ) ); }
Example #22
Source File: MapOfTest.java From cactoos with MIT License | 6 votes |
@Test @SuppressWarnings("unchecked") public void createsMapFromMapAndMapEntries() { MatcherAssert.assertThat( "Can't create a map from map and map entries", new MapOf<Integer, Integer>( new MapOf<Integer, Integer>( new MapEntry<Integer, Integer>(0, 0) ), new MapEntry<Integer, Integer>(1, 1) ), new AllOf<>( new IterableOf<>( new IsMapContaining<>(new IsEqual<>(0), new IsEqual<>(0)), new IsMapContaining<>(new IsEqual<>(1), new IsEqual<>(1)) ) ) ); }
Example #23
Source File: DayOfMonthMatcherTest.java From lib-recur with Apache License 2.0 | 6 votes |
@Test public void test() throws Exception { assertThat(onDayOfMonth(10), AllOf.<Matcher<DateTime>>allOf( matches(DateTime.parse("20180710T010001Z")), mismatches(DateTime.parse("20181001T005959Z"), "day of month was <1>"), mismatches(DateTime.parse("20181011T010000Z"), "day of month was <11>"), describesAs("day of month (<10>)") )); assertThat(onDayOfMonth(6, 8, 10), AllOf.<Matcher<DateTime>>allOf( matches(DateTime.parse("20180706T010001Z")), matches(DateTime.parse("20180708T010002Z")), matches(DateTime.parse("20180710T010003Z")), mismatches(DateTime.parse("20180605T005959Z"), "day of month was <5>"), mismatches(DateTime.parse("20180811T005958Z"), "day of month was <11>"), mismatches(DateTime.parse("20181009T005957Z"), "day of month was <9>"), mismatches(DateTime.parse("20180907T010000Z"), "day of month was <7>"), describesAs("day of month (<6> or <8> or <10>)") )); }
Example #24
Source File: DayOfYearMatcherTest.java From lib-recur with Apache License 2.0 | 6 votes |
@Test public void test() throws Exception { assertThat(onDayOfYear(10), AllOf.<Matcher<DateTime>>allOf( matches(DateTime.parse("20180110T010001Z")), mismatches(DateTime.parse("20180111T005959Z"), "day of year was <11>"), mismatches(DateTime.parse("20180109T010000Z"), "day of year was <9>"), describesAs("day of year (<10>)") )); assertThat(onDayOfYear(1, 8, 365), AllOf.<Matcher<DateTime>>allOf( matches(DateTime.parse("20180101T010001Z")), matches(DateTime.parse("20180108T010002Z")), matches(DateTime.parse("20181231T010003Z")), mismatches(DateTime.parse("20180102T005959Z"), "day of year was <2>"), mismatches(DateTime.parse("20180107T005959Z"), "day of year was <7>"), mismatches(DateTime.parse("20180109T005959Z"), "day of year was <9>"), mismatches(DateTime.parse("20180228T005958Z"), "day of year was <59>"), mismatches(DateTime.parse("20181230T005957Z"), "day of year was <364>"), describesAs("day of year (<1> or <8> or <365>)") )); }
Example #25
Source File: MonthMatcherTest.java From lib-recur with Apache License 2.0 | 6 votes |
@Test public void test() throws Exception { assertThat(inMonth(10), AllOf.<Matcher<DateTime>>allOf( matches(DateTime.parse("20181001T010001Z")), mismatches(DateTime.parse("20180901T005959Z"), "month was <9>"), mismatches(DateTime.parse("20181101T010000Z"), "month was <11>"), describesAs("month (<10>)") )); assertThat(inMonth(6, 8, 10), AllOf.<Matcher<DateTime>>allOf( matches(DateTime.parse("20181001T010001Z")), matches(DateTime.parse("20180801T010002Z")), matches(DateTime.parse("20180601T010003Z")), mismatches(DateTime.parse("20180501T005959Z"), "month was <5>"), mismatches(DateTime.parse("20180701T005958Z"), "month was <7>"), mismatches(DateTime.parse("20180901T005957Z"), "month was <9>"), mismatches(DateTime.parse("20181101T010000Z"), "month was <11>"), describesAs("month (<6> or <8> or <10>)") )); }
Example #26
Source File: BeforeMatcherTest.java From lib-recur with Apache License 2.0 | 6 votes |
@Test public void test() throws Exception { assertThat(before(DateTime.parse("20180101T010000Z")), AllOf.<Matcher<DateTime>>allOf( matches(DateTime.parse("20180101T000059Z")), mismatches(DateTime.parse("20180101T010001Z"), "not before 20180101T010000Z"), mismatches(DateTime.parse("20180101T010000Z"), "not before 20180101T010000Z"), describesAs("before 20180101T010000Z") )); assertThat(before("20180101T010000Z"), AllOf.<Matcher<DateTime>>allOf( matches(DateTime.parse("20180101T000059Z")), mismatches(DateTime.parse("20180101T010001Z"), "not before 20180101T010000Z"), mismatches(DateTime.parse("20180101T010000Z"), "not before 20180101T010000Z"), describesAs("before 20180101T010000Z") )); }
Example #27
Source File: AfterMatcherTest.java From lib-recur with Apache License 2.0 | 6 votes |
@Test public void test() throws Exception { assertThat(after(DateTime.parse("20180101T010000Z")), AllOf.<Matcher<DateTime>>allOf( matches(DateTime.parse("20180101T010001Z")), mismatches(DateTime.parse("20180101T005959Z"), "not after 20180101T010000Z"), mismatches(DateTime.parse("20180101T010000Z"), "not after 20180101T010000Z"), describesAs("after 20180101T010000Z") )); assertThat(after("20180101T010000Z"), AllOf.<Matcher<DateTime>>allOf( matches(DateTime.parse("20180101T010001Z")), mismatches(DateTime.parse("20180101T005959Z"), "not after 20180101T010000Z"), mismatches(DateTime.parse("20180101T010000Z"), "not after 20180101T010000Z"), describesAs("after 20180101T010000Z") )); }
Example #28
Source File: WorkspaceAndProjectGeneratorTest.java From buck with Apache License 2.0 | 5 votes |
private Matcher<XCScheme.BuildActionEntry> withNameAndBuildingFor( String name, Matcher<? super EnumSet<XCScheme.BuildActionEntry.BuildFor>> buildFor) { return AllOf.allOf( buildActionEntryWithName(name), new FeatureMatcher<XCScheme.BuildActionEntry, EnumSet<XCScheme.BuildActionEntry.BuildFor>>( buildFor, "Building for", "BuildFor") { @Override protected EnumSet<XCScheme.BuildActionEntry.BuildFor> featureValueOf( XCScheme.BuildActionEntry entry) { return entry.getBuildFor(); } }); }
Example #29
Source File: WorkspaceAndProjectGeneratorTest.java From buck with Apache License 2.0 | 5 votes |
private Matcher<XCScheme.BuildActionEntry> withNameAndBuildingFor( String name, Matcher<? super EnumSet<XCScheme.BuildActionEntry.BuildFor>> buildFor) { return AllOf.allOf( buildActionEntryWithName(name), new FeatureMatcher<XCScheme.BuildActionEntry, EnumSet<XCScheme.BuildActionEntry.BuildFor>>( buildFor, "Building for", "BuildFor") { @Override protected EnumSet<XCScheme.BuildActionEntry.BuildFor> featureValueOf( XCScheme.BuildActionEntry entry) { return entry.getBuildFor(); } }); }
Example #30
Source File: TkAuthTest.java From takes with MIT License | 5 votes |
/** * TkAuth can login a user via cookie. * @throws Exception If some problem inside */ @Test @SuppressWarnings("unchecked") public void logsInUserViaCookie() throws Exception { new Assertion<>( "Response with header Set-Cookie", new RsPrint( new TkAuth( new TkText(), new PsChain( new PsCookie(new CcPlain()), new PsLogout() ) ).act( new RqWithHeader( new RqFake(), new FormattedText( "Cookie: %s=%s", PsCookie.class.getSimpleName(), "urn%3Atest%3A0" ).asString() ) ) ), new AllOf<>( new IterableOf<>( new StartsWith("HTTP/1.1 200 "), new TextHasString("Set-Cookie: PsCookie=urn%3Atest%3A0") ) ) ).affirm(); }