Class DataDTOToMVELTranslatorTest

java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.broadleafcommerce.admin.web.rulebuilder.DataDTOToMVELTranslatorTest
All Implemented Interfaces:
junit.framework.Test

public class DataDTOToMVELTranslatorTest extends junit.framework.TestCase
Author:
Elbert Bautista (elbertbautista)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    void
    Tests the creation of an MVEL expression from a DataDTO
    void
    Tests the creation of a Customer Qualification MVEL expression from a DataDTO
    void
    Tests the creation of a Fulfillment Group Qualification MVEL expression from a DataDTO
    void
     
    void
    Tests the creation of an Item Qualification MVEL expression from a DataDTO
    void
    Tests the creation of an Order Qualification MVEL expression from a DataDTO
    void
     

    Methods inherited from class junit.framework.TestCase

    assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, tearDown, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DataDTOToMVELTranslatorTest

      public DataDTOToMVELTranslatorTest()
  • Method Details

    • setUp

      protected void setUp()
      Overrides:
      setUp in class junit.framework.TestCase
    • testCreateMVEL

      public void testCreateMVEL() throws org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException
      Tests the creation of an MVEL expression from a DataDTO
      Throws:
      org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException - Here's an example of a DataWrapper with a single DataDTO [{"pk":"100", "quantity":"1", "condition":"AND", "rules":[ {"pk":null, "quantity":null, "condition":null, "rules":null, "id":"category.name", "operator":"IEQUALS", "value":"merchandise"}] }]
    • testCustomerQualificationMVEL

      public void testCustomerQualificationMVEL() throws org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException
      Tests the creation of a Customer Qualification MVEL expression from a DataDTO
      Throws:
      org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException - [{"pk":null, "quantity":null, "condition":"AND", "rules":[ {"pk":null, "quantity":null, "condition":null, "rules":null, "id":"emailAddress", "operator":"NOT_EQUAL_FIELD", "value":"username"}] }]
    • testOrderQualificationMVEL

      public void testOrderQualificationMVEL() throws org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException
      Tests the creation of an Order Qualification MVEL expression from a DataDTO
      Throws:
      org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException - [{"pk":null, "quantity":null, "condition":"AND", "rules":[ {"pk":null, "quantity":null, "condition":null, "rules":null, "id":"subTotal", "operator":"GREATER_OR_EQUAL", "value":"100"}] }]
    • testItemQualificationMVEL

      public void testItemQualificationMVEL() throws org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException
      Tests the creation of an Item Qualification MVEL expression from a DataDTO
      Throws:
      org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException - [{"pk":100, "quantity":1, "condition":"AND", "rules":[ {"pk":null, "quantity":null, "condition":null, "rules":null, "id":"category.name", "operator":"EQUALS", "value":"test category" }] }, {"pk":"200", "quantity":2, "condition":"NOT", "rules":[ {"pk":null, "quantity":null, "condition":null, "rules":null, "id":"product.manufacturer", "operator":"EQUALS", "value":"test manufacturer"}] }]
    • testFulfillmentQualificationMVEL

      public void testFulfillmentQualificationMVEL() throws org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException
      Tests the creation of a Fulfillment Group Qualification MVEL expression from a DataDTO
      Throws:
      org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException - [{"pk":null, "quantity":null, "condition":"AND", "rules":[ {"pk":null, "quantity":null, "condition":null, "rules":null, "id":"address.state.name", "operator":"EQUALS", "value":["Texas"]}, {"pk":null, "quantity":null, "condition":null, "rules":null, "id":"retailShippingPrice", "operator":"BETWEEN_INCLUSIVE", "value":"[99,199]"}] }]
    • testItemQualificationCollectionMVEL

      public void testItemQualificationCollectionMVEL() throws org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException
      Throws:
      org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException
    • testWithinDaysMVEL

      public void testWithinDaysMVEL() throws org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException
      Throws:
      org.broadleafcommerce.openadmin.web.rulebuilder.MVELTranslationException