import vtk.*;

public class Regression {
  static { 
    System.loadLibrary("vtkCommonJava"); 
    System.loadLibrary("vtkFilteringJava"); 
    System.loadLibrary("vtkIOJava"); 
    System.loadLibrary("vtkImagingJava"); 
    System.loadLibrary("vtkGraphicsJava"); 
    System.loadLibrary("vtkRenderingJava"); 
  }
  public static void main (String []args) {
    vtkRenderWindow renWin = new vtkRenderWindow();
    vtkRenderer ren1 = new vtkRenderer();
    renWin.AddRenderer(ren1);
    vtkConeSource cone = new vtkConeSource();
    cone.SetResolution(8);
    vtkPolyDataMapper coneMapper = new vtkPolyDataMapper();
    coneMapper.SetInput(cone.GetOutput());

    vtkActor coneActor = new vtkActor();
    coneActor.SetMapper(coneMapper);

    ren1.AddActor(coneActor);
    renWin.Render();
    renWin.Render();

    vtkWindowToImageFilter w2if = new vtkWindowToImageFilter();
    w2if.SetInput(renWin);

    vtkImageDifference imgDiff = new vtkImageDifference();
    
    vtkPNGReader rtpnm = new vtkPNGReader();
    rtpnm.SetFileName("Regression.png");

    imgDiff.SetInput(w2if.GetOutput());
    imgDiff.SetImage(rtpnm.GetOutput());
    imgDiff.Update();

    if (imgDiff.GetThresholdedError() <= 10) 
	{
        System.out.println("Java smoke test passed."); 
	} 
      else 
        {
        System.out.println("Java smoke test error!"); 
	}	
    } 
}


@@ -6,16 +6,37 @@
 t vtk.*;
+%0Aimport java.io.File;
 %0A%0Apublic
@@ -372,16 +372,1119 @@
 args) %7B%0A
+    String image_path = %22Cone.png%22;%0A    String data_path = %22%22;%0A    int cc;%0A    boolean last = false;%0A    for ( cc = 0; cc %3C args.length; cc ++ )%0A      %7B%0A      if( cc == args.length )%0A        %7B%0A        last = true;%0A        %7D%0A      if ( args%5Bcc%5D.equals(%22-D%22) )%0A        %7B%0A        if ( !last )%0A          %7B%0A          data_path = args%5Bcc+1%5D;%0A          System.out.println(%22Set data path to: %22 + data_path);%0A          cc++;%0A          %7D%0A        else%0A          %7B%0A          System.err.println(%22Data path not specified%22);%0A          System.exit(1);%0A          %7D%0A        %7D%0A      if ( args%5Bcc%5D.equals(%22-V%22) )%0A        %7B%0A        if ( !last )%0A          %7B%0A          image_path = args%5Bcc+1%5D;%0A          System.out.println(%22Set image path to: %22 + image_path);%0A          cc++;%0A          %7D%0A        else%0A          %7B%0A          System.err.println(%22Image path not specified%22);%0A          System.exit(1);%0A          %7D%0A        %7D%0A      %7D%0A    %0A    File file = new File(data_path + %22/%22 + image_path);%0A    if ( !file.exists() )%0A      %7B%0A      System.err.println(%22File %22 + file.getName() + %22 does not exists%22);%0A      System.exit(1);%0A      %7D%0A%0A
     vtkR
@@ -2155,24 +2155,36 @@
 ame(
-%22Regression.png%22
+data_path + %22/%22 + image_path
 );%0A%0A
@@ -2410,32 +2410,32 @@
 else %0A        %7B%0A
-
         System.o
@@ -2473,16 +2473,40 @@
 or!%22); %0A
+        System.exit(1);%0A
 %09%7D%09%0A    

Improve Test, so that it kind of matches the signature of other regression tests.