Skip to content

Commit e3e01a5

Browse files
committed
Make this test junit 4 and make it not hide failures
1 parent 78cf1af commit e3e01a5

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
package edu.stanford.nlp.semgraph;
22

3+
import org.junit.Test;
4+
import static org.junit.Assert.*;
5+
36
import java.io.IOException;
47
import java.io.StringReader;
58
import java.util.List;
69
import java.util.Map;
710
import java.util.Arrays;
811
import java.util.function.Function;
912

10-
import junit.framework.TestCase;
1113
import edu.stanford.nlp.ling.IndexedWord;
1214
import edu.stanford.nlp.trees.EnglishGrammaticalRelations;
1315
import edu.stanford.nlp.trees.LabeledScoredTreeFactory;
@@ -19,23 +21,18 @@
1921
*
2022
* @author Sonal Gupta
2123
*/
22-
public class SemanticGraphUtilsTest extends TestCase {
23-
24-
SemanticGraph graph;
24+
public class SemanticGraphUtilsTest {
2525

26+
@Test
2627
public void testCreateSemgrexPattern(){
27-
try{
2828
SemanticGraph graph = SemanticGraph.valueOf("[ate subj>Bill]");
2929

3030
Function<IndexedWord, String> transformNode = o ->{
3131
return "{word: " + o.word().toLowerCase() + "; tag: " + o.tag() +"; ner: " + o.ner() + "}";
32-
};
32+
};
3333

3434
String pat = SemanticGraphUtils.semgrexFromGraphOrderedNodes(graph, null, null, transformNode);
3535
assertEquals("{word: ate; tag: null; ner: null}=ate >subj=E1 {word: bill; tag: null; ner: null}=Bill", pat.trim());
36-
}catch(Exception e){
37-
e.printStackTrace();
38-
}
3936
}
4037

41-
}
38+
}

0 commit comments

Comments
 (0)