logo       

jicarilla-sandbox/platform/framework/impl/src/test/com/leosimons/jicarilla/: msg#00005

Subject: jicarilla-sandbox/platform/framework/impl/src/test/com/leosimons/jicarilla/framework/test AbstractAsyncEnabledTestCase.java,1.2,1.3 AbstractReadonlyEnabledTestCase.java,1.2,1.3 PostProcessorTestCase.java,1.2,1.3 SimpleAlternatorTestCase.java,1.2,1.3 SimpleMulticasterTestCase.java,1.2,1.3 SimpleScreenerTestCase.java,1.2,1.3
Update of 
/cvsroot/jicarilla/jicarilla-sandbox/platform/framework/impl/src/test/com/leosimons/jicarilla/framework/test
In directory 
sc8-pr-cvs1:/tmp/cvs-serv22244/platform/framework/impl/src/test/com/leosimons/jicarilla/framework/test

Modified Files:
        AbstractAsyncEnabledTestCase.java 
        AbstractReadonlyEnabledTestCase.java 
        PostProcessorTestCase.java SimpleAlternatorTestCase.java 
        SimpleMulticasterTestCase.java SimpleScreenerTestCase.java 
Log Message:
Quite a few changes:
* improve on the javadocs
* rename a few methods for consistency
* fix bug in PostProcessor (which was a PreProcessor!)
* unify synchronization/multithread setup

Index: AbstractAsyncEnabledTestCase.java
===================================================================
RCS file: 
/cvsroot/jicarilla/jicarilla-sandbox/platform/framework/impl/src/test/com/leosimons/jicarilla/framework/test/AbstractAsyncEnabledTestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- AbstractAsyncEnabledTestCase.java   17 Dec 2003 23:23:02 -0000      1.2
+++ AbstractAsyncEnabledTestCase.java   29 Dec 2003 13:46:18 -0000      1.3
@@ -151,9 +151,9 @@
             return m_incoming;
         }
 
-        public Object getImmediateResult()
+        public Object getImmediateResult( Invocation invocation )
         {
-            return super.getImmediateResult();
+            return super.getImmediateResult( invocation );
         }
 
         public void doHandle( Invocation i )
@@ -193,7 +193,8 @@
 
     public void testGetImmediateResult()
     {
-        assertNull( aei.getImmediateResult() );
+        assertNull( aei.getImmediateResult( null ) );
+        assertNull( aei.getImmediateResult( new Invocation() ) );
     }
 
     public void testHandle() throws Throwable

Index: AbstractReadonlyEnabledTestCase.java
===================================================================
RCS file: 
/cvsroot/jicarilla/jicarilla-sandbox/platform/framework/impl/src/test/com/leosimons/jicarilla/framework/test/AbstractReadonlyEnabledTestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- AbstractReadonlyEnabledTestCase.java        17 Dec 2003 23:23:02 -0000      
1.2
+++ AbstractReadonlyEnabledTestCase.java        29 Dec 2003 13:46:18 -0000      
1.3
@@ -48,47 +48,47 @@
         /**
          * Determine whether makeReadOnly() has been called.
          */
-        protected boolean isReadonly()
+        protected boolean isReadOnly()
         {
-            return super.isReadonly();
+            return super.isReadOnly();
         }
 
         /**
          * Throw an IllegalStateException if makeReadOnly() has been called.
          */
-        protected void checkReadonly()
+        protected void checkReadOnly()
         {
-            super.checkReadonly();
+            super.checkReadOnly();
         }
     }
 
     public void testIsReadonly()
     {
         Readonly r = new Readonly();
-        assertFalse( r.isReadonly() );
+        assertFalse( r.isReadOnly() );
 
         r.makeReadOnly();
-        assertTrue( r.isReadonly() );
+        assertTrue( r.isReadOnly() );
 
         // multiple
         r.makeReadOnly();
         r.makeReadOnly();
         r.makeReadOnly();
         r.makeReadOnly();
-        assertTrue( r.isReadonly() );
+        assertTrue( r.isReadOnly() );
 
     }
 
     public void testCheckReadonly()
     {
         Readonly r = new Readonly();
-        r.checkReadonly();
+        r.checkReadOnly();
 
         // multiple
-        r.checkReadonly();
-        r.checkReadonly();
-        r.checkReadonly();
-        r.checkReadonly();
+        r.checkReadOnly();
+        r.checkReadOnly();
+        r.checkReadOnly();
+        r.checkReadOnly();
 
         r.makeReadOnly();
 
@@ -98,7 +98,7 @@
             IllegalStateException ise = null;
             try
             {
-                r.checkReadonly();
+                r.checkReadOnly();
             }
             catch( IllegalStateException e )
             {

Index: PostProcessorTestCase.java
===================================================================
RCS file: 
/cvsroot/jicarilla/jicarilla-sandbox/platform/framework/impl/src/test/com/leosimons/jicarilla/framework/test/PostProcessorTestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- PostProcessorTestCase.java  17 Dec 2003 23:23:02 -0000      1.2
+++ PostProcessorTestCase.java  29 Dec 2003 13:46:18 -0000      1.3
@@ -165,7 +165,7 @@
         p.put( new Object() );
         p.put( new Object() );
 
-        assertEquals( 4, p.processed );
+        assertEquals( 0, p.processed );
     }
 
     public void testOffer() throws InterruptedException
@@ -176,6 +176,40 @@
         p.offer( new Object(), 100 );
         p.offer( new Object(), 100 );
         p.offer( new Object(), 100 );
+
+        assertEquals( 0, p.processed );
+    }
+
+    public void testTake() throws InterruptedException
+    {
+        final Processor p = new Processor( c, e );
+
+        p.put( new Object() );
+        p.put( new Object() );
+        p.put( new Object() );
+        p.put( new Object() );
+
+        p.take();
+        p.take();
+        p.take();
+        p.take();
+
+        assertEquals( 4, p.processed );
+    }
+
+    public void testPoll() throws InterruptedException
+    {
+        final Processor p = new Processor( c, e );
+
+        p.put( new Object() );
+        p.put( new Object() );
+        p.put( new Object() );
+        p.put( new Object() );
+
+        p.poll( 100 );
+        p.poll( 100 );
+        p.poll( 100 );
+        p.poll( 100 );
 
         assertEquals( 4, p.processed );
     }

Index: SimpleAlternatorTestCase.java
===================================================================
RCS file: 
/cvsroot/jicarilla/jicarilla-sandbox/platform/framework/impl/src/test/com/leosimons/jicarilla/framework/test/SimpleAlternatorTestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- SimpleAlternatorTestCase.java       17 Dec 2003 23:23:02 -0000      1.2
+++ SimpleAlternatorTestCase.java       29 Dec 2003 13:46:18 -0000      1.3
@@ -219,7 +219,7 @@
 
         public int getSize()
         {
-            return m_size;
+            return m_sinks.size();
         }
     }
 

Index: SimpleMulticasterTestCase.java
===================================================================
RCS file: 
/cvsroot/jicarilla/jicarilla-sandbox/platform/framework/impl/src/test/com/leosimons/jicarilla/framework/test/SimpleMulticasterTestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- SimpleMulticasterTestCase.java      17 Dec 2003 23:23:02 -0000      1.2
+++ SimpleMulticasterTestCase.java      29 Dec 2003 13:46:18 -0000      1.3
@@ -194,7 +194,7 @@
 
         public int getSize()
         {
-            return m_size;
+            return m_sinks.size();
         }
     }
 

Index: SimpleScreenerTestCase.java
===================================================================
RCS file: 
/cvsroot/jicarilla/jicarilla-sandbox/platform/framework/impl/src/test/com/leosimons/jicarilla/framework/test/SimpleScreenerTestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- SimpleScreenerTestCase.java 17 Dec 2003 23:23:02 -0000      1.2
+++ SimpleScreenerTestCase.java 29 Dec 2003 13:46:18 -0000      1.3
@@ -199,7 +199,7 @@
 
         public int getSize()
         {
-            return m_size;
+            return m_sinks.size();
         }
     }
 }




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
web.pylons.gene...    hurd.l4/2002-10...    kernel.commits....    user-groups.lin...    yellowdog.gener...    java.drools.use...    security.openva...    package-managem...    linux.debian.us...    qnx.openqnx.dev...    genealogy.gramp...    file-systems.if...    voip.wengophone...    tex.context/200...    ietf.smime/2003...    audio.csound.de...    culture.region....    xfree86.devel/2...    mobile.kannel.u...    distributed.con...    education.engli...    org.user-groups...    bug-tracking.gn...    recreation.bicy...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe