Last active
May 25, 2016 17:36
-
-
Save takezoe/e4d9ed92e0c0af52c2a709a5b291e6df to your computer and use it in GitHub Desktop.
Test for GitBucket Migration with MySQL
This file contains hidden or 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
"com.wix" % "wix-embedded-mysql" % "1.0.3" % "test" |
This file contains hidden or 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
package gitbucket.core | |
import java.sql.DriverManager | |
import org.scalatest.FunSuite | |
import com.wix.mysql.EmbeddedMysql._ | |
import com.wix.mysql.config.MysqldConfig._ | |
import com.wix.mysql.distribution.Version._ | |
import io.github.gitbucket.solidbase.Solidbase | |
import io.github.gitbucket.solidbase.model.Module | |
import liquibase.database.core.MySQLDatabase | |
class GitBucketCoreModuleSpec extends FunSuite { | |
test("Migration: MySQL"){ | |
val config = aMysqldConfig(v5_7_10).withPort(3306).withUser("root", "").build() | |
val mysqld = anEmbeddedMysql(config) | |
.addSchema("gitbucket") | |
.start() | |
try { | |
new Solidbase().migrate( | |
DriverManager.getConnection("jdbc:mysql://localhost:3306/gitbucket", "root", ""), | |
Thread.currentThread.getContextClassLoader, | |
new MySQLDatabase(), | |
new Module(GitBucketCoreModule.getModuleId, GitBucketCoreModule.getVersions) | |
) | |
} finally { | |
mysqld.stop() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment