List of usage examples for org.apache.http.hacked GetUriRegexMatcher GetUriRegexMatcher
public GetUriRegexMatcher(String uriRegex)
From source file:com.jaspersoft.android.jaspermobile.test.acceptance.SearchableActivityTest.java
public void testFolderClick() { FakeHttpLayerManager.addHttpResponseRule(ApiMatcher.REPORTS_QUERY, TestResponses.ONLY_FOLDER); RequestMatcher uriRegexMatcher = new GetUriRegexMatcher(".*(folderUri=/organizations/org_template).*"); FakeHttpLayerManager.addHttpResponseRule(uriRegexMatcher, TestResponses.ROOT_REPOSITORIES); uriRegexMatcher = new GetUriRegexMatcher(".*(folderUri=/public).*"); FakeHttpLayerManager.addHttpResponseRule(uriRegexMatcher, TestResponses.get().noContent()); startActivityUnderTest();/*from www . j a v a 2 s.c om*/ onData(is(instanceOf(ResourceLookup.class))).inAdapterView(withId(android.R.id.list)).atPosition(0) .perform(click()); ResourceLookupsList levelRepositories = TestResources.get().fromXML(ResourceLookupsList.class, TestResources.ONLY_FOLDER); String firstLevelRepoLabel = levelRepositories.getResourceLookups().get(0).getLabel(); onView(withId(android.R.id.list)) .check(matches(not(withAdaptedData(withItemContent(firstLevelRepoLabel))))); // Bug related: To check whether we have only one switcher. Otherwise it will rise 'matches multiple views in the hierarchy.' onView(withId(R.id.switchLayout)).check(matches(isDisplayed())); onView(withText("Public")).perform(click()); // Bug related: Check whether empty test displays correct message. onView(withId(android.R.id.empty)).check(matches(withText(R.string.r_browser_nothing_to_display))); }