View Javadoc

1   /*
2    * $Id: GWESResourceQualityTest.java 1529 2011-06-22 16:37:19Z hoheisel $
3    *
4    * Copyright (c) 2007
5    * Fraunhofer Institute for Computer Architecture and Software Technology
6    * See http://www.first.fraunhofer.de for more details.
7    */
8   
9   package net.kwfgrid.gwes;
10  
11  import net.kwfgrid.gwes.exception.LoggingException;
12  import org.apache.log4j.Logger;
13  import junit.framework.Test;
14  import junit.framework.TestSuite;
15  import net.kwfgrid.gwes.exception.DatabaseException;
16  import net.kwfgrid.gwes.prorater.ResourceQualityCalculator;
17  
18  /**
19   * <code>
20   * maven -Dtestcase=net.kwfgrid.gwes.GWESResourceQualityTest test:single
21   * </code>
22   *
23   * @author Andreas Hoheisel
24   *         (<a href="http://www.andreas-hoheisel.de">www.andreas-hoheisel.de</a>)
25   * @version $Id: GWESResourceQualityTest.java 1529 2011-06-22 16:37:19Z hoheisel $
26   */
27  public final class GWESResourceQualityTest extends LocalGWESAbstractTestCase {
28  
29      static Logger logger = Logger.getLogger(GWESResourceQualityTest.class);
30  
31      /**
32       * Create the test case.
33       *
34       * @param testName name of the test case
35       */
36      public GWESResourceQualityTest(String testName) throws LoggingException {
37          super(testName);
38      }
39  
40      /**
41       * @return the suite of tests being tested
42       */
43      public static Test suite() {
44          return new TestSuite(GWESResourceQualityTest.class);
45      }
46  
47      public void testCalculateBatchQueueQuality() throws DatabaseException {
48          logger.info("RUNNING WAITING QUALITY");
49          for (int r = 0; r<10; r++) {
50              for (int w=0; w<20; w++) {
51                  float quality = ResourceQualityCalculator.calculateBatchQueueQuality(r,w);
52                  logger.info(r+" "+w+" "+quality);
53              }
54          }
55      }
56  
57      /**
58       * *******************************************************************************************
59       * End of public test classes.
60       * ********************************************************************************************
61       */
62  
63  }