Beispiel #1
0
  @SuppressWarnings("nls")
  public void testCriteriaCriteria() {
    Criteria criteria = new Criteria();
    criteria.setExpression("test");
    criteria.setLifeLineSelected(true);
    criteria.setSyncMessageSelected(true);

    Criteria copy = new Criteria(criteria);

    assertEquals(
        "testCriteriaCriteria",
        criteria.isAsyncMessageReturnSelected(),
        copy.isAsyncMessageReturnSelected());
    assertEquals(
        "testCriteriaCriteria", criteria.isAsyncMessageSelected(), copy.isAsyncMessageSelected());
    assertEquals(
        "testCriteriaCriteria", criteria.isCaseSenstiveSelected(), copy.isCaseSenstiveSelected());
    assertEquals("testCriteriaCriteria", criteria.isLifeLineSelected(), copy.isLifeLineSelected());
    assertEquals("testCriteriaCriteria", criteria.isStopSelected(), copy.isStopSelected());
    assertEquals(
        "testCriteriaCriteria",
        criteria.isSyncMessageReturnSelected(),
        copy.isSyncMessageReturnSelected());
    assertEquals(
        "testCriteriaCriteria", criteria.isSyncMessageSelected(), copy.isSyncMessageSelected());
    assertEquals("testCriteriaCriteria", criteria.getExpression(), copy.getExpression());
    assertEquals(
        "testCriteriaCriteria", criteria.getPattern().pattern(), copy.getPattern().pattern());
  }
Beispiel #2
0
  @SuppressWarnings("nls")
  public void testAccessors() {
    Criteria criteria = new Criteria();
    criteria.setAsyncMessageReturnSelected(true);
    criteria.setAsyncMessageSelected(true);
    criteria.setCaseSenstiveSelected(true);
    criteria.setLifeLineSelected(true);
    criteria.setStopSelected(true);
    criteria.setSyncMessageReturnSelected(true);
    criteria.setSyncMessageSelected(true);
    criteria.setExpression("test.*");

    // set true to all flags
    assertTrue("testAccessors", criteria.isAsyncMessageReturnSelected());
    assertTrue("testAccessors", criteria.isAsyncMessageSelected());
    assertTrue("testAccessors", criteria.isCaseSenstiveSelected());
    assertTrue("testAccessors", criteria.isLifeLineSelected());
    assertTrue("testAccessors", criteria.isStopSelected());
    assertTrue("testAccessors", criteria.isSyncMessageReturnSelected());
    assertTrue("testAccessors", criteria.isSyncMessageSelected());
    assertEquals("testAccessors", "test.*", criteria.getExpression());
    assertNotNull("testAccessors", criteria.getPattern());
    assertEquals("testAccessors", "test.*", criteria.getPattern().pattern());
    assertEquals("testAccessors", 0, criteria.getPattern().flags() & Pattern.CASE_INSENSITIVE);

    // set false to all flags
    criteria.setAsyncMessageReturnSelected(false);
    criteria.setAsyncMessageSelected(false);
    criteria.setCaseSenstiveSelected(false);
    criteria.setLifeLineSelected(false);
    criteria.setStopSelected(false);
    criteria.setSyncMessageReturnSelected(false);
    criteria.setSyncMessageSelected(false);

    assertFalse("testAccessors", criteria.isAsyncMessageReturnSelected());
    assertFalse("testAccessors", criteria.isAsyncMessageSelected());
    assertFalse("testAccessors", criteria.isCaseSenstiveSelected());
    assertFalse("testAccessors", criteria.isLifeLineSelected());
    assertFalse("testAccessors", criteria.isStopSelected());
    assertFalse("testAccessors", criteria.isSyncMessageReturnSelected());
    assertFalse("testAccessors", criteria.isSyncMessageSelected());
    assertEquals("testAccessors", "test.*", criteria.getExpression());
    assertNotNull("testAccessors", criteria.getPattern());
    assertEquals("testAccessors", "test.*", criteria.getPattern().pattern());
    assertEquals(
        "testAccessors",
        Pattern.CASE_INSENSITIVE,
        criteria.getPattern().flags() & Pattern.CASE_INSENSITIVE);
  }
Beispiel #3
0
 @SuppressWarnings("nls")
 public void testCriteria() {
   Criteria criteria = new Criteria();
   assertFalse("testCriteria", criteria.isAsyncMessageReturnSelected());
   assertFalse("testCriteria", criteria.isAsyncMessageSelected());
   assertFalse("testCriteria", criteria.isCaseSenstiveSelected());
   assertFalse("testCriteria", criteria.isLifeLineSelected());
   assertFalse("testCriteria", criteria.isStopSelected());
   assertFalse("testCriteria", criteria.isSyncMessageReturnSelected());
   assertFalse("testCriteria", criteria.isSyncMessageSelected());
   assertNull("testCriteria", criteria.getExpression());
   assertNull("testCriteria", criteria.getPattern());
 }