Skip to content

Tag: java

SpringJUnit4ClassRunner class not found

i am trying to create a unit test using SpringJUnit4ClassRunner but everytime i execute the test it says it cannot find SpringJUnit4ClassRunner using mvn install. here is my code Here is my POM file: i am using springSource tool suit IDE to develop this spring mvc app and on the IDE it highlights SpringJUnit4…

Measuring time spent on GC

Suppose I am testing a Java server application. I know how much time it takes to finish the test. Now I’d like to know how much was spent on GC during that test. How can I do it? Answer The simplest way is to use the -Xloggc and -XX:-PrintGCTimeStamps options when starting up your JVM. I think it prints…

Why are reference types stored in heap

I do know that in Java, (perhaps in .net too) , primitives are stored on stacks , where as reference types are stored on heaps. My question was that I do not understand the proc/cons for this behavior. Why can’t we reference a memory location inside our stacks instead? . I couldn’t find a proper e…

JFreeChart with truncated data points

I have created a JFreeChart with the code below, but the Y-Axis marks are truncated. How should I display the chart even though the data points are overlapped in the Y-Axis? Basically, I want the Y-Axis points to be generated from my file, a proper range is populated and displayed in the chart. Below is the i…