|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.seasar.aptina.unit.AptinaTestCase
public abstract class AptinaTestCase
Processor
をテストするための抽象クラスです.
サブクラスのテストメソッドでは,コンパイルオプションやコンパイル対象などを設定して compile()
メソッドを呼び出します.
コンパイル後に生成されたソースの検証などを行うことができます.
compile()
前に以下のメソッドを呼び出すことができます (TestCase.setUp()
から呼び出すこともできます).
setLocale(Locale)
setLocale(String)
setCharset(Charset)
setCharset(String)
setOut(Writer)
addSourcePath(File...)
addSourcePath(String...)
addOption(String...)
addProcessor(Processor...)
addCompilationUnit(Class)
addCompilationUnit(String)
addCompilationUnit(Class, CharSequence)
addCompilationUnit(String, CharSequence)
compile()
後に以下のメソッドを呼び出して情報を取得することができます.getCompiledResult()
getDiagnostics()
getDiagnostics(Class)
getDiagnostics(String)
getDiagnostics(javax.tools.Diagnostic.Kind)
getDiagnostics(Class, javax.tools.Diagnostic.Kind)
getDiagnostics(String, javax.tools.Diagnostic.Kind)
getProcessingEnvironment()
getElementUtils()
getTypeUtils()
getTypeElement(Class)
getTypeElement(String)
getFieldElement(TypeElement, Field)
getFieldElement(TypeElement, String)
getConstructorElement(TypeElement)
getConstructorElement(TypeElement, Class...)
getConstructorElement(TypeElement, String...)
getMethodElement(TypeElement, String)
getMethodElement(TypeElement, String, Class...)
getMethodElement(TypeElement, String, String...)
getTypeMirror(Class)
getTypeMirror(String)
getGeneratedSource(Class)
getGeneratedSource(String)
compile()
後に以下のメソッドを呼び出して生成されたソースの内容を検証することができます.assertEqualsGeneratedSource(CharSequence, Class)
assertEqualsGeneratedSource(CharSequence, String)
assertEqualsGeneratedSourceWithFile(File, Class)
assertEqualsGeneratedSourceWithFile(File, String)
assertEqualsGeneratedSourceWithFile(String, Class)
assertEqualsGeneratedSourceWithFile(String, String)
assertEqualsGeneratedSourceWithResource(URL, Class)
assertEqualsGeneratedSourceWithResource(URL, String)
assertEqualsGeneratedSourceWithResource(String, Class)
assertEqualsGeneratedSourceWithResource(String, String)
compile()
を呼び出した後に状態をリセットしてコンパイル前の状態に戻すには, reset()
を呼び出します.
次のサンプルは, src/test/java
フォルダにある TestSource.java
をコンパイルすると,
foo.bar.Baz
クラスのソースを生成する TestProcessor
のテストクラスです.
public class TestProcessorTest extends AptinaTestCase { @Override protected void setUp() throws Exception { super.setUp(); // ソースパスを追加 addSourcePath("src/test/java"); } public void test() throws Exception { // テスト対象の Annotation Processor を生成して追加 TestProcessor processor = new TestProcessor(); addProcessor(processor); // コンパイル対象を追加 addCompilationUnit(TestSource.class); // コンパイル実行 compile(); // テスト対象の Annotation Processor が生成したソースを検証 assertEqualsGeneratedSource("package foo.bar; public class Baz {}", "foo.bar.Baz"); } }
コンストラクタの概要 | |
---|---|
protected |
AptinaTestCase()
インスタンスを構築します. |
protected |
AptinaTestCase(String name)
インスタンスを構築します. |
メソッドの概要 | |
---|---|
protected void |
addCompilationUnit(Class<?> clazz)
コンパイル対象のクラスを追加します. |
protected void |
addCompilationUnit(Class<?> clazz,
CharSequence source)
コンパイル対象のクラスをソースとともに追加します. |
protected void |
addCompilationUnit(String className)
コンパイル対象のクラスを追加します. |
protected void |
addCompilationUnit(String className,
CharSequence source)
コンパイル対象のクラスをソースとともに追加します. |
protected void |
addOption(String... options)
コンパイラオプションを追加します. |
protected void |
addProcessor(Processor... processors)
注釈を処理する Processor を追加します. |
protected void |
addSourcePath(File... sourcePaths)
コンパイル時に参照するソースパスを追加します. |
protected void |
addSourcePath(String... sourcePaths)
コンパイル時に参照するソースパスを追加します. |
protected void |
assertEqualsByLine(BufferedReader expectedReader,
BufferedReader actualReader)
文字列を行単位で比較します. |
protected void |
assertEqualsByLine(String expected,
String actual)
文字列を行単位で比較します. |
protected void |
assertEqualsGeneratedSource(CharSequence expected,
Class<?> clazz)
Processor が生成したソースを文字列と比較・検証します. |
protected void |
assertEqualsGeneratedSource(CharSequence expected,
String className)
Processor が生成したソースを文字列と比較・検証します. |
protected void |
assertEqualsGeneratedSourceWithFile(File expectedSourceFile,
Class<?> clazz)
Processor が生成したソースをファイルと比較・検証します. |
protected void |
assertEqualsGeneratedSourceWithFile(File expectedSourceFile,
String className)
Processor が生成したソースをファイルと比較・検証します. |
protected void |
assertEqualsGeneratedSourceWithFile(String expectedSourceFilePath,
Class<?> clazz)
Processor が生成したソースをファイルと比較・検証します. |
protected void |
assertEqualsGeneratedSourceWithFile(String expectedSourceFilePath,
String className)
Processor が生成したソースをファイルと比較・検証します. |
protected void |
assertEqualsGeneratedSourceWithResource(String expectedResource,
Class<?> clazz)
Processor が生成したソースをクラスパス上のリソースと比較・検証します. |
protected void |
assertEqualsGeneratedSourceWithResource(String expectedResource,
String className)
Processor が生成したソースをクラスパス上のリソースと比較・検証します. |
protected void |
assertEqualsGeneratedSourceWithResource(URL expectedResourceUrl,
Class<?> clazz)
Processor が生成したソースをクラスパス上のリソースと比較・検証します. |
protected void |
assertEqualsGeneratedSourceWithResource(URL expectedResourceUrl,
String className)
Processor が生成したソースをクラスパス上のリソースと比較・検証します. |
protected void |
compile()
コンパイルを実行します. |
protected Charset |
getCharset()
文字セットを返します. |
protected Boolean |
getCompiledResult()
コンパイラの実行結果を返します. |
protected ExecutableElement |
getConstructorElement(TypeElement typeElement)
型エレメントに定義されたデフォルトコンストラクタの実行可能エレメントを返します. |
protected ExecutableElement |
getConstructorElement(TypeElement typeElement,
Class<?>... parameterTypes)
型エレメントに定義されたコンストラクタの実行可能エレメントを返します. |
protected ExecutableElement |
getConstructorElement(TypeElement typeElement,
String... parameterTypeNames)
型エレメントに定義されたコンストラクタの実行可能エレメントを返します. |
protected List<Diagnostic<? extends JavaFileObject>> |
getDiagnostics()
コンパイル中に作成された Diagnostic のリストを返します. |
protected List<Diagnostic<? extends JavaFileObject>> |
getDiagnostics(Class<?> clazz)
指定されたクラスに対する Diagnostic のリストを返します. |
protected List<Diagnostic<? extends JavaFileObject>> |
getDiagnostics(Class<?> clazz,
Diagnostic.Kind kind)
指定されたクラスに対する指定された Diagnostic.Kind を持つ
Diagnostic のリストを返します. |
protected List<Diagnostic<? extends JavaFileObject>> |
getDiagnostics(Diagnostic.Kind kind)
指定された Diagnostic.Kind を持つ Diagnostic
のリストを返します. |
protected List<Diagnostic<? extends JavaFileObject>> |
getDiagnostics(String className)
指定されたクラスに対する Diagnostic のリストを返します. |
protected List<Diagnostic<? extends JavaFileObject>> |
getDiagnostics(String className,
Diagnostic.Kind kind)
指定されたクラスに対する指定された Diagnostic.Kind を持つ
Diagnostic のリストを返します. |
protected Elements |
getElementUtils()
Elements を返します. |
protected VariableElement |
getFieldElement(TypeElement typeElement,
Field field)
型エレメントに定義されたフィールドの変数エレメントを返します. |
protected VariableElement |
getFieldElement(TypeElement typeElement,
String fieldName)
型エレメントに定義されたフィールドの変数エレメントを返します. |
protected String |
getGeneratedSource(Class<?> clazz)
Processor が生成したソースを返します. |
protected String |
getGeneratedSource(String className)
Processor が生成したソースを返します. |
protected Locale |
getLocale()
ロケールを返します. |
protected ExecutableElement |
getMethodElement(TypeElement typeElement,
String methodName)
型エレメントに定義されたメソッドの実行可能エレメントを返します. |
protected ExecutableElement |
getMethodElement(TypeElement typeElement,
String methodName,
Class<?>... parameterTypes)
型エレメントに定義されたメソッドの実行可能エレメントを返します. |
protected ExecutableElement |
getMethodElement(TypeElement typeElement,
String methodName,
String... parameterTypeNames)
型エレメントに定義されたメソッドの実行可能エレメントを返します. |
protected ProcessingEnvironment |
getProcessingEnvironment()
ProcessingEnvironment を返します. |
protected TypeElement |
getTypeElement(Class<?> clazz)
クラスに対応する TypeElement を返します. |
protected TypeElement |
getTypeElement(String className)
クラスに対応する TypeElement を返します. |
protected TypeMirror |
getTypeMirror(Class<?> clazz)
クラスに対応する TypeMirror を返します. |
protected TypeMirror |
getTypeMirror(String className)
クラスに対応する TypeMirror を返します. |
protected Types |
getTypeUtils()
Types を返します. |
protected void |
reset()
設定をリセットし,初期状態に戻します. |
protected void |
setCharset(Charset charset)
文字セットを設定します. |
protected void |
setCharset(String charset)
文字セットを設定します. |
protected void |
setLocale(Locale locale)
ロケールを設定します. |
protected void |
setLocale(String locale)
ロケールを設定します. |
protected void |
setOut(Writer out)
コンパイラがメッセージを出力する Writer を設定します. |
protected void |
tearDown()
|
クラス junit.framework.TestCase から継承されたメソッド |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, toString |
クラス junit.framework.Assert から継承されたメソッド |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
コンストラクタの詳細 |
---|
protected AptinaTestCase()
protected AptinaTestCase(String name)
name
- 名前メソッドの詳細 |
---|
protected void tearDown() throws Exception
TestCase
内の tearDown
Exception
protected Locale getLocale()
null
protected void setLocale(Locale locale)
設定されなかった場合はプラットフォームデフォルトのロケールが使われます.
locale
- ロケールLocale.getDefault()
protected void setLocale(String locale)
設定されなかった場合はプラットフォームデフォルトのロケールが使われます.
locale
- ロケールLocale.getDefault()
protected Charset getCharset()
null
protected void setCharset(Charset charset)
設定されなかった場合はプラットフォームデフォルトの文字セットが使われます.
charset
- 文字セットCharset.defaultCharset()
protected void setCharset(String charset)
設定されなかった場合はプラットフォームデフォルトの文字セットが使われます.
charset
- 文字セットCharset.defaultCharset()
protected void setOut(Writer out)
Writer
を設定します.
設定されなかった場合は標準エラーが使われます.
out
- コンパイラがメッセージを出力するWriter
protected void addSourcePath(File... sourcePaths)
sourcePaths
- コンパイル時に参照するソースパスの並びprotected void addSourcePath(String... sourcePaths)
sourcePaths
- コンパイル時に参照するソースパスの並びprotected void addOption(String... options)
options
- 形式のコンパイラオプションの並びprotected void addProcessor(Processor... processors)
Processor
を追加します.
processors
- 注釈を処理するProcessor
の並びprotected void addCompilationUnit(Class<?> clazz)
指定されたクラスのソースはソースパス上に存在していなければなりません.
clazz
- コンパイル対象クラスprotected void addCompilationUnit(String className)
指定されたクラスのソースはソースパス上に存在していなければなりません.
className
- コンパイル対象クラスの完全限定名protected void addCompilationUnit(Class<?> clazz, CharSequence source)
clazz
- コンパイル対象クラスsource
- ソースprotected void addCompilationUnit(String className, CharSequence source)
className
- コンパイル対象クラスの完全限定名source
- ソースprotected void compile() throws IOException
IOException
- 入出力例外が発生した場合protected Boolean getCompiledResult() throws IllegalStateException
IllegalStateException
- compile()
が呼び出されていない場合JavaCompiler.CompilationTask.call()
protected List<Diagnostic<? extends JavaFileObject>> getDiagnostics() throws IllegalStateException
Diagnostic
のリストを返します.
Diagnostic
のリスト
IllegalStateException
- compile()
が呼び出されていない場合protected List<Diagnostic<? extends JavaFileObject>> getDiagnostics(Class<?> clazz)
Diagnostic
のリストを返します.
clazz
- 取得するクラス
Diagnostic
のリストprotected List<Diagnostic<? extends JavaFileObject>> getDiagnostics(String className)
Diagnostic
のリストを返します.
className
- 取得するクラス名
Diagnostic
のリストprotected List<Diagnostic<? extends JavaFileObject>> getDiagnostics(Diagnostic.Kind kind)
Diagnostic.Kind
を持つ Diagnostic
のリストを返します.
kind
- 取得する Diagnostic.Kind
Diagnostic.Kind
を持つ Diagnostic
のリストprotected List<Diagnostic<? extends JavaFileObject>> getDiagnostics(Class<?> clazz, Diagnostic.Kind kind)
Diagnostic.Kind
を持つ
Diagnostic
のリストを返します.
clazz
- 取得するクラスkind
- 取得する Diagnostic.Kind
Diagnostic.Kind
を持つ
Diagnostic
のリストprotected List<Diagnostic<? extends JavaFileObject>> getDiagnostics(String className, Diagnostic.Kind kind)
Diagnostic.Kind
を持つ
Diagnostic
のリストを返します.
className
- 取得するクラス名kind
- 取得する Diagnostic.Kind
Diagnostic.Kind
を持つ
Diagnostic
のリストprotected ProcessingEnvironment getProcessingEnvironment() throws IllegalStateException
ProcessingEnvironment
を返します.
ProcessingEnvironment
IllegalStateException
- compile()
が呼び出されていない場合protected Elements getElementUtils() throws IllegalStateException
Elements
を返します.
Elements
IllegalStateException
- compile()
が呼び出されていない場合ProcessingEnvironment.getElementUtils()
protected Types getTypeUtils() throws IllegalStateException
Types
を返します.
Types
IllegalStateException
- compile()
が呼び出されていない場合ProcessingEnvironment.getTypeUtils()
protected TypeElement getTypeElement(Class<?> clazz) throws IllegalStateException
TypeElement
を返します.
このメソッドが返す TypeElement
およびその Element.getEnclosedElements()
が返す Element
から, Elements.getDocComment(Element)
を使って
Javadoc コメントを取得することはできません.
clazz
- クラス
TypeElement
, 存在しない場合は null
IllegalStateException
- compile()
が呼び出されていない場合protected TypeElement getTypeElement(String className) throws IllegalStateException
TypeElement
を返します.
このメソッドが返す TypeElement
およびその Element.getEnclosedElements()
が返す Element
から, Elements.getDocComment(Element)
を使って
Javadoc コメントを取得することはできません.
className
- クラスの完全限定名
TypeElement
, 存在しない場合は null
IllegalStateException
- compile()
が呼び出されていない場合protected VariableElement getFieldElement(TypeElement typeElement, Field field) throws IllegalStateException
typeElement
- 型エレメントfield
- フィールド
null
IllegalStateException
- compile()
が呼び出されていない場合protected VariableElement getFieldElement(TypeElement typeElement, String fieldName) throws IllegalStateException
typeElement
- 型エレメントfieldName
- フィールド名
null
IllegalStateException
- compile()
が呼び出されていない場合protected ExecutableElement getConstructorElement(TypeElement typeElement) throws IllegalStateException
typeElement
- 型エレメント
null
IllegalStateException
- compile()
が呼び出されていない場合protected ExecutableElement getConstructorElement(TypeElement typeElement, Class<?>... parameterTypes) throws IllegalStateException
引数型が型引数を持つ場合は getConstructorElement(TypeElement, String...)
を使用してください.
typeElement
- 型エレメントparameterTypes
- 引数型の並び
null
IllegalStateException
- compile()
が呼び出されていない場合protected ExecutableElement getConstructorElement(TypeElement typeElement, String... parameterTypeNames) throws IllegalStateException
引数がの型が配列の場合は, 要素型の名前の後に []
を連ねる形式と, [[LString;
のような形式のどちらでも指定することができます.
引数型が型引数を持つ場合は "java.util.List<T>"
のようにそのまま指定します.
typeElement
- 型エレメントparameterTypeNames
- 引数の型名の並び
null
IllegalStateException
- compile()
が呼び出されていない場合protected ExecutableElement getMethodElement(TypeElement typeElement, String methodName) throws IllegalStateException
typeElement
- 型エレメントmethodName
- メソッド名
null
IllegalStateException
- compile()
が呼び出されていない場合protected ExecutableElement getMethodElement(TypeElement typeElement, String methodName, Class<?>... parameterTypes) throws IllegalStateException
引数型が型引数を持つ場合は getMethodElement(TypeElement, String, String...)
を使用してください.
typeElement
- 型エレメントmethodName
- メソッド名parameterTypes
- 引数型の並び
null
IllegalStateException
- compile()
が呼び出されていない場合protected ExecutableElement getMethodElement(TypeElement typeElement, String methodName, String... parameterTypeNames) throws IllegalStateException
引数がの型が配列の場合は, 要素型の名前の後に []
を連ねる形式と, [[LString;
のような形式のどちらでも指定することができます.
引数型が型引数を持つ場合は "java.util.List<T>"
のようにそのまま指定します.
typeElement
- 型エレメントmethodName
- メソッド名parameterTypeNames
- 引数の型名の並び
null
IllegalStateException
- compile()
が呼び出されていない場合protected TypeMirror getTypeMirror(Class<?> clazz) throws IllegalStateException
TypeMirror
を返します.
clazz
- クラス
TypeMirror
, クラスが存在しない場合は null
IllegalStateException
- compile()
が呼び出されていない場合protected TypeMirror getTypeMirror(String className) throws IllegalStateException
TypeMirror
を返します.
配列の場合は要素型の名前の後に []
を連ねる形式と, [[LString;
のような
形式のどちらでも指定することができます.
className
- クラスの完全限定名
TypeMirror
, クラスが存在しない場合は null
IllegalStateException
- compile()
が呼び出されていない場合protected String getGeneratedSource(Class<?> clazz) throws IllegalStateException, IOException, SourceNotGeneratedException
Processor
が生成したソースを返します.
clazz
- 生成されたクラス
IllegalStateException
- compile()
が呼び出されていない場合
IOException
- 入出力例外が発生した場合
SourceNotGeneratedException
- ソースが生成されなかった場合protected String getGeneratedSource(String className) throws IllegalStateException, IOException, SourceNotGeneratedException
Processor
が生成したソースを返します.
className
- 生成されたクラスの完全限定名
IllegalStateException
- compile()
が呼び出されていない場合
IOException
- 入出力例外が発生した場合
SourceNotGeneratedException
- ソースが生成されなかった場合protected void assertEqualsByLine(String expected, String actual)
expected
- 期待される文字列actual
- 実際の文字列protected void assertEqualsByLine(BufferedReader expectedReader, BufferedReader actualReader) throws IOException
expectedReader
- 期待される文字列の入力ストリームactualReader
- 実際の文字列の入力ストリーム
IOException
- 入出力例外が発生した場合protected void assertEqualsGeneratedSource(CharSequence expected, Class<?> clazz) throws IllegalStateException, IOException, SourceNotGeneratedException, ComparisonFailure
Processor
が生成したソースを文字列と比較・検証します.
expected
- 生成されたソースに期待される内容の文字列clazz
- 生成されたクラス
IllegalStateException
- compile()
が呼び出されていない場合
IOException
- 入出力例外が発生した場合
SourceNotGeneratedException
- ソースが生成されなかった場合
ComparisonFailure
- 生成されたソースが期待される内容と一致しなかった場合protected void assertEqualsGeneratedSource(CharSequence expected, String className) throws IllegalStateException, IOException, SourceNotGeneratedException, ComparisonFailure
Processor
が生成したソースを文字列と比較・検証します.
expected
- 生成されたソースに期待される内容の文字列className
- 生成されたクラスの完全限定名
IllegalStateException
- compile()
が呼び出されていない場合
IOException
- 入出力例外が発生した場合
SourceNotGeneratedException
- ソースが生成されなかった場合
ComparisonFailure
- 生成されたソースが期待される内容と一致しなかった場合protected void assertEqualsGeneratedSourceWithFile(File expectedSourceFile, Class<?> clazz) throws IllegalStateException, IOException, SourceNotGeneratedException, ComparisonFailure
Processor
が生成したソースをファイルと比較・検証します.
expectedSourceFile
- 生成されたソースに期待される内容を持つファイルclazz
- 生成されたクラス
IllegalStateException
- compile()
が呼び出されていない場合
IOException
- 入出力例外が発生した場合
SourceNotGeneratedException
- ソースが生成されなかった場合
ComparisonFailure
- 生成されたソースが期待される内容と一致しなかった場合protected void assertEqualsGeneratedSourceWithFile(File expectedSourceFile, String className) throws IllegalStateException, IOException, SourceNotGeneratedException, ComparisonFailure
Processor
が生成したソースをファイルと比較・検証します.
expectedSourceFile
- 生成されたソースに期待される内容を持つファイルclassName
- クラスの完全限定名
IllegalStateException
- compile()
が呼び出されていない場合
IOException
- 入出力例外が発生した場合
SourceNotGeneratedException
- ソースが生成されなかった場合
ComparisonFailure
- 生成されたソースが期待される内容と一致しなかった場合protected void assertEqualsGeneratedSourceWithFile(String expectedSourceFilePath, Class<?> clazz) throws IllegalStateException, IOException, SourceNotGeneratedException, ComparisonFailure
Processor
が生成したソースをファイルと比較・検証します.
expectedSourceFilePath
- 生成されたソースに期待される内容を持つファイルのパスclazz
- 生成されたクラス
IllegalStateException
- compile()
が呼び出されていない場合
IOException
- 入出力例外が発生した場合
SourceNotGeneratedException
- ソースが生成されなかった場合
ComparisonFailure
- 生成されたソースが期待される内容と一致しなかった場合protected void assertEqualsGeneratedSourceWithFile(String expectedSourceFilePath, String className) throws IllegalStateException, IOException, SourceNotGeneratedException, ComparisonFailure
Processor
が生成したソースをファイルと比較・検証します.
expectedSourceFilePath
- 生成されたソースに期待される内容を持つファイルのパスclassName
- 生成されたクラスの完全限定名
IllegalStateException
- compile()
が呼び出されていない場合
IOException
- 入出力例外が発生した場合
SourceNotGeneratedException
- ソースが生成されなかった場合
ComparisonFailure
- 生成されたソースが期待される内容と一致しなかった場合protected void assertEqualsGeneratedSourceWithResource(URL expectedResourceUrl, Class<?> clazz) throws IllegalStateException, IOException, SourceNotGeneratedException, ComparisonFailure
Processor
が生成したソースをクラスパス上のリソースと比較・検証します.
expectedResourceUrl
- 生成されたソースに期待される内容を持つリソースのURLclazz
- 生成されたクラス
IllegalStateException
- compile()
が呼び出されていない場合
IOException
- 入出力例外が発生した場合
SourceNotGeneratedException
- ソースが生成されなかった場合
ComparisonFailure
- 生成されたソースが期待される内容と一致しなかった場合protected void assertEqualsGeneratedSourceWithResource(URL expectedResourceUrl, String className) throws IllegalStateException, IOException, SourceNotGeneratedException, ComparisonFailure
Processor
が生成したソースをクラスパス上のリソースと比較・検証します.
expectedResourceUrl
- 生成されたソースに期待される内容を持つリソースのURLclassName
- 生成されたクラスの完全限定名
IllegalStateException
- compile()
が呼び出されていない場合
IOException
- 入出力例外が発生した場合
SourceNotGeneratedException
- ソースが生成されなかった場合
ComparisonFailure
- 生成されたソースが期待される内容と一致しなかった場合protected void assertEqualsGeneratedSourceWithResource(String expectedResource, Class<?> clazz) throws IllegalStateException, IOException, SourceNotGeneratedException, ComparisonFailure
Processor
が生成したソースをクラスパス上のリソースと比較・検証します.
expectedResource
- 生成されたソースに期待される内容を持つリソースのパスclazz
- 生成されたクラス
IllegalStateException
- compile()
が呼び出されていない場合
IOException
- 入出力例外が発生した場合
SourceNotGeneratedException
- ソースが生成されなかった場合
ComparisonFailure
- 生成されたソースが期待される内容と一致しなかった場合protected void assertEqualsGeneratedSourceWithResource(String expectedResource, String className) throws IllegalStateException, IOException, SourceNotGeneratedException, ComparisonFailure
Processor
が生成したソースをクラスパス上のリソースと比較・検証します.
expectedResource
- 生成されたソースに期待される内容を持つリソースのパスclassName
- 生成されたクラスの完全限定名
IllegalStateException
- compile()
が呼び出されていない場合
IOException
- 入出力例外が発生した場合
SourceNotGeneratedException
- ソースが生成されなかった場合
ComparisonFailure
- 生成されたソースが期待される内容と一致しなかった場合protected void reset()
|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |