hamcrest

    -1熱度

    1回答

    我有一個腳本來檢查返回的http狀態代碼。 import static org.hamcrest.Matchers.anyOf import static org.hamcrest.Matchers.equalTo import static org.hamcrest.MatcherAssert.assertThat int[] expectedStatuses = [201,204]

    2熱度

    1回答

    我想在spock或hamcrest中編寫一個自定義域相關的聲明/匹配器,但我不知道如何繼續。 我試過在hamcrest中編寫一個自定義的Matcher,但到目前爲止,這隻能讓我得到部分解決方案。 我在尋找一些關於在這種情況下適當的課程的指導。 域對象: 的ResultMap的目的地圖< ILINE,IResult> - 有一個 與每個相關聯的ILINE INodeResult。 IResult有4

    1熱度

    2回答

    我想使用hamcrest聲明兩個收集的平等。 我知道有contains匹配器,但我希望它忽略排序。 {1,2}等於我的需要{2,1}。 什麼是正確的語法?

    5熱度

    3回答

    我有一個警報對話框,顯示一些項目。 private String[] choices; // populated externally AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setItems(choices, new DialogInterface.OnCli

    10熱度

    2回答

    hasProperty可以hasItem被用來檢查給定屬性的值,例如: Matcher hasName = Matchers<Person>hasProperty("name", is("Winkleburger")); assertThat(names, hasItem(hasName)); 這是罰款時,名字是一個屬性,即:有是一種名爲getName()的方法。 是否有一個匹配器會檢查一個

    7熱度

    2回答

    我想運行此行代碼: assertThat(contextPin.get(), equalTo(pinPage.getPinObjFromUi())); ,但我想打印到日誌翔實 這意味着我可以知道哪些領域不等於。 所以我想到實現一個匹配器。 我用Google搜索,但不能把它寫正確 我的方法不能得到actual和expected對象組合在一起。 這是我的代碼: 我該怎麼寫它乾淨? public cla

    2熱度

    1回答

    我做了一個使用hamcrest matchers的測試套件,一切正常,直到我在不同的機器上移動項目。 我得到的錯誤是: The method assertThat(T, Matcher<? super T>) in the type MatcherAssert is not applicable for the arguments (Object, Matcher<Double>) 任何想法

    3熱度

    2回答

    我已經發現三個問題應該涉及同一個問題,但不知何故,他們並沒有完全解決我的問題。 NoSuchMethodError with Hamcrest 1.3 & JUnit 4.11 NoSuchMethodError: org.hamcrest.Matchers.hasXPath when I run tests in eclipse Getting "NoSuchMethodError: org.h

    2熱度

    1回答

    Hamcrest回購包括org.hamcrest.io.FileMatchers(請參閱https://github.com/hamcrest/JavaHamcrest/tree/master/hamcrest-library/src/main/java/org/hamcrest/io),但它不存在於構建工件hamcrest-all或hamcrest-library(v1.3)中。匹配者發生了什麼

    2熱度

    1回答

    TFS中有可能工作項目創建時可以有兩個狀態選項。例如 我有一個要求,當創建bug時,它可以是DEV狀態或CCB狀態。 但我無法弄清楚如何做到這一點。我所能做的就是將一個冗餘的初始狀態作爲「新」來開始。而從新州來說,我可以去DEV或者選擇CCB。 任何輸入將非常感激。 感謝, MAYUR