jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1334660 - in /jmeter/trunk: src/core/org/apache/jmeter/save/SaveService.java test/src/org/apache/jmeter/save/TestSaveService.java
Date Sun, 06 May 2012 15:27:50 GMT
Author: pmouawad
Date: Sun May  6 15:27:50 2012
New Revision: 1334660

URL: http://svn.apache.org/viewvc?rev=1334660&view=rev
Log:
Add logs to diagnose GUMP Failure

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java
    jmeter/trunk/test/src/org/apache/jmeter/save/TestSaveService.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java?rev=1334660&r1=1334659&r2=1334660&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/save/SaveService.java Sun May  6 15:27:50 2012
@@ -23,13 +23,15 @@ import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
 import java.io.OutputStream;
+import java.io.OutputStreamWriter;
 import java.io.Writer;
 import java.lang.reflect.InvocationTargetException;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 import java.util.Properties;
-import java.nio.charset.Charset;
 
 import org.apache.jmeter.reporters.ResultCollectorHelper;
 import org.apache.jmeter.samplers.SampleEvent;
@@ -43,15 +45,15 @@ import org.apache.jorphan.util.JOrphanUt
 import org.apache.log.Logger;
 
 import com.thoughtworks.xstream.XStream;
-import com.thoughtworks.xstream.io.xml.XppDriver;
-import com.thoughtworks.xstream.mapper.CannotResolveClassException;
-import com.thoughtworks.xstream.mapper.Mapper;
-import com.thoughtworks.xstream.mapper.MapperWrapper;
 import com.thoughtworks.xstream.converters.ConversionException;
 import com.thoughtworks.xstream.converters.Converter;
 import com.thoughtworks.xstream.converters.DataHolder;
 import com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider;
 import com.thoughtworks.xstream.converters.reflection.ReflectionProvider;
+import com.thoughtworks.xstream.io.xml.XppDriver;
+import com.thoughtworks.xstream.mapper.CannotResolveClassException;
+import com.thoughtworks.xstream.mapper.Mapper;
+import com.thoughtworks.xstream.mapper.MapperWrapper;
 
 /**
  * Handles setting up XStream serialisation.
@@ -402,21 +404,22 @@ public class SaveService {
     }
 
     // Allow test code to check for spurious class references
-    static boolean checkClasses(){
+    static List<String> checkClasses(){
         final ClassLoader classLoader = SaveService.class.getClassLoader();
-        boolean OK = true;
+        List<String> missingClasses = new ArrayList<String>();
+        //boolean OK = true;
         for (Object clazz : classToAlias.keySet()) {
             String name = (String) clazz;
             if (!NameUpdater.isMapped(name)) {// don't bother checking class is present if
it is to be updated
                 try {
                     Class.forName(name, false, classLoader);
                 } catch (ClassNotFoundException e) {
-                        log.error("Unexpected entry in saveservice.properties; class does
not exist and is not upgraded: "+name);                    
-                        OK = false;
+                        log.error("Unexpected entry in saveservice.properties; class does
not exist and is not upgraded: "+name);              
+                        missingClasses.add(name);
                 }
             }
         }
-        return OK;
+        return missingClasses;
     }
 
     static boolean checkVersions() {

Modified: jmeter/trunk/test/src/org/apache/jmeter/save/TestSaveService.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/save/TestSaveService.java?rev=1334660&r1=1334659&r2=1334660&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/save/TestSaveService.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/save/TestSaveService.java Sun May  6 15:27:50
2012
@@ -24,6 +24,7 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.InputStream;
+import java.util.List;
 
 import org.apache.jmeter.junit.JMeterTestCase;
 import org.apache.jmeter.util.JMeterUtils;
@@ -141,6 +142,9 @@ public class TestSaveService extends JMe
     }
 
     public void testClasses(){
-        assertTrue("One or more classes not found - see log file",SaveService.checkClasses());
+        List<String> missingClasses = SaveService.checkClasses();
+        if(missingClasses.size()>0) {
+            fail("One or more classes not found:"+missingClasses);
+        }
     }
 }



Mime
View raw message