Skip to content

Commit

Permalink
JDO-832: Remove RunTCK option jdo.tck.skipJndi (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
mboapache authored Jul 13, 2023
1 parent f3396e2 commit 470883f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 37 deletions.
5 changes: 2 additions & 3 deletions HowToReleaseJDO.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,8 @@ Detailed process steps
Artifacts](https://infra.apache.org/publishing-maven-artifacts.html)
to set up your development environment.

8. Copy the JNDI implementation jars (`providerutil.jar` and
`fscontext.jar`) to the branch `lib/ext` directory. This is needed to
test the tck before distributing it.
8. If you want to use a JNDI implementation other the TCK's own JNDI mock implementation, then copy the JNDI
implementation jars to the branch `lib/ext` directory. This is needed to test the tck before distributing it.
**Do not check these in into the repository**

9. Make sure the TCK passes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ You must have Maven (version 2+) to build the projects from source and to execut
Note that Maven uses the `user.home` system property for the location of the Maven local repository: `${user.home}/.m2/repository`.
Under Windows this system property is `C:\Documents and Settings\{user}` no matter what the `HOME` variable is set to. As a workaround you may set the system property by adding `-Duser.home=%HOME%` to the environment variable `MAVEN_OPTS`.

### JNDI Implementation (fscontext.jar and providerutil.jar)
### JNDI Implementation

The JNDI test cases in *tck* need a JNDI implementation. The TCK is configured to use the TCK's own JNDI mock implementation. To use your own implementation, add the dependencies to the TCK's `.pom` or put the implementation jar files directly into `lib/ext`. Then update `jndi.properties` in the TCK directory `src/conf`.

Expand Down
5 changes: 0 additions & 5 deletions exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ public class RunTCK extends AbstractTCKMojo {
required = true)
private String extLibsDirectory;

/** To skip jndi PMF Tests set to true. */
@Parameter(property = "jdo.tck.skipJndi", defaultValue = "false", required = true)
private boolean skipJndi;

/** Name of file in src/conf containing pmf properties. */
@Parameter(property = "jdo.tck.pmfproperties", defaultValue = "jdori-pmf.properties")
private String pmfProperties;
Expand Down Expand Up @@ -205,7 +201,6 @@ public void execute() throws MojoExecutionException, MojoFailureException {
propsString.add("-DResultPrinterClass=" + resultPrinterClass);
propsString.add("-Dverbose=" + verbose);
propsString.add("-Djdo.tck.cleanupaftertest=" + cleanupaftertest);
propsString.add("-Djdo.tck.skipJndi=" + skipJndi);
propsString.add(
"-DPMFProperties="
+ buildDirectory
Expand Down
4 changes: 0 additions & 4 deletions tck/src/main/java/org/apache/jdo/tck/JDO_Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,6 @@ public abstract class JDO_Test extends TestCase {
protected static final boolean CLOSE_PMF_AFTER_EACH_TEST =
System.getProperty("jdo.tck.closePMFAfterEachTest", "false").equalsIgnoreCase("true");

/** Flag indicating whether to skip JNDI related tests. */
protected static final boolean SKIP_JNDI =
System.getProperty("jdo.tck.skipJndi", "false").equalsIgnoreCase("true");

/** The Properties object for the PersistenceManagerFactory. */
protected static Properties PMFPropertiesObject;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,12 @@ public static void main(String[] args) {

/** */
public void testInvalidGetPMF() {
if (SKIP_JNDI) {
logger.debug(
"Skipped test GetPMFByJNDILocation.testInvalidGetPMF because of jdo.tck.skipJndi.");
} else {
checkGetPMFWithInvalidProperties(ASSERTION_FAILED);
}
checkGetPMFWithInvalidProperties(ASSERTION_FAILED);
}

/** */
public void testValidGetPMF() {
if (SKIP_JNDI) {
logger.debug(
"Skipped test GetPMFByJNDILocation.testValidGetPMF because of jdo.tck.skipJndi.");
} else {
checkGetPMFWithValidProperties();
}
checkGetPMFWithValidProperties();
}

/** */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,12 @@ public static void main(String[] args) {

/** */
public void testInvalidGetPMF() {
if (SKIP_JNDI) {
logger.debug(
"Skipped test GetPMFByJNDILocationAndClassLoader.testInvalidGetPMF because of jdo.tck.skipJndi.");
} else {
checkGetPMFWithInvalidProperties(ASSERTION_FAILED);
}
checkGetPMFWithInvalidProperties(ASSERTION_FAILED);
}

/** */
public void testValidGetPMF() {
if (SKIP_JNDI) {
logger.debug(
"Skipped test GetPMFByJNDILocationAndClassLoader.testValidGetPMF because of jdo.tck.skipJndi.");
} else {
checkGetPMFWithValidProperties();
}
checkGetPMFWithValidProperties();
}

/** */
Expand Down

0 comments on commit 470883f

Please sign in to comment.