using jmockit 1.2 jar, trying mock string's length method getting unexpected invocation exception: failed: test java.lang.illegalstateexception: missing invocation mocked type @ point; please make sure such invocations appear after declaration of suitable mock field or parameter @ stringdemo.testa$1.<init>(testa.java:17) @ stringdemo.testa.test(testa.java:13) i using testng: @test public void test() throws exception { new expectations() { @mocked("length") string astring; { astring.length(); result = 2; } }; system.out.println(a.showa("test")); } } actual class a: public class { public static int showa(string str){ int a= str.length(); return a; } } this wrong way of recording expected results. shouldn't mock , record string's length() method, record showa() instead. here solution @suppresswarnings("unused...
i'm implementing weightedslopeone prediciton algorithm recommender system , @ point in code need have 2 2d maps, 1 map<integer, map<integer, integer>> , 1 map<integer, map<integer, double>> as can understand accessing these , assigning values cumbersome procedure: //the following 20 lines 1 line in python. sigh... hashmap<integer, integer> freqsforitem1 = frequencies.get(curitemid); //see if have value curitemid if (freqsforitem1 == null) { freqsforitem1 = new hashmap<integer, integer>(); freqsforitem1.put(curitemid_2, 1); frequencies.put(curitemid, freqsforitem1); } else {//see if have value curitemid+curitemid_2 integer freqforitem1item2 = freqsforitem1.get(curitemid_2); if (freqforitem1item2 == null) { //if don't have value item1+item2 put 1 freqsforitem1.put(curitemid_2, 1); } else {//we have value curitemid+curitemid_2 //so increment freqsforitem1.put(curitemid_2, freqf...
i have simple page in intranet uses razor/asp fetch single record table , display it, plus few graphic, dashboard display. meaning, no user intervention other first time open ie internal url. the problem having every morning ie displays "page not found or network error" message. refresh page, , it's stuck , doesn't display anything. try different pc, open ie internal url , it's stuck... ...until following: login server hosting page run inetmgr go web sites, etc right click on page that's giving me problem , select browse at moment, error message: server error in '/' application. -------------------------------------------------------------------------------- type of page not served. description: type of page have requested not served because has been explicitly forbidden. extension '.cshtml' may incorrect. please review url below , make sure spelled correctly. requested url: /application/dashboard.cshtml ---------------...
Comments
Post a Comment