Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright 2010 the original author or authors.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.

JUnit-3.8.x integration. This API is compatible with JDK-1.4.

Since annotations are not supported under JDK-1.4 there are alternatives available ...
1) Combine-configuration can be tweaked by low-level APIs that allow the test-developer to override CallbackRecordsFactory.
2) Callback-injection is performed for all interface fields, i.e. not just the fields that are annotated with @CallbackField.

When this API is used under JDK-1.5+ the combine-annotations are automagically enabled, thus making alternative 1) less attractive. @CallbackField-annotated interface-fields are of course callback-injected but all other interface-fields will be injected as well. (Which only means that uninitialized interface-fields will be non-null when the constructor runs, so it will only be a minor inconvenience ...)
Nevertheless test-developers are encouraged to upgrade to JUnit-4.x ASAP and switch to the integration-API provided by CallbackParamsRunner, because of the advantages it offers while still allowing existing tests to use the JUnit-3.8.x API.
package org.callbackparams.junit3;
New to GrepCode? Check out our FAQ X