use of eu.ggnet.dwoss.spec.ee.entity.piece.Display in project dwoss by gg-net.
the class SpecTest method testNotebook.
@Test
public void testNotebook() {
Notebook notebook = new Notebook();
notebook.setColor(BasicSpec.Color.RED);
notebook.setModel(basicSpec.getModel());
notebook.setPartNo(basicSpec.getPartNo());
notebook.setComment("TestBasicNotebook");
notebook.setExtras(ProductSpec.Extra.KAMERA, ProductSpec.Extra.CONVERTABLE);
notebook.setDisplay(new Display(Display.Size._10_1, Display.Resolution.VGA, Display.Type.MATT, Display.Ration.FOUR_TO_THREE));
desktop.add(Desktop.Hdd.SSD_0016);
notebook.add(Desktop.Odd.DVD_ROM);
notebook.setMemory(4096);
notebook.setOs(Desktop.Os.WINDOWS_7_STARTER_32);
notebook.setGpu(new Gpu(Gpu.Type.MOBILE, Gpu.Series.GEFORCE_300, "TestNotebookGPU"));
notebook.setCpu(new Cpu(Cpu.Series.CORE_I7, "TestDesktopCPU", Cpu.Type.DESKTOP, 2.4, 4));
Set<ProductSpec.Extra> extras = EnumSet.noneOf(ProductSpec.Extra.class);
extras.add(ProductSpec.Extra.USB_3);
extras.add(ProductSpec.Extra.UMTS);
notebook.setExtras(extras);
assertTrue("ViolationException: Notebook look like this: " + notebook.toString() + "\nViolations: " + ConstraintViolationFormater.toSingleLine(validator.validate(notebook)), validator.validate(notebook).isEmpty());
}
use of eu.ggnet.dwoss.spec.ee.entity.piece.Display in project dwoss by gg-net.
the class DisplayEmoIT method testFind.
@Test
public void testFind() throws Exception {
utx.begin();
em.joinTransaction();
Display d = new Display(Display.Size._10_1, Display.Resolution.VGA, Display.Type.MATT, Display.Ration.SIXTEEN_TO_NINE);
em.persist(d);
em.persist(new Display(Display.Size._15, Display.Resolution.VGA, Display.Type.CRYSTAL_BRIGHT, Display.Ration.SIXTEEN_TO_NINE));
utx.commit();
utx.begin();
em.joinTransaction();
DisplayEmo displayEao = new DisplayEmo(em);
Display display = displayEao.weakRequest(d.getSize(), d.getResolution(), d.getType(), d.getRation());
assertNotNull(display);
assertEquals(d.getId(), display.getId());
display = displayEao.weakRequest(Display.Size._11_6, Display.Resolution.HD, Display.Type.MATT, Display.Ration.SIXTEEN_TO_TEN);
assertNotNull(display);
assertEquals(0, display.getId());
utx.commit();
}
use of eu.ggnet.dwoss.spec.ee.entity.piece.Display in project dwoss by gg-net.
the class DisplayPanel method getDisplay.
public Display getDisplay() {
Display display = new Display();
display.setRation(rations.getSelected());
display.setResolution(resolutions.getSelected());
display.setSize(sizes.getSelected());
display.setType(typeGroup.getSelected());
if (displayLedCheck.isSelected()) {
display.setLed(true);
} else {
display.setLed(false);
}
if (display.equalsContent(original))
return original;
else
return display;
}
Aggregations