CHAPTER 5 PERFORMANCE THROUGH THE APPLICATION DEVELOPMENT (Web design service)
CHAPTER 5 PERFORMANCE THROUGH THE APPLICATION DEVELOPMENT LIFE CYCLE // Sleep for 100ms so we can be sure that the time of // the new data point is later than the first Thread.sleep( 100 ); } catch( Exception e ) { } // Construct a new DataPoint DataPoint other = new DataPoint( new Date(), 4.0, 0.5, 20.0 ); // Should return -1 because other occurs after dp int result = dp.compareTo( other ); assertEquals( -1, result ); // Should return 1 because dp occurs before other result = other.compareTo( dp ); assertEquals( 1, result ); // Should return 0 because dp == dp result = dp.compareTo( dp ); assertEquals( 0, result ); } } Listing 5-2. MetricTest.java package com.javasrc.metric; import junit.framework.TestCase; import java.util.*; public class MetricTest extends TestCase { private Metric sampleHeap; protected void setUp() { this.sampleHeap = new Metric( “Test Metric”, “Value/Min/Max”, “megabytes” ); double heapValue = 100.0; double heapMin = 50.0; double heapMax = 150.0;
Note: In case you are looking for affordable webhost to host and run your web application check Vision http web server services