package Ġs ios io . dom a Ċ Ċ import Ġcom . intellij . openapi . module . Resource File Util Ċ import Ġcom . intellij . openapi . project Roots . impl . Java Aware Project J dk Table Impl Ċ import Ġcom . intellij . openapi . vfs . Virtual File Ċ import Ġcom . intellij . pom . java . Language Level Ċ import Ġcom . intellij . psi . search . Global Search Scope Ċ import Ġcom . intellij . test Framework . Ide a TestUtil Ċ import Ġcom . intellij . test Framework . builders . Java Module Fixture Builder Ċ import Ġcom . intellij . test Framework . fixtures . Java Code Insight Fixture TestCase Ċ import Ġcom . intellij . util . Path Util Ċ import Ġorg . se asar . dom a . Dao Ċ import Ġjava . io . File Ċ Ċ abstract Ġclass ĠDao TestCase Ġ: ĠJava Code Insight Fixture TestCase () Ġ{ ĊĊĠĠĠ Ġoverride Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . setUp () ĊĠĠĠĠĠĠĠ Ġadd Class From Java File (" testData / si os io / dom a / entity / Immutable Entity . java ") ĊĠĠĠĠĠĠĠ Ġadd Class From Java File (" testData / si os io / dom a / entity / Mutable Entity . java ") ĊĠĠĠ Ġ} ĊĠĠĠĠĊĠĠĠ Ġoverride Ġfun Ġtune Fixture ( module Builder : ĠJava Module Fixture Builder <* >) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . tune Fixture ( module Builder ) ĊĠĠĠĠĠĠĠ Ġmodule Builder . set Language Level ( Language Level . JDK _ 1 _ 8 ); ĊĠĠĠĠĠĠĠ Ġmodule Builder . add J dk ("./ java / mock JDK - 1 . 8 "); ĊĠĠĠĠĠĠĠ Ġmodule Builder . add Library (" dom a ", ĠPath Util . get Jar Path For Class ( Dao :: class . java )) ĊĠĠĠĠĠĠĠ Ġmodule Builder . add Library (" test - classes - kt ", Ġ"./ build / classes / kotlin / test ") ĊĠĠĠĠĠĠĠ Ġmodule Builder . add Library (" test - classes - java ", Ġ"./ build / classes / java / test ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcreate Sql File ( var arg Ġsql File Names : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġfor Ġ( name Ġin Ġsql File Names ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmy Fixture . add File To Project (" META - INF / dao /$ name ", Ġ""); ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġfind Sql File ( sql FileName : ĠString ): ĠVirtual File ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġscope Ġ= ĠGlobal Search Scope . module Runtime Scope ( module , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġreturn ĠResource File Util . find Resource File In Scope (" META - INF / dao /$ sql FileName ", Ġmy Fixture . project , Ġscope ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġin fix Ġfun Ġadd Class From Java File ( path : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfile Ġ= ĠFile ( path ) ĊĠĠĠĠĠĠĠ Ġmy Fixture . addClass ( file . read Text ()) ĊĠĠĠ Ġ} Ċ } Ċ