Package org.milyn.profile

Examples of org.milyn.profile.DefaultProfileSet.addProfile()


    ProfileTargetingExpression expression;

    // Add a few profiles
    profileSet1.addProfile("profile1");
    profileSet1.addProfile("profile2");
    profileSet2.addProfile("profile2");
    profileSet2.addProfile("accept:application/xhtml+xml");
   
    // Match against exact device name
    expression = new ProfileTargetingExpression("device1");
    assertTrue(expression.isMatch(profileSet1));
View Full Code Here


    // Add a few profiles
    profileSet1.addProfile("profile1");
    profileSet1.addProfile("profile2");
    profileSet2.addProfile("profile2");
    profileSet2.addProfile("accept:application/xhtml+xml");
   
    // Match against exact device name
    expression = new ProfileTargetingExpression("device1");
    assertTrue(expression.isMatch(profileSet1));
    assertTrue(!expression.isMatch(profileSet2));
View Full Code Here

  public void testAddProfile_exceptions() {
    DefaultProfileSet set = new DefaultProfileSet("baseProfile");

    try {
      set.addProfile((Profile) null);
      fail("no arg exception on null");
    } catch (IllegalArgumentException e) {
    }
    try {
      set.addProfile("");
View Full Code Here

      set.addProfile((Profile) null);
      fail("no arg exception on null");
    } catch (IllegalArgumentException e) {
    }
    try {
      set.addProfile("");
      fail("no arg exception on empty");
    } catch (IllegalArgumentException e) {
    }
    try {
      set.addProfile(" ");
View Full Code Here

      set.addProfile("");
      fail("no arg exception on empty");
    } catch (IllegalArgumentException e) {
    }
    try {
      set.addProfile(" ");
      fail("no arg exception on whitespace");
    } catch (IllegalArgumentException e) {
    }
  }
View Full Code Here

  public void testIsMember() {
    DefaultProfileSet set = new DefaultProfileSet("baseProfile");

    assertTrue(!set.isMember("xxx"));
    set.addProfile("xxx");
    assertTrue(set.isMember("xxx"));

    assertTrue(!set.isMember("yyy"));
    set.addProfile(" YYY");
    assertTrue(set.isMember("YYY"));
View Full Code Here

    assertTrue(!set.isMember("xxx"));
    set.addProfile("xxx");
    assertTrue(set.isMember("xxx"));

    assertTrue(!set.isMember("yyy"));
    set.addProfile(" YYY");
    assertTrue(set.isMember("YYY"));
    assertTrue(set.isMember(" YYY"));
    assertTrue(set.isMember("YYY "));
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.