File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 197 |
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 308 |
public void testHashCodeDifferent() throws InvalidTokenException {
final String phrase1 = GraphAnswerTest.CREATE_TABLE;
final String option11 = GraphAnswerTest.TABLE;
final String option12 = GraphAnswerTest.TABLESPACE;
final String phrase2 = GraphAnswerTest.CREATE_TABLESPACE;
final String option21 = GraphAnswerTest.TABLENAME;
final String option22 = GraphAnswerTest.TABLESPACENAME;
final List<Token> phrases1 = new ArrayList<Token>();
phrases1.add(new Token(phrase1, true));
final List<Token> options1 = new ArrayList<Token>();
options1.add(new Token(option11, true));
options1.add(new Token(option12, true));
final GraphAnswer expected = new GraphAnswer(phrases1, options1);
final List<Token> phrases2 = new ArrayList<Token>();
phrases2.add(new Token(phrase2, true));
final List<Token> options2 = new ArrayList<Token>();
options2.add(new Token(option21, true));
options2.add(new Token(option22, true));
final GraphAnswer actual = new GraphAnswer(phrases2, options2);
final boolean condition = expected.hashCode() != actual.hashCode(); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 794 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 858 |
public void testMergeAndSimplify() throws AbstractZemucanException {
final String graphName1 = GraphTest.GRAPH1;
final String graphName2 = GraphTest.GRAPH2;
final String create = GraphTest.CREATE;
final Graph graph1 = new Graph(graphName1, false);
final Graph graph2 = new Graph(graphName2, false);
graph1.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph1.addNode(create, create, true);
graph1.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph1.firstPhaseFinished();
graph1.addRelation(Constants.STARTING_NODE, create);
graph1.addRelation(create, Constants.ENDING_NODE);
graph1.secondPhaseFinished();
graph2.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph2.addNode(create, create, true);
graph2.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph2.firstPhaseFinished();
graph2.addRelation(Constants.STARTING_NODE, create);
graph2.addRelation(create, Constants.ENDING_NODE);
graph2.secondPhaseFinished();
graph1.merge(graph2); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 233 |
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 344 |
public void testHashCodeIdentical() throws InvalidTokenException {
final String phrase1 = GraphAnswerTest.CREATE;
final String option1 = GraphAnswerTest.TABLE;
final String option2 = GraphAnswerTest.TABLESPACE;
final List<Token> phrases1 = new ArrayList<Token>();
phrases1.add(new Token(phrase1, true));
final List<Token> options1 = new ArrayList<Token>();
options1.add(new Token(option1, true));
options1.add(new Token(option2, true));
final GraphAnswer expected = new GraphAnswer(phrases1, options1);
final List<Token> phrases2 = new ArrayList<Token>();
phrases2.add(new Token(phrase1, true));
final List<Token> options2 = new ArrayList<Token>();
options2.add(new Token(option1, true));
options2.add(new Token(option2, true));
final GraphAnswer actual = new GraphAnswer(phrases2, options2); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1284 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1593 |
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_ENDING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_2;
final Graph graph = new Graph("delimiters", false); //$NON-NLS-1$
final InputSource contentToParse = new InputSource(
new StringReader(xml));
final InputSource contentToValidate = new InputSource(new StringReader(
xml));
ImplementationXMLGrammarReaderTest.LOGGER.info("testNoDelimiters"); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1988 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 2019 |
final Graph graph = new Graph(GraphTest.VALIDATED_TWICE, false);
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(Constants.STARTING_NODE, GraphTest.TABLE);
graph.addRelation(GraphTest.CREATE, Constants.ENDING_NODE);
graph.addRelation(GraphTest.TABLE, Constants.ENDING_NODE);
graph.secondPhaseFinished();
graph.addRelation(GraphTest.CREATE, GraphTest.TABLE);
graph.secondPhaseFinished();
final StartingNode node = graph.getStartingNode();
final List<AbstractGraphNode> nodes = node.getChildren();
Assert.assertEquals(GraphTest.QTY_OF_WAYS, 2, nodes.size()); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1900 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1929 |
final Graph graph = new Graph(GraphTest.VALIDATED_GRAPH, false);
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(Constants.STARTING_NODE, GraphTest.TABLE);
graph.addRelation(GraphTest.CREATE, Constants.ENDING_NODE);
graph.addRelation(GraphTest.TABLE, Constants.ENDING_NODE);
graph.secondPhaseFinished();
final StartingNode node = graph.getStartingNode();
final List<AbstractGraphNode> nodes = node.getChildren();
Assert.assertEquals(GraphTest.QTY_OF_WAYS, 2, nodes.size()); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 991 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1124 |
final Graph graph = new Graph(graphName, true); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(GraphTest.CREATE, Constants.ENDING_NODE);
graph.secondPhaseFinished();
final StartingNode startingNode = graph.getStartingNode();
final List<AbstractGraphNode> nodes = startingNode.getChildren();
boolean found = false;
for (final AbstractGraphNode node : nodes) {
if (node.getId().equals(
graphName + ':' + Constants.LICENSE_TOKEN_ID)) { |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1956 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1988 |
final Graph graph = new Graph("validated twice extra nodes", true); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(Constants.STARTING_NODE, GraphTest.TABLE);
graph.addRelation(GraphTest.CREATE, Constants.ENDING_NODE);
graph.addRelation(GraphTest.TABLE, Constants.ENDING_NODE);
graph.secondPhaseFinished();
graph.addRelation(GraphTest.CREATE, GraphTest.TABLE);
graph.secondPhaseFinished();
final StartingNode node = graph.getStartingNode(); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1131 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1242 |
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_ENDING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_2;
return xml;
}
/**
* Tests that the configuration file has wrongly defined the delimiters.
*
* @throws AbstractZemucanException
* Never
*/
@Test
public void testEmptyDelimiters() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 342 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 2019 |
final Graph graph = new Graph(GraphTest.VALIDATED_TWICE, false);
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(Constants.STARTING_NODE, GraphTest.TABLE);
graph.addRelation(GraphTest.CREATE, Constants.ENDING_NODE);
graph.addRelation(GraphTest.TABLE, Constants.ENDING_NODE);
graph.secondPhaseFinished();
graph.addRelation(GraphTest.CREATE, GraphTest.TABLE); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 342 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1988 |
final Graph graph = new Graph("validated twice extra nodes", true); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(Constants.STARTING_NODE, GraphTest.TABLE);
graph.addRelation(GraphTest.CREATE, Constants.ENDING_NODE);
graph.addRelation(GraphTest.TABLE, Constants.ENDING_NODE);
graph.secondPhaseFinished();
graph.addRelation(GraphTest.CREATE, GraphTest.TABLE); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1131 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1593 |
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_ENDING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_2; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1242 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1284 |
+ ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_ENDING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_2; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1179 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1437 |
.info("testErrorBuildWithExtraTokens");
ImplementationXMLGrammarReaderTest.LOGGER.debug(xml);
final ImplementationXMLGrammarReader grammar = new ImplementationXMLGrammarReader(
actual, contentToParse, contentToValidate);
grammar.generateGraph();
grammar.getStartingNode();
final Graph expected = new Graph(
ImplementationXMLGrammarReaderTest.NORMAL_GRAPH, false);
expected
.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
expected.addNode(ImplementationXMLGrammarReaderTest.CREATE,
ImplementationXMLGrammarReaderTest.CREATE, true);
expected.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
expected.firstPhaseFinished();
expected.addRelation(Constants.STARTING_NODE,
ImplementationXMLGrammarReaderTest.CREATE);
expected.addRelation(ImplementationXMLGrammarReaderTest.CREATE,
Constants.ENDING_NODE);
expected.secondPhaseFinished();
Assert.assertFalse( |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1131 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1284 |
+ ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_ENDING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_2; |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1182 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1315 |
final Graph graph = new Graph("not going ending node", true); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.addNode(GraphTest.OTHER, GraphTest.OTHER, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(GraphTest.CREATE, GraphTest.TABLE);
graph.addRelation(GraphTest.TABLE, Constants.ENDING_NODE);
graph.addRelation(GraphTest.TABLE, GraphTest.OTHER); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 342 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1929 |
final Graph graph = new Graph(GraphTest.VALIDATED_GRAPH, false);
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(Constants.STARTING_NODE, GraphTest.TABLE);
graph.addRelation(GraphTest.CREATE, Constants.ENDING_NODE);
graph.addRelation(GraphTest.TABLE, Constants.ENDING_NODE);
graph.secondPhaseFinished(); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 342 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1900 |
final Graph graph = new Graph("validated extra nodes", true); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(Constants.STARTING_NODE, GraphTest.TABLE);
graph.addRelation(GraphTest.CREATE, Constants.ENDING_NODE);
graph.addRelation(GraphTest.TABLE, Constants.ENDING_NODE);
graph.secondPhaseFinished(); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 727 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 767 |
final List<Token> phraseIn = new ArrayList<Token>();
// Bogus warning in the next lines, but it's a test case :)
phraseIn.add(new Token(tokenIn1, true));
phraseIn.add(new Token(tokenIn2, true));
phraseIn.add(new Token(tokenIn3, true));
phraseIn.add(new Token(tokenIn4, true));
phraseIn.add(new Token(tokenIn5, true));
phraseIn.add(new Token(tokenIn6, true));
phraseIn.add(new Token(tokenIn7, true));
phraseIn.add(new Token(tokenIn8, true)); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 584 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 618 |
public void testGetOptions4options() throws AbstractZemucanException {
final String tokenIn1 = ImplementationSyntacticAnalyzerTest.CREATE;
final String tokenIn2 = ImplementationSyntacticAnalyzerTest.TABLE;
final String tokenIn3 = ImplementationSyntacticAnalyzerTest.T1;
final String tokenIn4 = ImplementationSyntacticAnalyzerTest.OPEN_PARENTHESIS;
final String option1 = ImplementationSyntacticAnalyzerTest.COL_NAME;
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
phraseIn.add(new Token(tokenIn2, true));
phraseIn.add(new Token(tokenIn3, true));
phraseIn.add(new Token(tokenIn4, true));
final boolean endsWithSpace = false;
final GraphAnswer graph = ImplementationSyntacticAnalyzer.getInstance() |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 238 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 1081 |
public void testCase6() throws AbstractZemucanException {
final String cmdIn = "db2 create tables"; //$NON-NLS-1$
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2 create tablespace";
final int actualOptionsSize = ret.getOptions().length;
final int actualPhrasesSize = ret.getPhrases().length;
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertEquals("options: '" + cmdIn + "'", 0, actualOptionsSize);
// The only option is added in the phrase.
Assert.assertEquals("phrases: '" + cmdIn + "'", 0, actualPhrasesSize);
}
/**
* Tests case 7: Zero phrases and multiples options. command 'db2 create'
*
* @throws AbstractZemucanException
*/
@Test
public void testCase7() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/tools/messages/executer/MessagesTest.java | Zemucan - executer impl | 52 |
name/angoca/zemucan/tools/messages/MessagesTest.java | Zemucan - Core - tools | 52 |
@RunWith(RandomTestRunner.class)
public final class MessagesTest {
/**
* Default constructor.
*/
public MessagesTest() {
// Nothing.
}
/**
* Tests to obtain an empty message.
*/
@Test(expected = AssertionError.class)
public void testGetEmpty() {
Messages.getString(""); //$NON-NLS-1$
}
/**
* Tests to obtain a null message.
*/
@Test(expected = AssertionError.class)
public void testGetNull() {
Messages.getString(null);
}
/**
* Test the retrieve of a non existing message.
*/
@Test
public void testGetStringNotExistant() {
final String name = "NOT_EXISTING_MESSAGE"; //$NON-NLS-1$
final String actual = Messages.getString(name);
final String expected = '¡' + name + '!';
Assert.assertEquals("Not existing message", expected, actual); //$NON-NLS-1$
}
} |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 735 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 957 |
public void testCase1() throws AbstractZemucanException {
final String cmdIn = "db2"; //$NON-NLS-1$
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2";
final int actualOptionsSize = ret.getOptions().length;
final int actualPhrasesSize = ret.getPhrases().length;
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
// catalog, create, attach
Assert.assertEquals("options: '" + cmdIn + "'", 3, actualOptionsSize);
// db2ilist, db2auto, db2fm, db2fmcu
Assert.assertEquals("phrases: '" + cmdIn + "'", 4, actualPhrasesSize);
} |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 171 |
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 281 |
public void testHashCode() throws InvalidTokenException {
final String phrase1 = GraphAnswerTest.CREATE;
final String option1 = GraphAnswerTest.TABLE;
final String option2 = GraphAnswerTest.TABLESPACE;
final List<Token> phrases = new ArrayList<Token>();
phrases.add(new Token(phrase1, true));
final List<Token> options = new ArrayList<Token>();
options.add(new Token(option1, true));
options.add(new Token(option2, true));
final GraphAnswer object = new GraphAnswer(phrases, options); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1127 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1384 |
private String testEmptyGrammarText() {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += " <idToken>STARTING_NODE</idToken>"; //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 247 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1340 |
public void testEmptyGrammar() throws AbstractZemucanException {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_ENDING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2; |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 689 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 767 |
final List<Token> phraseIn = new ArrayList<Token>();
// Bogus warning in the next lines, but it's a test case :)
phraseIn.add(new Token(tokenIn1, true));
phraseIn.add(new Token(tokenIn2, true));
phraseIn.add(new Token(tokenIn3, true));
phraseIn.add(new Token(tokenIn4, true));
phraseIn.add(new Token(tokenIn5, true));
phraseIn.add(new Token(tokenIn6, true));
phraseIn.add(new Token(tokenIn7, true)); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 865 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 889 |
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2 create";
final int actualOptionsSize = ret.getOptions().length;
final int actualPhrasesSize = ret.getPhrases().length;
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertEquals("options: '" + cmdIn + "'", 0, actualOptionsSize);
Assert.assertEquals("phrases: '" + cmdIn + "'", 0, actualPhrasesSize);
}
/**
* Tests the command ' db2 crea'
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void test8a() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 612 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 712 |
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2";
final int actualOptionsSize = ret.getOptions().length;
final int actualPhrasesSize = ret.getPhrases().length;
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
// EMPTY
Assert.assertEquals("options: '" + cmdIn + "'", 0, actualOptionsSize);
// db2, db2ilist, db2auto, db2fm, db2fmcu
Assert.assertEquals("phrases: '" + cmdIn + "'", 5, actualPhrasesSize);
}
/**
* Tests the command 'db2'
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void test4() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 560 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 738 |
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2";
final int actualOptionsSize = ret.getOptions().length;
final int actualPhrasesSize = ret.getPhrases().length;
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
// catalog, create, attach
Assert.assertEquals("options: '" + cmdIn + "'", 3, actualOptionsSize);
// db2ilist, db2auto, db2fm, db2fmcu
Assert.assertEquals("phrases: '" + cmdIn + "'", 4, actualPhrasesSize);
}
/**
* Tests the command 'db2 '
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void test5() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 191 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 1108 |
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2 create table";
final int actualOptionsSize = ret.getOptions().length;
final int actualPhrasesSize = ret.getPhrases().length;
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertEquals("options: '" + cmdIn + "'", 2, actualOptionsSize);
Assert.assertEquals("phrases: '" + cmdIn + "'", 0, actualPhrasesSize);
}
/**
* Tests case 8: Zero phrases and one option. command 'db2 create table'
*
* @throws AbstractZemucanException
*/
@Test
public void testCase8() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/interfaze/model/ReturnOptionsTest.java | Zemucan - Core - ui API | 112 |
name/angoca/zemucan/interfaze/model/ReturnOptionsTest.java | Zemucan - Core - ui API | 303 |
public void testHashCodeDifferent() throws ParameterNullException {
final String phrase1 = "create table"; //$NON-NLS-1$
final String phrase11 = ReturnOptionsTest.TABLESPACE;
final String option11 = ReturnOptionsTest.TABLE_NAME;
final String phrase2 = ReturnOptionsTest.CREATE;
final String option21 = ReturnOptionsTest.TABLE;
final String option22 = ReturnOptionsTest.TABLESPACE;
final ReturnOptions object1 = new ReturnOptions(phrase1,
new String[] { phrase11 }, new String[] { option11 });
final ReturnOptions object2 = new ReturnOptions(phrase2,
new String[] {}, new String[] { option21, option22 }); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 563 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1384 |
private String testBuildWithExtraTokensText() {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN; |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 555 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1873 |
public void testValidateGraph() throws AbstractZemucanException {
final Graph graph = new Graph(GraphTest.VALIDATED_GRAPH, false);
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(GraphTest.CREATE, Constants.ENDING_NODE);
graph.secondPhaseFinished();
final GraphState actual = graph.getGraphState(); |
File | Project | Line |
---|
name/angoca/zemucan/tools/messages/executer/Messages.java | Zemucan - executer API | 61 |
name/angoca/zemucan/tools/messages/Messages.java | Zemucan - Core - tools | 61 |
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(Messages.BUNDLE_NAME);
/**
* Retrieves a message for the given string.
*
* @param key
* Name of the message.
* @return Message in the corresponding language.
*/
public static/* ! */String getString(final String/* ! */key) {
assert (key != null) && !key.equals(""); //$NON-NLS-1$
String message = ""; //$NON-NLS-1$
try {
message = Messages.RESOURCE_BUNDLE.getString(key);
} catch (final MissingResourceException e) {
message = '¡' + key + '!';
}
assert (message != null) && !message.equals(""); //$NON-NLS-1$
return message;
}
/**
* Default constructor hidden.
*/
private Messages() {
// Nothing. No tests.
}
} |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/Graph.java | Zemucan - Core - graph | 563 |
name/angoca/zemucan/core/graph/model/Graph.java | Zemucan - Core - graph | 928 |
"Removing relation in graph '{}' between '{}' and '{}'", //$NON-NLS-1$
new String[] { this.name, parentId, childId });
if (parentId == null) {
throw new ParameterNullException("parentId"); //$NON-NLS-1$
}
if (childId == null) {
throw new ParameterNullException("childId"); //$NON-NLS-1$
}
if (this.graphState.equals(GraphState.FirstPhase)) {
throw new InvalidGraphStateException(this.graphState,
GraphState.SecondPhase);
}
if (this.graphState.equals(GraphState.Validated)) {
this.graphState = GraphState.SecondPhase;
}
final AbstractGraphNode parent = this.nodes.get(this.name + ':' |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 241 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 1155 |
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2 create tablespace";
final int actualOptionsSize = ret.getOptions().length;
final int actualPhrasesSize = ret.getPhrases().length;
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertEquals("options: '" + cmdIn + "'", 0, actualOptionsSize);
Assert.assertEquals("phrases: '" + cmdIn + "'", 0, actualPhrasesSize);
} |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 233 |
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 425 |
public void testToString() throws InvalidTokenException {
final String phrase1 = GraphAnswerTest.CREATE;
final String option1 = GraphAnswerTest.TABLE;
final String option2 = GraphAnswerTest.TABLESPACE;
final List<Token> phrases1 = new ArrayList<Token>();
phrases1.add(new Token(phrase1, true));
final List<Token> options1 = new ArrayList<Token>();
options1.add(new Token(option1, true));
options1.add(new Token(option2, true));
final GraphAnswer answer = new GraphAnswer(phrases1, options1); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 626 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 656 |
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
phraseIn.add(new Token(tokenIn2, true));
phraseIn.add(new Token(tokenIn3, true));
phraseIn.add(new Token(tokenIn4, true));
final boolean endsWithSpace = false;
final GraphAnswer graph = ImplementationSyntacticAnalyzer.getInstance()
.analyzeTokens(phraseIn, endsWithSpace);
final List<Token> actual = graph.getPhrases(); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1750 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1809 |
final Graph graph = new Graph(name, false);
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
final String id = "CREA"; //$NON-NLS-1$
final String nameNode = GraphTest.CREATE;
graph.addNode(id, nameNode, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, id);
graph.addRelation(id, Constants.ENDING_NODE);
graph.secondPhaseFinished();
final String actual = graph.toString(); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 496 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 527 |
public void testGetOptions3options() throws AbstractZemucanException {
final String tokenIn1 = ImplementationSyntacticAnalyzerTest.CREATE;
final String tokenIn2 = ImplementationSyntacticAnalyzerTest.TABLE;
final String tokenIn3 = ImplementationSyntacticAnalyzerTest.T1;
final String option1 = ImplementationSyntacticAnalyzerTest.OPEN_PARENTHESIS;
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
phraseIn.add(new Token(tokenIn2, true));
phraseIn.add(new Token(tokenIn3, true));
final boolean endsWithSpace = false;
final GraphAnswer graph = ImplementationSyntacticAnalyzer.getInstance() |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 563 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 644 |
public void testBuildNoEndingNode() throws AbstractZemucanException {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2; |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 764 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 789 |
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2 ";
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
// catalog, create, attach
Assert.assertTrue("options: '" + cmdIn + "'",
ret.getOptions().length == 3);
Assert.assertTrue("phrases: '" + cmdIn + "'",
ret.getPhrases().length == 0);
}
/**
* Tests the command 'db2 c'
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void test6() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 363 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 387 |
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2 create table t1 (";
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertTrue("options: '" + cmdIn + "'",
ret.getOptions().length == 0);
Assert.assertTrue("phrases: '" + cmdIn + "'",
ret.getPhrases().length == 0);
}
/**
* Tests the command 'd'
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void test2() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 217 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 289 |
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2 create table";
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertTrue("options: '" + cmdIn + "'",
ret.getOptions().length == 0);
Assert.assertTrue("phrases: '" + cmdIn + "'",
ret.getPhrases().length == 2);
}
/**
* Tests the command 'db2 create table'
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void test16() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/Graph.java | Zemucan - Core - graph | 530 |
name/angoca/zemucan/core/graph/model/Graph.java | Zemucan - Core - graph | 895 |
public void removeRelation(final AbstractGraphNode parentNode,
final AbstractGraphNode childNode)
throws AbstractZemucanException {
final int size = this.name.length() + 1;
String parentId = parentNode.getId();
String childId = childNode.getId();
if (parentId.startsWith(this.name)) {
parentId = parentId.substring(size);
}
if (childId.startsWith(this.name)) {
childId = childId.substring(size);
}
this.removeRelation(parentId, childId); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 389 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 803 |
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
phraseIn.add(new Token(tokenIn2, true));
final boolean endsWithSpace = false;
final GraphAnswer actual = ImplementationSyntacticAnalyzer
.getInstance().analyzeTokens(phraseIn, endsWithSpace);
final List<Token> phraseOut = new ArrayList<Token>();
phraseOut.add(new Token(tokenOut1, true)); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1366 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1393 |
final Graph graph = new Graph("referencing starting node", true); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(GraphTest.CREATE, Constants.ENDING_NODE);
Exception e = null;
try {
graph.addRelation(GraphTest.CREATE, Constants.STARTING_NODE); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 644 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 813 |
public void testBuildNoName() throws AbstractZemucanException {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.RESERVED; |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 117 |
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 403 |
public void testSymmetric() throws InvalidTokenException {
final String tokenString1 = GraphAnswerTest.TEST1;
final String tokenString2 = GraphAnswerTest.TEST2;
final List<Token> phrases = new ArrayList<Token>();
phrases.add(new Token(tokenString1, true));
final List<Token> options = new ArrayList<Token>();
options.add(new Token(tokenString2, true));
final GraphAnswer actual = new GraphAnswer(phrases, options);
final boolean value = actual.equals(actual); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 283 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 362 |
final GraphAnswer actual = ImplementationSyntacticAnalyzer
.getInstance().analyzeTokens(phraseIn, endsWithSpace);
final List<Token> phraseOut = new ArrayList<Token>();
final List<Token> options = new ArrayList<Token>();
options.add(new Token(option1, true));
options.add(new Token(option2, true));
final GraphAnswer expected = new GraphAnswer(phraseOut, options);
Assert.assertEquals("'create ' command", expected, actual); //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1540 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1692 |
expected += expectedGraphName + graphName1 + ':'
+ Constants.ENDING_NODE + '-' + expectedGraphName + graphName1
+ ':' + Constants.ENDING_NODE + '\n';
expected += expectedGraphName + graphName1 + ':'
+ Constants.STARTING_NODE + '-' + expectedGraphName
+ graphName1 + ':' + Constants.STARTING_NODE + '\n';
expected += expectedGraphName + graphName1 + ':' + a + '-' + a + '\n';
expected += expectedGraphName + graphName1 + ':' + create1Id + '-'
+ create + '\n';
expected += expectedGraphName + graphName1 + ':' + e + '-' + e + '\n'; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1242 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1388 |
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += " <idToken>STARTING_NODE</idToken>"; //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1107 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1187 |
ImplementationXMLGrammarReaderTest.NORMAL_GRAPH, false);
expected
.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
expected.addNode(ImplementationXMLGrammarReaderTest.CREATE,
ImplementationXMLGrammarReaderTest.CREATE, true);
expected.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
expected.firstPhaseFinished();
expected.addRelation(Constants.STARTING_NODE,
ImplementationXMLGrammarReaderTest.CREATE);
expected.addRelation(ImplementationXMLGrammarReaderTest.CREATE,
Constants.ENDING_NODE);
expected.secondPhaseFinished();
Assert.assertEquals("Simple graph without extra tokens", expected, //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1284 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1388 |
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += " <idToken>STARTING_NODE</idToken>"; //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 534 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 562 |
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
phraseIn.add(new Token(tokenIn2, true));
phraseIn.add(new Token(tokenIn3, true));
final boolean endsWithSpace = false;
final GraphAnswer graph = ImplementationSyntacticAnalyzer.getInstance()
.analyzeTokens(phraseIn, endsWithSpace);
final List<Token> actual = graph.getPhrases(); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 506 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 596 |
phraseIn.add(new Token(tokenIn4, true));
final boolean endsWithSpace = false;
final GraphAnswer actual = ImplementationSyntacticAnalyzer
.getInstance().analyzeTokens(phraseIn, endsWithSpace);
final List<Token> phraseOut = new ArrayList<Token>();
final List<Token> options = new ArrayList<Token>();
options.add(new Token(option1, true));
final GraphAnswer expected = new GraphAnswer(phraseOut, options);
Assert.assertEquals("Phrases for 'create table t1' command", //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 180 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1874 |
final Graph graph = new Graph(GraphTest.VALIDATED_GRAPH, false);
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(GraphTest.CREATE, Constants.ENDING_NODE);
graph.secondPhaseFinished(); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 813 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1127 |
private String testBuildWithExtraTokensText() {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 567 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1242 |
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN; |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 556 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 991 |
final Graph graph = new Graph(graphName, true); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(GraphTest.CREATE, Constants.ENDING_NODE);
graph.secondPhaseFinished();
final StartingNode startingNode = graph.getStartingNode(); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 342 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 420 |
final Graph graph = new Graph(GraphTest.DUMMY_GRAPH, true);
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(GraphTest.CREATE, GraphTest.TABLE); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 644 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 755 |
public void testBuildNoIdNoName() throws AbstractZemucanException {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.RESERVED; |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 180 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 991 |
final Graph graph = new Graph(graphName, true); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(GraphTest.CREATE, Constants.ENDING_NODE);
graph.secondPhaseFinished(); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 567 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1284 |
+ ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 916 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1143 |
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_ENDING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_2; |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 280 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 829 |
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
final boolean endsWithSpace = false;
final GraphAnswer actual = ImplementationSyntacticAnalyzer
.getInstance().analyzeTokens(phraseIn, endsWithSpace);
final List<Token> phraseOut = new ArrayList<Token>();
final List<Token> options = new ArrayList<Token>(); |
File | Project | Line |
---|
name/angoca/zemucan/interfaze/model/ReturnOptionsTest.java | Zemucan - Core - ui API | 186 |
name/angoca/zemucan/interfaze/model/ReturnOptionsTest.java | Zemucan - Core - ui API | 331 |
public void testHashCodeIdentical() throws ParameterNullException {
final String phrase = "create table"; //$NON-NLS-1$
final String phrase1 = ReturnOptionsTest.TABLESPACE;
final String option1 = ReturnOptionsTest.TABLE_NAME;
final ReturnOptions object1 = new ReturnOptions(phrase,
new String[] { phrase1 }, new String[] { option1 });
final ReturnOptions object2 = new ReturnOptions(phrase,
new String[] { phrase1 }, new String[] { option1 }); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 991 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1366 |
final Graph graph = new Graph("referencing ending node", true); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(GraphTest.CREATE, Constants.ENDING_NODE); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 696 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1127 |
private String testBuildWithExtraTokensText() {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 648 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1242 |
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN; |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 197 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 281 |
phraseIn.add(new Token(tokenIn1, true));
final boolean endsWithSpace = false;
final GraphAnswer actual = ImplementationSyntacticAnalyzer
.getInstance().analyzeTokens(phraseIn, endsWithSpace);
final List<Token> phraseOut = new ArrayList<Token>();
final List<Token> options = new ArrayList<Token>();
options.add(new Token(option1, true));
options.add(new Token(option2, true)); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 1061 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 1108 |
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2 create table";
final int actualOptionsSize = ret.getOptions().length;
final int actualPhrasesSize = ret.getPhrases().length;
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertEquals("options: '" + cmdIn + "'", 2, actualOptionsSize); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 560 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 638 |
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2";
final int actualOptionsSize = ret.getOptions().length;
final int actualPhrasesSize = ret.getPhrases().length;
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
// EMPTY
Assert.assertEquals("options: '" + cmdIn + "'", 0, actualOptionsSize); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 191 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 1061 |
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2 create table";
final int actualOptionsSize = ret.getOptions().length;
final int actualPhrasesSize = ret.getPhrases().length;
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertEquals("options: '" + cmdIn + "'", 1, actualOptionsSize); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 247 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 962 |
public void testBuildNotAllChildren() throws AbstractZemucanException {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2; |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 389 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 853 |
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
phraseIn.add(new Token(tokenIn2, true));
final boolean endsWithSpace = false;
final GraphAnswer actual = ImplementationSyntacticAnalyzer
.getInstance().analyzeTokens(phraseIn, endsWithSpace);
final List<Token> phraseOut = new ArrayList<Token>(); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 838 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 894 |
expected += expectedGraphName + graphName2 + ':'
+ Constants.ENDING_NODE + '-' + expectedGraphName + graphName2
+ ':' + Constants.ENDING_NODE + '\n';
expected += expectedGraphName + graphName2 + ':'
+ Constants.STARTING_NODE + '-' + expectedGraphName
+ graphName2 + ':' + Constants.STARTING_NODE + '\n';
expected += expectedGraphName + graphName2 + ':' + create + '-'
+ create + '\n';
expected += ")]"; //$NON-NLS-1$
Assert.assertEquals("Merge and Simplify", expected, actual); //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 648 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1284 |
+ ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN; |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 478 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 598 |
final GraphAnswer actual = ImplementationSyntacticAnalyzer
.getInstance().analyzeTokens(phraseIn, endsWithSpace);
final List<Token> phraseOut = new ArrayList<Token>();
final List<Token> options = new ArrayList<Token>();
options.add(new Token(option1, true));
final GraphAnswer expected = new GraphAnswer(phraseOut, options);
Assert.assertEquals("'create table t1' command", expected, //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 118 |
name/angoca/zemucan/interfaze/InterfaceCoreTest.java | Zemucan - Core - interface | 89 |
@BeforeClass
public static void setUpBeforeClass() throws AbstractZemucanException {
System.setProperty(Constants.ZEMUCAN_CONF_XML_PROPERTY,
"sa_conf-test.xml"); //$NON-NLS-1$
Configurator.getInstance().setProperty(
Constants.GRAMMAR_READER_NAME_PROPERTY,
Configurator.GRAMMAR_READER_NAME_VALUE);
Configurator.getInstance()
.setProperty(Constants.GRAMMAR_FILE_DESCRIPTORS_PROPERTY,
"grammar-test.xml"); //$NON-NLS-1$
// Creates the lexical analyzer instance.
ImplementationLexicalAnalyzer.getInstance();
}
/**
* Clears the configuration file name property at the end of the test.
*/
@AfterClass
public static void tearDownAfterClass() {
// Destroys any existent instance.
ImplementationLexicalAnalyzer.destroyInstance(); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 117 |
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 373 |
public void testSimpleMethods() throws AbstractZemucanException {
final String tokenString1 = GraphAnswerTest.TEST1;
final String tokenString2 = GraphAnswerTest.TEST2;
final List<Token> phrases = new ArrayList<Token>();
phrases.add(new Token(tokenString1, true));
final List<Token> options = new ArrayList<Token>();
options.add(new Token(tokenString2, true));
final GraphAnswer graphAnswer = new GraphAnswer(phrases, options); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 592 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 656 |
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
phraseIn.add(new Token(tokenIn2, true));
phraseIn.add(new Token(tokenIn3, true));
phraseIn.add(new Token(tokenIn4, true));
final boolean endsWithSpace = false;
final GraphAnswer graph = ImplementationSyntacticAnalyzer.getInstance() |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 248 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 671 |
final int actualOptionsSize = ret.getOptions().length;
final int actualPhrasesSize = ret.getPhrases().length;
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertEquals("options: '" + cmdIn + "'", 0, actualOptionsSize);
Assert.assertEquals("phrases: '" + cmdIn + "'", 0, actualPhrasesSize);
}
/**
* Tests the command 'db2 crea '
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void test9() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 696 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 737 |
phraseIn.add(new Token(tokenIn1, true));
final boolean endsWithSpace = false;
final GraphAnswer actual = ImplementationSyntacticAnalyzer
.getInstance().analyzeTokens(phraseIn, endsWithSpace);
final List<Token> phraseOut = new ArrayList<Token>();
final List<Token> options = new ArrayList<Token>();
final GraphAnswer expected = new GraphAnswer(phraseOut, options);
Assert.assertEquals("'toto' phrase", expected, actual); //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 418 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 446 |
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
phraseIn.add(new Token(tokenIn2, true));
final boolean endsWithSpace = false;
final GraphAnswer graph = ImplementationSyntacticAnalyzer.getInstance()
.analyzeTokens(phraseIn, endsWithSpace);
final List<Token> actual = graph.getPhrases(); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 412 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 468 |
public void testGetOptions2WithSpace() throws AbstractZemucanException {
final String tokenIn1 = ImplementationSyntacticAnalyzerTest.CREATE;
final String tokenIn2 = ImplementationSyntacticAnalyzerTest.TABLE;
final String option1 = ImplementationSyntacticAnalyzerTest.TABLE_NAME;
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
phraseIn.add(new Token(tokenIn2, true));
final boolean endsWithSpace = true; |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 200 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 362 |
final GraphAnswer actual = ImplementationSyntacticAnalyzer
.getInstance().analyzeTokens(phraseIn, endsWithSpace);
final List<Token> phraseOut = new ArrayList<Token>();
final List<Token> options = new ArrayList<Token>();
options.add(new Token(option1, true));
options.add(new Token(option2, true)); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1521 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1590 |
graph2.addRelation(z, Constants.ENDING_NODE);
graph2.secondPhaseFinished();
graph2.merge(graph1);
graph1.simplifyGraph();
final String actual = graph1.toString();
String expectedGraphName = "merged:{" + graphName1 + ',' + graphName2
+ "}:";
String expected = expectedGraphName + '[' + GraphState.Validated
+ "-WithoutExtraNodes{{" + Constants.STARTING_NODE + '<'
+ expectedGraphName + graphName1 + ':' + create1Id + '-' |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 714 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 772 |
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_ENDING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_2;
final Graph graph = new Graph("node without name", false); //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 420 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 630 |
phraseIn.add(new Token(tokenIn4, true));
final boolean endsWithSpace = false;
final GraphAnswer graph = ImplementationSyntacticAnalyzer.getInstance()
.analyzeTokens(phraseIn, endsWithSpace);
final List<Token> actual = graph.getOptions();
final List<Token> expected = new ArrayList<Token>();
expected.add(new Token(option1, true));
Assert.assertEquals("Options for 'create table t1 (' command", //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 713 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 918 |
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_ENDING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_2;
final String id = "no StartingNode"; //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/ui/impl/jline/ImplementationJlineInterfaceController.java | Zemucan - ui impl jLine | 138 |
name/angoca/zemucan/ui/impl/system/ImplementationSystemInterfaceController.java | Zemucan - ui impl System | 118 |
if (Boolean.parseBoolean(Configurator.getInstance().getProperty(
AbstractInterfaceController.SHOW_LICENSE))) {
this.output.writeLine(AboutNode.readAboutInformation());
}
// Shows a introductory help.
if (Boolean.parseBoolean(Configurator.getInstance().getProperty(
AbstractInterfaceController.SHOW_INTRO_PROPERTY))) {
this.output
.writeLine(Messages
.getString("ImplementationSystemInterfaceController.Instructions")); //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/executer/impl/ImplementationExecuterTest.java | Zemucan - executer impl | 222 |
name/angoca/zemucan/executer/impl/ImplementationExecuterTest.java | Zemucan - executer impl | 252 |
System.setProperty(ImplementationExecuter.DB2_PARAMS, "-v"); //$NON-NLS-1$
final String command = "db2 !dir"; //$NON-NLS-1$
final String os = System.getProperty("os.name"); //$NON-NLS-1$
System.setProperty("os.name", "Windows 7"); //$NON-NLS-1$ //$NON-NLS-2$
final String[] actuals = ImplementationExecuter.getInstance()
.getCommandsToExecute(command);
System.setProperty("os.name", os); //$NON-NLS-1$
final String[] expecteds = new String[] { "cmd.exe", "/c", "db2", "-v", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 555 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 581 |
final String cmdOut = "create table t2 ( "; //$NON-NLS-1$
final String opt1 = ImplementationLexicalAnalyzerTest.COL_NAME;
final ReturnOptions actual = ImplementationLexicalAnalyzer
.getInstance().analyzePhrase(cmdIn);
final ReturnOptions expected = new ReturnOptions(cmdOut,
new String[] {}, new String[] { opt1 });
Assert.assertEquals("object for 'create table t2 ('", expected, //$NON-NLS-1$
actual);
}
/**
* Test of the options for the 'create table t2(c1' command.
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void testDataType() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/AboutNodeTest.java | Zemucan - Core - graph | 206 |
name/angoca/zemucan/core/graph/model/EndingNodeTest.java | Zemucan - Core - graph | 195 |
final EndingNode actual = new EndingNode(new Graph("test", false));
Assert.assertTrue("HashCode different to 1", //$NON-NLS-1$
1 != actual.hashCode());
Assert.assertTrue("HashCode different to 0", //$NON-NLS-1$
0 != actual.hashCode());
Assert.assertTrue("HashCode different to -1", //$NON-NLS-1$
-1 != actual.hashCode());
}
/**
* Test the equals method to a null.
*
* @throws AbstractZemucanException
* Never
*/
@Test
public void testNullEqualsObject() throws AbstractZemucanException {
final EndingNode actual = new EndingNode(new Graph("test", false)); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1089 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1427 |
public void testErrorBuildWithExtraTokens() throws AbstractZemucanException {
final String xml = this.testBuildWithExtraTokensText();
final String id = ImplementationXMLGrammarReaderTest.NORMAL_GRAPH;
final Graph actual = new Graph(id, true);
final InputSource contentToParse = new InputSource(
new StringReader(xml));
final InputSource contentToValidate = new InputSource(new StringReader(
xml));
ImplementationXMLGrammarReaderTest.LOGGER
.info("testErrorBuildWithExtraTokens"); |
File | Project | Line |
---|
name/angoca/zemucan/tools/messages/executer/Messages.java | Zemucan - executer API | 72 |
name/angoca/zemucan/tools/messages/xml/Messages.java | Zemucan - grammar reader impl XML | 74 |
assert !key.equals(""); //$NON-NLS-1$
String message = ""; //$NON-NLS-1$
try {
message = Messages.RESOURCE_BUNDLE.getString(key);
} catch (final MissingResourceException e) {
message = '¡' + key + '!';
}
assert (message != null) && !message.equals(""); //$NON-NLS-1$
return message;
}
/**
* Default constructor hidden.
*/
private Messages() {
// Nothing. No tests.
}
} |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 309 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 630 |
phraseIn.add(new Token(tokenIn2, true));
final boolean endsWithSpace = false;
final GraphAnswer graph = ImplementationSyntacticAnalyzer.getInstance()
.analyzeTokens(phraseIn, endsWithSpace);
final List<Token> actual = graph.getOptions();
final List<Token> expected = new ArrayList<Token>();
expected.add(new Token(option1, true)); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 592 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 767 |
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
phraseIn.add(new Token(tokenIn2, true));
phraseIn.add(new Token(tokenIn3, true));
phraseIn.add(new Token(tokenIn4, true)); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 420 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1182 |
final Graph graph = new Graph("not coming starting node", true); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.addNode(GraphTest.OTHER, GraphTest.OTHER, true); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 293 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 430 |
final String node23 = GraphNodeTest.TABLESPACE;
final GraphNode actual = new GraphNode(node11, graph);
final GraphNode child1 = new GraphNode(node12, graph);
actual.addChild(child1);
final GraphNode expected = new GraphNode(node21, graph);
final GraphNode child2 = new GraphNode(node22, graph);
expected.addChild(child2);
final GraphNode child3 = new GraphNode(node23, graph); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNode.java | Zemucan - Core - graph | 148 |
name/angoca/zemucan/core/graph/model/NonReservedGraphNode.java | Zemucan - Core - graph | 81 |
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public final int hashCode() {
int superHash = super.hashCode();
if (superHash == 0) {
superHash = 1;
}
final int value = superHash + GraphNode.class.getName().hashCode();
return value;
}
/*
* (non-Javadoc)
*
* @see
* name.angoca.zemucan.core.graph.model.AbstractGraphNode#represent(java
* .lang.String)
*/
@Override
public final boolean represent(final String/* ! */token) { |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 831 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 919 |
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_ENDING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_2;
final String id = "no StartingNode"; //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1538 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1606 |
+ z + "]}}(4:\n";
expected += expectedGraphName + graphName1 + ':'
+ Constants.ENDING_NODE + '-' + expectedGraphName + graphName1
+ ':' + Constants.ENDING_NODE + '\n';
expected += expectedGraphName + graphName1 + ':'
+ Constants.STARTING_NODE + '-' + expectedGraphName
+ graphName1 + ':' + Constants.STARTING_NODE + '\n';
expected += expectedGraphName + graphName1 + ':' + create1Id + '-' |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1318 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1627 |
ImplementationXMLGrammarReaderTest.LOGGER.info("testNoDelimiters");
ImplementationXMLGrammarReaderTest.LOGGER.debug(xml);
final ImplementationXMLGrammarReader grammar = new ImplementationXMLGrammarReader(
graph, contentToParse, contentToValidate);
Exception e = null;
try {
grammar.generateGraph();
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("DelimitersIncorrectlyDefinedException",
e instanceof DelimitersIncorrectlyDefinedException);
}
/**
* Tests a not existing file as grammar.
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void testNotExistingFile() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1146 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1350 |
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_ENDING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_2; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 887 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 940 |
.info("testBuildNoStartingNode");
ImplementationXMLGrammarReaderTest.LOGGER.debug(xml);
final ImplementationXMLGrammarReader grammar = new ImplementationXMLGrammarReader(
graph, contentToParse, contentToValidate);
Exception e = null;
try {
grammar.generateGraph();
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("StartingNodeNotDefinedException",
e instanceof StartingNodeNotDefinedException);
}
/**
* Tests a grammar that has defined all the nodes that are children.
*
* @throws AbstractZemucanException
* Never
*/
@Test
public void testBuildNotAllChildren() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 515 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 714 |
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_ENDING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_2; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 313 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1067 |
.info("testBuildUnknownStructure");
ImplementationXMLGrammarReaderTest.LOGGER.debug(xml);
final ImplementationXMLGrammarReader grammar = new ImplementationXMLGrammarReader(
graph, contentToParse, contentToValidate);
Exception e = null;
try {
grammar.generateGraph();
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("XMLProblemException",
e instanceof XMLProblemException);
}
/**
* Tests that a simple graph can be constructed with extra tokens.
*
* @throws AbstractZemucanException
* Never
*/
@Test
public void testBuildWithExtraTokens() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 716 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 757 |
public void testGetOptions7() throws AbstractZemucanException {
final String tokenIn1 = ImplementationSyntacticAnalyzerTest.CREATE;
final String tokenIn2 = ImplementationSyntacticAnalyzerTest.TABLE;
final String tokenIn3 = ImplementationSyntacticAnalyzerTest.T1;
final String tokenIn4 = ImplementationSyntacticAnalyzerTest.OPEN_PARENTHESIS;
final String tokenIn5 = ImplementationSyntacticAnalyzerTest.C1;
final String tokenIn6 = ImplementationSyntacticAnalyzerTest.INT;
final String tokenIn7 = ImplementationSyntacticAnalyzerTest.CLOSE_PARENTHESIS;
final String tokenIn8 = "in"; //$NON-NLS-1$
final List<Token> phraseIn = new ArrayList<Token>(); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 1068 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 1138 |
final int actualOptionsSize = ret.getOptions().length;
final int actualPhrasesSize = ret.getPhrases().length;
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertEquals("options: '" + cmdIn + "'", 1, actualOptionsSize);
Assert.assertEquals("phrases: '" + cmdIn + "'", 0, actualPhrasesSize); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 619 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 1091 |
final int actualOptionsSize = ret.getOptions().length;
final int actualPhrasesSize = ret.getPhrases().length;
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertEquals("options: '" + cmdIn + "'", 0, actualOptionsSize);
Assert.assertEquals("phrases: '" + cmdIn + "'", 2, actualPhrasesSize); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 289 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 313 |
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2 create table";
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
// <tableName>
Assert.assertTrue("options: '" + cmdIn + "'",
ret.getOptions().length == 1); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 248 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 1020 |
final int actualOptionsSize = ret.getOptions().length;
final int actualPhrasesSize = ret.getPhrases().length;
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertEquals("options: '" + cmdIn + "'", 0, actualOptionsSize);
Assert.assertEquals("phrases: '" + cmdIn + "'", 2, actualPhrasesSize); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 217 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 313 |
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2 create table";
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
// <tableName>
Assert.assertTrue("options: '" + cmdIn + "'",
ret.getOptions().length == 1); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 198 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 1043 |
final int actualOptionsSize = ret.getOptions().length;
final int actualPhrasesSize = ret.getPhrases().length;
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
// -t, -i
Assert.assertEquals("options: '" + cmdIn + "'", 2, actualOptionsSize);
// db2fmcu
Assert.assertEquals("phrases: '" + cmdIn + "'", 1, actualPhrasesSize); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 141 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 217 |
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2 create table";
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertTrue("options: '" + cmdIn + "'",
ret.getOptions().length == 0); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1182 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1929 |
final Graph graph = new Graph(GraphTest.VALIDATED_GRAPH, false);
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished(); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 700 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1593 |
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 500 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1293 |
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID; |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 274 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 302 |
public void testGetOptions1options() throws AbstractZemucanException {
final String tokenIn1 = ImplementationSyntacticAnalyzerTest.CREATE;
final String option1 = ImplementationSyntacticAnalyzerTest.TABLE;
final String option2 = ImplementationSyntacticAnalyzerTest.TABLESPACE;
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
final boolean endsWithSpace = false;
final GraphAnswer graph = ImplementationSyntacticAnalyzer.getInstance() |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 543 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 944 |
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertTrue("options: '" + cmdIn + "'",
ret.getOptions().length == 0);
Assert.assertTrue("phrases: '" + cmdIn + "'",
ret.getPhrases().length == 0);
}
/**
* Tests case 1: Multiples phrases and multiples options. command 'db2'
*
* @throws AbstractZemucanException
*/
@Test
public void testCase1() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 493 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 518 |
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
// int, char
Assert.assertTrue("options: '" + cmdIn + "'",
ret.getOptions().length == 2);
Assert.assertTrue("phrases: '" + cmdIn + "'",
ret.getPhrases().length == 0);
}
/**
* Tests the command 'db2 create table t1 ( c1 int )'
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void test24() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 444 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 468 |
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
// <colName>
Assert.assertTrue("options: '" + cmdIn + "'",
ret.getOptions().length == 1);
Assert.assertTrue("phrases: '" + cmdIn + "'",
ret.getPhrases().length == 0);
}
/**
* Tests the command 'db2 create table t1 (c1'
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void test22() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 370 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 944 |
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertTrue("options: '" + cmdIn + "'",
ret.getOptions().length == 0);
Assert.assertTrue("phrases: '" + cmdIn + "'",
ret.getPhrases().length == 0);
}
/**
* Tests the command ' db2'
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void test25() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 345 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 444 |
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertTrue("options: '" + cmdIn + "'",
ret.getOptions().length == 1);
Assert.assertTrue("phrases: '" + cmdIn + "'",
ret.getPhrases().length == 0);
}
/**
* Tests the command 'db2 create table t1('
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void test21() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 296 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 845 |
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertTrue("options: '" + cmdIn + "'",
ret.getOptions().length == 0);
Assert.assertTrue("phrases: '" + cmdIn + "'",
ret.getPhrases().length == 2);
}
// TODO v2.0 tests "db2 update db" Aquí se usan alias y no
// funciona
/**
* Tests the command 'db2 c'
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void test7() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 272 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 370 |
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertTrue("options: '" + cmdIn + "'",
ret.getOptions().length == 0);
Assert.assertTrue("phrases: '" + cmdIn + "'",
ret.getPhrases().length == 0);
}
/**
* Tests the command 'db2 create table t1 '
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void test19() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 224 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 845 |
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertTrue("options: '" + cmdIn + "'",
ret.getOptions().length == 0);
Assert.assertTrue("phrases: '" + cmdIn + "'",
ret.getPhrases().length == 2);
}
// TODO v2.0 tests "db2 update db" Aquí se usan alias y no
// funciona
/**
* Tests the command 'db2 c'
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void test7() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 148 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 173 |
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
// int, char
Assert.assertTrue("options: '" + cmdIn + "'",
ret.getOptions().length == 2);
Assert.assertTrue("phrases: '" + cmdIn + "'",
ret.getPhrases().length == 0);
}
/**
* Tests the command 'db2 create table t1( c1'
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void test23() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1608 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1692 |
expected += expectedGraphName + graphName1 + ':'
+ Constants.ENDING_NODE + '-' + expectedGraphName + graphName1
+ ':' + Constants.ENDING_NODE + '\n';
expected += expectedGraphName + graphName1 + ':'
+ Constants.STARTING_NODE + '-' + expectedGraphName
+ graphName1 + ':' + Constants.STARTING_NODE + '\n';
expected += expectedGraphName + graphName1 + ':' + a + '-' + a + '\n'; |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 522 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 655 |
public void testHashCodeIdenticalReserved()
throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final String node1 = GraphNodeTest.CREATE;
final String node2 = GraphNodeTest.CREATE;
final GraphNode actual = new GraphNode(node1, graph);
final GraphNode expected = new GraphNode(node2, graph);
final boolean condition = actual.hashCode() == expected.hashCode(); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 456 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 630 |
public void testHashCodeIdenticalNotReserved()
throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final String node1 = GraphNodeTest.TABLENAME;
final String node2 = GraphNodeTest.TABLENAME;
final NonReservedGraphNode actual = new NonReservedGraphNode(node1,
graph);
final NonReservedGraphNode expected = new NonReservedGraphNode(node2,
graph);
final boolean condition = actual.hashCode() == expected.hashCode(); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 295 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 554 |
final GraphNode actual = new GraphNode(node11, graph);
final GraphNode child1 = new GraphNode(node12, graph);
actual.addChild(child1);
final GraphNode expected = new GraphNode(node21, graph);
final GraphNode child2 = new GraphNode(node22, graph);
expected.addChild(child2);
final boolean condition = actual.equals(expected); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 247 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 696 |
public void testBuildNoEndingNode() throws AbstractZemucanException {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN; |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 432 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 554 |
final GraphNode actual = new GraphNode(node11, graph);
final GraphNode child1 = new GraphNode(node12, graph);
actual.addChild(child1);
final GraphNode expected = new GraphNode(node21, graph);
final GraphNode child2 = new GraphNode(node22, graph);
expected.addChild(child2);
final boolean condition = actual.equals(expected); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 286 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 369 |
public void testEqualsDifferentParents()
throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final String node11 = GraphNodeTest.CREATE;
final String node12 = GraphNodeTest.TABLE;
final String node21 = GraphNodeTest.CREATE;
final String node22 = GraphNodeTest.TABLESPACE;
final GraphNode actual = new GraphNode(node11, graph);
final GraphNode parent1 = new GraphNode(node12, graph); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 700 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1284 |
+ ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID; |
File | Project | Line |
---|
name/angoca/zemucan/executer/impl/ImplementationExecuterTest.java | Zemucan - executer impl | 224 |
name/angoca/zemucan/executer/impl/ImplementationExecuterTest.java | Zemucan - executer impl | 283 |
final String os = System.getProperty("os.name"); //$NON-NLS-1$
System.setProperty("os.name", "Windows 7"); //$NON-NLS-1$ //$NON-NLS-2$
final String[] actuals = ImplementationExecuter.getInstance()
.getCommandsToExecute(command);
System.setProperty("os.name", os); //$NON-NLS-1$
final String[] expecteds = new String[] { "cmd.exe", "/c", "dir" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 503 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 562 |
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
phraseIn.add(new Token(tokenIn2, true));
phraseIn.add(new Token(tokenIn3, true));
final boolean endsWithSpace = false;
final GraphAnswer graph = ImplementationSyntacticAnalyzer.getInstance() |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 532 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 609 |
final Graph graph = new Graph(GraphTest.STARTING_NODE, false);
graph.addNode(GraphTest.ID1, GraphTest.ID1, true);
graph.addNode(GraphTest.ID2, GraphTest.ID2, true);
graph.firstPhaseFinished();
graph.addRelation(GraphTest.ID1, GraphTest.ID2);
Exception e = null;
try {
graph.getStartingNode(); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 423 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1028 |
graph.addNode("tablespace", GraphTest.TABLE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(GraphTest.CREATE, GraphTest.TABLE);
graph.addRelation(GraphTest.CREATE, "tablespace"); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1067 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1222 |
ImplementationXMLGrammarReaderTest.LOGGER.info("testDoubleDelimiters");
ImplementationXMLGrammarReaderTest.LOGGER.debug(xml);
final ImplementationXMLGrammarReader grammar = new ImplementationXMLGrammarReader(
graph, contentToParse, contentToValidate);
Exception e = null;
try {
grammar.generateGraph();
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("XMLProblemException",
e instanceof XMLProblemException);
} |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 487 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1384 |
private String testBuildNodeNotGoesToEndingNodeText() {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 472 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1036 |
.info("testBuildNotConnectedGraph");
ImplementationXMLGrammarReaderTest.LOGGER.debug(xml);
final ImplementationXMLGrammarReader grammar = new ImplementationXMLGrammarReader(
graph, contentToParse, contentToValidate);
Exception e = null;
try {
grammar.generateGraph();
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("NodeNotComesFromStartingNodeException",
e instanceof NodeNotComesFromStartingNodeException);
} |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 313 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1222 |
ImplementationXMLGrammarReaderTest.LOGGER.info("testDoubleDelimiters");
ImplementationXMLGrammarReaderTest.LOGGER.debug(xml);
final ImplementationXMLGrammarReader grammar = new ImplementationXMLGrammarReader(
graph, contentToParse, contentToValidate);
Exception e = null;
try {
grammar.generateGraph();
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("XMLProblemException",
e instanceof XMLProblemException);
} |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 308 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 333 |
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
final boolean endsWithSpace = false;
final GraphAnswer graph = ImplementationSyntacticAnalyzer.getInstance()
.analyzeTokens(phraseIn, endsWithSpace);
final List<Token> actual = graph.getPhrases(); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 302 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 353 |
public void testGetOptions1WithSpace() throws AbstractZemucanException {
final String tokenIn1 = ImplementationSyntacticAnalyzerTest.CREATE;
final String option1 = ImplementationSyntacticAnalyzerTest.TABLE;
final String option2 = ImplementationSyntacticAnalyzerTest.TABLESPACE;
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
final boolean endsWithSpace = true; |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 283 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 478 |
final GraphAnswer actual = ImplementationSyntacticAnalyzer
.getInstance().analyzeTokens(phraseIn, endsWithSpace);
final List<Token> phraseOut = new ArrayList<Token>();
final List<Token> options = new ArrayList<Token>();
options.add(new Token(option1, true)); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 274 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 353 |
public void testGetOptions1WithSpace() throws AbstractZemucanException {
final String tokenIn1 = ImplementationSyntacticAnalyzerTest.CREATE;
final String option1 = ImplementationSyntacticAnalyzerTest.TABLE;
final String option2 = ImplementationSyntacticAnalyzerTest.TABLESPACE;
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
final boolean endsWithSpace = true; |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 200 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 478 |
final GraphAnswer actual = ImplementationSyntacticAnalyzer
.getInstance().analyzeTokens(phraseIn, endsWithSpace);
final List<Token> phraseOut = new ArrayList<Token>();
final List<Token> options = new ArrayList<Token>();
options.add(new Token(option1, true)); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 188 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 875 |
final String option1 = ","; //$NON-NLS-1$
final String option2 = ImplementationLexicalAnalyzerTest.CLOSE_PARENTHESIS;
final ReturnOptions actual = ImplementationLexicalAnalyzer
.getInstance().analyzePhrase(cmdIn);
final ReturnOptions expected = new ReturnOptions(cmdOut,
new String[] {}, new String[] { option1, option2 });
Assert.assertEquals( |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 680 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 716 |
public void testGetOptions6() throws AbstractZemucanException {
final String tokenIn1 = ImplementationSyntacticAnalyzerTest.CREATE;
final String tokenIn2 = ImplementationSyntacticAnalyzerTest.TABLE;
final String tokenIn3 = ImplementationSyntacticAnalyzerTest.T1;
final String tokenIn4 = ImplementationSyntacticAnalyzerTest.OPEN_PARENTHESIS;
final String tokenIn5 = ImplementationSyntacticAnalyzerTest.C1;
final String tokenIn6 = ImplementationSyntacticAnalyzerTest.INT;
final String tokenIn7 = ImplementationSyntacticAnalyzerTest.CLOSE_PARENTHESIS;
final String tokenIn8 = "in"; //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 334 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 565 |
phraseIn.add(new Token(tokenIn4, true));
final boolean endsWithSpace = false;
final GraphAnswer graph = ImplementationSyntacticAnalyzer.getInstance()
.analyzeTokens(phraseIn, endsWithSpace);
final List<Token> actual = graph.getPhrases();
final List<Token> expected = new ArrayList<Token>();
Assert.assertEquals("Phrase for 'create table t1 (' command", //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 229 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 309 |
phraseIn.add(new Token(tokenIn1, true));
final boolean endsWithSpace = false;
final GraphAnswer graph = ImplementationSyntacticAnalyzer.getInstance()
.analyzeTokens(phraseIn, endsWithSpace);
final List<Token> actual = graph.getOptions();
final List<Token> expected = new ArrayList<Token>();
expected.add(new Token(option1, true)); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 235 |
name/angoca/zemucan/core/graph/model/StartingNodeTest.java | Zemucan - Core - graph | 92 |
e instanceof ParentStartingNodeException);
}
/**
* Tests if two consecutive calls returns the same value.
*
* @throws AbstractZemucanException
* Never
*/
@Test
public void testCongruent() throws AbstractZemucanException {
final String node = "test"; //$NON-NLS-1$
final GraphNode node1 = new GraphNode(node, new Graph("test", false));
final int val1 = node1.hashCode();
final int val2 = node1.hashCode();
final boolean condition = val1 == val2; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 487 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 644 |
public void testBuildNoEndingNode() throws AbstractZemucanException {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 421 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 510 |
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// table Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_TABLE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_TABLE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 257 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 919 |
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_ENDING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 247 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 487 |
private String testBuildNodeNotComeFromStartingNodeText() {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_TABLE_ID_TOKEN; |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 189 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 221 |
public void testGetOptions0options() throws AbstractZemucanException {
// There is nothing as token in.
final String option1 = ImplementationSyntacticAnalyzerTest.CREATE;
final String option2 = ImplementationSyntacticAnalyzerTest.ABOUT;
final String option3 = ImplementationSyntacticAnalyzerTest.HELP;
final String option4 = ImplementationSyntacticAnalyzerTest.LICENSE;
final List<Token> phraseIn = new ArrayList<Token>();
final boolean endsWithSpace = false;
final GraphAnswer graph = ImplementationSyntacticAnalyzer.getInstance() |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 411 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 560 |
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2";
final int actualOptionsSize = ret.getOptions().length;
final int actualPhrasesSize = ret.getPhrases().length;
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 317 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 575 |
public void testHashCodeDifferent() throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final String node1 = GraphNodeTest.CREATE;
final String node2 = GraphNodeTest.TABLENAME;
final GraphNode actual = new GraphNode(node1, graph);
final NonReservedGraphNode expected = new NonReservedGraphNode(node2,
graph);
final int actualHashcode = actual.hashCode(); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 247 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1009 |
public void testBuildNotConnectedGraph() throws AbstractZemucanException {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2; |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 281 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 696 |
phraseIn.add(new Token(tokenIn7, true));
final boolean endsWithSpace = false;
final GraphAnswer actual = ImplementationSyntacticAnalyzer
.getInstance().analyzeTokens(phraseIn, endsWithSpace);
final List<Token> phraseOut = new ArrayList<Token>();
final List<Token> options = new ArrayList<Token>(); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 148 |
name/angoca/zemucan/IntegrationTest.java | Zemucan - main | 71 |
@BeforeClass
public static void setUpBeforeClass() throws AbstractZemucanException {
System.setProperty(Constants.ZEMUCAN_CONF_XML_PROPERTY,
"sa_conf-test.xml"); //$NON-NLS-1$
Configurator.getInstance().setProperty(
Constants.GRAMMAR_READER_NAME_PROPERTY,
Configurator.GRAMMAR_READER_NAME_VALUE);
Configurator.getInstance()
.setProperty(Constants.GRAMMAR_FILE_DESCRIPTORS_PROPERTY,
"grammar-test.xml"); //$NON-NLS-1$
ImplementationSyntacticAnalyzer.getInstance(); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerAcceptanceTest.java | Zemucan - Core - analyzers | 57 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 64 |
public final class ImplementationLexicalAnalyzerRealGrammarTest {
/**
* Load the graph.
*
* @throws AbstractZemucanException
* Never
*/
@BeforeClass
public static void setUpBeforeClass() throws AbstractZemucanException {
System.setProperty(Constants.ZEMUCAN_CONF_XML_PROPERTY,
"sa_conf-test-realGrammar.xml"); //$NON-NLS-1$
Configurator.getInstance().setProperty(
Constants.GRAMMAR_READER_NAME_PROPERTY,
Configurator.GRAMMAR_READER_NAME_VALUE);
// Creates the Lexical analyzer instance.
ImplementationLexicalAnalyzer.getInstance();
}
/**
* Clears the configuration file name property at the end of the test.
*/
@AfterClass
public static void tearDownAfterClass() { |
File | Project | Line |
---|
name/angoca/zemucan/interfaze/InterfaceCoreTest.java | Zemucan - Core - interface | 82 |
name/angoca/zemucan/IntegrationTest.java | Zemucan - main | 63 |
public final class IntegrationTest {
/**
* Refreshes the singletons.
*
* @throws AbstractZemucanException
* Never.
*/
@BeforeClass
public static void setUpBeforeClass() throws AbstractZemucanException {
System.setProperty(Constants.ZEMUCAN_CONF_XML_PROPERTY,
"sa_conf-test.xml"); //$NON-NLS-1$
Configurator.getInstance().setProperty(
Constants.GRAMMAR_READER_NAME_PROPERTY,
Configurator.GRAMMAR_READER_NAME_VALUE);
Configurator.getInstance()
.setProperty(Constants.GRAMMAR_FILE_DESCRIPTORS_PROPERTY,
"grammar-test.xml"); //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 518 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1407 |
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_ENDING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_2;
return xml;
}
/**
* Tests that a simple graph is different with and without extra tokens.
*
* @throws AbstractZemucanException
* Never
*/
@Test
public void testErrorBuildWithExtraTokens() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 387 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 416 |
final String option1 = ImplementationSyntacticAnalyzerTest.TABLE_NAME;
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
phraseIn.add(new Token(tokenIn2, true));
final boolean endsWithSpace = false;
final GraphAnswer graph = ImplementationSyntacticAnalyzer.getInstance() |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 370 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 845 |
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertTrue("options: '" + cmdIn + "'",
ret.getOptions().length == 0);
Assert.assertTrue("phrases: '" + cmdIn + "'",
ret.getPhrases().length == 2); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 320 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 444 |
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
// <tableName>
Assert.assertTrue("options: '" + cmdIn + "'",
ret.getOptions().length == 1);
Assert.assertTrue("phrases: '" + cmdIn + "'",
ret.getPhrases().length == 0); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 224 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 272 |
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertTrue("options: '" + cmdIn + "'",
ret.getOptions().length == 0);
Assert.assertTrue("phrases: '" + cmdIn + "'",
ret.getPhrases().length == 0); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/Graph.java | Zemucan - Core - graph | 581 |
name/angoca/zemucan/core/graph/model/Graph.java | Zemucan - Core - graph | 946 |
+ parentId);
if (parent == null) {
throw new NotExistingNodeException(parentId);
}
// Retrieves the child and established the relation.
final AbstractGraphNode childNode = this.nodes.get(this.name + ':'
+ childId);
if (childNode == null) {
throw new NotExistingChildNodeException(parentId, childId);
}
parent.removeChild(childNode); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 334 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 448 |
phraseIn.add(new Token(tokenIn2, true));
final boolean endsWithSpace = false;
final GraphAnswer graph = ImplementationSyntacticAnalyzer.getInstance()
.analyzeTokens(phraseIn, endsWithSpace);
final List<Token> actual = graph.getPhrases();
final List<Token> expected = new ArrayList<Token>(); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 148 |
name/angoca/zemucan/interfaze/InterfaceCoreTest.java | Zemucan - Core - interface | 89 |
@BeforeClass
public static void setUpBeforeClass() throws AbstractZemucanException {
System.setProperty(Constants.ZEMUCAN_CONF_XML_PROPERTY,
"sa_conf-test.xml"); //$NON-NLS-1$
Configurator.getInstance().setProperty(
Constants.GRAMMAR_READER_NAME_PROPERTY,
Configurator.GRAMMAR_READER_NAME_VALUE);
Configurator.getInstance()
.setProperty(Constants.GRAMMAR_FILE_DESCRIPTORS_PROPERTY,
"grammar-test.xml"); //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 629 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 897 |
final String cmdIn = ImplementationLexicalAnalyzerTest.SPACE;
final String cmdOut = ""; //$NON-NLS-1$
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = cmdOut;
Assert.assertEquals("Empty phrase for an space", expected, //$NON-NLS-1$
actual);
}
/**
* The string with just one space returns a string with one space also.
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void testSpace2() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 118 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 148 |
@BeforeClass
public static void setUpBeforeClass() throws AbstractZemucanException {
System.setProperty(Constants.ZEMUCAN_CONF_XML_PROPERTY,
"sa_conf-test.xml"); //$NON-NLS-1$
Configurator.getInstance().setProperty(
Constants.GRAMMAR_READER_NAME_PROPERTY,
Configurator.GRAMMAR_READER_NAME_VALUE);
Configurator.getInstance()
.setProperty(Constants.GRAMMAR_FILE_DESCRIPTORS_PROPERTY,
"grammar-test.xml"); //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/IntegrationTest.java | Zemucan - main | 155 |
name/angoca/zemucan/IntegrationTest.java | Zemucan - main | 177 |
final OutputWriter writer = null;
Exception e = null;
try {
ImplementationExecuter.getInstance().execute(command, writer);
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("ParameterNullException",
e instanceof ParameterNullException);
}
/**
* Tests the execution of a quit command.
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void testExecuteQuit() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 503 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 767 |
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
phraseIn.add(new Token(tokenIn2, true));
phraseIn.add(new Token(tokenIn3, true)); |
File | Project | Line |
---|
name/angoca/zemucan/interfaze/model/ReturnOptionsTest.java | Zemucan - Core - ui API | 208 |
name/angoca/zemucan/interfaze/model/ReturnOptionsTest.java | Zemucan - Core - ui API | 280 |
public void testHashCode() throws ParameterNullException {
final String phrase = "create table"; //$NON-NLS-1$
final String phrase1 = ReturnOptionsTest.TABLESPACE;
final String option1 = ReturnOptionsTest.TABLE_NAME;
final ReturnOptions object = new ReturnOptions(phrase,
new String[] { phrase1 }, new String[] { option1 }); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1530 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1680 |
String expectedGraphName = "merged:{" + graphName1 + ',' + graphName2
+ "}:";
String expected = expectedGraphName + '[' + GraphState.Validated
+ "-WithoutExtraNodes{{" + Constants.STARTING_NODE + '<'
+ expectedGraphName + graphName1 + ':' + a + '-'
+ expectedGraphName + graphName1 + ':' + create1Id + '-' |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1024 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1315 |
final Graph graph = new Graph("not coming starting node", true); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 817 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 883 |
graph2.simplifyGraph();
final String actual = graph2.toString();
String expectedGraphName = "merged:{" + graphName2 + ',' + graphName1
+ "}:";
String expected = expectedGraphName + '[' + GraphState.Validated
+ "-WithoutExtraNodes{{" + Constants.STARTING_NODE + '<'
+ expectedGraphName + graphName2 + ':' + create + ">}-{" |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 420 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1024 |
final Graph graph = new Graph("Duplicated node name", true); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true);
graph.addNode("tablespace", GraphTest.TABLE, true); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1036 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1222 |
ImplementationXMLGrammarReaderTest.LOGGER.info("testEmptyGrammar");
ImplementationXMLGrammarReaderTest.LOGGER.debug(xml);
final ImplementationXMLGrammarReader grammar = new ImplementationXMLGrammarReader(
graph, contentToParse, contentToValidate);
Exception e = null;
try {
grammar.generateGraph();
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("EmptyGrammarException", |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1009 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1127 |
private String testBuildWithExtraTokensText() {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 283 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 986 |
.info("testBuildNotAllChildren");
ImplementationXMLGrammarReaderTest.LOGGER.debug(xml);
final ImplementationXMLGrammarReader grammar = new ImplementationXMLGrammarReader(
graph, contentToParse, contentToValidate);
Exception e = null;
try {
grammar.generateGraph();
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("NotExistingChildNodeException", |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 238 |
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 454 |
final List<Token> phrases1 = new ArrayList<Token>();
phrases1.add(new Token(phrase1, true));
final List<Token> options1 = new ArrayList<Token>();
options1.add(new Token(option1, false)); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 444 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 801 |
final String tokenOut2 = ImplementationSyntacticAnalyzerTest.TABLESPACE;
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
phraseIn.add(new Token(tokenIn2, true));
final boolean endsWithSpace = false;
final GraphAnswer actual = ImplementationSyntacticAnalyzer |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 532 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 557 |
final String opt1 = ImplementationLexicalAnalyzerTest.COL_NAME;
final ReturnOptions actual = ImplementationLexicalAnalyzer
.getInstance().analyzePhrase(cmdIn);
final ReturnOptions expected = new ReturnOptions(cmdOut,
new String[] {}, new String[] { opt1 });
Assert.assertEquals("object for 'create table t2 ('", expected, //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 251 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 609 |
final Graph graph = new Graph("ending node", false); //$NON-NLS-1$
graph.addNode(GraphTest.ID1, GraphTest.ID1, true);
graph.addNode(GraphTest.ID2, GraphTest.ID2, true);
graph.firstPhaseFinished();
graph.addRelation(GraphTest.ID1, GraphTest.ID2); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/LicenseNodeTest.java | Zemucan - Core - graph | 138 |
name/angoca/zemucan/core/graph/model/LicenseNodeTest.java | Zemucan - Core - graph | 160 |
public void testEqualsNodeReserved() throws AbstractZemucanException {
final String node = LicenseNodeTest.LICENSE_NODE;
final Graph graph = new Graph("test", false);
final LicenseNode actual = new LicenseNode(graph);
final GraphNode notExpected = new GraphNode(node, graph);
Assert.assertFalse( |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 206 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 228 |
public void testAddNullRelation2() throws AbstractZemucanException {
final Graph graph = new Graph(GraphTest.NULL_RELATION, false);
graph.addNode(GraphTest.ID1, GraphTest.ID1, true);
graph.firstPhaseFinished();
Exception e = null;
try {
graph.addRelation(null, GraphTest.ID1); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/EndingNodeTest.java | Zemucan - Core - graph | 150 |
name/angoca/zemucan/core/graph/model/EndingNodeTest.java | Zemucan - Core - graph | 172 |
public void testEqualsNodeReserved() throws AbstractZemucanException {
final String node = EndingNodeTest.ENDING_NODE;
final Graph graph = new Graph("test", false);
final EndingNode actual = new EndingNode(graph);
final GraphNode notExpected = new GraphNode(node, graph);
Assert.assertFalse( |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/AboutNodeTest.java | Zemucan - Core - graph | 162 |
name/angoca/zemucan/core/graph/model/AboutNodeTest.java | Zemucan - Core - graph | 184 |
public void testEqualsNodeReserved() throws AbstractZemucanException {
final String node = AboutNodeTest.ABOUT_NODE;
final Graph graph = new Graph("test", false);
final AboutNode actual = new AboutNode(graph);
final GraphNode notExpected = new GraphNode(node, graph);
Assert.assertFalse("Equals between AboutNode and a reserved GraphNode", //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/AboutNodeTest.java | Zemucan - Core - graph | 100 |
name/angoca/zemucan/core/graph/model/LicenseNodeTest.java | Zemucan - Core - graph | 77 |
final LicenseNode node1 = new LicenseNode(new Graph("test", false));
final int val1 = node1.hashCode();
final int val2 = node1.hashCode();
final boolean val = val1 == val2;
Assert.assertTrue("Two consecutive calls return the same value", val); //$NON-NLS-1$
}
/**
* Test the toString method with no license file.
*
* @throws AbstractZemucanException
* Never
*/
@Test
public void testDefaultLicense() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 519 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 593 |
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_ENDING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_2;
return xml;
}
/**
* Tests a grammar that has a node that references to StartingNode.
*
* @throws AbstractZemucanException
* Never
*/
@Test
public void testBuildNodeReferencingStartingNode() |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 206 |
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 238 |
final List<Token> phrases1 = new ArrayList<Token>();
phrases1.add(new Token(phrase1, true));
final List<Token> options1 = new ArrayList<Token>();
options1.add(new Token(option1, true)); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzer.java | Zemucan - Core - analyzers | 263 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzer.java | Zemucan - Core - analyzers | 295 |
private ReturnOptions phraseOne(String newPhrase, final List<Token> tokens,
final GraphAnswer answer, final int sizeOptions,
String[] setOfOptions, String[] setOfPhrases)
throws GeneralException, ParameterNullException {
if (sizeOptions > 1) {
// There are one phrase and multiple options, then add them.
ImplementationLexicalAnalyzer.LOGGER.debug("Case 4!"); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 950 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1439 |
final Graph graph1 = new Graph(GraphTest.GRAPH1, false);
final Graph graph2 = new Graph(GraphTest.GRAPH2, false);
graph1.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph1.addNode(GraphTest.CREATE1, GraphTest.CREATE, true); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 424 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1188 |
graph.addNode(GraphTest.OTHER, GraphTest.OTHER, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(GraphTest.CREATE, GraphTest.TABLE);
graph.addRelation(GraphTest.TABLE, Constants.ENDING_NODE);
graph.addRelation(GraphTest.OTHER, GraphTest.CREATE); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 250 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 317 |
public void testAddRelationInSecondPhase()
throws AbstractZemucanException {
final Graph graph = new Graph(GraphTest.ADD_RELATION, false);
graph.addNode(GraphTest.ID1, GraphTest.ID1, true);
graph.addNode(GraphTest.ID2, GraphTest.ID2, true); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 1076 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 1104 |
public void testToStringWithParents() throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final String nodeIn = GraphNodeTest.TABLENAME;
final String nodeIn1 = GraphNodeTest.TABLENAME;
final String nodeOut = GraphNodeTest.TABLENAME + "::" + '{'
+ GraphNodeTest.TABLENAME
+ "\n1\t<" + GraphNodeTest.TABLENAME + ">\n0\nfalse|false}"; //$NON-NLS-1$ //$NON-NLS-2$ |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 198 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 671 |
final int actualOptionsSize = ret.getOptions().length;
final int actualPhrasesSize = ret.getPhrases().length;
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
Assert.assertEquals("options: '" + cmdIn + "'", 0, actualOptionsSize); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 122 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 418 |
final int actualOptionsSize = ret.getOptions().length;
final int actualPhrasesSize = ret.getPhrases().length;
Assert.assertEquals("phrase '" + cmdIn + "'", expected, actual);
// EMPTY
Assert.assertEquals("options '" + cmdIn + "'", 0, actualOptionsSize); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/StartingNodeTest.java | Zemucan - Core - graph | 141 |
name/angoca/zemucan/core/graph/model/StartingNodeTest.java | Zemucan - Core - graph | 161 |
public void testEqualsNodeReserved() throws AbstractZemucanException {
final String node = "StartingNode"; //$NON-NLS-1$
final Graph graph = new Graph("test", false);
final StartingNode actual = new StartingNode(graph);
final GraphNode notExpected = new GraphNode(node, graph);
Assert.assertFalse("equals for a reserved object", //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 423 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 546 |
public void testEqualsSameChildren() throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final String node11 = GraphNodeTest.CREATE;
final String node12 = GraphNodeTest.TABLE;
final String node21 = GraphNodeTest.CREATE;
final String node22 = GraphNodeTest.TABLE;
final GraphNode actual = new GraphNode(node11, graph); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 775 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1407 |
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_ENDING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_2; |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 389 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 446 |
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
phraseIn.add(new Token(tokenIn2, true));
final boolean endsWithSpace = false;
final GraphAnswer graph = ImplementationSyntacticAnalyzer.getInstance() |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerAcceptanceTest.java | Zemucan - Core - analyzers | 57 |
name/angoca/zemucan/ui/impl/jline/JlineInputReaderTest.java | Zemucan - ui impl jLine | 74 |
public final class JlineInputReaderTest {
/**
* Establishes the configuration for the tests. This configuration is before
* all the tests.
*
* @throws AbstractZemucanException
* Never.
*/
@BeforeClass
public static void setUpBeforeClass() throws AbstractZemucanException {
System.setProperty(Constants.ZEMUCAN_CONF_XML_PROPERTY,
"sa_conf-test-realGrammar.xml"); //$NON-NLS-1$
Configurator.getInstance().setProperty(
Constants.GRAMMAR_READER_NAME_PROPERTY,
Configurator.GRAMMAR_READER_NAME_VALUE);
// Creates the Lexical analyzer instance.
ImplementationLexicalAnalyzer.getInstance();
}
/**
* Configuration before each test.
*
* @throws IOException
* If there is a problem when initializing the console.
*/
@Before |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 407 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 528 |
final GraphNode actual = new GraphNode(node1, graph);
final GraphNode expected = new GraphNode(node2, graph);
final boolean condition = actual.equals(expected);
final boolean condition2 = expected.equals(actual);
Assert.assertTrue("two identical nodes - reserved word", //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 349 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 462 |
final NonReservedGraphNode actual = new NonReservedGraphNode(node1,
graph);
final NonReservedGraphNode expected = new NonReservedGraphNode(node2,
graph);
final boolean condition = actual.equals(expected);
final boolean condition2 = expected.equals(actual);
Assert.assertTrue("two identical node reserved", condition); //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/AboutNodeTest.java | Zemucan - Core - graph | 100 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 248 |
final GraphNode node1 = new GraphNode(node, new Graph("test", false));
final int val1 = node1.hashCode();
final int val2 = node1.hashCode();
final boolean val = val1 == val2;
Assert.assertTrue("Two consecutive calls return the same value", val); //$NON-NLS-1$
}
/**
* Tests that the graph node has to receive a not null parameter.
*
* @throws AbstractZemucanException
* Never.
*/
@Test(expected = AssertionError.class) |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 441 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 651 |
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 429 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 576 |
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_TABLE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN; |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 229 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 255 |
final List<Token> phraseIn = new ArrayList<Token>();
final boolean endsWithSpace = false;
final GraphAnswer graph = ImplementationSyntacticAnalyzer.getInstance()
.analyzeTokens(phraseIn, endsWithSpace);
final List<Token> actual = graph.getPhrases(); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 191 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 610 |
final ReturnOptions actual = ImplementationLexicalAnalyzer
.getInstance().analyzePhrase(cmdIn);
final ReturnOptions expected = new ReturnOptions(cmdOut,
new String[] {}, new String[] { option1, option2 });
Assert.assertEquals("object for 'create table t2(c1'", expected, //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 286 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 546 |
public void testEqualsMoreChildren() throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final String node11 = GraphNodeTest.CREATE;
final String node12 = GraphNodeTest.TABLE;
final String node21 = GraphNodeTest.CREATE;
final String node22 = GraphNodeTest.TABLE; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1680 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1708 |
.info("testNullContentToValidate");
Exception e = null;
try {
new ImplementationXMLGrammarReader(graph, contentToParse,
contentToValidate);
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("ParameterNullException",
e instanceof ParameterNullException);
}
/**
* Tests that a graph cannot be null.
*
* @throws AbstractZemucanException
* Never
*/
@Test
public void testNullGraph() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1099 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1179 |
.info("testBuildWithoutExtraTokens");
ImplementationXMLGrammarReaderTest.LOGGER.debug(xml);
final ImplementationXMLGrammarReader grammar = new ImplementationXMLGrammarReader(
actual, contentToParse, contentToValidate);
grammar.generateGraph();
grammar.getStartingNode();
final Graph expected = new Graph(
ImplementationXMLGrammarReaderTest.NORMAL_GRAPH, false); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 669 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 882 |
final Graph graph = new Graph(id, false);
final InputSource contentToParse = new InputSource(
new StringReader(xml));
final InputSource contentToValidate = new InputSource(new StringReader(
xml));
ImplementationXMLGrammarReaderTest.LOGGER
.info("testBuildNoStartingNode"); |
File | Project | Line |
---|
name/angoca/zemucan/executer/impl/ImplementationExecuterTest.java | Zemucan - executer impl | 116 |
name/angoca/zemucan/executer/impl/ImplementationExecuterTest.java | Zemucan - executer impl | 143 |
System.setProperty(ImplementationExecuter.DB2_PARAMS, "-v"); //$NON-NLS-1$
System.setProperty("os.name", "Linux Virtual"); //$NON-NLS-1$ //$NON-NLS-2$
final String command = "db2 !ls"; //$NON-NLS-1$
final String[] actuals = ImplementationExecuter.getInstance()
.getCommandsToExecute(command);
final String[] expecteds = new String[] { "db2", "-v", "!ls" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1492 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1561 |
public void testSimplify3() throws AbstractZemucanException {
final String graphName1 = GraphTest.GRAPH1;
final String graphName2 = GraphTest.GRAPH2;
final String create1Id = GraphTest.CREATE1;
final String create2Id = GraphTest.CREATE2;
final String create = GraphTest.CREATE;
final String z = "z"; //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1028 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1087 |
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(GraphTest.CREATE, Constants.ENDING_NODE); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1028 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1903 |
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(Constants.STARTING_NODE, GraphTest.TABLE); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 932 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1274 |
graph2.addNode(GraphTest.OTHER, GraphTest.OTHER, true);
graph2.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph2.firstPhaseFinished();
graph2.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph2.addRelation(GraphTest.CREATE, GraphTest.OTHER); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 423 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1876 |
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(GraphTest.CREATE, Constants.ENDING_NODE); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 274 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 297 |
graph.addNode(GraphTest.ID2, GraphTest.ID2, true);
graph.firstPhaseFinished();
Exception e = null;
try {
graph.addRelation(GraphTest.ID1, GraphTest.ID2);
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("NotExistingNodeException", |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 182 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 423 |
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(GraphTest.CREATE, GraphTest.TABLE); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 149 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 173 |
public void testAddNullParent() throws AbstractZemucanException {
final String name = GraphNodeTest.NODE;
final GraphNode nul = null;
final GraphNode graphNode = new GraphNode(name,
new Graph("test", false));
Exception e = null;
try {
graphNode.addParent(nul); |
File | Project | Line |
---|
name/angoca/zemucan/executer/impl/ImplementationExecuter.java | Zemucan - executer impl | 494 |
name/angoca/zemucan/executer/impl/ImplementationExecuter.java | Zemucan - executer impl | 551 |
private String[]/* [!]! */getWindowsCommand(final boolean isADB2Command,
final boolean thereAreDB2Params, final String/* ? */db2params,
final String/* ! */db2Command) {
assert db2Command != null;
String[] commands;
if (isADB2Command) {
if (thereAreDB2Params) {
ImplementationExecuter.LOGGER
.debug("Windows and db2 command with params"); //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 446 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 474 |
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
phraseIn.add(new Token(tokenIn2, true));
final boolean endsWithSpace = true; |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 397 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 481 |
final List<Token> phraseOut = new ArrayList<Token>();
final List<Token> options = new ArrayList<Token>();
options.add(new Token(option1, true));
final GraphAnswer expected = new GraphAnswer(phraseOut, options);
Assert.assertEquals("'create table ' command", expected, actual); //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 488 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 534 |
final ReturnOptions actual = ImplementationLexicalAnalyzer
.getInstance().analyzePhrase(cmdIn);
final ReturnOptions expected = new ReturnOptions(cmdOut,
new String[] {}, new String[] { opt1 });
Assert.assertEquals("object for 'create table t2('", expected, //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 286 |
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 177 |
phrases.add(new Token(phrase1, true));
final List<Token> options = new ArrayList<Token>();
options.add(new Token(option1, true));
options.add(new Token(option2, true));
final GraphAnswer object = new GraphAnswer(phrases, options); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 166 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 982 |
final ReturnOptions actual = ImplementationLexicalAnalyzer
.getInstance().analyzePhrase(cmdIn);
final ReturnOptions expected = new ReturnOptions(cmdOut,
new String[] {}, new String[] {});
Assert.assertEquals( |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 78 |
name/angoca/zemucan/interfaze/InterfaceCoreTest.java | Zemucan - Core - interface | 98 |
"grammar-test.xml"); //$NON-NLS-1$
// Creates the lexical analyzer instance.
ImplementationLexicalAnalyzer.getInstance();
}
/**
* Clears the configuration file name property at the end of the test.
*/
@AfterClass
public static void tearDownAfterClass() {
// Destroys any existent instance.
ImplementationLexicalAnalyzer.destroyInstance();
// Recreates the configurator instance.
Configurator.destroyInstance();
GrammarReaderController.destroyInstance();
System.clearProperty(Constants.ZEMUCAN_CONF_XML_PROPERTY);
}
/**
* Default constructor.
*/
public InterfaceCoreTest() { |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 798 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1568 |
final Graph graph1 = new Graph(graphName1, false);
final Graph graph2 = new Graph(graphName2, false);
graph1.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph1.addNode(create1Id, GraphTest.CREATE, true); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 669 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1173 |
final Graph actual = new Graph(id, false);
final InputSource contentToParse = new InputSource(
new StringReader(xml));
final InputSource contentToValidate = new InputSource(new StringReader(
xml));
ImplementationXMLGrammarReaderTest.LOGGER
.info("testBuildWithoutExtraTokens"); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 511 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 536 |
graph.addRelation(GraphTest.ID1, GraphTest.ID2);
Exception e = null;
try {
graph.getEndingNode();
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("InvalidGraphStateException",
e instanceof InvalidGraphStateException);
}
/**
* Tests the retrieve of starting node.
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void testGetStartingNode() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 724 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 801 |
public void testRemoveParent() throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final String name = GraphNodeTest.GRAPHNODE;
final GraphNode graphNode = new GraphNode(name, graph);
int size = graphNode.getParents().size(); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/EndingNodeTest.java | Zemucan - Core - graph | 286 |
name/angoca/zemucan/core/graph/model/StartingNodeTest.java | Zemucan - Core - graph | 272 |
final StartingNode actual = new StartingNode(new Graph("test", false));
final boolean value = actual.equals(actual);
Assert.assertTrue("Symmetry", value); //$NON-NLS-1$
}
/**
* Test the toString method.
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void testToString() throws AbstractZemucanException {
final StartingNode actual = new StartingNode(new Graph("test", false)); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/AboutNodeTest.java | Zemucan - Core - graph | 100 |
name/angoca/zemucan/core/graph/model/EndingNodeTest.java | Zemucan - Core - graph | 113 |
final EndingNode node1 = new EndingNode(graph);
final int val1 = node1.hashCode();
final int val2 = node1.hashCode();
final boolean val = val1 == val2;
Assert.assertTrue("Two consecutive calls return the same value", val); //$NON-NLS-1$
}
/**
* Test that the hash code is different to hashCode of StartingNode.
*
* @throws AbstractZemucanException
* Never
*/
@Test
public void testDifferentStartingNodeHashCode() |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/AbstractGraphNode.java | Zemucan - Core - graph | 229 |
name/angoca/zemucan/core/graph/model/AbstractGraphNode.java | Zemucan - Core - graph | 250 |
final int size = this.parents.size();
boolean ret = false;
for (int i = 0; (i < size) && !ret; i += 1) {
if (graphNode.getId().equals(this.parents.get(i).getId())) { |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 966 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1593 |
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 429 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 500 |
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 380 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1437 |
.info("testBuildWithExtraTokens");
ImplementationXMLGrammarReaderTest.LOGGER.debug(xml);
final ImplementationXMLGrammarReader grammar = new ImplementationXMLGrammarReader(
actual, contentToParse, contentToValidate);
grammar.generateGraph();
grammar.getStartingNode();
final Graph expected = new Graph( |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 335 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 644 |
public void testBuildNoEndingNode() throws AbstractZemucanException {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 251 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1593 |
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 247 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 335 |
public void testBuildInvalidStructure() throws AbstractZemucanException {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID; |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 281 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 805 |
phraseIn.add(new Token(tokenIn2, true));
final boolean endsWithSpace = false;
final GraphAnswer actual = ImplementationSyntacticAnalyzer
.getInstance().analyzeTokens(phraseIn, endsWithSpace);
final List<Token> phraseOut = new ArrayList<Token>(); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 203 |
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 177 |
phrases.add(new Token(phrase1, true));
final List<Token> options = new ArrayList<Token>();
options.add(new Token(option1, true));
options.add(new Token(option2, true)); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/model/TokenTest.java | Zemucan - Core - analyzers | 116 |
name/angoca/zemucan/core/lexical/model/TokenTest.java | Zemucan - Core - analyzers | 194 |
public void testHashCodeDifferentObject() throws InvalidTokenException {
final String token1 = TokenTest.CREATE;
final String token2 = "table"; //$NON-NLS-1$
final Token expected = new Token(token1, true);
final Token actual = new Token(token2, true); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 532 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 849 |
final String option = ImplementationLexicalAnalyzerTest.COL_NAME;
final ReturnOptions actual = ImplementationLexicalAnalyzer
.getInstance().analyzePhrase(cmdIn);
final ReturnOptions expected = new ReturnOptions(cmdOut,
new String[] {}, new String[] { option }); |
File | Project | Line |
---|
name/angoca/zemucan/interfaze/model/ReturnOptionsTest.java | Zemucan - Core - ui API | 90 |
name/angoca/zemucan/interfaze/model/ReturnOptionsTest.java | Zemucan - Core - ui API | 465 |
public void testSymmetric() throws ParameterNullException {
final String phrase = "test"; //$NON-NLS-1$
final String[] phrases = new String[] { "test1" }; //$NON-NLS-1$
final String[] options = new String[] { "test2" }; //$NON-NLS-1$
final ReturnOptions actual = new ReturnOptions(phrase, phrases, options); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1086 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1157 |
final Graph graph = new Graph("no starting node", false); //$NON-NLS-1$
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(GraphTest.CREATE, Constants.ENDING_NODE); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1029 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1188 |
graph.addNode(GraphTest.OTHER, GraphTest.OTHER, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(GraphTest.CREATE, GraphTest.TABLE);
graph.addRelation(GraphTest.TABLE, Constants.ENDING_NODE); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 557 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1157 |
final Graph graph = new Graph("no starting node", false); //$NON-NLS-1$
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(GraphTest.CREATE, Constants.ENDING_NODE); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 182 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 345 |
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, GraphTest.CREATE);
graph.addRelation(Constants.STARTING_NODE, GraphTest.TABLE); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 181 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1157 |
final Graph graph = new Graph("no starting node", false); //$NON-NLS-1$
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(GraphTest.CREATE, Constants.ENDING_NODE); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/Graph.java | Zemucan - Core - graph | 115 |
name/angoca/zemucan/core/graph/model/Graph.java | Zemucan - Core - graph | 148 |
private static void changeDescendancyNodeRelations(
final AbstractGraphNode/* ! */n1, final AbstractGraphNode/* ! */n2,
final AbstractGraphNode /* ! */node) throws AbstractGraphException {
assert n1 != null;
assert n2 != null;
assert node != null;
assert n1 != n2;
assert n2 != node;
// First adds the parent relation.
node.addParent(n1); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 247 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 909 |
public void testBuildNoStartingNode() throws AbstractZemucanException {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/api/ImplementationInMemoryGrammarReader.java | Zemucan - Core - grammar reader API | 130 |
name/angoca/zemucan/grammarReader/api/ImplementationInMemoryGrammarReader.java | Zemucan - Core - grammar reader API | 150 |
graphToFill.addNode(create, create, true);
graphToFill.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graphToFill.firstPhaseFinished();
graphToFill.addRelation(Constants.STARTING_NODE, create);
graphToFill.addRelation(create, Constants.ENDING_NODE); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 389 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 767 |
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
phraseIn.add(new Token(tokenIn2, true)); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 835 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 1010 |
public void testCase3() throws AbstractZemucanException {
final String cmdIn = "db2 c"; //$NON-NLS-1$
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2 c"; |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 335 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 1128 |
public void testCase8() throws AbstractZemucanException {
final String cmdIn = "db2 create table "; //$NON-NLS-1$
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2 create table "; |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 310 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 1058 |
public void testCase5() throws AbstractZemucanException {
final String cmdIn = "db2 create table"; //$NON-NLS-1$
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2 create table"; |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 138 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 1105 |
public void testCase7() throws AbstractZemucanException {
final String cmdIn = "db2 create"; //$NON-NLS-1$
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = "db2 create table"; |
File | Project | Line |
---|
name/angoca/zemucan/interfaze/model/ReturnOptionsTest.java | Zemucan - Core - ui API | 382 |
name/angoca/zemucan/interfaze/model/ReturnOptionsTest.java | Zemucan - Core - ui API | 449 |
new ReturnOptions(phrase, new String[] { null },
new String[] { options });
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("ParameterNullException",
e instanceof ParameterNullException);
}
/**
* Tests the symmetry of equals.
*
* @throws ParameterNullException
* Never.
*/
@Test
public void testSymmetric() throws ParameterNullException { |
File | Project | Line |
---|
name/angoca/zemucan/main/Main.java | Zemucan - main | 129 |
name/angoca/zemucan/main/Main.java | Zemucan - main | 341 |
controller.start(thread, synchronizedLoad);
} catch (final AbstractZemucanException exception) {
Main.LOGGER.error(exception.getMessage());
Main.LOGGER.info(exception.getStackTrace().toString()); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1598 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1680 |
String expectedGraphName = "merged:{" + graphName1 + ',' + graphName2
+ "}:";
String expected = expectedGraphName + '[' + GraphState.Validated
+ "-WithoutExtraNodes{{" + Constants.STARTING_NODE + '<'
+ expectedGraphName + graphName1 + ':' + a + '-' |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 757 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 779 |
public void testRemoveNullParent() throws AbstractZemucanException {
final String name = GraphNodeTest.GRAPHNODE;
final GraphNode graphNode = new GraphNode(name,
new Graph("test", false));
Exception e = null;
try {
graphNode.removeParent(null); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/EndingNodeTest.java | Zemucan - Core - graph | 113 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 248 |
final GraphNode node1 = new GraphNode(node, new Graph("test", false));
final int val1 = node1.hashCode();
final int val2 = node1.hashCode();
final boolean val = val1 == val2;
Assert.assertTrue("Two consecutive calls return the same value", val); //$NON-NLS-1$
}
/**
* Tests that the graph node has to receive a not null parameter.
*
* @throws AbstractZemucanException
* Never.
*/
@Test(expected = AssertionError.class) |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/AboutNodeTest.java | Zemucan - Core - graph | 259 |
name/angoca/zemucan/core/graph/model/AboutNodeTest.java | Zemucan - Core - graph | 276 |
public void testSameHashCode() throws AbstractZemucanException {
final AboutNode actual = new AboutNode(new Graph("test", false));
final AboutNode expected = new AboutNode(new Graph("test", false));
Assert.assertEquals("Two AboutNode generate the same hashcode.", //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 491 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1284 |
+ ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_CREATE_ID_TOKEN; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/api/GrammarReaderControllerTest.java | Zemucan - Core - grammar reader API | 217 |
name/angoca/zemucan/grammarReader/api/GrammarReaderControllerTest.java | Zemucan - Core - grammar reader API | 286 |
"sa_conf-test-grammar1.xml ; sa_conf-test-grammar2.xml"); //$NON-NLS-1$
try {
GrammarReaderController.getInstance().getStartingNode();
} catch (final Exception exception) {
Assert.assertTrue("GeneralGrammarReaderProblemException",
exception instanceof GeneralGrammarReaderProblemException);
}
}
/**
* Test an invalid value for the grammar reader.
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public final void testInexistantGrammar() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 631 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 653 |
final String cmdOut = ""; //$NON-NLS-1$
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = cmdOut;
Assert.assertEquals("Return Empty phrase", expected, actual); //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzer.java | Zemucan - Core - analyzers | 264 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzer.java | Zemucan - Core - analyzers | 322 |
final boolean endsWithSpace, final GraphAnswer answer,
final int sizeOptions, String[] setOfOptions, String[] setOfPhrases)
throws GeneralException, ParameterNullException {
if (sizeOptions > 1) {
// There are multiple options and 0 phrases, then show all options
// and add a space at the end.
ImplementationLexicalAnalyzer.LOGGER.debug("Case 7"); |
File | Project | Line |
---|
name/angoca/zemucan/interfaze/model/ReturnOptionsTest.java | Zemucan - Core - ui API | 382 |
name/angoca/zemucan/interfaze/model/ReturnOptionsTest.java | Zemucan - Core - ui API | 404 |
new ReturnOptions(phrase, null, new String[] { options });
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("ParameterNullException",
e instanceof ParameterNullException);
}
/**
* Tests the null exception when one element in the options is null.
*
* @throws ParameterNullException
* Never.
*/
@Test
public void testReturnOptionsOneNullInOptions() |
File | Project | Line |
---|
name/angoca/zemucan/interfaze/model/ReturnOptionsTest.java | Zemucan - Core - ui API | 355 |
name/angoca/zemucan/interfaze/model/ReturnOptionsTest.java | Zemucan - Core - ui API | 419 |
public void testReturnOptionsOneNullInOptions()
throws ParameterNullException {
final String phrase = "create table"; //$NON-NLS-1$
final String phrases = ReturnOptionsTest.TABLESPACE;
Exception e = null;
try {
new ReturnOptions(phrase, new String[] { phrases }, |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/StartingNodeTest.java | Zemucan - Core - graph | 235 |
name/angoca/zemucan/core/graph/model/StartingNodeTest.java | Zemucan - Core - graph | 254 |
public void testSameHashCode() throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final StartingNode actual = new StartingNode(graph);
final StartingNode expected = new StartingNode(graph);
Assert.assertEquals("hashcode for two identical objects", //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/LicenseNodeTest.java | Zemucan - Core - graph | 255 |
name/angoca/zemucan/core/graph/model/LicenseNodeTest.java | Zemucan - Core - graph | 274 |
public void testSameHashCode() throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final LicenseNode actual = new LicenseNode(graph);
final LicenseNode expected = new LicenseNode(graph);
Assert.assertEquals("Two LicenseNode generate the same hashcode.", //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 954 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1443 |
graph1.addNode(GraphTest.CREATE1, GraphTest.CREATE, true);
graph1.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph1.firstPhaseFinished();
graph1.addRelation(Constants.STARTING_NODE, GraphTest.CREATE1); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 932 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1451 |
graph2.addNode(GraphTest.CREATE2, GraphTest.CREATE, true);
graph2.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph2.firstPhaseFinished();
graph2.addRelation(Constants.STARTING_NODE, GraphTest.CREATE2); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 207 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 273 |
final Graph graph = new Graph("inexistant child", false); //$NON-NLS-1$
graph.addNode(GraphTest.ID1, GraphTest.ID1, true);
graph.firstPhaseFinished();
Exception e = null;
try {
graph.addRelation(GraphTest.ID1, GraphTest.ID2); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 197 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 221 |
public void testAddTwiceSameParent() throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final String name = GraphNodeTest.NODE;
final GraphNode node = new GraphNode(name, graph);
final String parentName = GraphNodeTest.PARENT; |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/EndingNodeTest.java | Zemucan - Core - graph | 248 |
name/angoca/zemucan/core/graph/model/EndingNodeTest.java | Zemucan - Core - graph | 267 |
public void testSameHashCode() throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final EndingNode actual = new EndingNode(graph);
final EndingNode expected = new EndingNode(graph);
Assert.assertEquals( |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/Graph.java | Zemucan - Core - graph | 751 |
name/angoca/zemucan/core/graph/model/Graph.java | Zemucan - Core - graph | 794 |
public final StartingNode getStartingNode()
throws InvalidGraphStateException {
if (!this.graphState.equals(GraphState.Validated)) {
throw new InvalidGraphStateException(this.graphState,
GraphState.Validated);
}
return this.startingNode; |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 210 |
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 242 |
options1.add(new Token(option2, true));
final GraphAnswer expected = new GraphAnswer(phrases1, options1);
final List<Token> phrases2 = new ArrayList<Token>();
phrases2.add(new Token(phrase1, true)); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/model/TokenTest.java | Zemucan - Core - analyzers | 134 |
name/angoca/zemucan/core/lexical/model/TokenTest.java | Zemucan - Core - analyzers | 215 |
public void testHashCodeIdenticalObject() throws InvalidTokenException {
final String token = TokenTest.CREATE;
final Token expected = new Token(token, true);
final Token actual = new Token(token, true);
Assert.assertEquals("Two identical objects with the same hashcode", //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 610 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 827 |
final ReturnOptions actual = ImplementationLexicalAnalyzer
.getInstance().analyzePhrase(cmdIn);
final ReturnOptions expected = new ReturnOptions(cmdOut,
new String[] {}, new String[] { option1 }); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 349 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 488 |
final ReturnOptions actual = ImplementationLexicalAnalyzer
.getInstance().analyzePhrase(cmdIn);
final ReturnOptions expected = new ReturnOptions(cmdOut,
new String[] {}, new String[] { opt1 }); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 191 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 827 |
final ReturnOptions actual = ImplementationLexicalAnalyzer
.getInstance().analyzePhrase(cmdIn);
final ReturnOptions expected = new ReturnOptions(cmdOut,
new String[] {}, new String[] { option1 }); |
File | Project | Line |
---|
name/angoca/zemucan/IntegrationTest.java | Zemucan - main | 135 |
name/angoca/zemucan/IntegrationTest.java | Zemucan - main | 198 |
final OutputWriter writer = new SystemOutputWriter();
final ExecutionState actual = ImplementationExecuter.getInstance()
.execute(command, writer);
final ExecutionState expected = ExecutionState.APPLICATION_EXIT;
Assert.assertEquals("Execution of 'quit'", expected, actual); //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1315 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1393 |
final Graph graph = new Graph("referencing starting node", true); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1217 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1271 |
final Graph graph2 = new Graph(GraphTest.DUMMY_GRAPH, true);
graph2.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph2.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph2.addNode(GraphTest.OTHER, GraphTest.OTHER, true); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 991 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1024 |
final Graph graph = new Graph("Duplicated node name", true); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 929 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1217 |
final Graph graph2 = new Graph(GraphTest.TEST, false);
graph2.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph2.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph2.addNode(GraphTest.TABLE, GraphTest.TABLE, true); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 878 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1455 |
graph2.addRelation(GraphTest.CREATE2, Constants.ENDING_NODE);
graph2.secondPhaseFinished();
graph1.merge(graph2);
graph2.simplifyGraph();
final String actual = graph2.toString();
String expectedGraphName = "merged:{" + GraphTest.GRAPH2 + ',' |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 342 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1874 |
final Graph graph = new Graph(GraphTest.VALIDATED_GRAPH, false);
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 275 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 321 |
graph.addNode(GraphTest.ID2, GraphTest.ID2, true);
Exception e = null;
try {
graph.addRelation(GraphTest.ID1, GraphTest.ID2);
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("InvalidGraphStateException", |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 180 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1956 |
final Graph graph = new Graph("add relation validated", false); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/Graph.java | Zemucan - Core - graph | 605 |
name/angoca/zemucan/core/graph/model/Graph.java | Zemucan - Core - graph | 1089 |
Iterator<AbstractGraphNode> it = this.nodes.values().iterator();
while (it.hasNext()) {
final AbstractGraphNode node = it.next(); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 466 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 786 |
final Graph graph = new Graph("empty grammar", false); //$NON-NLS-1$
final InputSource contentToParse = new InputSource(
new StringReader(xml));
final InputSource contentToValidate = new InputSource(new StringReader(
xml));
ImplementationXMLGrammarReaderTest.LOGGER.info("testEmptyGrammar"); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 375 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1093 |
final Graph actual = new Graph(id, true);
final InputSource contentToParse = new InputSource(
new StringReader(xml));
final InputSource contentToValidate = new InputSource(new StringReader(
xml));
ImplementationXMLGrammarReaderTest.LOGGER
.info("testBuildWithExtraTokens"); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 344 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 786 |
final Graph graph = new Graph("node without parent", false); //$NON-NLS-1$
final InputSource contentToParse = new InputSource(
new StringReader(xml));
final InputSource contentToValidate = new InputSource(new StringReader(
xml));
ImplementationXMLGrammarReaderTest.LOGGER
.info("testBuildNodeNotComeFromStartingNode"); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 335 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 487 |
private String testBuildNodeNotComeFromStartingNodeText() {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 277 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 845 |
final Graph graph = new Graph("incomplete structure", false); //$NON-NLS-1$
final InputSource contentToParse = new InputSource(
new StringReader(xml));
final InputSource contentToValidate = new InputSource(new StringReader(
xml));
ImplementationXMLGrammarReaderTest.LOGGER
.info("testBuildInvalidStructure"); |
File | Project | Line |
---|
name/angoca/zemucan/executer/impl/ImplementationExecuterTest.java | Zemucan - executer impl | 309 |
name/angoca/zemucan/executer/impl/ImplementationExecuterTest.java | Zemucan - executer impl | 334 |
System.clearProperty(ImplementationExecuter.DB2_PARAMS);
final String command = "db2 !dir"; //$NON-NLS-1$
final String[] actuals = ImplementationExecuter.getInstance()
.getCommandsToExecute(command);
final String[] expecteds = new String[] { "db2", "!dir" }; //$NON-NLS-1$//$NON-NLS-2$ |
File | Project | Line |
---|
name/angoca/zemucan/executer/impl/ImplementationExecuterTest.java | Zemucan - executer impl | 109 |
name/angoca/zemucan/executer/impl/ImplementationExecuterTest.java | Zemucan - executer impl | 163 |
public void testExecutionInLinuxNoDB2() throws ParameterNullException {
// Deletes the property, loading other configuration file.
System.setProperty(Constants.ZEMUCAN_CONF_XML_PROPERTY,
"sa_conf-test-NoDB2Native.xml"); //$NON-NLS-1$
// Sets an environment property.
System.clearProperty(ImplementationExecuter.DB2_PARAMS);
System.setProperty("os.name", "Linux Virtual"); //$NON-NLS-1$ //$NON-NLS-2$
final String command = "ls"; //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 584 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 680 |
public void testGetOptions5() throws AbstractZemucanException {
final String tokenIn1 = ImplementationSyntacticAnalyzerTest.CREATE;
final String tokenIn2 = ImplementationSyntacticAnalyzerTest.TABLE;
final String tokenIn3 = ImplementationSyntacticAnalyzerTest.T1;
final String tokenIn4 = ImplementationSyntacticAnalyzerTest.OPEN_PARENTHESIS;
final String tokenIn5 = ImplementationSyntacticAnalyzerTest.C1; |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 166 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 534 |
final ReturnOptions actual = ImplementationLexicalAnalyzer
.getInstance().analyzePhrase(cmdIn);
final ReturnOptions expected = new ReturnOptions(cmdOut,
new String[] {}, new String[] { opt1, opt2 }); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/StartingNodeTest.java | Zemucan - Core - graph | 122 |
name/angoca/zemucan/core/graph/model/StartingNodeTest.java | Zemucan - Core - graph | 216 |
public void testOtherTypeEqualsObject() throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final StartingNode actual = new StartingNode(graph);
final EndingNode notExpected = new EndingNode(graph); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/LicenseNodeTest.java | Zemucan - Core - graph | 117 |
name/angoca/zemucan/core/graph/model/LicenseNodeTest.java | Zemucan - Core - graph | 236 |
public void testOtherTypeEqualsObject() throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final LicenseNode actual = new LicenseNode(graph);
final StartingNode notExpected = new StartingNode(graph); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 753 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 774 |
public void testInvalidStartingNode2() throws AbstractZemucanException {
final Graph graph = new Graph(GraphTest.NAME, true);
Exception e = null;
try {
graph.addNode(Constants.STARTING_NODE, Constants.ENDING_NODE, true); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 713 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 733 |
public void testInvalidEndingNode21() throws AbstractZemucanException {
final Graph graph = new Graph(GraphTest.NAME, true);
Exception e = null;
try {
graph.addNode(Constants.ENDING_NODE, Constants.STARTING_NODE, true); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 698 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 724 |
public void testRemoveChild() throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final String name = GraphNodeTest.GRAPHNODE;
final GraphNode graphNode = new GraphNode(name, graph); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/EndingNodeTest.java | Zemucan - Core - graph | 129 |
name/angoca/zemucan/core/graph/model/EndingNodeTest.java | Zemucan - Core - graph | 229 |
public void testOtherTypeEqualsObject() throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final EndingNode actual = new EndingNode(graph);
final StartingNode notExpected = new StartingNode(graph); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/AboutNodeTest.java | Zemucan - Core - graph | 141 |
name/angoca/zemucan/core/graph/model/AboutNodeTest.java | Zemucan - Core - graph | 240 |
public void testOtherTypeEqualsObject() throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final AboutNode actual = new AboutNode(graph);
final StartingNode notExpected = new StartingNode(graph); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1013 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1242 |
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 909 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1127 |
private String testBuildWithExtraTokensText() {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 506 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 515 |
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 500 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 657 |
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_CREATE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 426 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 919 |
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 335 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 410 |
private String testBuildInvertedText() {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Ending Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 263 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 417 |
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_ENDING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_ENDING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// table Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_TABLE_ID; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 257 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 426 |
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN;
xml += ImplementationXMLGrammarReaderTest.ID_TOKEN_ENDING_NODE_ID_TOKEN;
xml += ImplementationXMLGrammarReaderTest.CHILDREN_2;
xml += ImplementationXMLGrammarReaderTest.TOKEN_2;
// create Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_CREATE_ID; |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 650 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 716 |
public void testGetOptions5() throws AbstractZemucanException {
final String tokenIn1 = ImplementationSyntacticAnalyzerTest.CREATE;
final String tokenIn2 = ImplementationSyntacticAnalyzerTest.TABLE;
final String tokenIn3 = ImplementationSyntacticAnalyzerTest.T1;
final String tokenIn4 = ImplementationSyntacticAnalyzerTest.OPEN_PARENTHESIS;
final String tokenIn5 = ImplementationSyntacticAnalyzerTest.C1; |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 334 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 630 |
phraseIn.add(new Token(tokenIn2, true));
final boolean endsWithSpace = false;
final GraphAnswer graph = ImplementationSyntacticAnalyzer.getInstance()
.analyzeTokens(phraseIn, endsWithSpace);
final List<Token> actual = graph.getOptions(); |
File | Project | Line |
---|
name/angoca/zemucan/ui/impl/jline/ImplementationJlineInterfaceController.java | Zemucan - ui impl jLine | 155 |
name/angoca/zemucan/ui/impl/system/ImplementationSystemInterfaceController.java | Zemucan - ui impl System | 131 |
if (synchro != null) {
synchronized (synchro) {
synchronizedLoad.alreadyLoaded();
synchro.notifyAll();
}
}
while (execState != ExecutionState.APPLICATION_EXIT) { |
File | Project | Line |
---|
name/angoca/zemucan/main/MainTest.java | Zemucan - main | 91 |
name/angoca/zemucan/main/MainTest.java | Zemucan - main | 103 |
final String[] args = new String[] { "Other" }; //$NON-NLS-1$
final int actual = Main.getInterfaceControllerType(args);
final int expected = Main.ID_JLINE;
Assert.assertEquals("Interface controller type", expected, //$NON-NLS-1$
actual);
}
/**
* Tests that the controller is System.
*/
@Test
public void testGetControllerSystem() { |
File | Project | Line |
---|
name/angoca/zemucan/main/Main.java | Zemucan - main | 203 |
name/angoca/zemucan/main/Main.java | Zemucan - main | 304 |
Main(final String[]/* [!]! */args) throws AbstractZemucanException {
assert args != null;
boolean assertsEnabled = false;
// Intentional side-effect!
assert assertsEnabled = true;
if (assertsEnabled) {
for (final String string : args) {
assert string != null;
}
} |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1124 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1929 |
final Graph graph = new Graph(GraphTest.VALIDATED_GRAPH, false);
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 929 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1271 |
final Graph graph2 = new Graph(GraphTest.DUMMY_GRAPH, true);
graph2.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph2.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph2.addNode(GraphTest.OTHER, GraphTest.OTHER, true); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 556 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1900 |
final Graph graph = new Graph("validated extra nodes", true); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 556 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1055 |
final Graph graph = new Graph("no ending node", false); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.firstPhaseFinished(); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 342 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 991 |
final Graph graph = new Graph(graphName, true); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 342 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1055 |
final Graph graph = new Graph("no ending node", false); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.firstPhaseFinished(); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 180 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 420 |
final Graph graph = new Graph(GraphTest.DUMMY_GRAPH, true);
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 180 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1055 |
final Graph graph = new Graph("no ending node", false); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.firstPhaseFinished(); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/EndingNode.java | Zemucan - Core - graph | 108 |
name/angoca/zemucan/core/graph/model/StartingNode.java | Zemucan - Core - graph | 109 |
final StartingNode token = (StartingNode) object;
final List<AbstractGraphNode> ways = token.getChildren();
if ((ways.size() == this.getChildren().size())) { |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1476 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1544 |
public final void testGrammarFilesInOneDirectory()
throws AbstractZemucanException {
Configurator.getInstance().setProperty(
Constants.GRAMMAR_READER_NAME_PROPERTY,
ImplementationXMLGrammarReaderTest.XML_GRAMMAR_READER);
Configurator.getInstance().setProperty(
Constants.GRAMMAR_FILE_DESCRIPTORS_PROPERTY, |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 882 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1093 |
final Graph actual = new Graph(id, true);
final InputSource contentToParse = new InputSource(
new StringReader(xml));
final InputSource contentToValidate = new InputSource(new StringReader(
xml));
ImplementationXMLGrammarReaderTest.LOGGER
.info("testBuildWithExtraTokens"); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 872 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1340 |
public void testBuildNotAllChildren() throws AbstractZemucanException {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 845 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1093 |
final Graph actual = new Graph(id, true);
final InputSource contentToParse = new InputSource(
new StringReader(xml));
final InputSource contentToValidate = new InputSource(new StringReader(
xml));
ImplementationXMLGrammarReaderTest.LOGGER
.info("testBuildWithExtraTokens"); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 813 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 872 |
public void testBuildNoNodes() throws AbstractZemucanException {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 786 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1431 |
final Graph actual = new Graph(id, true);
final InputSource contentToParse = new InputSource(
new StringReader(xml));
final InputSource contentToValidate = new InputSource(new StringReader(
xml));
ImplementationXMLGrammarReaderTest.LOGGER
.info("testBuildWithExtraTokens"); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 755 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 872 |
public void testBuildNoNodes() throws AbstractZemucanException {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 728 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1093 |
final Graph actual = new Graph(id, true);
final InputSource contentToParse = new InputSource(
new StringReader(xml));
final InputSource contentToValidate = new InputSource(new StringReader(
xml));
ImplementationXMLGrammarReaderTest.LOGGER
.info("testBuildWithExtraTokens"); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 696 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 872 |
public void testBuildNoNodes() throws AbstractZemucanException {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 669 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1431 |
final Graph actual = new Graph(id, true);
final InputSource contentToParse = new InputSource(
new StringReader(xml));
final InputSource contentToValidate = new InputSource(new StringReader(
xml));
ImplementationXMLGrammarReaderTest.LOGGER
.info("testBuildWithExtraTokens"); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 644 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 872 |
public void testBuildNoNodes() throws AbstractZemucanException {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 344 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 375 |
final Graph actual = new Graph("grammar inversed", true); //$NON-NLS-1$
final InputSource contentToParse = new InputSource(
new StringReader(xml));
final InputSource contentToValidate = new InputSource(new StringReader(
xml));
ImplementationXMLGrammarReaderTest.LOGGER.info("testBuildInverted"); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 335 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 872 |
public void testBuildNoNodes() throws AbstractZemucanException {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 277 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 375 |
final Graph actual = new Graph("grammar inversed", true); //$NON-NLS-1$
final InputSource contentToParse = new InputSource(
new StringReader(xml));
final InputSource contentToValidate = new InputSource(new StringReader(
xml));
ImplementationXMLGrammarReaderTest.LOGGER.info("testBuildInverted"); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 247 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 872 |
public void testBuildNoNodes() throws AbstractZemucanException {
String xml = ""; //$NON-NLS-1$
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_OPEN;
xml += ImplementationXMLGrammarReaderTest.DELIMITERS_DELIMITERS;
xml += ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
xml += ImplementationXMLGrammarReaderTest.TOKENS_2; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/api/GrammarReaderControllerTest.java | Zemucan - Core - grammar reader API | 360 |
name/angoca/zemucan/grammarReader/api/GrammarReaderControllerTest.java | Zemucan - Core - grammar reader API | 400 |
public final void testUnrecognizedGrammar() throws AbstractZemucanException {
Configurator.getInstance().setProperty(
Constants.GRAMMAR_READER_NAME_PROPERTY,
GrammarReaderControllerTest.IN_MEMORY_GRAMMAR_READER);
Configurator.getInstance()
.setProperty(Constants.GRAMMAR_FILE_DESCRIPTORS_PROPERTY, |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/api/GrammarReaderControllerTest.java | Zemucan - Core - grammar reader API | 305 |
name/angoca/zemucan/grammarReader/api/GrammarReaderControllerTest.java | Zemucan - Core - grammar reader API | 324 |
"sa_conf-test-InvalidGrammarReaderDefined.xml"); //$NON-NLS-1$
try {
GrammarReaderController.getInstance();
} catch (final Exception exception) {
Assert.assertTrue("GeneralGrammarReaderProblemException",
exception instanceof GeneralGrammarReaderProblemException);
}
}
/**
* Tests that the grammar reader name cannot be null.
*
* @throws AbstractZemucanException
* Never
*/
@Test
public final void testNullValue() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/api/GrammarReaderControllerTest.java | Zemucan - Core - grammar reader API | 148 |
name/angoca/zemucan/grammarReader/api/GrammarReaderControllerTest.java | Zemucan - Core - grammar reader API | 211 |
public final void testSameGrammarFileTwice() throws AbstractZemucanException {
Configurator.getInstance().setProperty(
Constants.GRAMMAR_READER_NAME_PROPERTY,
GrammarReaderControllerTest.IN_MEMORY_GRAMMAR_READER);
Configurator.getInstance().setProperty(
Constants.GRAMMAR_FILE_DESCRIPTORS_PROPERTY, |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/api/GrammarReaderControllerTest.java | Zemucan - Core - grammar reader API | 91 |
name/angoca/zemucan/grammarReader/api/GrammarReaderControllerTest.java | Zemucan - Core - grammar reader API | 324 |
Constants.GRAMMAR_READER_NAME_PROPERTY, "Inexistant"); //$NON-NLS-1$
try {
GrammarReaderController.getInstance();
} catch (final Exception exception) {
Assert.assertTrue("GeneralGrammarReaderProblemException",
exception instanceof GeneralGrammarReaderProblemException);
}
}
/**
* Tests that the grammar reader name cannot be empty.
*
* @throws AbstractZemucanException
* Never
*/
@Test
public final void testInvalidValue() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/executer/impl/ImplementationExecuterTest.java | Zemucan - executer impl | 196 |
name/angoca/zemucan/executer/impl/ImplementationExecuterTest.java | Zemucan - executer impl | 309 |
System.setProperty(ImplementationExecuter.DB2_PARAMS, "-v"); //$NON-NLS-1$
final String command = "db2 !dir"; //$NON-NLS-1$
final String[] actuals = ImplementationExecuter.getInstance()
.getCommandsToExecute(command);
final String[] expecteds = new String[] { "db2", "-v", "!dir" }; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 308 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 829 |
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
final boolean endsWithSpace = false;
final GraphAnswer actual = ImplementationSyntacticAnalyzer |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/model/GraphAnswer.java | Zemucan - Core - analyzers | 155 |
name/angoca/zemucan/core/syntactic/model/GraphAnswer.java | Zemucan - Core - analyzers | 182 |
for (final Token node : this.phrases) {
try {
copy.add(node.clone());
} catch (final CloneNotSupportedException e) {
throw new GeneralException(e);
}
}
return copy;
} |
File | Project | Line |
---|
name/angoca/zemucan/ui/impl/jline/JlineInputReaderTest.java | Zemucan - ui impl jLine | 597 |
name/angoca/zemucan/ui/impl/jline/JlineInputReaderTest.java | Zemucan - ui impl jLine | 612 |
final Buffer b = new Buffer(command);
b.op(ConsoleOperations.COMPLETE);
AssertionHelper.assertBuffer(command, "db2 create", b);
}
/**
* Tests the command ' db2 crea'
*
* @throws IOException
* Never
*/
@Test
public void test8a() throws IOException { |
File | Project | Line |
---|
name/angoca/zemucan/ui/impl/jline/JlineInputReaderTest.java | Zemucan - ui impl jLine | 326 |
name/angoca/zemucan/ui/impl/jline/JlineInputReaderTest.java | Zemucan - ui impl jLine | 507 |
final Buffer b = new Buffer(command);
b.op(ConsoleOperations.COMPLETE);
AssertionHelper.assertBuffer(command, "db2", b);
}
/**
* Tests the command 'db2 '
*
* @throws IOException
* Never
*/
@Test
public void test5() throws IOException { |
File | Project | Line |
---|
name/angoca/zemucan/ui/impl/jline/JlineInputReaderTest.java | Zemucan - ui impl jLine | 296 |
name/angoca/zemucan/ui/impl/jline/JlineInputReaderTest.java | Zemucan - ui impl jLine | 311 |
final Buffer b = new Buffer(command);
b.op(ConsoleOperations.COMPLETE);
AssertionHelper.assertBuffer(command, "db2 create table t1 (", b);
}
/**
* Tests the command 'd'
*
* @throws IOException
* Never
*/
@Test
public void test2() throws IOException { |
File | Project | Line |
---|
name/angoca/zemucan/ui/impl/jline/JlineInputReaderTest.java | Zemucan - ui impl jLine | 251 |
name/angoca/zemucan/ui/impl/jline/JlineInputReaderTest.java | Zemucan - ui impl jLine | 266 |
final Buffer b = new Buffer(command);
b.op(ConsoleOperations.COMPLETE);
AssertionHelper.assertBuffer(command, "db2 create table", b);
}
/**
* Tests the command 'db2 create table '
*
* @throws IOException
* Never
*/
@Test
public void test17() throws IOException { |
File | Project | Line |
---|
name/angoca/zemucan/ui/impl/jline/JlineInputReaderTest.java | Zemucan - ui impl jLine | 221 |
name/angoca/zemucan/ui/impl/jline/JlineInputReaderTest.java | Zemucan - ui impl jLine | 236 |
final Buffer b = new Buffer(command);
b.op(ConsoleOperations.COMPLETE);
AssertionHelper.assertBuffer(command, "db2 create tablespace", b);
}
/**
* Tests the command 'db2 create ta'
*
* @throws IOException
* Never
*/
@Test
public void test15() throws IOException { |
File | Project | Line |
---|
name/angoca/zemucan/ui/impl/jline/JlineInputReaderTest.java | Zemucan - ui impl jLine | 160 |
name/angoca/zemucan/ui/impl/jline/JlineInputReaderTest.java | Zemucan - ui impl jLine | 266 |
final Buffer b = new Buffer(command);
b.op(ConsoleOperations.COMPLETE);
AssertionHelper.assertBuffer(command, "db2 create table", b);
}
/**
* Tests the command 'db2 create table'
*
* @throws IOException
* Never
*/
@Test
public void test16() throws IOException { |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1274 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1451 |
graph2.addNode(GraphTest.CREATE2, GraphTest.CREATE, true);
graph2.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph2.firstPhaseFinished();
graph2.addRelation(Constants.STARTING_NODE, GraphTest.CREATE2); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1059 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1195 |
graph.addRelation(GraphTest.OTHER, GraphTest.CREATE);
Exception e = null;
try {
graph.secondPhaseFinished();
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("NodeNotComesFromStartingNodeException", |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1035 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1161 |
graph.addRelation(GraphTest.CREATE, Constants.ENDING_NODE);
Exception e = null;
try {
graph.secondPhaseFinished();
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("StartingNodeNotDefinedException", |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 874 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1515 |
graph2.addNode(create2Id, create, true);
graph2.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph2.firstPhaseFinished();
graph2.addRelation(Constants.STARTING_NODE, a); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 866 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1504 |
graph1.addNode(create1Id, create, true);
graph1.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph1.firstPhaseFinished();
graph1.addRelation(Constants.STARTING_NODE, a); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 810 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1515 |
graph2.addNode(create2Id, create, true);
graph2.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph2.firstPhaseFinished();
graph2.addRelation(Constants.STARTING_NODE, a); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 802 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1504 |
graph1.addNode(create1Id, create, true);
graph1.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph1.firstPhaseFinished();
graph1.addRelation(Constants.STARTING_NODE, a); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 489 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1161 |
graph.addRelation("tablespace", Constants.ENDING_NODE);
Exception e = null;
try {
graph.secondPhaseFinished();
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("DuplicatedNodeNameException", |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 229 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 273 |
final Graph graph = new Graph("inexistant child", false); //$NON-NLS-1$
graph.addNode(GraphTest.ID1, GraphTest.ID1, true);
graph.firstPhaseFinished();
Exception e = null;
try {
graph.addRelation(GraphTest.ID1, GraphTest.ID2); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 1089 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 1117 |
actualnode.addParent(actualnode1);
final String actual = actualnode.toString();
final String expected = nodeOut;
Assert.assertEquals("String of a node", expected, actual); //$NON-NLS-1$
}
/**
* Tests the transitivity of the equals.
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void testTransitivity() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/EndingNode.java | Zemucan - Core - graph | 155 |
name/angoca/zemucan/core/graph/model/StartingNode.java | Zemucan - Core - graph | 155 |
for (final AbstractGraphNode node : super.getChildren()) {
ret += node.getId() + '-';
}
ret = ret.substring(0, ret.length() - 1);
ret += '>'; |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/EndingNode.java | Zemucan - Core - graph | 125 |
name/angoca/zemucan/core/graph/model/StartingNode.java | Zemucan - Core - graph | 125 |
return Constants.STARTING_NODE.hashCode() * -1;
}
/*
* (non-Javadoc)
*
* @see
* name.angoca.zemucan.core.graph.model.AbstractGraphNode#represent(java
* .lang.String)
*/
@Override
public final boolean represent(final String token) {
boolean ret = false;
if (token.equals(Constants.STARTING_NODE)) { |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1684 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1739 |
new ImplementationXMLGrammarReader(null, contentToParse,
contentToValidate);
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("ParameterNullException",
e instanceof ParameterNullException);
}
/**
* Test the exception thrown when no filename defined.
*
* @throws AbstractZemucanException
* Never
*/
@Test
public void testReadNoFileDefined() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1031 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1731 |
final InputSource contentToParse = new InputSource(
new StringReader(xml));
final InputSource contentToValidate = new InputSource(new StringReader(
xml));
ImplementationXMLGrammarReaderTest.LOGGER.info("testNullGraph"); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1013 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1284 |
+ ImplementationXMLGrammarReaderTest.GRAMMAR_1_CLOSE;
xml += ImplementationXMLGrammarReaderTest.TOKENS;
// Starting Node.
xml += ImplementationXMLGrammarReaderTest.TOKEN;
xml += ImplementationXMLGrammarReaderTest.ID_STARTING_NODE_ID;
xml += ImplementationXMLGrammarReaderTest.NAME_STARTING_NODE_NAME;
xml += ImplementationXMLGrammarReaderTest.RESERVED;
xml += ImplementationXMLGrammarReaderTest.CHILDREN; |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 278 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1731 |
final InputSource contentToParse = new InputSource(
new StringReader(xml));
final InputSource contentToValidate = new InputSource(new StringReader(
xml));
ImplementationXMLGrammarReaderTest.LOGGER.info("testNullGraph"); |
File | Project | Line |
---|
name/angoca/zemucan/executer/impl/ImplementationExecuter.java | Zemucan - executer impl | 516 |
name/angoca/zemucan/executer/impl/ImplementationExecuter.java | Zemucan - executer impl | 570 |
commands = new String[] { "cmd.exe", "/c", db2Command }; //$NON-NLS-1$ //$NON-NLS-2$
}
assert commands != null;
if (this.assertsEnabled) {
for (final String retCommand : commands) {
assert retCommand != null;
}
}
return commands;
} |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 122 |
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 152 |
phrases2.add(new Token(tokenString1, true));
final List<Token> options = new ArrayList<Token>();
options.add(new Token(tokenString4, true)); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 265 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 633 |
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final String actual = ret.getPhrase();
final String expected = cmdOut;
Assert.assertEquals("Empty phrase for an space", expected, //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 148 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 845 |
Assert.assertEquals("phrase: '" + cmdIn + "'", expected, actual);
// catalog, create, attach
Assert.assertTrue("options: '" + cmdIn + "'",
ret.getOptions().length == 3); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzer.java | Zemucan - Core - analyzers | 419 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzer.java | Zemucan - Core - analyzers | 495 |
assert tokens != null;
boolean assertsEnabled = false;
// Intentional side-effect!
assert assertsEnabled = true;
if (assertsEnabled) {
for (final Token token : tokens) {
assert token != null;
}
} |
File | Project | Line |
---|
name/angoca/zemucan/main/Main.java | Zemucan - main | 121 |
name/angoca/zemucan/main/Main.java | Zemucan - main | 130 |
} catch (final AbstractZemucanException exception) {
Main.LOGGER.error(exception.getMessage());
Main.LOGGER.info(exception.getStackTrace().toString()); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/LicenseNodeTest.java | Zemucan - Core - graph | 263 |
name/angoca/zemucan/core/graph/model/StartingNodeTest.java | Zemucan - Core - graph | 243 |
Assert.assertTrue("equals fot two identical objects 2", //$NON-NLS-1$
expected.equals(actual));
}
/**
* Test that the hash code is the same.
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void testSameHashCode() throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final StartingNode actual = new StartingNode(graph); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/LicenseNodeTest.java | Zemucan - Core - graph | 244 |
name/angoca/zemucan/core/graph/model/StartingNodeTest.java | Zemucan - Core - graph | 224 |
Assert.assertFalse("equals for two different objects 2", //$NON-NLS-1$
notExpected.equals(actual));
}
/**
* Test the equals method to the same object.
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void testSameEqualsObject() throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final StartingNode actual = new StartingNode(graph); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 991 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1055 |
final Graph graph = new Graph("no ending node", false); //$NON-NLS-1$
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph.firstPhaseFinished(); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 927 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 949 |
public void testMergeNotValidated2() throws AbstractZemucanException {
final Graph graph1 = new Graph(GraphTest.GRAPH1, false);
final Graph graph2 = new Graph(GraphTest.GRAPH2, false); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 372 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 388 |
final Graph graph2 = new Graph(GraphTest.NO_CONGRUENT_2, true);
final boolean result = graph1.hashCode() == graph2.hashCode();
Assert.assertTrue(GraphTest.SAME_HASHCODE, result);
}
/**
* Tests the construction of a graph.
*
* @throws ParameterNullException
* Never.
*/
@Test
public void testConstructed() throws ParameterNullException { |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 319 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 532 |
final Graph graph = new Graph("ending node", false); //$NON-NLS-1$
graph.addNode(GraphTest.ID1, GraphTest.ID1, true);
graph.addNode(GraphTest.ID2, GraphTest.ID2, true); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 858 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 912 |
final GraphNode node = new GraphNode(node1, new Graph("test", false));
final boolean condition = node.represent(node2);
Assert.assertTrue("Not represents a reserved word", condition); //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 840 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 895 |
final GraphNode node = new GraphNode(node1, new Graph("test", false));
final boolean condition = node.represent(node2);
Assert.assertFalse("Represents a reserved word", condition); //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 522 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 599 |
public void testHashCodeDifferentWithChildren()
throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final String node1 = GraphNodeTest.CREATE;
final String node2 = GraphNodeTest.CREATE;
final String node21 = GraphNodeTest.TABLE; |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/EndingNodeTest.java | Zemucan - Core - graph | 256 |
name/angoca/zemucan/core/graph/model/LicenseNodeTest.java | Zemucan - Core - graph | 263 |
Assert.assertTrue("Two LicenseNode are equals 2", //$NON-NLS-1$
expected.equals(actual));
}
/**
* Test that the hash code is the same.
*
* @throws AbstractZemucanException
* Never
*/
@Test
public void testSameHashCode() throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final LicenseNode actual = new LicenseNode(graph); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/EndingNodeTest.java | Zemucan - Core - graph | 237 |
name/angoca/zemucan/core/graph/model/LicenseNodeTest.java | Zemucan - Core - graph | 244 |
Assert.assertFalse("Equals between LicenseNode and StartingNode 2", //$NON-NLS-1$
notExpected.equals(actual));
}
/**
* Test the equals method to the same object.
*
* @throws AbstractZemucanException
* Never
*/
@Test
public void testSameEqualsObject() throws AbstractZemucanException {
final Graph graph = new Graph("test", false);
final LicenseNode actual = new LicenseNode(graph); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/AboutNodeTest.java | Zemucan - Core - graph | 145 |
name/angoca/zemucan/core/graph/model/EndingNodeTest.java | Zemucan - Core - graph | 133 |
final LicenseNode actual = new LicenseNode(graph);
final StartingNode notExpected = new StartingNode(graph);
final boolean condition = notExpected.hashCode() == actual.hashCode();
Assert.assertFalse( |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/Graph.java | Zemucan - Core - graph | 186 |
name/angoca/zemucan/core/graph/model/Graph.java | Zemucan - Core - graph | 610 |
final List<AbstractGraphNode> children = new ArrayList<AbstractGraphNode>();
children.addAll(node.getChildren());
Collections.sort(children);
AbstractGraphNode n0 = children.get(0); |
File | Project | Line |
---|
name/angoca/zemucan/executer/impl/ImplementationExecuterTest.java | Zemucan - executer impl | 147 |
name/angoca/zemucan/executer/impl/ImplementationExecuterTest.java | Zemucan - executer impl | 312 |
final String[] actuals = ImplementationExecuter.getInstance()
.getCommandsToExecute(command);
final String[] expecteds = new String[] { "db2", "-v", "!dir" }; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ |
File | Project | Line |
---|
name/angoca/zemucan/executer/impl/ImplementationExecuterTest.java | Zemucan - executer impl | 136 |
name/angoca/zemucan/executer/impl/ImplementationExecuterTest.java | Zemucan - executer impl | 189 |
public void testExecutionInUnknownOS() throws ParameterNullException {
// Deletes the property, loading other configuration file.
System.setProperty(Constants.ZEMUCAN_CONF_XML_PROPERTY,
"sa_conf-test-NoDB2Native.xml"); //$NON-NLS-1$
// Sets an environment property.
System.setProperty(ImplementationExecuter.DB2_PARAMS, "-v"); //$NON-NLS-1$
System.setProperty("os.name", "Unknown OS"); //$NON-NLS-1$ //$NON-NLS-2$ |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 171 |
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 425 |
public void testEqualsObjectTrue() throws InvalidTokenException {
final String phrase1 = GraphAnswerTest.CREATE;
final String option1 = GraphAnswerTest.TABLE;
final String option2 = GraphAnswerTest.TABLESPACE;
final List<Token> phrases1 = new ArrayList<Token>(); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 255 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 309 |
phraseIn.add(new Token(tokenIn1, true));
final boolean endsWithSpace = false;
final GraphAnswer graph = ImplementationSyntacticAnalyzer.getInstance()
.analyzeTokens(phraseIn, endsWithSpace);
final List<Token> actual = graph.getOptions(); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 678 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 921 |
final ReturnOptions actual = ImplementationLexicalAnalyzer
.getInstance().analyzePhrase(cmdIn);
final boolean condition = 0 < actual.getOptions().length;
Assert.assertTrue("Several options for a space", //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/IntegrationTest.java | Zemucan - main | 116 |
name/angoca/zemucan/IntegrationTest.java | Zemucan - main | 135 |
final OutputWriter writer = new SystemOutputWriter();
final ExecutionState actual = ImplementationExecuter.getInstance()
.execute(command, writer);
final ExecutionState expected = ExecutionState.APPLICATION_EXIT; |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1515 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1584 |
graph2.addNode(z, z, true);
graph2.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph2.firstPhaseFinished();
graph2.addRelation(Constants.STARTING_NODE, create2Id); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1504 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1573 |
graph1.addNode(z, z, true);
graph1.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph1.firstPhaseFinished();
graph1.addRelation(Constants.STARTING_NODE, create1Id); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1451 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1584 |
graph2.addNode(z, z, true);
graph2.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph2.firstPhaseFinished();
graph2.addRelation(Constants.STARTING_NODE, create2Id); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1443 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1573 |
graph1.addNode(create1Id, create, true);
graph1.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph1.firstPhaseFinished();
graph1.addRelation(Constants.STARTING_NODE, a); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1368 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1664 |
graph.addNode(e, e, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, a); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1274 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1584 |
graph2.addNode(z, z, true);
graph2.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph2.firstPhaseFinished();
graph2.addRelation(Constants.STARTING_NODE, create2Id); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 993 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1664 |
graph.addNode(e, e, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, a); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 954 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1504 |
graph1.addNode(create1Id, create, true);
graph1.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph1.firstPhaseFinished();
graph1.addRelation(Constants.STARTING_NODE, a); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 874 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1274 |
graph2.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph2.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph2.firstPhaseFinished();
graph2.addRelation(Constants.STARTING_NODE, GraphTest.CREATE); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 866 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1573 |
graph1.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph1.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph1.firstPhaseFinished();
graph1.addRelation(Constants.STARTING_NODE, GraphTest.CREATE); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 810 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 932 |
graph2.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph2.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph2.firstPhaseFinished();
graph2.addRelation(Constants.STARTING_NODE, GraphTest.CREATE); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 802 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 954 |
graph1.addNode(GraphTest.CREATE, GraphTest.CREATE, true);
graph1.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph1.firstPhaseFinished();
graph1.addRelation(Constants.STARTING_NODE, GraphTest.CREATE); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 713 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 753 |
public void testInvalidStartingNode1() throws AbstractZemucanException {
final Graph graph = new Graph(GraphTest.NAME, true);
Exception e = null;
try {
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 345 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 1664 |
graph.addNode(e, e, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, a); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 213 |
name/angoca/zemucan/interfaze/model/ReturnOptionsTest.java | Zemucan - Core - ui API | 361 |
new ReturnOptions(phrase, new String[] { phrases }, null);
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("ParameterNullException",
e instanceof ParameterNullException);
}
/**
* Tests the null exception when the phrase is null.
*
* @throws ParameterNullException
* Never.
*/
@Test
public void testReturnOptionsNullPhrase() throws ParameterNullException { |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 182 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 485 |
graph.addNode(Constants.STARTING_NODE, Constants.STARTING_NODE, true);
graph.addNode(Constants.ENDING_NODE, Constants.ENDING_NODE, true);
graph.firstPhaseFinished();
graph.addRelation(Constants.STARTING_NODE, Constants.ENDING_NODE); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 164 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 191 |
graph.addNode(GraphTest.TABLE, GraphTest.TABLE, true);
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("InvalidGraphStateException",
e instanceof InvalidGraphStateException);
}
/**
* Tests that a relation cannot have a null child.
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void testAddNullRelation1() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 158 |
name/angoca/zemucan/core/graph/model/GraphTest.java | Zemucan - Core - graph | 229 |
final Graph graph = new Graph(GraphTest.NULL_RELATION, false);
graph.addNode(GraphTest.ID1, GraphTest.ID1, true);
graph.firstPhaseFinished();
Exception e = null;
try {
graph.addRelation(GraphTest.ID1, null); |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 764 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 786 |
graphNode.removeParent(null);
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("NullGraphNodeException",
e instanceof NullGraphNodeException);
}
/**
* Removes a parent from the list of parents.
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void testRemoveParent() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 158 |
name/angoca/zemucan/core/graph/model/GraphNodeTest.java | Zemucan - Core - graph | 182 |
graphNode.addParent(nul);
} catch (final Exception exception) {
e = exception;
}
Assert.assertTrue("NullGraphNodeException",
e instanceof NullGraphNodeException);
}
/**
* Adds twice the same child node.
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public void testAddTwiceSameChild() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1169 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReaderTest.java | Zemucan - grammar reader impl XML | 1427 |
public void testErrorBuildWithExtraTokens() throws AbstractZemucanException {
final String xml = this.testBuildWithExtraTokensText();
final String id = ImplementationXMLGrammarReaderTest.NORMAL_GRAPH;
final Graph actual = new Graph(id, true); |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReader.java | Zemucan - grammar reader impl XML | 547 |
name/angoca/zemucan/grammarReader/impl/xml/ImplementationXMLGrammarReader.java | Zemucan - grammar reader impl XML | 733 |
validator.validate(source);
} catch (final SAXException exception) {
throw new XMLProblemException(exception);
} catch (final IOException exception) {
// I don't know how to test this part. It's outside my scope.
throw new GeneralGrammarFileProblemException(exception);
} |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/api/GrammarReaderControllerTest.java | Zemucan - Core - grammar reader API | 154 |
name/angoca/zemucan/grammarReader/api/GrammarReaderControllerTest.java | Zemucan - Core - grammar reader API | 175 |
";sa_conf-test-grammar1.xml;sa_conf-test-grammar2.xml"); //$NON-NLS-1$
final StartingNode node = GrammarReaderController.getInstance()
.getStartingNode();
Assert.assertTrue("Extra commas", node != null);
}
/**
* Tests to read the files with extra spaces.
*
* @throws AbstractZemucanException
* Never.
*/
@Test
public final void testExtraSpaces1() throws AbstractZemucanException { |
File | Project | Line |
---|
name/angoca/zemucan/grammarReader/api/GrammarReaderControllerTest.java | Zemucan - Core - grammar reader API | 131 |
name/angoca/zemucan/grammarReader/api/GrammarReaderControllerTest.java | Zemucan - Core - grammar reader API | 343 |
"sa_conf-test-NoGrammarReader.xml"); //$NON-NLS-1$
try {
GrammarReaderController.getInstance();
} catch (final Exception exception) {
Assert.assertTrue("GrammarReaderNotDefinedException",
exception instanceof GrammarReaderNotDefinedException);
}
}
/**
* Tests the merge of the same file twice.
*
* @throws AbstractZemucanException
* Never.
*/
@Test(expected = AssertionError.class) |
File | Project | Line |
---|
name/angoca/zemucan/executer/impl/ImplementationExecuter.java | Zemucan - executer impl | 470 |
name/angoca/zemucan/executer/impl/ImplementationExecuter.java | Zemucan - executer impl | 517 |
}
assert commands != null;
if (this.assertsEnabled) {
for (final String retCommand : commands) {
assert retCommand != null;
}
}
return commands;
} |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 701 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 812 |
phraseOut.add(new Token(tokenOut2, true));
final List<Token> options = new ArrayList<Token>();
final GraphAnswer expected = new GraphAnswer(phraseOut, options);
Assert.assertEquals("'create tab' command", expected, actual); //$NON-NLS-1$ |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 397 |
name/angoca/zemucan/core/syntactic/model/GraphAnswerTest.java | Zemucan - Core - analyzers | 177 |
phrases.add(new Token(phrase1, true));
final List<Token> options = new ArrayList<Token>();
options.add(new Token(option1, true)); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 393 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 478 |
final GraphAnswer actual = ImplementationSyntacticAnalyzer
.getInstance().analyzeTokens(phraseIn, endsWithSpace);
final List<Token> phraseOut = new ArrayList<Token>(); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 359 |
name/angoca/zemucan/core/syntactic/impl/ImplementationSyntacticAnalyzerTest.java | Zemucan - Core - analyzers | 829 |
final List<Token> phraseIn = new ArrayList<Token>();
phraseIn.add(new Token(tokenIn1, true));
final boolean endsWithSpace = false; |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 347 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 370 |
final String opt1 = "tablespace"; //$NON-NLS-1$
final ReturnOptions actual = ImplementationLexicalAnalyzer
.getInstance().analyzePhrase(cmdIn);
final ReturnOptions expected = new ReturnOptions(cmdOut,
new String[] { opt1 }, new String[] {}); |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 281 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerTest.java | Zemucan - Core - analyzers | 300 |
public void testCreaPhrase3() throws AbstractZemucanException {
final String cmdIn = "crea"; //$NON-NLS-1$
final ReturnOptions ret = ImplementationLexicalAnalyzer.getInstance()
.analyzePhrase(cmdIn);
final int actual = ret.getPhrases().length; |
File | Project | Line |
---|
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 198 |
name/angoca/zemucan/core/lexical/impl/ImplementationLexicalAnalyzerRealGrammarTest.java | Zemucan - Core - analyzers | 993 |
final int actualOptionsSize = ret.getOptions().length;
final int actualPhrasesSize = ret.getPhrases().length;
Assert.assertEquals("phrase: '" + cmdIn + "' TODO", expected, actual); |
File | Project | Line |
---|
name/angoca/zemucan/core/syntactic/model/GraphAnswer.java | Zemucan - Core - analyzers | 149 |
name/angoca/zemucan/core/syntactic/model/GraphAnswer.java | Zemucan - Core - analyzers | 176 |
for (final Token token : this.phrases) {
assert token != null;
}
}
final List<Token> copy = new ArrayList<Token>();
for (final Token node : this.phrases) { |