Skip to content

Commit

Permalink
nothing changed
Browse files Browse the repository at this point in the history
  • Loading branch information
earayu committed Aug 13, 2017
1 parent 72e4e72 commit 4c12fdb
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/test/java/com/zzg/mybatis/generator/util/ConfigHelperTest.java
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 src/test/java/com/zzg/mybatis/generator/util/StringUtilTest.java
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);
}

}

0 comments on commit 4c12fdb

Please sign in to comment.