Package org.eclipse.test.internal.performance.db

Examples of org.eclipse.test.internal.performance.db.Variations


    map.put(Dimension.CPU_TIME, new Scalar((Dim) Dimension.CPU_TIME, (long) performanceResult.getTime() * 1000));
    points[1] = new DataPoint(1, map);

    final Sample sample = new Sample(scenarioId, System.currentTimeMillis(), Collections.EMPTY_MAP, points);
    sample.tagAsSummary(true, performanceResult.getName(), new Dimension[] {Dimension.CPU_TIME}, 0, null);
    Variations variations = PerformanceTestPlugin.getVariations();
    variations.put("browser", suiteName);
    DB.store(variations, sample);

    PerformanceMeter meter = new InternalPerformanceMeter(scenarioId) {
      public void stop() {
        throw new IllegalStateException();
View Full Code Here


import junit.framework.TestCase;

public class VariationsTests extends TestCase {

    public void testVariations() {
        Variations v1= new Variations();
        v1.put("k1", "foo"); //$NON-NLS-1$ //$NON-NLS-2$
        assertEquals("|k1=foo|", v1.toExactMatchString()); //$NON-NLS-1$
        assertEquals("%|k1=foo|%", v1.toQueryPattern()); //$NON-NLS-1$
       
        Variations v2= new Variations();
        v2.put("k1", "foo"); //$NON-NLS-1$ //$NON-NLS-2$
        v2.put("k2", "bar"); //$NON-NLS-1$ //$NON-NLS-2$
        assertEquals("|k1=foo||k2=bar|", v2.toExactMatchString()); //$NON-NLS-1$
        assertEquals("%|k1=foo|%|k2=bar|%", v2.toQueryPattern()); //$NON-NLS-1$

        Variations v3= new Variations();
        v3.put("k1", "foo"); //$NON-NLS-1$ //$NON-NLS-2$
        v3.put("k2", "bar"); //$NON-NLS-1$ //$NON-NLS-2$
        v3.put("k3", "xyz"); //$NON-NLS-1$ //$NON-NLS-2$
        assertEquals("|k1=foo||k2=bar||k3=xyz|", v3.toExactMatchString()); //$NON-NLS-1$
        assertEquals("%|k1=foo|%|k2=bar|%|k3=xyz|%", v3.toQueryPattern()); //$NON-NLS-1$
}
View Full Code Here

        assertEquals("|k1=foo||k2=bar||k3=xyz|", v3.toExactMatchString()); //$NON-NLS-1$
        assertEquals("%|k1=foo|%|k2=bar|%|k3=xyz|%", v3.toQueryPattern()); //$NON-NLS-1$
}
   
    public void testParseVariations() {
        Variations v1= new Variations();
        v1.put("k1", "foo"); //$NON-NLS-1$ //$NON-NLS-2$
       
        Variations v= new Variations();
        v.parseDB(v1.toExactMatchString());
        assertEquals(v1, v);
       
        Variations v2= new Variations();
        v2.put("k1", "foo"); //$NON-NLS-1$ //$NON-NLS-2$
        v2.put("k2", "bar"); //$NON-NLS-1$ //$NON-NLS-2$
        v= new Variations();
        v.parseDB(v2.toExactMatchString());
        assertEquals(v2, v);

        Variations v3= new Variations();
        v3.put("k1", "foo"); //$NON-NLS-1$ //$NON-NLS-2$
        v3.put("k2", "bar"); //$NON-NLS-1$ //$NON-NLS-2$
        v3.put("k3", "xyz"); //$NON-NLS-1$ //$NON-NLS-2$
        v= new Variations();
        v.parseDB(v3.toExactMatchString());
        assertEquals(v3, v);
    }
View Full Code Here

        }
    pm2.dispose();
   
    if (!failed) {
      // check in DB     
      Variations v= new Variations();
      v.put(CONFIG, "%"); //$NON-NLS-1$
      v.put(BUILD, build);
          Scenario[] scenarios= DB.queryScenarios(v, SCENARIO_NAME_0, CONFIG, null);
          if (scenarios != null && scenarios.length > 0) {
              Scenario s= scenarios[0];
              String[] failureMessages= s.getFailureMessages();
              if (failureMessages.length == 1) {
View Full Code Here

    pm4.commit();
    pm4.dispose();

    //
   
    Variations v= new Variations();
    v.put(CONFIG, "test"); //$NON-NLS-1$
    v.put(BUILD, "b0001"); //$NON-NLS-1$
    v.put("jvm", "sun142"); //$NON-NLS-1$ //$NON-NLS-2$
    DataPoint[] points= DB.queryDataPoints(v, SCENARIO_NAME_1, null);
    assertEquals(1, points.length);
   
    DataPoint dp= points[0];
    Dim[] dimensions= dp.getDimensions();
    assertEquals(2, dimensions.length);
   
    Scalar s1= dp.getScalar(InternalDimensions.CPU_TIME);
    assertNotNull(s1);
    assertEquals(900, s1.getMagnitude());

    Scalar s2= dp.getScalar(InternalDimensions.WORKING_SET);
    assertNotNull(s2);
    assertEquals(1000, s2.getMagnitude());

    //
    Set dims= new HashSet();
    dims.add(InternalDimensions.WORKING_SET);
    points= DB.queryDataPoints(v, SCENARIO_NAME_1, dims);
    assertEquals(1, points.length);
    dimensions= points[0].getDimensions();
    assertEquals(1, dimensions.length);
    Scalar s= points[0].getScalar(InternalDimensions.WORKING_SET);
    assertNotNull(s)
    assertEquals(1000, s.getMagnitude());
   
    //
    List buildNames= new ArrayList();
    Variations v2= new Variations();
    v2.put(CONFIG, "%"); //$NON-NLS-1$
    v2.put(BUILD, "b%"); //$NON-NLS-1$
    DB.queryDistinctValues(buildNames, BUILD, v2, "%"); //$NON-NLS-1$
    assertEquals(1, buildNames.size());
    assertEquals("b0001", buildNames.get(0)); //$NON-NLS-1$
   
      SummaryEntry[] fps= DB.querySummaries(PerformanceTestPlugin.getVariations(), null);
View Full Code Here

      if (fSummaryDimensions != null) {
        sample.tagAsSummary(fSummaryIsGlobal, fShortName, fSummaryDimensions, fCommentType, fComment);
      } else if (this.fComment != null) {
        sample.setComment(this.fCommentType, this.fComment);
      }
      Variations variations= PerformanceTestPlugin.getVariations();
      if (variations != null)
        DB.store(variations, sample);
      if (!DB.isActive() || System.getProperty(VERBOSE_PERFORMANCE_METER_PROPERTY) != null) {
        printSample(System.out, sample);
//        printSampleCSV(System.out, sample);
View Full Code Here

   * -Declipse.perf.dbloc=net://localhost
   */
  public static String getDBLocation() {
    String dbloc= System.getProperty(ECLIPSE_PERF_DBLOC);
    if (dbloc != null) {
        Variations keys= new Variations();
        keys.parsePairs(ECLIPSE_PERF_DBLOC + '=' + dbloc);
        return keys.getProperty(ECLIPSE_PERF_DBLOC);
    }
    return null;
  }
View Full Code Here

  }

  public static String getDBName() {
    String dbloc= System.getProperty(ECLIPSE_PERF_DBLOC);
    if (dbloc != null) {
        Variations keys= new Variations();
        keys.parsePairs(ECLIPSE_PERF_DBLOC + '=' + dbloc);
        return keys.getProperty(DB_NAME, DEFAULT_DB_NAME);
    }
      return DEFAULT_DB_NAME;
  }
View Full Code Here

  }

  public static String getDBUser() {
    String dbloc= System.getProperty(ECLIPSE_PERF_DBLOC);
    if (dbloc != null) {
        Variations keys= new Variations();
        keys.parsePairs(ECLIPSE_PERF_DBLOC + '=' + dbloc);
        return keys.getProperty(DB_USER, DEFAULT_DB_USER);
    }
      return DEFAULT_DB_USER;
  }
View Full Code Here

  }

  public static String getDBPassword() {
    String dbloc= System.getProperty(ECLIPSE_PERF_DBLOC);
    if (dbloc != null) {
        Variations keys= new Variations();
        keys.parsePairs(ECLIPSE_PERF_DBLOC + '=' + dbloc);
        return keys.getProperty(DB_PASSWD, DEFAULT_DB_PASSWORD);
    }
      return DEFAULT_DB_PASSWORD;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.test.internal.performance.db.Variations

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.