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);
}
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());
}
Aggregations