T
- テスト中の型 public class JsonbTester<T> extends AbstractJsonMarshalTester<T>
initFields(Object, Jsonb)
を介してインスタンス化されます。例:public class ExampleObjectJsonTests { private JsonbTester<ExampleObject> json; @Before public void setup() { Jsonb jsonb = JsonbBuilder.create(); JsonbTester.initFields(this, jsonb); } @Test public void testWriteJson() throws IOException { ExampleObject object = // ... assertThat(json.write(object)).isEqualToJson("expected.json"); } }詳細については、
AbstractJsonMarshalTester
を参照してください。AbstractJsonMarshalTester.FieldInitializer<M>
修飾子 | コンストラクターと説明 |
---|---|
| JsonbTester(ClassSE<?> resourceLoadClass, ResolvableType type, javax.json.bind.JsonbEE jsonb) 新しい JsonbTester インスタンスを作成します。 |
protected | JsonbTester(javax.json.bind.JsonbEE jsonb) 初期化されていない新しい JsonbTester インスタンスを作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
static void | initFields(ObjectSE testInstance, javax.json.bind.JsonbEE jsonb) JsonbTester フィールドを初期化するユーティリティメソッド。 |
static void | initFields(ObjectSE testInstance, ObjectFactory<javax.json.bind.JsonbEE> jsonb) JsonbTester フィールドを初期化するユーティリティメソッド。 |
protected T | readObject(ReaderSE reader, ResolvableType type) 指定したリーダーから読み取り、指定した型のオブジェクトを作成します。 |
protected StringSE | writeObject(T value, ResolvableType type) 指定されたオブジェクトを JSON 文字列に書き込みます。 |
getJsonContent, getResourceLoadClass, getType, initialize, parse, parse, parseObject, parseObject, read, read, read, read, read, readObject, readObject, readObject, readObject, readObject, readObject, write
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
protected JsonbTester(javax.json.bind.JsonbEE jsonb)
JsonbTester
インスタンスを作成します。jsonb
- Jsonb インスタンス public JsonbTester(ClassSE<?> resourceLoadClass, ResolvableType type, javax.json.bind.JsonbEE jsonb)
JsonbTester
インスタンスを作成します。resourceLoadClass
- リソースのロードに使用されるソースクラス type
- テスト中の型 jsonb
- Jsonb インスタンス initFields(Object, Jsonb)
protected StringSE writeObject(T value, ResolvableType type) throws IOExceptionSE
AbstractJsonMarshalTester
AbstractJsonMarshalTester<T>
の writeObject
value
- ソース値 (非 null
)type
- 結果の型 (非 null
)IOExceptionSE
- 書き込みエラー時 protected T readObject(ReaderSE reader, ResolvableType type) throws IOExceptionSE
AbstractJsonMarshalTester
AbstractJsonMarshalTester<T>
の readObject
reader
- ソースリーダー (非 null
)type
- 結果の型 (非 null
)IOExceptionSE
- 読み取りエラー時 public static void initFields(ObjectSE testInstance, javax.json.bind.JsonbEE jsonb)
JsonbTester
フィールドを初期化するユーティリティメソッド。使用例については、class-level documentation
を参照してください。testInstance
- テストインスタンス jsonb
- Jsonb インスタンス public static void initFields(ObjectSE testInstance, ObjectFactory<javax.json.bind.JsonbEE> jsonb)
JsonbTester
フィールドを初期化するユーティリティメソッド。使用例については、class-level documentation
を参照してください。testInstance
- テストインスタンス jsonb
- Jsonb インスタンスを作成するためのオブジェクトファクトリ