harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r463610 - in /incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi: provider/dns/ tests/javax/naming/ tests/javax/naming/directory/ tests/javax/naming/ldap/ tests/javax/naming/spi/
Date Fri, 13 Oct 2006 09:54:30 GMT
Author: hindessm
Date: Fri Oct 13 02:54:28 2006
New Revision: 463610

URL: http://svn.apache.org/viewvc?view=rev&rev=463610
Log:
Converting things like:

  assertTrue(blah == [true|false|null]) to assert[True|False|Null]
  assertEquals(blah, [true,false,null]) to assert[True|False|Null]
  assertEquals([true,false,null], blah) to assert[True|False|Null]

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/provider/dns/DNSContextTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/provider/dns/DNSPseudoURLTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/BindingTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/CompositeNameTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/CompoundNameTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/NameClassPairTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/directory/SearchControlsTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/directory/SearchResultTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/ControlFactoryTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/UnsolicitedNotificationEventTest.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/NamingManagerExploreTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/provider/dns/DNSContextTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/provider/dns/DNSContextTest.java?view=diff&rev=463610&r1=463609&r2=463610
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/provider/dns/DNSContextTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/provider/dns/DNSContextTest.java
Fri Oct 13 02:54:28 2006
@@ -139,12 +139,12 @@
         env.put(DNSContext.THREADS_MAX, "17");
         env.put(Context.PROVIDER_URL, "dns://superdns.com/intel.com");
         context = (DNSContext)new DNSContextFactory().getInitialContext(env);
-        assertEquals(true, TestMgr.getBoolField(context, "authoritative"));
+        assertTrue(TestMgr.getBoolField(context, "authoritative"));
         assertEquals(ProviderConstants.A_TYPE,
                 TestMgr.getIntField(context, "lookupAttrType"));
         assertEquals(ProviderConstants.IN_CLASS,
                 TestMgr.getIntField(context, "lookupAttrClass"));
-        assertEquals(true, TestMgr.getBoolField(context, "recursion"));
+        assertTrue(TestMgr.getBoolField(context, "recursion"));
         assertEquals(5000, TestMgr.getIntField(context, "timeoutInitial"));
         assertEquals(5, TestMgr.getIntField(context, "timeoutRetries"));
         assertEquals(17, TestMgr.getIntField(context, "maxThreads"));
@@ -154,12 +154,12 @@
         env.put(DNSContext.RECURSION, "trueee");
         env.remove(DNSContext.THREADS_MAX);
         context = (DNSContext)new DNSContextFactory().getInitialContext(env);
-        assertEquals(false, TestMgr.getBoolField(context, "authoritative"));
+        assertFalse(TestMgr.getBoolField(context, "authoritative"));
         assertEquals(ProviderConstants.MX_TYPE,
                 TestMgr.getIntField(context, "lookupAttrType"));
         assertEquals(ProviderConstants.IN_CLASS,
                 TestMgr.getIntField(context, "lookupAttrClass"));
-        assertEquals(false, TestMgr.getBoolField(context, "recursion"));
+        assertFalse(TestMgr.getBoolField(context, "recursion"));
         assertEquals(ProviderConstants.DEFAULT_MAX_THREADS,
                 TestMgr.getIntField(context, "maxThreads"));
 
@@ -243,7 +243,7 @@
         // remove from environment
         context.removeFromEnvironment(DNSContext.TIMEOUT_INITIAL);
         env2 = context.getEnvironment();
-        assertEquals(null, env2.get(DNSContext.TIMEOUT_INITIAL));        
+        assertNull(env2.get(DNSContext.TIMEOUT_INITIAL));        
     }
     
 //    public void testConstructCannotProceedException() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/provider/dns/DNSPseudoURLTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/provider/dns/DNSPseudoURLTest.java?view=diff&rev=463610&r1=463609&r2=463610
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/provider/dns/DNSPseudoURLTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/provider/dns/DNSPseudoURLTest.java
Fri Oct 13 02:54:28 2006
@@ -37,13 +37,13 @@
 
         url = new DNSPseudoURL("dns://super.puper.server.ru:54/sub.domain.com");
         assertEquals("super.puper.server.ru", url.getHost());
-        assertEquals(false, url.isHostIpGiven());
+        assertFalse(url.isHostIpGiven());
         assertEquals(54, url.getPort());
         assertEquals("sub.domain.com.", url.getDomain());
 
         url = new DNSPseudoURL("dns://123.456.678.1/example.com.");
         assertEquals("123.456.678.1", url.getHost());
-        assertEquals(true, url.isHostIpGiven());
+        assertTrue(url.isHostIpGiven());
         assertEquals(53, url.getPort());
         assertEquals("example.com.", url.getDomain());
         
@@ -60,19 +60,19 @@
 
         url = new DNSPseudoURL("dns://www.mydomain.ru");
         assertEquals("www.mydomain.ru", url.getHost());
-        assertEquals(false, url.isHostIpGiven());
+        assertFalse(url.isHostIpGiven());
         assertEquals(53, url.getPort());
         assertEquals(".", url.getDomain());
 
         url = new DNSPseudoURL("dns:/mydomain.org");
         assertEquals("localhost", url.getHost());
-        assertEquals(false, url.isHostIpGiven());
+        assertFalse(url.isHostIpGiven());
         assertEquals(53, url.getPort());
         assertEquals("mydomain.org.", url.getDomain());
 
         url = new DNSPseudoURL("dns:");
         assertEquals("localhost", url.getHost());
-        assertEquals(false, url.isHostIpGiven());
+        assertFalse(url.isHostIpGiven());
         assertEquals(53, url.getPort());
         assertEquals(".", url.getDomain());
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/BindingTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/BindingTest.java?view=diff&rev=463610&r1=463609&r2=463610
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/BindingTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/BindingTest.java
Fri Oct 13 02:54:28 2006
@@ -57,7 +57,7 @@
 		assertEquals("name1", p.getName());
 		assertEquals("java.lang.Integer", p.getClassName());
 		assertEquals(new Integer(1), p.getObject());
-		assertEquals(true, p.isRelative());
+		assertTrue(p.isRelative());
 	}
 
 	public void testConstructor_NullValue() {
@@ -65,15 +65,15 @@
 
 		p = new Binding("name1", null, null);
 		assertEquals("name1", p.getName());
-		assertTrue(null == p.getClassName());
-		assertTrue(null == p.getObject());
+		assertNull(p.getClassName());
+		assertNull(p.getObject());
 	}
 
 	public void testConstructor_DefaultRelativeValue() {
 		Binding p;
 
 		p = new Binding("name1", null);
-		assertEquals(true, p.isRelative());
+		assertTrue(p.isRelative());
 	}
 
 	public void testToString() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/CompositeNameTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/CompositeNameTest.java?view=diff&rev=463610&r1=463609&r2=463610
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/CompositeNameTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/CompositeNameTest.java
Fri Oct 13 02:54:28 2006
@@ -297,7 +297,7 @@
 		name.add(null);
 		assertEquals(name.size(), oldSize + 2);
 		try {
-			assertEquals(null, name.getSuffix(4).toString());
+			assertNull(name.getSuffix(4).toString());
 			fail();
 		} catch (NullPointerException e) {
 		}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/CompoundNameTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/CompoundNameTest.java?view=diff&rev=463610&r1=463609&r2=463610
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/CompoundNameTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/CompoundNameTest.java
Fri Oct 13 02:54:28 2006
@@ -1310,15 +1310,15 @@
 		CompoundName name;
 
 		name = new CompoundName("a/b/c/d", props);
-		assertTrue(false == name.isEmpty());
+		assertFalse(name.isEmpty());
 		name.remove(0);
-		assertTrue(false == name.isEmpty());
+		assertFalse(name.isEmpty());
 		name.remove(0);
-		assertTrue(false == name.isEmpty());
+		assertFalse(name.isEmpty());
 		name.remove(0);
-		assertTrue(false == name.isEmpty());
+		assertFalse(name.isEmpty());
 		name.remove(0);
-		assertTrue(true == name.isEmpty());
+		assertTrue(name.isEmpty());
 	}
 
 	public void testStartsWith() throws InvalidNameException {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/NameClassPairTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/NameClassPairTest.java?view=diff&rev=463610&r1=463609&r2=463610
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/NameClassPairTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/NameClassPairTest.java
Fri Oct 13 02:54:28 2006
@@ -57,7 +57,7 @@
 		p = new NameClassPair("name2", "class2", false);
 		assertEquals("name2", p.getName());
 		assertEquals("class2", p.getClassName());
-		assertEquals(false, p.isRelative());
+		assertFalse(p.isRelative());
 	}
 
 	public void testConstructor_NullValue() {
@@ -65,14 +65,14 @@
 
 		p = new NameClassPair("name1", null);
 		assertEquals("name1", p.getName());
-		assertTrue(null == p.getClassName());
+		assertNull(p.getClassName());
 	}
 
 	public void testConstructor_DefaultRelativeValue() {
 		NameClassPair p;
 
 		p = new NameClassPair("name1", null);
-		assertEquals(true, p.isRelative());
+		assertTrue(p.isRelative());
 	}
 
 	public void testToString() {
@@ -103,6 +103,6 @@
 
 		p = new NameClassPair("name1", null, true);
 		p.setRelative(false);
-		assertEquals(false, p.isRelative());
+		assertFalse(p.isRelative());
 	}
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/directory/SearchControlsTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/directory/SearchControlsTest.java?view=diff&rev=463610&r1=463609&r2=463610
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/directory/SearchControlsTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/directory/SearchControlsTest.java
Fri Oct 13 02:54:28 2006
@@ -38,9 +38,9 @@
 		assertEquals(SearchControls.ONELEVEL_SCOPE, ctrl.getSearchScope());
 		assertEquals(0, ctrl.getCountLimit());
 		assertEquals(0, ctrl.getTimeLimit());
-		assertEquals(null, ctrl.getReturningAttributes());
-		assertEquals(false, ctrl.getDerefLinkFlag());
-		assertEquals(false, ctrl.getReturningObjFlag());
+		assertNull(ctrl.getReturningAttributes());
+		assertFalse(ctrl.getDerefLinkFlag());
+		assertFalse(ctrl.getReturningObjFlag());
 	}
 
 	/*
@@ -57,8 +57,8 @@
 		assertEquals(200, ctrl.getTimeLimit());
 		assertTrue(Arrays.equals(new String[] { "id1", "id2" }, ctrl
 				.getReturningAttributes()));
-		assertEquals(true, ctrl.getDerefLinkFlag());
-		assertEquals(true, ctrl.getReturningObjFlag());
+		assertTrue(ctrl.getDerefLinkFlag());
+		assertTrue(ctrl.getReturningObjFlag());
 	}
 
 	public void testSearchControls_Illegal_Scope() {
@@ -101,8 +101,8 @@
 		assertEquals(200, ctrl.getTimeLimit());
 		assertTrue(Arrays.equals(new String[] { "id1", "id2" }, ctrl
 				.getReturningAttributes()));
-		assertEquals(true, ctrl.getDerefLinkFlag());
-		assertEquals(true, ctrl.getReturningObjFlag());
+		assertTrue(ctrl.getDerefLinkFlag());
+		assertTrue(ctrl.getReturningObjFlag());
 	}
 
 	/*

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/directory/SearchResultTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/directory/SearchResultTest.java?view=diff&rev=463610&r1=463609&r2=463610
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/directory/SearchResultTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/directory/SearchResultTest.java
Fri Oct 13 02:54:28 2006
@@ -40,7 +40,7 @@
 		assertEquals("name", r.getName());
 		assertEquals("obj", r.getObject());
 		assertEquals(attrs, r.getAttributes());
-		assertEquals(true, r.isRelative());
+		assertTrue(r.isRelative());
 	}
 
 	/*
@@ -55,7 +55,7 @@
 		assertEquals("name", r.getName());
 		assertEquals("obj", r.getObject());
 		assertEquals(attrs, r.getAttributes());
-		assertEquals(false, r.isRelative());
+		assertFalse(r.isRelative());
 	}
 
 	/*
@@ -70,7 +70,7 @@
 		assertEquals("name", r.getName());
 		assertEquals("obj", r.getObject());
 		assertEquals(attrs, r.getAttributes());
-		assertEquals(true, r.isRelative());
+		assertTrue(r.isRelative());
 	}
 
 	/*
@@ -85,7 +85,7 @@
 		assertEquals("name", r.getName());
 		assertEquals("obj", r.getObject());
 		assertEquals(attrs, r.getAttributes());
-		assertEquals(false, r.isRelative());
+		assertFalse(r.isRelative());
 	}
 
 	public void testSearchResult_NullAttributes() {
@@ -105,7 +105,7 @@
 		SearchResult r;
 
 		r = new SearchResult("name", "obj", null);
-		assertEquals(null, r.getAttributes());
+		assertNull(r.getAttributes());
 		r.setAttributes(attrs);
 		assertEquals(attrs, r.getAttributes());
 	}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/ControlFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/ControlFactoryTest.java?view=diff&rev=463610&r1=463609&r2=463610
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/ControlFactoryTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/ControlFactoryTest.java
Fri Oct 13 02:54:28 2006
@@ -115,7 +115,7 @@
 		Control newControl = ControlFactory.getControlInstance(null, context,
 				new Hashtable<Object, Object>());
 
-		assertEquals(null, newControl);
+		assertNull(newControl);
 		assertSame(null, newControl);
 	}
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/UnsolicitedNotificationEventTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/UnsolicitedNotificationEventTest.java?view=diff&rev=463610&r1=463609&r2=463610
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/UnsolicitedNotificationEventTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/UnsolicitedNotificationEventTest.java
Fri Oct 13 02:54:28 2006
@@ -78,7 +78,7 @@
 				src, null);
 
 		assertEquals(src, event.getSource());
-		assertEquals(null, event.getNotification());
+		assertNull(event.getNotification());
 	}
 
 	public void testDispatch() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/NamingManagerExploreTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/NamingManagerExploreTest.java?view=diff&rev=463610&r1=463609&r2=463610
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/NamingManagerExploreTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/spi/NamingManagerExploreTest.java
Fri Oct 13 02:54:28 2006
@@ -63,7 +63,7 @@
 		String obj = "String object";
 		context.bind(name, obj);
 
-		assertEquals(InvokeRecord.getLatestUrlSchema(), null);
+		assertNull(InvokeRecord.getLatestUrlSchema());
 	}
 
 	public void testFactoryBuilder_name() throws IllegalStateException,
@@ -92,7 +92,7 @@
 		String obj = "Name object";
 		context.bind(name, obj);
 
-		assertEquals(InvokeRecord.getLatestUrlSchema(), null);
+		assertNull(InvokeRecord.getLatestUrlSchema());
 	}
 
 	class MyInitialContext extends InitialContext {



Mime
View raw message