Search in sources :

Example 1 with BSBKnob

use of blue.orchestra.blueSynthBuilder.BSBKnob in project blue by kunstmusik.

the class BSBCompletionItemTest method testReplaceWordBeforeCaret.

/**
 * Test of replaceWordBeforeCaret method, of class BSBCompletionItem.
 */
@Test
public void testReplaceWordBeforeCaret() {
    String replacementText = "<test>";
    JTextComponent jtc = new JEditorPane();
    jtc.setText("<");
    jtc.setCaretPosition(1);
    BSBCompletionItem instance = new BSBCompletionItem(new BSBKnob(), "test");
    instance.replaceWordBeforeCaret(replacementText, jtc);
    assertEquals("<test>", jtc.getText());
}
Also used : BSBKnob(blue.orchestra.blueSynthBuilder.BSBKnob) JEditorPane(javax.swing.JEditorPane) JTextComponent(javax.swing.text.JTextComponent) Test(org.junit.Test)

Aggregations

BSBKnob (blue.orchestra.blueSynthBuilder.BSBKnob)1 JEditorPane (javax.swing.JEditorPane)1 JTextComponent (javax.swing.text.JTextComponent)1 Test (org.junit.Test)1