STest.java [test/service_tests] Revision:   Date:
package service_tests;

import csip.test.ServiceTest2;
import java.io.File;
import java.util.Properties;
import org.codehaus.jettison.json.JSONArray;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;

/**
 *
 * @author od
 */
public class STest {

    @Rule
    public TestName name = new TestName();

    private void run() throws Exception {
        String testFolder = new File(getClass().getCanonicalName().replace('.', '/')).getParent();
        JSONArray r = ServiceTest2.run(new Properties(), "test/" + testFolder + "/" + name.getMethodName() + ".json");
        Assert.assertTrue(r.getJSONObject(0).getInt("successful") == 1);
    }

    // all test cases. the name corresponds to the 
    // json file name with no extension
    @Test public void d_barrier_1_0__default()      throws Exception { run(); }
    @Test public void d_barrier_1_0__barrier_1()    throws Exception { run(); }
    @Test public void d_barrier_1_0__barrier_2()    throws Exception { run(); }
    @Test public void d_barrier_1_0__barrier_3()    throws Exception { run(); }
    
    @Test public void d_contour_1_0__contour_1()    throws Exception { run(); }                                                                                        
    @Test public void d_contour_1_0__contour_2()    throws Exception { run(); }          
    
    @Test public void d_crop_1_0__crop_1()          throws Exception { run(); }                                                                                              
    @Test public void d_crop_1_0__crop_2()          throws Exception { run(); }                                                                                              
    @Test public void d_crop_1_0__crop_3()          throws Exception { run(); }                                                                                              
    @Test public void d_crop_1_0__crop_4()          throws Exception { run(); }                                                                                              

//    @Test public void d_export_1_0__export_1()      throws Exception { run(); }                                                                                          
    @Test public void d_export_1_0__export_2()      throws Exception { run(); }                                                                                          
//    @Test public void d_export_1_0__export_3()      throws Exception { run(); }                                                                                          
//    @Test public void d_export_1_0__export_4()      throws Exception { run(); }                                                                                          

//    @Test public void d_management_1_0__man_1()     throws Exception { run(); }  // too big for now?                                                                                         
    @Test public void d_management_1_0__man_2()     throws Exception { run(); }                                                                                         
    @Test public void d_management_1_0__man_3()     throws Exception { run(); }
    @Test public void d_management_1_0__man_4()     throws Exception { run(); }
    @Test public void d_management_1_0__man_5()     throws Exception { run(); }

    @Test public void d_contour_1_0__permBarr_1()   throws Exception { run(); }
//    @Test public void d_contour_1_0__permBarr_2()   throws Exception { run(); }
//    @Test public void d_contour_1_0__permBarr_3()   throws Exception { run(); }
    @Test public void d_contour_1_0__permBarr_4()   throws Exception { run(); }

    @Test public void d_residue_1_0__residue_1()    throws Exception { run(); }
    @Test public void d_residue_1_0__residue_2()    throws Exception { run(); }

    @Test public void d_strip_1_0__strip_1()        throws Exception { run(); }
    @Test public void d_strip_1_0__strip_2()        throws Exception { run(); }

}