Examples of StockItem


Examples of org.hibernate.beanvalidation.tck.tests.methodvalidation.model.StockItem

    assertEquals(
        Validation.byDefaultProvider().configure().getBootstrapConfiguration().getDefaultValidatedExecutableTypes(),
        Collections.emptySet()
    );

    Object object = new StockItem( null );
    String methodName = "setName";
    Method method = StockItem.class.getMethod( methodName, String.class );
    Object[] parameterValues = new Object[] { null };

    Set<ConstraintViolation<Object>> violations = executableValidator.validateParameters(
View Full Code Here

Examples of org.hibernate.beanvalidation.tck.tests.methodvalidation.model.StockItem

    assertEquals(
        Validation.byDefaultProvider().configure().getBootstrapConfiguration().getDefaultValidatedExecutableTypes(),
        Collections.emptySet()
    );

    Object object = new StockItem( null );
    String methodName = "setName";
    Method method = StockItem.class.getMethod( methodName, String.class );
    Object returnValue = null;

    Set<ConstraintViolation<Object>> violations = executableValidator.validateReturnValue(
View Full Code Here

Examples of org.hibernate.beanvalidation.tck.tests.methodvalidation.model.StockItem

        Validation.byDefaultProvider().configure().getBootstrapConfiguration().getDefaultValidatedExecutableTypes(),
        Collections.emptySet()
    );

    Constructor<StockItem> constructor = StockItem.class.getConstructor( String.class );
    StockItem createdObject = new StockItem( null );

    Set<ConstraintViolation<StockItem>> violations = executableValidator.validateConstructorReturnValue(
        constructor,
        createdObject
    );
View Full Code Here

Examples of org.plugtree.training.handsonlabs.model.StockItem

      Double sony_led_price = 900d;
      Double sony_lcd_price = 500d;
     
     
      //TVs
      StockItem samsungLEDTV1 = new StockItem(ItemType.LED_TV,"Samsung");
      StockItem samsungLEDTV2 = new StockItem(ItemType.LED_TV,"Samsung");
     
      StockItem samsungLCDTV1 = new StockItem(ItemType.LCD_TV,"Samsung");
     
      StockItem samsungTUBETV1 = new StockItem(ItemType.TUBE_TV,"Samsung");
     
      StockItem sonyLEDTV1 = new StockItem(ItemType.LED_TV,"Sony");
     
      StockItem sonyLCDTV1 = new StockItem(ItemType.LCD_TV,"Sony");
      StockItem sonyLCDTV2 = new StockItem(ItemType.LCD_TV,"Sony");
     
      //PROMOTIONAL PRICES
      SpecialOffer samsungLCDSpecialOffer = new SpecialOffer(ItemType.LCD_TV, "Samsung", 300d);
     
      SpecialOffer sonyLEDSpecialOffer = new SpecialOffer(ItemType.LED_TV, "Sony", 850d);
     
      //Insert promotional prices as globals
      ksession.setGlobal("samsung_led_price", samsung_led_price);
      ksession.setGlobal("samsung_lcd_price", samsung_lcd_price);
      ksession.setGlobal("samsung_tube_price", samsung_tube_price);
      ksession.setGlobal("sony_led_price", sony_led_price);
      ksession.setGlobal("sony_lcd_price", sony_lcd_price);
       
      //Insert Special prices as facts
      ksession.insert(samsungLCDSpecialOffer);
      ksession.insert(sonyLEDSpecialOffer);
     
      //Insert items as facts
        ksession.insert(samsungLEDTV1);
        ksession.insert(samsungLEDTV2);
        ksession.insert(samsungLCDTV1);
        ksession.insert(samsungTUBETV1);
        ksession.insert(sonyLEDTV1);
        ksession.insert(sonyLCDTV1);
        ksession.insert(sonyLCDTV2);
       
        //fire all rules
        ksession.fireAllRules();
       
       
        //Control
       
        //SAMSUNG
        Assert.assertEquals("",samsung_led_price.doubleValue(), samsungLEDTV1.getPrice(),0.1);
        Assert.assertEquals("",samsung_led_price.doubleValue(), samsungLEDTV2.getPrice(),0.1);

        Assert.assertEquals("",samsungLCDSpecialOffer.getPrice(), samsungLCDTV1.getPrice(),0.1);
       
        Assert.assertEquals("",samsung_tube_price.doubleValue(), samsungTUBETV1.getPrice(),0.1);
       
        //SONY
        Assert.assertEquals("",sonyLEDSpecialOffer.getPrice(), sonyLEDTV1.getPrice(),0.1);
       
        Assert.assertEquals("",sony_lcd_price.doubleValue(), sonyLCDTV1.getPrice(),0.1);
        Assert.assertEquals("",sony_lcd_price.doubleValue(), sonyLCDTV2.getPrice(),0.1);
       
       
        ksession.dispose();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.