Index: modules/archive/src/test/java/tests/api/java/util/jar/JarEntryTest.java =================================================================== --- modules/archive/src/test/java/tests/api/java/util/jar/JarEntryTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/archive/src/test/java/tests/api/java/util/jar/JarEntryTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -49,11 +49,11 @@ */ public void test_ConstructorLjava_util_zip_ZipEntry() { // Test for method java.util.jar.JarEntry(java.util.zip.ZipEntry) - assertTrue("Jar file is null", jarFile != null); + assertNotNull("Jar file is null", jarFile); zipEntry = jarFile.getEntry(entryName); - assertTrue("Zip entry is null", zipEntry != null); + assertNotNull("Zip entry is null", zipEntry); jarEntry = new JarEntry(zipEntry); - assertTrue("Jar entry is null", jarEntry != null); + assertNotNull("Jar entry is null", jarEntry); assertTrue("Wrong entry constucted--wrong name", jarEntry.getName() .equals(entryName)); assertEquals("Wrong entry constucted--wrong size", @@ -79,8 +79,8 @@ try { jarEntry = attrJar.getJarEntry(attEntryName); - assertTrue("Should have Manifest attributes", jarEntry - .getAttributes() != null); + assertNotNull("Should have Manifest attributes", jarEntry + .getAttributes()); } catch (Exception e) { fail("Exception during 2nd test: " + e.toString()); } Index: modules/archive/src/test/java/tests/api/java/util/jar/JarFileTest.java =================================================================== --- modules/archive/src/test/java/tests/api/java/util/jar/JarFileTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/archive/src/test/java/tests/api/java/util/jar/JarFileTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -240,8 +240,8 @@ try { Support_Resources.copyFile(resources, null, jarName); JarFile jarFile = new JarFile(new File(resources, jarName)); - assertTrue("Error--Manifest not returned", - jarFile.getManifest() != null); + assertNotNull("Error--Manifest not returned", + jarFile.getManifest()); jarFile.close(); } catch (Exception e) { fail("Exception during 1st test: " + e.toString()); @@ -260,8 +260,8 @@ // jarName3 was created using the following test Support_Resources.copyFile(resources, null, jarName3); JarFile jarFile = new JarFile(new File(resources, jarName3)); - assertTrue("Should find manifest without verifying", jarFile - .getManifest() != null); + assertNotNull("Should find manifest without verifying", jarFile + .getManifest()); jarFile.close(); } catch (Exception e) { fail("Exception during 3rd test: " + e.toString()); @@ -292,8 +292,8 @@ jarOut.write(65); jarOut.close(); JarFile jar = new JarFile(file.getAbsolutePath(), false); - assertTrue("Should find manifest without verifying", jar - .getManifest() != null); + assertNotNull("Should find manifest without verifying", jar + .getManifest()); jar.close(); file.delete(); } catch (IOException e) { Index: modules/archive/src/test/java/tests/api/java/util/jar/JarInputStreamTest.java =================================================================== --- modules/archive/src/test/java/tests/api/java/util/jar/JarInputStreamTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/archive/src/test/java/tests/api/java/util/jar/JarInputStreamTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -54,8 +54,8 @@ .getInputStream(); boolean hasCorrectEntry = false; JarInputStream jis = new JarInputStream(is); - assertTrue("The jar input stream should have a manifest", jis - .getManifest() != null); + assertNotNull("The jar input stream should have a manifest", jis + .getManifest()); JarEntry je = jis.getNextJarEntry(); while (je != null) { if (je.getName().equals(entryName)) @@ -90,7 +90,7 @@ is = new URL(jarName).openConnection().getInputStream(); jis = new JarInputStream(is); m = jis.getManifest(); - assertTrue("The jar input stream should have a manifest", m != null); + assertNotNull("The jar input stream should have a manifest", m); } catch (Exception e) { fail("Exception during test: " + e.toString()); } Index: modules/archive/src/test/java/tests/api/java/util/zip/GZIPInputStreamTest.java =================================================================== --- modules/archive/src/test/java/tests/api/java/util/zip/GZIPInputStreamTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/archive/src/test/java/tests/api/java/util/zip/GZIPInputStreamTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -61,8 +61,8 @@ + "/GZIPInputStream/hyts_gInput.txt").toURL(); TestGZIPInputStream inGZIP = new TestGZIPInputStream(gInput .openConnection().getInputStream()); - assertTrue("the constructor for GZIPInputStream is null", - inGZIP != null); + assertNotNull("the constructor for GZIPInputStream is null", + inGZIP); assertEquals("the CRC value of the inputStream is not zero", 0, inGZIP .getChecksum().getValue()); inGZIP.close(); @@ -85,8 +85,8 @@ + "/GZIPInputStream/hyts_gInput.txt").toURL(); TestGZIPInputStream inGZIP = new TestGZIPInputStream(gInput .openConnection().getInputStream(), 200); - assertTrue("the constructor for GZIPInputStream is null", - inGZIP != null); + assertNotNull("the constructor for GZIPInputStream is null", + inGZIP); assertEquals("the CRC value of the inputStream is not zero", 0, inGZIP .getChecksum().getValue()); inGZIP.close(); Index: modules/archive/src/test/java/tests/api/java/util/zip/GZIPOutputStreamTest.java =================================================================== --- modules/archive/src/test/java/tests/api/java/util/zip/GZIPOutputStreamTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/archive/src/test/java/tests/api/java/util/zip/GZIPOutputStreamTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -46,8 +46,8 @@ try { FileOutputStream outFile = new FileOutputStream("GZIPOutCon.txt"); TestGZIPOutputStream outGZIP = new TestGZIPOutputStream(outFile); - assertTrue("the constructor for GZIPOutputStream is null", - outGZIP != null); + assertNotNull("the constructor for GZIPOutputStream is null", + outGZIP); assertEquals("the CRC value of the outputStream is not zero", 0, outGZIP .getChecksum().getValue()); outGZIP.close(); @@ -66,8 +66,8 @@ FileOutputStream outFile = new FileOutputStream("GZIPOutCon.txt"); TestGZIPOutputStream outGZIP = new TestGZIPOutputStream(outFile, 100); - assertTrue("the constructor for GZIPOutputStream is null", - outGZIP != null); + assertNotNull("the constructor for GZIPOutputStream is null", + outGZIP); assertEquals("the CRC value of the outputStream is not zero", 0, outGZIP .getChecksum().getValue()); outGZIP.close(); Index: modules/archive/src/test/java/tests/api/java/util/zip/InflaterTest.java =================================================================== --- modules/archive/src/test/java/tests/api/java/util/zip/InflaterTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/archive/src/test/java/tests/api/java/util/zip/InflaterTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -367,8 +367,8 @@ // test method of java.util.zip.inflater.Inflater() try { Inflater inflate = new Inflater(); - assertTrue("failed to create the instance of inflater", - inflate != null); + assertNotNull("failed to create the instance of inflater", + inflate); } catch (Exception e) { @@ -385,7 +385,7 @@ // doesn't or vice versa. byte byteArray[] = { 1, 3, 4, 7, 8, 'e', 'r', 't', 'y', '5' }; Inflater inflate = new Inflater(true); - assertTrue("failed to create the instance of inflater", inflate != null); + assertNotNull("failed to create the instance of inflater", inflate); byte outPutInf[] = new byte[500]; int r = 0; try { Index: modules/archive/src/test/java/tests/api/java/util/zip/ZipEntryTest.java =================================================================== --- modules/archive/src/test/java/tests/api/java/util/zip/ZipEntryTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/archive/src/test/java/tests/api/java/util/zip/ZipEntryTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -47,7 +47,7 @@ public void test_ConstructorLjava_lang_String() { // Test for method java.util.zip.ZipEntry(java.lang.String) zentry = zfile.getEntry("File3.txt"); - assertTrue("Failed to create ZipEntry", zentry != null); + assertNotNull("Failed to create ZipEntry", zentry); try { zentry = zfile.getEntry(null); fail("NullPointerException not thrown"); Index: modules/archive/src/test/java/tests/api/java/util/zip/ZipFileTest.java =================================================================== --- modules/archive/src/test/java/tests/api/java/util/zip/ZipFileTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/archive/src/test/java/tests/api/java/util/zip/ZipFileTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -100,12 +100,12 @@ out.close(); /* * ZipFile zip = new ZipFile(file); ZipEntry entry1 = - * zip.getEntry("File1.txt"); assertTrue("Did not find entry", - * entry1 != null); entry1 = null; zip = null; + * zip.getEntry("File1.txt"); assertNotNull("Did not find entry", + * entry1); entry1 = null; zip = null; */ - assertTrue("Did not find entry", - test_finalize1(test_finalize2(file)) != null); + assertNotNull("Did not find entry", + test_finalize1(test_finalize2(file))); System.gc(); System.gc(); System.runFinalization(); @@ -166,34 +166,34 @@ // Test for method java.util.zip.ZipEntry // java.util.zip.ZipFile.getEntry(java.lang.String) java.util.zip.ZipEntry zentry = zfile.getEntry("File1.txt"); - assertTrue("Could not obtain ZipEntry", zentry != null); + assertNotNull("Could not obtain ZipEntry", zentry); zentry = zfile.getEntry("testdir1/File1.txt"); - assertTrue("Could not obtain ZipEntry: testdir1/File1.txt", - zentry != null); + assertNotNull("Could not obtain ZipEntry: testdir1/File1.txt", + zentry); try { int r; InputStream in; zentry = zfile.getEntry("testdir1/"); - assertTrue("Could not obtain ZipEntry: testdir1/", zentry != null); + assertNotNull("Could not obtain ZipEntry: testdir1/", zentry); in = zfile.getInputStream(zentry); - assertTrue("testdir1/ should not have null input stream", - in != null); + assertNotNull("testdir1/ should not have null input stream", + in); r = in.read(); in.close(); assertEquals("testdir1/ should not contain data", -1, r); zentry = zfile.getEntry("testdir1"); - assertTrue("Could not obtain ZipEntry: testdir1", zentry != null); + assertNotNull("Could not obtain ZipEntry: testdir1", zentry); in = zfile.getInputStream(zentry); - assertTrue("testdir1 should not have null input stream", in != null); + assertNotNull("testdir1 should not have null input stream", in); r = in.read(); in.close(); assertEquals("testdir1 should not contain data", -1, r); zentry = zfile.getEntry("testdir1/testdir1"); - assertTrue("Could not obtain ZipEntry: testdir1/testdir1", - zentry != null); + assertNotNull("Could not obtain ZipEntry: testdir1/testdir1", + zentry); in = zfile.getInputStream(zentry); byte[] buf = new byte[256]; r = in.read(buf); Index: modules/archive/src/test/java/tests/api/java/util/zip/ZipInputStreamTest.java =================================================================== --- modules/archive/src/test/java/tests/api/java/util/zip/ZipInputStreamTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/archive/src/test/java/tests/api/java/util/zip/ZipInputStreamTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -76,7 +76,7 @@ // Test for method java.util.zip.ZipEntry // java.util.zip.ZipInputStream.getNextEntry() try { - assertTrue("getNextEntry failed", zis.getNextEntry() != null); + assertNotNull("getNextEntry failed", zis.getNextEntry()); } catch (java.io.IOException e) { fail("Exception during getNextEntry test"); } Index: modules/jndi/src/test/java/tests/api/javax/naming/directory/TestSearchControls.java =================================================================== --- modules/jndi/src/test/java/tests/api/javax/naming/directory/TestSearchControls.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/jndi/src/test/java/tests/api/javax/naming/directory/TestSearchControls.java 2006-04-16 17:56:27.000000000 +0100 @@ -140,7 +140,7 @@ SearchControls ctrl; ctrl = new SearchControls(); - assertTrue(ctrl.toString() != null); + assertNotNull(ctrl.toString()); } } Index: modules/luni/src/test/java/tests/api/java/io/SerializationStressTest2.java =================================================================== --- modules/luni/src/test/java/tests/api/java/io/SerializationStressTest2.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/io/SerializationStressTest2.java 2006-04-16 17:56:27.000000000 +0100 @@ -1297,8 +1297,8 @@ System.out.println("Obj = " + objToSave); objLoaded = dumpAndReload(objToSave); // Has to have worked - assertTrue(MSG_TEST_FAILED + objToSave, - ((NestedPutField) objLoaded).field1 != null); + assertNotNull(MSG_TEST_FAILED + objToSave, + ((NestedPutField) objLoaded).field1); } catch (IOException e) { fail("IOException serializing " + objToSave + " : " Index: modules/luni/src/test/java/tests/api/java/lang/ClassLoaderTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/ClassLoaderTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/ClassLoaderTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -25,11 +25,11 @@ // java.lang.ClassLoader.getResource(java.lang.String) java.net.URL u = ClassLoader.getSystemClassLoader().getResource( "hyts_Foo.c"); - assertTrue("Unable to find resource", u != null); + assertNotNull("Unable to find resource", u); java.io.InputStream is = null; try { is = u.openStream(); - assertTrue("Resource returned is invalid", is != null); + assertNotNull("Resource returned is invalid", is); is.close(); } catch (java.io.IOException e) { fail("IOException getting stream for resource : " + e.getMessage()); @@ -45,9 +45,9 @@ // Need better test... java.io.InputStream is = null; - assertTrue("Failed to find resource: hyts_Foo.c", + assertNotNull("Failed to find resource: hyts_Foo.c", (is = ClassLoader.getSystemClassLoader().getResourceAsStream( - "hyts_Foo.c")) != null); + "hyts_Foo.c"))); try { is.close(); } catch (java.io.IOException e) { @@ -63,7 +63,7 @@ // java.lang.ClassLoader.getSystemClassLoader() ClassLoader cl = ClassLoader.getSystemClassLoader(); java.io.InputStream is = cl.getResourceAsStream("hyts_Foo.c"); - assertTrue("Failed to find resource from system classpath", is != null); + assertNotNull("Failed to find resource from system classpath", is); try { is.close(); } catch (java.io.IOException e) { @@ -78,8 +78,8 @@ // Test for method java.net.URL // java.lang.ClassLoader.getSystemResource(java.lang.String) // Need better test... - assertTrue("Failed to find resource: hyts_Foo.c", ClassLoader - .getSystemResource("hyts_Foo.c") != null); + assertNotNull("Failed to find resource: hyts_Foo.c", ClassLoader + .getSystemResource("hyts_Foo.c")); } /** Index: modules/luni/src/test/java/tests/api/java/lang/ClassTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/ClassTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/ClassTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -739,9 +739,9 @@ java.net.URL res = Object.class.getResource("Object.class"); assertNull("Object.class should not be found", res); - assertTrue("Security: the file " + name + assertNotNull("Security: the file " + name + " can not be found in this directory", ClassTest.class - .getResource(name) != null); + .getResource(name)); } finally { System.setSecurityManager(null); } @@ -762,16 +762,16 @@ fail( "Should be able to find the class tests.api.java.lang.ClassTest"); } - assertTrue("the file " + name + " can not be found in this directory", - clazz.getResourceAsStream(name) != null); + assertNotNull("the file " + name + " can not be found in this directory", + clazz.getResourceAsStream(name)); System.setSecurityManager(new SecurityManager()); try { InputStream res = Object.class.getResourceAsStream("Object.class"); assertNull("Object.class should not be found", res); InputStream is = ClassTest.class.getResourceAsStream(name); - assertTrue("Security: the file " + name - + " can not be found in this directory", is != null); + assertNotNull("Security: the file " + name + + " can not be found in this directory", is); } finally { System.setSecurityManager(null); } @@ -780,9 +780,9 @@ assertNull("the file " + name + " should not be found in this directory", clazz .getResourceAsStream(name)); - assertTrue("the file " + name + assertNotNull("the file " + name + " can not be found in the root directory", clazz - .getResourceAsStream("/" + name) != null); + .getResourceAsStream("/" + name)); try { clazz = Class.forName("java.lang.Object"); @@ -790,9 +790,9 @@ fail("Should be able to find the class java.lang.Object"); } InputStream str = clazz.getResourceAsStream("Class.class"); - assertTrue( + assertNotNull( "java.lang.Object couldn't find its class with getResource...", - str != null); + str); try { assertTrue("Cannot read single byte", str.read() != -1); assertEquals("Cannot read multiple bytes", 5, str.read(new byte[5])); @@ -803,7 +803,7 @@ InputStream str2 = getClass().getResourceAsStream( Support_Resources.RESOURCE_PACKAGE + "hyts_compressD.txt"); - assertTrue("Can't find resource", str2 != null); + assertNotNull("Can't find resource", str2); try { assertTrue("Cannot read single byte", str2.read() != -1); assertEquals("Cannot read multiple bytes", @@ -980,8 +980,8 @@ } catch (ClassNotFoundException e) { fail("Should be able to find the class java.lang.Object"); } - assertTrue("new object instance was null", - clazz.newInstance() != null); + assertNotNull("new object instance was null", + clazz.newInstance()); } catch (Exception e) { fail("Unexpected exception " + e + " in newInstance()"); } Index: modules/luni/src/test/java/tests/api/java/lang/ObjectTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/ObjectTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/ObjectTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -35,7 +35,7 @@ */ public void test_Constructor() { // Test for method java.lang.Object() - assertTrue("Constructor failed !!!", new Object() != null); + assertNotNull("Constructor failed !!!", new Object()); } /** @@ -232,7 +232,7 @@ */ public void test_toString() { // Test for method java.lang.String java.lang.Object.toString() - assertTrue("Object toString returned null.", obj1.toString() != null); + assertNotNull("Object toString returned null.", obj1.toString()); } /** Index: modules/luni/src/test/java/tests/api/java/lang/SystemTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/SystemTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/SystemTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -140,7 +140,7 @@ "os.version", "file.separator", "path.separator", "line.separator", "user.name", "user.home", "user.dir", }; for (int i = 0; i < props.length; i++) { - assertTrue(props[i], System.getProperty(props[i]) != null); + assertNotNull(props[i], System.getProperty(props[i])); } } Index: modules/luni/src/test/java/tests/api/java/lang/ThreadTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/ThreadTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/ThreadTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -405,7 +405,7 @@ } catch (InterruptedException e) { } assertNull("group should be null", st.getThreadGroup()); - assertTrue("toString() should not be null", st.toString() != null); + assertNotNull("toString() should not be null", st.toString()); tg.destroy(); final Object lock = new Object(); Index: modules/luni/src/test/java/tests/api/java/lang/UnsatisfiedLinkErrorTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/UnsatisfiedLinkErrorTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/UnsatisfiedLinkErrorTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -41,7 +41,7 @@ try { Runtime.getRuntime().loadLibrary("Hello World89797"); } catch (UnsatisfiedLinkError e) { - assertTrue("Does not set message", e.getMessage() != null); + assertNotNull("Does not set message", e.getMessage()); exception = true; } assertTrue("Does not throw UnsatisfiedLinkError", exception); Index: modules/luni/src/test/java/tests/api/java/lang/ref/ReferenceQueueTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/ref/ReferenceQueueTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/ref/ReferenceQueueTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -95,7 +95,7 @@ Thread ct = new Thread(new ChildThread()); ct.start(); Reference ret = rq.remove(0L); - assertTrue("Delayed remove failed.", ret != null); + assertNotNull("Delayed remove failed.", ret); } catch (InterruptedException e) { fail("InterruptedExeException during test : " + e.getMessage()); } Index: modules/luni/src/test/java/tests/api/java/lang/ref/ReferenceTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/ref/ReferenceTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/ref/ReferenceTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -113,7 +113,7 @@ System.runFinalization(); ref = rq.remove(); assertTrue("Unexpected ref1", ref == wr); - assertTrue("Object not garbage collected1.", ref != null); + assertNotNull("Object not garbage collected1.", ref); assertNull("Object could not be reclaimed1.", wr.get()); } catch (InterruptedException e) { fail("InterruptedException : " + e.getMessage()); @@ -127,7 +127,7 @@ System.runFinalization(); ref = rq.poll(); assertTrue("Unexpected ref2", ref == wr); - assertTrue("Object not garbage collected.", ref != null); + assertNotNull("Object not garbage collected.", ref); assertNull("Object could not be reclaimed.", ref.get()); // Reference wr so it does not get collected assertNull("Object could not be reclaimed.", wr.get()); Index: modules/luni/src/test/java/tests/api/java/net/DatagramSocketTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/net/DatagramSocketTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/net/DatagramSocketTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -1073,8 +1073,8 @@ // all is ok theSocket = new DatagramSocket(null); theSocket.bind(null); - assertTrue("Bind with null did not work", theSocket - .getLocalSocketAddress() != null); + assertNotNull("Bind with null did not work", theSocket + .getLocalSocketAddress()); theSocket.close(); // now check the error conditions Index: modules/luni/src/test/java/tests/api/java/net/MulticastSocketTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/net/MulticastSocketTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/net/MulticastSocketTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -212,10 +212,10 @@ // set mss = new MulticastSocket(groupPort); NetworkInterface theInterface = mss.getNetworkInterface(); - assertTrue( + assertNotNull( "network interface returned wrong network interface when not set:" + theInterface, - theInterface.getInetAddresses() != null); + theInterface.getInetAddresses()); InetAddress firstAddress = (InetAddress) theInterface .getInetAddresses().nextElement(); // validate we the first address in the network interface is the Index: modules/luni/src/test/java/tests/api/java/net/NetworkInterfaceTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/net/NetworkInterfaceTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/net/NetworkInterfaceTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -39,8 +39,8 @@ */ public void test_getName() { if (atLeastOneInterface) { - assertTrue("validate that non null name is returned", - networkInterface1.getName() != null); + assertNotNull("validate that non null name is returned", + networkInterface1.getName()); assertFalse("validate that non-zero length name is generated", networkInterface1.getName().equals("")); } @@ -214,11 +214,11 @@ // This is to be compatible for (int i = 0; i < notOkAddresses.size(); i++) { try { - assertTrue( + assertNotNull( "validate we cannot get the NetworkInterface with an address for which we have no privs", NetworkInterface .getByInetAddress((InetAddress) notOkAddresses - .get(i)) != null); + .get(i))); } catch (Exception e) { fail("get NetworkInterface for address with no perm - exception"); } @@ -228,11 +228,11 @@ // addresses try { for (int i = 0; i < okAddresses.size(); i++) { - assertTrue( + assertNotNull( "validate we cannot get the NetworkInterface with an address fro which we have no privs", NetworkInterface .getByInetAddress((InetAddress) okAddresses - .get(i)) != null); + .get(i))); } } catch (Exception e) { fail("get NetworkInterface for address with perm - exception"); @@ -247,8 +247,8 @@ */ public void test_getDisplayName() { if (atLeastOneInterface) { - assertTrue("validate that non null display name is returned", - networkInterface1.getDisplayName() != null); + assertNotNull("validate that non null display name is returned", + networkInterface1.getDisplayName()); assertFalse( "validate that non-zero lengtj display name is generated", networkInterface1.getDisplayName().equals("")); @@ -446,8 +446,8 @@ */ public void test_toString() { if (atLeastOneInterface) { - assertTrue("validate that non null string is generated", - networkInterface1.toString() != null); + assertNotNull("validate that non null string is generated", + networkInterface1.toString()); assertFalse("validate that non-zero length string is generated", networkInterface1.toString().equals("")); } Index: modules/luni/src/test/java/tests/api/java/net/SocketTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/net/SocketTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/net/SocketTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -348,7 +348,7 @@ s = new Socket(InetAddress.getLocalHost(), sport, null, portNumber); (t = new SServer()).start(); java.io.InputStream is = s.getInputStream(); - assertTrue("Failed to get stream", is != null); + assertNotNull("Failed to get stream", is); s.setSoTimeout(6000); is.read(); s.close(); @@ -500,7 +500,7 @@ int portNumber = Support_PortManager.getNextPort(); s = new Socket(InetAddress.getLocalHost(), sport, null, portNumber); java.io.OutputStream os = s.getOutputStream(); - assertTrue("Failed to get stream", os != null); + assertNotNull("Failed to get stream", os); tearDown(); } catch (Exception e) { fail("Exception during getOutputStream test" + e.toString()); @@ -1208,8 +1208,8 @@ // all is ok theSocket = new Socket(); theSocket.bind(null); - assertTrue("Bind with null did not work", theSocket - .getLocalSocketAddress() != null); + assertNotNull("Bind with null did not work", theSocket + .getLocalSocketAddress()); theSocket.close(); // now check the error conditions Index: modules/luni/src/test/java/tests/api/java/net/URLClassLoaderTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/net/URLClassLoaderTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/net/URLClassLoaderTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -162,10 +162,10 @@ try { res = cl.getClassLoader().getResource("XX.class"); - assertTrue("Failed to load class", cl != null); - assertTrue( + assertNotNull("Failed to load class", cl); + assertNotNull( "Loaded class unable to access resource from same codeSource", - res != null); + res); cl = null; } catch (Error e) { fail("Test error : " + e.getMessage()); @@ -178,7 +178,7 @@ } catch (Exception e) { fail("Exception using explicit jar : " + e.getMessage()); } - assertTrue("Failed to load class from explicit jar URL", cl != null); + assertNotNull("Failed to load class from explicit jar URL", cl); } /** @@ -313,8 +313,8 @@ .copyFile(resources, "JarIndex", "hyts_22-new.jar"); urls[0] = new URL("file:/" + resPath + "/JarIndex/hyts_22-new.jar"); ucl = URLClassLoader.newInstance(urls, null); - assertTrue("Cannot find resource", - ucl.findResource("cpack/") != null); + assertNotNull("Cannot find resource", + ucl.findResource("cpack/")); Support_Resources.copyFile(resources, "JarIndex", "hyts_11.jar"); urls[0] = new URL("file:/" + resPath + "/JarIndex/hyts_31.jar"); ucl = URLClassLoader.newInstance(urls, null); Index: modules/luni/src/test/java/tests/api/java/net/URLDecoderTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/net/URLDecoderTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/net/URLDecoderTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -28,7 +28,7 @@ public void test_Constructor() { try { URLDecoder ud = new URLDecoder(); - assertTrue("Constructor failed.", ud != null); + assertNotNull("Constructor failed.", ud); } catch (Exception e) { fail("Constructor failed : " + e.getMessage()); } Index: modules/luni/src/test/java/tests/api/java/net/URLTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/net/URLTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/net/URLTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -885,7 +885,7 @@ try { u = new URL("systemresource:/FILE4/+/types.properties"); URLConnection uConn = u.openConnection(); - assertTrue("u.openConnection() returns null", uConn != null); + assertNotNull("u.openConnection() returns null", uConn); } catch (Exception e) { } } Index: modules/luni/src/test/java/tests/api/java/util/LinkedListTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/LinkedListTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/LinkedListTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -350,7 +350,7 @@ fail("Failed to throw expected exception when index out of range"); ll.add(20, null); ll.remove(20); - assertTrue("Should have removed null", ll.get(20) != null); + assertNotNull("Should have removed null", ll.get(20)); } /** Index: modules/luni/src/test/java/tests/api/java/util/PropertiesTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/PropertiesTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/PropertiesTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -51,8 +51,8 @@ if (System.getProperty("java.vendor") != null) { try { Properties p = new Properties(System.getProperties()); - assertTrue("failed to construct correct properties", p - .getProperty("java.vendor") != null); + assertNotNull("failed to construct correct properties", p + .getProperty("java.vendor")); } catch (Exception e) { fail("exception occured while creating construcotr" + e); } Index: modules/luni/src/test/java/tests/api/java/util/SimpleTimeZoneTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/SimpleTimeZoneTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/SimpleTimeZoneTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -423,7 +423,7 @@ public void test_toString() { // Test for method java.lang.String java.util.SimpleTimeZone.toString() String string = TimeZone.getTimeZone("EST").toString(); - assertTrue("toString() returned null", string != null); + assertNotNull("toString() returned null", string); assertTrue("toString() is empty", string.length() != 0); } Index: modules/luni/src/test/java/tests/api/java/util/VectorTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/VectorTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/VectorTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -629,7 +629,7 @@ tVector.remove(19); assertNull("Didn't move null element over", tVector.get(19)); tVector.remove(19); - assertTrue("Didn't remove null element", tVector.get(19) != null); + assertNotNull("Didn't remove null element", tVector.get(19)); assertEquals("Failed to decrement size after removing null", 98, tVector .size()); } @@ -721,8 +721,8 @@ assertEquals("Failed to remove element", -1, v.indexOf("Test 50", 0)); tVector.insertElementAt(null, 60); tVector.removeElementAt(60); - assertTrue("Element at 60 should not be null after removal", tVector - .elementAt(60) != null); + assertNotNull("Element at 60 should not be null after removal", tVector + .elementAt(60)); } /** Index: modules/security/src/test/java/common/java/security/cert/CollectionCertStoreParametersTest.java =================================================================== --- modules/security/src/test/java/common/java/security/cert/CollectionCertStoreParametersTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/security/src/test/java/common/java/security/cert/CollectionCertStoreParametersTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -198,7 +198,7 @@ CollectionCertStoreParameters cp = new CollectionCertStoreParameters(); String s = cp.toString(); - assertTrue(s != null); + assertNotNull(s); } /** @@ -220,7 +220,7 @@ */ public final void testGetCollection01() { CollectionCertStoreParameters cp = new CollectionCertStoreParameters(); - assertTrue(cp.getCollection() != null); + assertNotNull(cp.getCollection()); } /** @@ -231,7 +231,7 @@ Vector certificates = new Vector(); CollectionCertStoreParameters cp = new CollectionCertStoreParameters(certificates); - assertTrue(cp.getCollection() != null); + assertNotNull(cp.getCollection()); } } Index: modules/security/src/test/java/common/java/security/cert/X509CRLSelectorTest.java =================================================================== --- modules/security/src/test/java/common/java/security/cert/X509CRLSelectorTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/security/src/test/java/common/java/security/cert/X509CRLSelectorTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -576,8 +576,7 @@ selector.setMaxCRLNumber(maxCRL); selector.setDateAndTime(date); - assertTrue("The result should not be null.", - selector.toString() != null); + assertNotNull("The result should not be null.", selector.toString()); } public static Test suite() { Index: modules/security/src/test/java/common/java/security/cert/X509CertSelectorTest.java =================================================================== --- modules/security/src/test/java/common/java/security/cert/X509CertSelectorTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/security/src/test/java/common/java/security/cert/X509CertSelectorTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -2860,8 +2860,8 @@ selector.setMatchAllSubjectAltNames(true); selector.setPolicy(new HashSet(Arrays.asList(policies))); - assertTrue("The result should not be null.", - selector.toString() != null); + assertNotNull("The result should not be null.", + selector.toString()); } /** Index: modules/security/src/test/java/common/tests/api/java/security/AlgorithmParametersTest.java =================================================================== --- modules/security/src/test/java/common/tests/api/java/security/AlgorithmParametersTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/security/src/test/java/common/tests/api/java/security/AlgorithmParametersTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -124,7 +124,7 @@ DSAParameterSpec spec = (DSAParameterSpec) params .getParameterSpec(dsaps.getClass()); - assertTrue("param spec is null", spec != null); + assertNotNull("param spec is null", spec); assertTrue("p is wrong ", spec.getP().equals(BigInteger.ONE)); assertTrue("q is wrong ", spec.getQ().equals(BigInteger.ONE)); assertTrue("g is wrong ", spec.getG().equals(BigInteger.ONE)); @@ -138,7 +138,7 @@ // java.security.AlgorithmParameters.getProvider() try { Provider p = AlgorithmParameters.getInstance("DSA").getProvider(); - assertTrue("provider is null", p != null); + assertNotNull("provider is null", p); } catch (NoSuchAlgorithmException e) { fail("getInstance did not find algorithm"); } @@ -154,7 +154,7 @@ params.init(new DSAParameterSpec(BigInteger.ONE, BigInteger.ONE, BigInteger.ONE)); byte[] encoded = params.getEncoded(); - assertTrue("encoded spec is null", encoded != null); + assertNotNull("encoded spec is null", encoded); AlgorithmParameters params2 = AlgorithmParameters .getInstance("DSA"); params2.init(encoded); @@ -181,7 +181,7 @@ params.init(new DSAParameterSpec(BigInteger.ONE, BigInteger.ONE, BigInteger.ONE)); byte[] encoded = params.getEncoded(); - assertTrue("encoded spec is null", encoded != null); + assertNotNull("encoded spec is null", encoded); AlgorithmParameters params2 = AlgorithmParameters .getInstance("DSA"); params2.init(encoded, "ASN.1"); @@ -201,7 +201,7 @@ params.init(new DSAParameterSpec(BigInteger.ONE, BigInteger.ONE, BigInteger.ONE)); byte[] encoded = params.getEncoded(); - assertTrue("encoded spec is null", encoded != null); + assertNotNull("encoded spec is null", encoded); params.init(encoded, "DOUGLASMAWSON"); fail("unsupported format should have raised IOException"); } catch (NoSuchAlgorithmException e) { Index: modules/sql/src/test/java/tests/api/java/sql/DateTest.java =================================================================== --- modules/sql/src/test/java/tests/api/java/sql/DateTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/sql/src/test/java/tests/api/java/sql/DateTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -118,7 +118,7 @@ try { Date theDate = new Date(init1[i], init2[i], init3[i]); - assertTrue(theDate != null); + assertNotNull(theDate); if (theExceptions[i] != null) { fail(i + "Exception expected - none thrown."); } // end if @@ -151,7 +151,7 @@ try { Date theDate = new Date(init1[i]); - assertTrue(theDate != null); + assertNotNull(theDate); if (theExceptions[i] != null) { fail(i + "Exception expected - none thrown."); } // end if Index: modules/sql/src/test/java/tests/api/java/sql/DriverManagerTest.java =================================================================== --- modules/sql/src/test/java/tests/api/java/sql/DriverManagerTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/sql/src/test/java/tests/api/java/sql/DriverManagerTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -194,7 +194,7 @@ // validConnection - no user & password required try { theConnection = DriverManager.getConnection(validConnectionURL); - assertTrue(theConnection != null); + assertNotNull(theConnection); } catch (SQLException e) { fail(); } // end try @@ -249,7 +249,7 @@ // validConnection - user & password required try { theConnection = DriverManager.getConnection(validURL1, validProps); - assertTrue(theConnection != null); + assertNotNull(theConnection); } catch (SQLException e) { fail(); } // end try @@ -299,7 +299,7 @@ try { theConnection = DriverManager.getConnection(validURL1, validuser1, validpassword1); - assertTrue(theConnection != null); + assertNotNull(theConnection); } catch (SQLException e) { fail(); } // end try Index: modules/sql/src/test/java/tests/api/java/sql/DriverPropertyInfoTest.java =================================================================== --- modules/sql/src/test/java/tests/api/java/sql/DriverPropertyInfoTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/sql/src/test/java/tests/api/java/sql/DriverPropertyInfoTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -41,7 +41,7 @@ DriverPropertyInfo aDriverPropertyInfo = new DriverPropertyInfo( validName, validValue); - assertTrue(aDriverPropertyInfo != null); + assertNotNull(aDriverPropertyInfo); aDriverPropertyInfo = new DriverPropertyInfo(null, null); Index: modules/sql/src/test/java/tests/api/java/sql/SQLPermissionTest.java =================================================================== --- modules/sql/src/test/java/tests/api/java/sql/SQLPermissionTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/sql/src/test/java/tests/api/java/sql/SQLPermissionTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -39,7 +39,7 @@ SQLPermission thePermission = new SQLPermission(validName, validActions); - assertTrue(thePermission != null); + assertNotNull(thePermission); assertTrue(thePermission.getName().equals(validName)); // System.out.println("The actions: " + thePermission.getActions() + "." // ); @@ -54,7 +54,7 @@ SQLPermission thePermission = new SQLPermission(validName); - assertTrue(thePermission != null); + assertNotNull(thePermission); assertTrue(thePermission.getName().equals(validName)); // Set an invalid name ... @@ -62,7 +62,7 @@ thePermission = new SQLPermission(invalidName); - assertTrue(thePermission != null); + assertNotNull(thePermission); assertTrue(thePermission.getName().equals(invalidName)); assertTrue(thePermission.getActions().equals("")); } // end method testSQLPermissionString Index: modules/sql/src/test/java/tests/api/java/sql/TimeTest.java =================================================================== --- modules/sql/src/test/java/tests/api/java/sql/TimeTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/sql/src/test/java/tests/api/java/sql/TimeTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -74,14 +74,14 @@ Time theTime = new Time(10, 45, 20); // The date should have been created - assertTrue(theTime != null); + assertNotNull(theTime); } // end method testTimeintintint() public void testTime() { Time theTime = new Time(TIME_TEST1); // The date should have been created - assertTrue(theTime != null); + assertNotNull(theTime); } // end method testTime() public void testToString() { Index: modules/sql/src/test/java/tests/api/java/sql/TimestampTest.java =================================================================== --- modules/sql/src/test/java/tests/api/java/sql/TimestampTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/sql/src/test/java/tests/api/java/sql/TimestampTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -109,7 +109,7 @@ Timestamp theTimestamp = new Timestamp(TIME_TEST1); // The Timestamp should have been created - assertTrue(theTimestamp != null); + assertNotNull(theTimestamp); } // end method testTimestamplong /* @@ -153,7 +153,7 @@ Timestamp theTimestamp = new Timestamp(initParms[i][0], initParms[i][1], initParms[i][2], initParms[i][3], initParms[i][4], initParms[i][5], initParms[i][6]); - assertTrue("Timestamp not generated: ", theTimestamp != null); + assertNotNull("Timestamp not generated: ", theTimestamp); if (theExceptions[i] != null) fail(i + ": Did not get exception"); } catch (Exception e) { Index: modules/text/src/test/java/tests/api/java/text/MessageFormatTest.java =================================================================== --- modules/text/src/test/java/tests/api/java/text/MessageFormatTest.java.orig 2006-04-16 17:56:04.000000000 +0100 +++ modules/text/src/test/java/tests/api/java/text/MessageFormatTest.java 2006-04-16 17:56:27.000000000 +0100 @@ -89,7 +89,7 @@ assertTrue("Not a MessageFormat", format.getClass() == MessageFormat.class); Format[] formats = format.getFormats(); - assertTrue("null formats", formats != null); + assertNotNull("null formats", formats); assertTrue("Wrong format count: " + formats.length, formats.length >= 5); assertTrue("Wrong time format", formats[0].equals(DateFormat .getTimeInstance()));