commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nico...@apache.org
Subject svn commit: r646197 - in /commons/sandbox/monitoring/trunk/src: main/java/org/apache/commons/monitoring/reporting/ main/java/org/apache/commons/monitoring/reporting/web/ test/java/org/apache/commons/monitoring/listener/ test/java/org/apache/commons/mon...
Date Wed, 09 Apr 2008 06:51:07 GMT
Author: nicolas
Date: Tue Apr  8 23:51:05 2008
New Revision: 646197

URL: http://svn.apache.org/viewvc?rev=646197&view=rev
Log:
fix testcase

Modified:
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Selector.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringServlet.java
    commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/listener/SecondaryReposioryTest.java
    commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/reporting/SelectorTest.java

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Selector.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Selector.java?rev=646197&r1=646196&r2=646197&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Selector.java
(original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/Selector.java
Tue Apr  8 23:51:05 2008
@@ -80,7 +80,8 @@
         }
         if ( path.endsWith( SEP ) )
         {
-            stack.push( Key.DEFAULT );
+            // get()
+            stack.push( "" );
         }
         Collections.reverse( stack );
 

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringServlet.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringServlet.java?rev=646197&r1=646196&r2=646197&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringServlet.java
(original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/reporting/web/MonitoringServlet.java
Tue Apr  8 23:51:05 2008
@@ -161,7 +161,7 @@
                 mimeTypes.add( tokenizer.nextToken() );
             }
         }
-        if (accept.contains( "*/*" ) || accept.contains( "text/html" ))
+        if ( accept.contains( "*/*" ) || accept.contains( "text/html" ) )
         {
             // Let IE and FireFox get HTML !
             mimeTypes.add( 0, "text/html" );
@@ -203,12 +203,12 @@
 
         public boolean render( StatValue value, String attribute )
         {
-            String hide = request.getParameter( value.getRole() + "." + attribute );
-            if (hide != null)
+            String columns = request.getParameter( value.getRole() + ".columns" );
+            if ( columns != null )
             {
-                return Boolean.parseBoolean( hide );
+                return true;
             }
-            return true;
+            return columns.indexOf( attribute ) >= 0;
         }
 
         public Unit unitFor( StatValue value )

Modified: commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/listener/SecondaryReposioryTest.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/listener/SecondaryReposioryTest.java?rev=646197&r1=646196&r2=646197&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/listener/SecondaryReposioryTest.java
(original)
+++ commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/listener/SecondaryReposioryTest.java
Tue Apr  8 23:51:05 2008
@@ -17,13 +17,14 @@
 
 package org.apache.commons.monitoring.listener;
 
+import junit.framework.TestCase;
+
 import org.apache.commons.monitoring.Repository;
 import org.apache.commons.monitoring.Unit;
 import org.apache.commons.monitoring.impl.repositories.DefaultRepository;
+import org.apache.commons.monitoring.listeners.EmpyMonitor;
 import org.apache.commons.monitoring.listeners.SecondaryRepository;
 
-import junit.framework.TestCase;
-
 /**
  *
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
@@ -58,7 +59,7 @@
         primary.getMonitor( "anotherone" ).getCounter( "COUNTER" ).add( 10, Unit.NONE );
         primary.getMonitor( "test" ).getCounter( "COUNTER" ).add( 10, Unit.NONE );
         primary.getMonitor( "test" ).getGauge( "GAUGE" ).increment(Unit.NONE);
-        assertNull( secondary.getMonitor( "anotherone" ) );
+        assertTrue( secondary.getMonitor( "anotherone" ) instanceof EmpyMonitor );
         assertEquals( 30, primary.getMonitor( "test" ).getCounter( "COUNTER" ).get() );
         assertEquals( 10, secondary.getMonitor( "test" ).getCounter( "COUNTER" ).get() );
         assertEquals( 7, primary.getMonitor( "test" ).getGauge( "GAUGE" ).get() );

Modified: commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/reporting/SelectorTest.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/reporting/SelectorTest.java?rev=646197&r1=646196&r2=646197&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/reporting/SelectorTest.java
(original)
+++ commons/sandbox/monitoring/trunk/src/test/java/org/apache/commons/monitoring/reporting/SelectorTest.java
Tue Apr  8 23:51:05 2008
@@ -37,7 +37,7 @@
         throws Exception
     {
         Repository repository = new DefaultRepository();
-        Selector selector = new Selector( "monitor/test///counter/performances" );
+        Selector selector = new Selector( "monitor/test/default/default/counter/performances"
);
 
         repository.getMonitor( "test" ).getCounter( Monitor.PERFORMANCES ).add( 1234, Unit.NANOS
);
 
@@ -67,7 +67,7 @@
         throws Exception
     {
         Repository repository = new DefaultRepository();
-        Selector selector = new Selector( "monitor/test///counter/performances/" );
+        Selector selector = new Selector( "monitor/test/default/default/counter/performances/"
);
 
         repository.getMonitor( "test" ).getCounter( Monitor.PERFORMANCES ).add( 1234, Unit.NANOS
);
 



Mime
View raw message