Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.netbeans.api.java/1 1.10.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.netbeans.spi.java.queries
Interface UnitTestForSourceQueryImplementation

Deprecated. Use `MultipleRootsUnitTestForSourceQueryImplementation` instead.

    public interface UnitTestForSourceQueryImplementation

Query to find Java package root of unit tests for Java package root of sources and vice versa.

A default implementation is registered by the `org.netbeans.modules.java.project` module which looks up the project corresponding to the binary file and checks whether that project has an implementation of this interface in its lookup. If so, it delegates to that implementation. Therefore it is not generally necessary for a project type provider to register its own global implementation of this query, if it depends on the Java Project module and uses this style.

This interface assumes following mapping pattern between source files and unit tests: `*.java -> *Test.java`. This mapping is used for example for unit test generation and for searching test for source. Usage of any other pattern will break this functionality.

Since:
  org.netbeans.api.java/1 1.4
See Also:
  `Project.getLookup()`, `UnitTestForSourceQuery`

Method Summary
`URL` | `findSource(FileObject unitTest)` Deprecated. Returns the source root for a given test root.
`URL` | `findUnitTest(FileObject source)` Deprecated. Returns the test root for a given source root.

Method Detail

### findUnitTest

    URL findUnitTest(FileObject source)

  Deprecated.
  Returns the test root for a given source root.

  Parameters:
    `source` - a Java package root with sources
  Returns:
    a corresponding Java package root with unit tests. The returned URL need not point to an existing folder. It can be null when no mapping from source to unit test is known.

### findSource

    URL findSource(FileObject unitTest)

  Deprecated.
  Returns the source root for a given test root.

  Parameters:
    `unitTest` - a Java package root with unit tests
  Returns:
    a corresponding Java package root with sources. It can be null when no mapping from unit test to source is known.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.netbeans.api.java/1 1.10.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Built on December 7 2006. | Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.