Search in sources :

Example 1 with FilterPanelException

use of org.pentaho.platform.uifoundation.component.xml.FilterPanelException in project pentaho-platform by pentaho.

the class FilterDefinitionIT method testFilterCreation.

public void testFilterCreation() {
    try {
        // $NON-NLS-1$
        Class.forName("net.sf.cglib.transform.ClassFilter");
    } catch (ClassNotFoundException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    }
    ILogger l = new SimpleLogger(this);
    IPentahoSession session = getSession();
    setGlobalParams();
    this.sessionStartup(session);
    Document doc = null;
    try {
        // $NON-NLS-1$
        doc = XmlDom4JHelper.getDocFromFile(new File(SOLUTION_PATH + "/test/filterPanel/test.filterpanel.xml"), null);
    } catch (Exception ee) {
        ee.printStackTrace();
        // $NON-NLS-1$
        assertTrue("Failed to get the document from a file.", false);
    }
    FilterPanel fp = null;
    try {
        fp = new FilterPanel(session, doc, l);
    } catch (FilterPanelException e) {
        e.printStackTrace();
        // $NON-NLS-1$
        assertTrue("Failed to create stream from document.", false);
    }
    Map parameterProviders = getParameterProviders();
    boolean success = false;
    List filters = fp.getFilters();
    FilterDefinition fd = null;
    fd = (FilterDefinition) filters.get(0);
    // $NON-NLS-1$
    success = fd.populate(parameterProviders, new String[] { "huh" });
    // $NON-NLS-1$
    assertTrue("Populate on filter session-attribute failed", success);
    fd = (FilterDefinition) filters.get(1);
    // $NON-NLS-1$
    success = fd.populate(parameterProviders, new String[] { "huh" });
    // $NON-NLS-1$
    assertTrue("Populate on filter global-attribute failed", success);
    fd = (FilterDefinition) filters.get(2);
    // $NON-NLS-1$
    success = fd.populate(parameterProviders, new String[] { "huh" });
    // $NON-NLS-1$
    assertTrue("Populate on filter static-lov failed", success);
    fd = (FilterDefinition) filters.get(3);
    // $NON-NLS-1$
    success = fd.populate(parameterProviders, new String[] { "huh" });
    // $NON-NLS-1$
    assertTrue("Populate on filter action sequence failed", success);
}
Also used : IPentahoSession(org.pentaho.platform.api.engine.IPentahoSession) FilterPanelException(org.pentaho.platform.uifoundation.component.xml.FilterPanelException) Document(org.dom4j.Document) SimpleLogger(org.pentaho.platform.util.logging.SimpleLogger) FilterPanelException(org.pentaho.platform.uifoundation.component.xml.FilterPanelException) FilterPanel(org.pentaho.platform.uifoundation.component.xml.FilterPanel) FilterDefinition(org.pentaho.platform.uifoundation.component.FilterDefinition) ILogger(org.pentaho.platform.api.engine.ILogger) List(java.util.List) LinkedList(java.util.LinkedList) File(java.io.File) HashMap(java.util.HashMap) Map(java.util.Map)

Example 2 with FilterPanelException

use of org.pentaho.platform.uifoundation.component.xml.FilterPanelException in project pentaho-platform by pentaho.

the class FilterPanelExceptionIT method testFilterPanelException1.

public void testFilterPanelException1() {
    startTest();
    // $NON-NLS-1$
    info("Expected: Exception will be caught and thrown as a FilterPanel Exception");
    FilterPanelException fpe = new FilterPanelException();
    // $NON-NLS-1$
    System.out.println("FilterPanelException :" + fpe);
    assertTrue(true);
    finishTest();
}
Also used : FilterPanelException(org.pentaho.platform.uifoundation.component.xml.FilterPanelException)

Example 3 with FilterPanelException

use of org.pentaho.platform.uifoundation.component.xml.FilterPanelException in project pentaho-platform by pentaho.

the class FilterPanelExceptionIT method testFilterPanelException2.

public void testFilterPanelException2() {
    startTest();
    // $NON-NLS-1$
    info("Expected: Exception will be caught and thrown as a FilterPanel Exception");
    // $NON-NLS-1$
    FilterPanelException fpe1 = new FilterPanelException("A test FilterPanel Exception has been thrown");
    // $NON-NLS-1$
    System.out.println("FilterPanelException :" + fpe1);
    assertTrue(true);
    finishTest();
}
Also used : FilterPanelException(org.pentaho.platform.uifoundation.component.xml.FilterPanelException)

Example 4 with FilterPanelException

use of org.pentaho.platform.uifoundation.component.xml.FilterPanelException in project pentaho-platform by pentaho.

the class FilterPanelExceptionIT method testFilterPanelException3.

public void testFilterPanelException3() {
    startTest();
    // $NON-NLS-1$
    info("Expected: A FilterPanel Exception will be created with Throwable as a parameter");
    // $NON-NLS-1$
    FilterPanelException fpe2 = new FilterPanelException(new Throwable("This is a throwable exception"));
    // $NON-NLS-1$
    System.out.println("FilterPanelException :" + fpe2);
    assertTrue(true);
    finishTest();
}
Also used : FilterPanelException(org.pentaho.platform.uifoundation.component.xml.FilterPanelException)

Example 5 with FilterPanelException

use of org.pentaho.platform.uifoundation.component.xml.FilterPanelException in project pentaho-platform by pentaho.

the class FilterPanelExceptionIT method testFilterPanelException4.

public void testFilterPanelException4() {
    startTest();
    // $NON-NLS-1$
    info("Expected: Exception will be caught and thrown as a FilterPanel Exception");
    FilterPanelException fpe3 = // $NON-NLS-1$
    new FilterPanelException("A test FilterPanel Exception has been thrown", new Throwable());
    // $NON-NLS-1$
    System.out.println("FilterPanelException :" + fpe3);
    assertTrue(true);
    finishTest();
}
Also used : FilterPanelException(org.pentaho.platform.uifoundation.component.xml.FilterPanelException)

Aggregations

FilterPanelException (org.pentaho.platform.uifoundation.component.xml.FilterPanelException)5 File (java.io.File)1 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Map (java.util.Map)1 Document (org.dom4j.Document)1 ILogger (org.pentaho.platform.api.engine.ILogger)1 IPentahoSession (org.pentaho.platform.api.engine.IPentahoSession)1 FilterDefinition (org.pentaho.platform.uifoundation.component.FilterDefinition)1 FilterPanel (org.pentaho.platform.uifoundation.component.xml.FilterPanel)1 SimpleLogger (org.pentaho.platform.util.logging.SimpleLogger)1