forked from zouzg/mybatis-generator-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
src/test/java/com/zzg/mybatis/generator/util/ConfigHelperTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.zzg.mybatis.generator.util; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Created by zouzhigang on 2016/9/18. | ||
*/ | ||
public class ConfigHelperTest { | ||
|
||
@Test | ||
public void testFindConnectorLibPath_Oracle() { | ||
String path = ConfigHelper.findConnectorLibPath("Oracle"); | ||
Assert.assertTrue(path.contains("ojdbc")); | ||
} | ||
|
||
@Test | ||
public void testFindConnectorLibPath_Mysql() { | ||
String path = ConfigHelper.findConnectorLibPath("MySQL"); | ||
Assert.assertTrue(path.contains("mysql-connector")); | ||
} | ||
|
||
@Test | ||
public void testFindConnectorLibPath_PostgreSQL() { | ||
String path = ConfigHelper.findConnectorLibPath("PostgreSQL"); | ||
Assert.assertTrue(path.contains("postgresql")); | ||
} | ||
|
||
@Test | ||
public void testGetAllJDBCDriverJarPaths() { | ||
List<String> jarFilePaths = ConfigHelper.getAllJDBCDriverJarPaths(); | ||
Assert.assertTrue(jarFilePaths != null && jarFilePaths.size() > 0); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
src/test/java/com/zzg/mybatis/generator/util/StringUtilTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.zzg.mybatis.generator.util; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Created by Owen on 6/18/16. | ||
*/ | ||
public class StringUtilTest { | ||
|
||
@Test | ||
public void testDbStringToCamelStyle() { | ||
String result = MyStringUtils.dbStringToCamelStyle("person_address"); | ||
Assert.assertEquals("PersonAddress", result); | ||
} | ||
|
||
@Test | ||
public void testDbStringToCamelStyle_case2() { | ||
String result = MyStringUtils.dbStringToCamelStyle("person_address_name"); | ||
Assert.assertEquals("PersonAddressName", result); | ||
} | ||
|
||
@Test | ||
public void testDbStringToCamelStyle_case3() { | ||
String result = MyStringUtils.dbStringToCamelStyle("person_DB_name"); | ||
Assert.assertEquals("PersonDBName", result); | ||
} | ||
|
||
@Test | ||
public void testDbStringToCamelStyle_case4() { | ||
String result = MyStringUtils.dbStringToCamelStyle("person_jobs_"); | ||
Assert.assertEquals("PersonJobs", result); | ||
} | ||
|
||
@Test | ||
public void testDbStringToCamelStyle_case5() { | ||
String result = MyStringUtils.dbStringToCamelStyle("a"); | ||
Assert.assertEquals("A", result); | ||
} | ||
|
||
} |