Search in sources :

Example 1 with BasicSpec

use of eu.ggnet.dwoss.spec.ee.entity.BasicSpec in project dwoss by gg-net.

the class BasicViewTryout method main.

public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    BasicSpec basic = new BasicSpec();
    basic.setPartNo("ABX");
    basic.setColor(Color.RED);
    basic.setComment("Der große Kommentar");
    basic.setExtras(EnumSet.of(Extra.BLUETOOTH, Extra.CARD_READER));
    basic.setVideoPorts(EnumSet.of(VideoPort.HDMI, VideoPort.VGA));
    BasicView view = new BasicView();
    view.setSpec(basic);
    OkCancelDialog<BasicView> dialog = new OkCancelDialog<>("", view);
    dialog.setVisible(true);
    if (dialog.getCloseType() == CloseType.OK) {
        System.out.println(view.getSpec());
        System.out.println(view.getGtin());
    }
    Thread.sleep(1221);
    System.exit(0);
}
Also used : BasicSpec(eu.ggnet.dwoss.spec.ee.entity.BasicSpec) OkCancelDialog(eu.ggnet.dwoss.util.OkCancelDialog)

Example 2 with BasicSpec

use of eu.ggnet.dwoss.spec.ee.entity.BasicSpec in project dwoss by gg-net.

the class ProductSpecTest method testValidateProductSpec.

@Test
public void testValidateProductSpec() {
    ProductSeries veriton = new ProductSeries(TradeName.ACER, ProductGroup.DESKTOP, "Veriton");
    ProductFamily lfamiliy = new ProductFamily("Veriton L");
    lfamiliy.setSeries(veriton);
    ProductModel l640 = new ProductModel("Veriton L640");
    l640.setFamily(lfamiliy);
    ProductSpec s = new BasicSpec("LX.AAAAA.BBB", 1L);
    s.setModel(l640);
    assertThat(validator.validate(s)).isEmpty();
    s.setPartNo("LX.AAAAA.OOB");
    assertTrue("The letter O should be allowed", validator.validate(s).isEmpty());
    s.setPartNo("  LLL");
    assertFalse(s.getPartNo() + " should be invalid", validator.validate(s).isEmpty());
    s.setPartNo("RA LL");
    assertFalse(s.getPartNo() + " should be invalid", validator.validate(s).isEmpty());
}
Also used : ProductFamily(eu.ggnet.dwoss.spec.ee.entity.ProductFamily) BasicSpec(eu.ggnet.dwoss.spec.ee.entity.BasicSpec) ProductSeries(eu.ggnet.dwoss.spec.ee.entity.ProductSeries) ProductSpec(eu.ggnet.dwoss.spec.ee.entity.ProductSpec) ProductModel(eu.ggnet.dwoss.spec.ee.entity.ProductModel) Test(org.junit.Test)

Aggregations

BasicSpec (eu.ggnet.dwoss.spec.ee.entity.BasicSpec)2 ProductFamily (eu.ggnet.dwoss.spec.ee.entity.ProductFamily)1 ProductModel (eu.ggnet.dwoss.spec.ee.entity.ProductModel)1 ProductSeries (eu.ggnet.dwoss.spec.ee.entity.ProductSeries)1 ProductSpec (eu.ggnet.dwoss.spec.ee.entity.ProductSpec)1 OkCancelDialog (eu.ggnet.dwoss.util.OkCancelDialog)1 Test (org.junit.Test)1