8159879: Some typo and minor test bugs in ava/lang/module/ModuleReferenceTest.java and ConfigurationTest.java
authormli
Mon, 20 Jun 2016 18:30:57 -0700
changeset 39124 2f46f5082cd7
parent 39123 8c516d65ec4b
child 39126 1d9492ef71e9
8159879: Some typo and minor test bugs in ava/lang/module/ModuleReferenceTest.java and ConfigurationTest.java Reviewed-by: alanb
jdk/test/java/lang/module/ConfigurationTest.java
jdk/test/java/lang/module/ModuleReferenceTest.java
--- a/jdk/test/java/lang/module/ConfigurationTest.java	Mon Jun 20 17:06:27 2016 -0700
+++ b/jdk/test/java/lang/module/ConfigurationTest.java	Mon Jun 20 18:30:57 2016 -0700
@@ -157,7 +157,7 @@
      *
      * The test consists of three configurations:
      * - Configuration cf1: m1, m2 requires public m1
-     * - Configuration cf2: m3 requires m1
+     * - Configuration cf2: m3 requires m2
      */
     public void testRequiresPublic2() {
 
@@ -219,7 +219,7 @@
      *
      * The test consists of three configurations:
      * - Configuration cf1: m1
-     * - Configuration cf2: m2 requires public m3, m3 requires m2
+     * - Configuration cf2: m2 requires public m1, m3 requires m2
      */
     public void testRequiresPublic3() {
 
@@ -283,7 +283,7 @@
      * The test consists of three configurations:
      * - Configuration cf1: m1
      * - Configuration cf2: m2 requires public m1
-     * - Configuraiton cf3: m3 requires m3
+     * - Configuraiton cf3: m3 requires m2
      */
     public void testRequiresPublic4() {
 
@@ -657,8 +657,8 @@
      * Basic test of binding services with configurations.
      *
      * Configuration cf1: p@1.0 provides p.S
+     * Test configuration cf2: m1 uses p.S, p@2.0 provides p.S
      * Test configuration cf2: m1 uses p.S
-     * Test configuration cf2: m1 uses p.S, p@2.0 uses p.S
      */
     public void testServiceBindingWithConfigurations3() {
 
@@ -896,7 +896,7 @@
 
         Configuration cf2 = resolveRequires(cf1, finder, "m1");
         assertTrue(cf2.modules().size() == 1);
-        assertTrue(cf1.findModule("m1").isPresent());
+        assertTrue(cf2.findModule("m1").isPresent());
     }
 
 
@@ -1305,7 +1305,7 @@
 
 
     /**
-     * Test "provides p.S" where p is not local
+     * Test "provides p.S with q.T" where q.T is not local
      */
     @Test(expectedExceptions = { ResolutionException.class })
     public void testProviderPackageNotLocal() {
--- a/jdk/test/java/lang/module/ModuleReferenceTest.java	Mon Jun 20 17:06:27 2016 -0700
+++ b/jdk/test/java/lang/module/ModuleReferenceTest.java	Mon Jun 20 18:30:57 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -110,7 +110,7 @@
         ModuleReference mref3 = new ModuleReference(descriptor1, null, supplier);
 
         assertTrue(mref1.equals(mref1));
-        assertTrue(mref1.equals(mref1));
+        assertTrue(mref1.equals(mref2));
         assertTrue(mref2.equals(mref1));
         assertTrue(mref1.hashCode() == mref2.hashCode());