junit

    1熱度

    4回答

    我試圖按照the Groovy Testing Guide爲我的Groovy代碼編寫一些JUnit測試,但是我無法獲得它輸出的任何有用信息。舉例來說,如果我有這樣的: class Test extends GroovyTestCase { void testCase1() { assertTrue true assertEquals 1, 1 } }

    0熱度

    2回答

    我試圖捕獲在輸入傳遞到與PowerMockito模擬對象的參數,這是代碼: //I create a mock object ClassMocked mock = PowerMockito.mock(ClassMocked.class); //Create the captor that will capture the String passed in input to the mock

    0熱度

    2回答

    我正在試圖編寫一些測試用例的Spring-MVC應用程序。目前,我正在自動裝配我的服務層方法並用@ImportResouce註釋主類。我也試過@ContextConfiguration,但後來我得到一個NPE進行測試。我究竟做錯了什麼? JUNIT:4.1.2 - 與範圍測試POM目前 彈簧4.1.6 - 在POM目前 代碼: @RunWith(SpringJUnit4ClassRunner.cl

    0熱度

    1回答

    當我嘗試從Eclipse的junt測試中運行一個方法時,它將不會運行。右鍵單擊junit測試方法或從上下文菜單中進行選擇,或者在選擇測試時單擊F11將不起作用。它清除了以前的運行測試,然後沒有任何反應。我的測試是簡單的正常測試(沒有任何參數)。 當我運行所有測試沒什麼,他們運行良好。 我刪除了項目,並做了mvn clean install eclipse:clean eclipse:eclipse

    1熱度

    1回答

    我做了一個方法來計算String中給定字符的出現次數。 public Integer numberOf(String str, Character a){} 我試圖測試正常使用: @Test public void test1(){ Integer result = oc.numberOf("Lungimirante", 'u'); Assert.assertEquals

    0熱度

    1回答

    我試圖調用SQL查詢(Oracle數據庫)來更新一個表中的列,當鏈接表中的某些列具有某些值時。我的語法在一般的代碼工作正常,但在我的單元測試,我得到一個「BadSQLGrammarException」: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [UPDAT

    0熱度

    1回答

    我無法使用JUnit編譯測試。當我嘗試這樣做,我得到這個錯誤: package org.junit.jupiter.api does not exist 我得到這個錯誤編譯即使我把的.jar在同一目錄並編譯如下測試: javac -cp junit4-4.12.jar Tests.java 的Test.java的內容是: import static org.junit.jupiter.ap

    0熱度

    3回答

    我是mockito的新手。比方說,我有這樣 public class MyClass { int a; String b; public MyClass(int a) { this.a = a; this.b = draw(); System.out.println("class is created"); }

    0熱度

    1回答

    我有一個控制器,它增加了屬性從application.properties到Model對象: @Value("${products}") private String prod; @GetMapping("/") public String greetingForm(Model model) throws IOException { List<String> products

    1熱度

    1回答

    我正在繼承一個項目。我最近更新了Proguard和JUnit版本,並且在運行命令ant jtest時遇到問題。軟件 版本我現在有: 的Java 1.8.0_141 螞蟻1.10.1 Proguard的:最近更新5.3.3,爲4.9 的JUnit:最近更新到4.12,是4.10 該測試套件在Eclipse中運行良好,但是當使用命令從Cygwin運行時,我在第Ë輸出: jtest: [mkdir]