-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreateDDLMySQLTest.java
More file actions
79 lines (67 loc) · 1.99 KB
/
CreateDDLMySQLTest.java
File metadata and controls
79 lines (67 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import org.junit.Ignore;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import java.io.File;
/**
* Test class that will test the methods in the CreateDDLMySQL class
*
* @author Brendon Strowe
* @author Brett Phillips
* @author Steven Ricci
* @author Louie Trapani
*
*/
public class CreateDDLMySQLTest {
private File edgeFile = new File("./Courses.edg");
private EdgeConvertFileParser ecfp;
private CreateDDLMySQL testObj;
/**
* Set up the test object before running each test
*
* @throws Exception
*/
@Before
public void setUp() throws Exception {
ecfp = new EdgeConvertFileParser(edgeFile);
//Declare the test object
testObj = new CreateDDLMySQL(ecfp.getEdgeTables(), ecfp.getEdgeFields());
//runner();
}
/**
* Method that will call different mutator and
* accessor methods
*/
/*
public void runner() {
testConvertStrBooleanToInt();
//testGenerateDatabaseName();
testGetDatabaseName();
testGetProductName();
testGetSQLString();
}
*/
@Test
public void testConvertStrBooleanToInt() {
assertEquals("input is true, so it should be true", 1, testObj.convertStrBooleanToInt("true"));
}
@Test
public void testGenerateDatabaseName() {
String temp = testObj.generateDatabaseName();
assertEquals("databaseName returns " + temp + ", so it should be " + temp, "MySQLDB", testObj.getDatabaseName());
}
@Test
public void testGetDatabaseName() {
testObj.generateDatabaseName();
assertEquals("databaseName is set as MySQLDB, so it should be MySQLDB", "MySQLDB", testObj.getDatabaseName());
}
@Test
public void testGetProductName() {
assertEquals("productName returns MySQL, so it should be MySQL", "MySQL", testObj.getProductName());
}
@Test
public void testGetSQLString() {
String sqlString = testObj.getSQLString();
System.out.println(sqlString);
}
}