1 11 package org.eclipse.test.internal.performance.tests; 12 13 import org.eclipse.test.internal.performance.db.Variations; 14 15 import junit.framework.TestCase; 16 17 public class VariationsTests extends TestCase { 18 19 public void testVariations() { 20 Variations v1= new Variations(); 21 v1.put("k1", "foo"); assertEquals("|k1=foo|", v1.toExactMatchString()); assertEquals("%|k1=foo|%", v1.toQueryPattern()); 25 Variations v2= new Variations(); 26 v2.put("k1", "foo"); v2.put("k2", "bar"); assertEquals("|k1=foo||k2=bar|", v2.toExactMatchString()); assertEquals("%|k1=foo|%|k2=bar|%", v2.toQueryPattern()); 31 Variations v3= new Variations(); 32 v3.put("k1", "foo"); v3.put("k2", "bar"); v3.put("k3", "xyz"); assertEquals("|k1=foo||k2=bar||k3=xyz|", v3.toExactMatchString()); assertEquals("%|k1=foo|%|k2=bar|%|k3=xyz|%", v3.toQueryPattern()); } 38 39 public void testParseVariations() { 40 Variations v1= new Variations(); 41 v1.put("k1", "foo"); 43 Variations v= new Variations(); 44 v.parseDB(v1.toExactMatchString()); 45 assertEquals(v1, v); 46 47 Variations v2= new Variations(); 48 v2.put("k1", "foo"); v2.put("k2", "bar"); v= new Variations(); 51 v.parseDB(v2.toExactMatchString()); 52 assertEquals(v2, v); 53 54 Variations v3= new Variations(); 55 v3.put("k1", "foo"); v3.put("k2", "bar"); v3.put("k3", "xyz"); v= new Variations(); 59 v.parseDB(v3.toExactMatchString()); 60 assertEquals(v3, v); 61 } 62 63 } 76 | Popular Tags |