示例#1
0
  @Test
  public void testInject_mnemonic() {
    initializeInjecter();
    injecter.inject();

    Object mnemonicValue = action.getValue(Action.MNEMONIC_KEY);
    assertEquals(new Integer(KeyEvent.VK_A), mnemonicValue);
  }
示例#2
0
  @Test
  public void testInject_accelerator() {
    initializeInjecter();
    injecter.inject();

    Object keystrokeValue = action.getValue(Action.ACCELERATOR_KEY);
    assertEquals(KeyStroke.getKeyStroke(KeyEvent.VK_A, InputEvent.CTRL_DOWN_MASK), keystrokeValue);
  }
示例#3
0
  @Test
  public void testInject_longDescription() {
    initializeInjecter();
    injecter.inject();

    Object longDescValue = action.getValue(Action.LONG_DESCRIPTION);
    assertEquals("A very long description of action1", longDescValue);
  }
示例#4
0
  @Test
  public void testInject_shortDescription() {
    initializeInjecter();
    injecter.inject();

    Object shortDescValue = action.getValue(Action.SHORT_DESCRIPTION);
    assertEquals("Short description of action1", shortDescValue);
  }
示例#5
0
  @Test
  public void testInject_Name() {
    initializeInjecter();
    injecter.inject();

    Object nameValue = action.getValue(Action.NAME);
    assertEquals("Name1", nameValue);
  }
示例#6
0
  @Test
  public void testInject_largeIcon() {
    initializeInjecter();
    injecter.inject();

    Object largeIconValue = action.getValue(Action.LARGE_ICON_KEY);
    assertNotNull(largeIconValue);
    assertTrue(Icon.class.isAssignableFrom(largeIconValue.getClass()));
  }
示例#7
0
  @Test
  public void testInject_smallIcon() {
    initializeInjecter();
    injecter.inject();

    Object smallIconValue = action.getValue(Action.SMALL_ICON);
    assertNotNull(smallIconValue);
    assertTrue(Icon.class.isAssignableFrom(smallIconValue.getClass()));
  }