Skip to content

Commit f38e115

Browse files
jonahgrahamakurtakov
authored andcommitted
Convert Test_org_eclipse_swt_custom_StyledTextContent to JUnit5
1 parent 50b6343 commit f38e115

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledTextContent.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
package org.eclipse.swt.tests.junit;
1616

1717

18-
import static org.junit.Assert.assertEquals;
19-
import static org.junit.Assert.assertTrue;
18+
import static org.junit.jupiter.api.Assertions.assertEquals;
19+
import static org.junit.jupiter.api.Assertions.assertTrue;
2020

2121
import org.eclipse.swt.SWT;
2222
import org.eclipse.swt.custom.StyledText;
2323
import org.eclipse.swt.custom.StyledTextContent;
2424
import org.eclipse.swt.custom.TextChangeListener;
2525
import org.eclipse.swt.graphics.Point;
2626
import org.eclipse.swt.widgets.Shell;
27-
import org.junit.Before;
28-
import org.junit.Test;
27+
import org.junit.jupiter.api.BeforeEach;
28+
import org.junit.jupiter.api.Test;
2929

3030
/**
3131
* Automated Test Suite for class org.eclipse.swt.custom.StyledTextContent
@@ -85,7 +85,7 @@ public void setText(String text) {
8585
Shell shell;
8686
StyledText styledText;
8787

88-
@Before
88+
@BeforeEach
8989
public void setUp() {
9090
shell = new Shell();
9191
styledText = new StyledText(shell, SWT.NULL);
@@ -94,51 +94,51 @@ public void setUp() {
9494

9595
@Test
9696
public void test_getCharCount() {
97-
assertEquals(":a:", INITIAL_TEXT.length(), styledText.getCharCount());
97+
assertEquals(INITIAL_TEXT.length(), styledText.getCharCount());
9898
}
9999

100100
@Test
101101
public void test_getLineAtOffsetI() {
102-
assertEquals(":c:", 0, styledText.getLineAtOffset(0));
102+
assertEquals(0, styledText.getLineAtOffset(0));
103103
}
104104

105105
@Test
106106
public void test_getLineCount() {
107-
assertEquals(":d:", 1, styledText.getLineCount());
107+
assertEquals(1, styledText.getLineCount());
108108
}
109109

110110
@Test
111111
public void test_getLineDelimiter() {
112-
assertEquals(":e:", "getLineDelimiter", styledText.getLineDelimiter());
112+
assertEquals("getLineDelimiter", styledText.getLineDelimiter());
113113
}
114114

115115
@Test
116116
public void test_getLineI() {
117117
// will indirectly cause getLine to be called
118-
assertEquals(":b:", new Point(0,0), styledText.getLocationAtOffset(0));
118+
assertEquals(new Point(0,0), styledText.getLocationAtOffset(0));
119119
}
120120

121121
@Test
122122
public void test_getOffsetAtLineI() {
123123
// will indirectly cause getOffsetAtLine to be called
124-
assertEquals(":f:", new Point(0,0), styledText.getLocationAtOffset(0));
124+
assertEquals(new Point(0,0), styledText.getLocationAtOffset(0));
125125
}
126126

127127
@Test
128128
public void test_getTextRangeII() {
129-
assertTrue(":g:", styledText.getTextRange(0,0).isEmpty());
129+
assertTrue(styledText.getTextRange(0,0).isEmpty());
130130
}
131131

132132
@Test
133133
public void test_replaceTextRangeIILjava_lang_String() {
134134
styledText.replaceTextRange(0,0,"test1");
135-
assertEquals(":h:", "test1" + INITIAL_TEXT, styledText.getText());
135+
assertEquals("test1" + INITIAL_TEXT, styledText.getText());
136136
}
137137

138138
@Test
139139
public void test_setTextLjava_lang_String() {
140140
styledText.replaceTextRange(0,0,"test2");
141-
assertEquals(":i:", "test2" + INITIAL_TEXT, styledText.getText());
141+
assertEquals("test2" + INITIAL_TEXT, styledText.getText());
142142
}
143143

144144
}

0 commit comments

Comments
 (0)