1 package org.sapia.archie.impl; 2 3 import java.util.Properties ; 4 5 import junit.framework.TestCase; 6 7 15 public class OfferTest extends TestCase{ 16 17 20 public OfferTest(String arg0) { 21 super(arg0); 22 } 23 24 public void testMatches(){ 25 Properties attributes = new Properties (); 26 attributes.put("attr1", "val1"); 27 attributes.put("attr2", "val2"); 28 attributes.put("attr3", "val3"); 29 Offer offer = new Offer(attributes, "SomeObject"); 30 31 Properties constraints = new Properties (); 32 constraints.setProperty("attr1", "val1"); 33 super.assertTrue(offer.matches(constraints)); 34 constraints.setProperty("attr2", "val2"); 35 super.assertTrue(offer.matches(constraints)); 36 constraints.setProperty("attr3", "val3"); 37 super.assertTrue(offer.matches(constraints)); 38 constraints.setProperty("attr4", "val4"); 39 super.assertTrue(!offer.matches(constraints)); 40 } 41 } 42 43 | Popular Tags |