Search in sources :

Example 11 with Display

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());
}
Also used : Notebook(eu.ggnet.dwoss.spec.ee.entity.Notebook) Cpu(eu.ggnet.dwoss.spec.ee.entity.piece.Cpu) ProductSpec(eu.ggnet.dwoss.spec.ee.entity.ProductSpec) Gpu(eu.ggnet.dwoss.spec.ee.entity.piece.Gpu) Display(eu.ggnet.dwoss.spec.ee.entity.piece.Display)

Example 12 with Display

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();
}
Also used : DisplayEmo(eu.ggnet.dwoss.spec.ee.emo.DisplayEmo) Display(eu.ggnet.dwoss.spec.ee.entity.piece.Display) Test(org.junit.Test)

Example 13 with Display

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;
}
Also used : Display(eu.ggnet.dwoss.spec.ee.entity.piece.Display)

Aggregations

Display (eu.ggnet.dwoss.spec.ee.entity.piece.Display)13 Test (org.junit.Test)8 Notebook (eu.ggnet.dwoss.spec.ee.entity.Notebook)7 Cpu (eu.ggnet.dwoss.spec.ee.entity.piece.Cpu)7 Gpu (eu.ggnet.dwoss.spec.ee.entity.piece.Gpu)7 ProductFamily (eu.ggnet.dwoss.spec.ee.entity.ProductFamily)6 ProductModel (eu.ggnet.dwoss.spec.ee.entity.ProductModel)6 ProductSeries (eu.ggnet.dwoss.spec.ee.entity.ProductSeries)6 ProductSpec (eu.ggnet.dwoss.spec.ee.entity.ProductSpec)5 DisplayEao (eu.ggnet.dwoss.spec.ee.eao.DisplayEao)2 Monitor (eu.ggnet.dwoss.spec.ee.entity.Monitor)2 Product (eu.ggnet.dwoss.uniqueunit.ee.entity.Product)2 DisplayEmo (eu.ggnet.dwoss.spec.ee.emo.DisplayEmo)1 Desktop (eu.ggnet.dwoss.spec.ee.entity.Desktop)1 DesktopBundle (eu.ggnet.dwoss.spec.ee.entity.DesktopBundle)1 DisplayAble (eu.ggnet.dwoss.spec.ee.entity.DisplayAble)1 ProductEao (eu.ggnet.dwoss.uniqueunit.ee.eao.ProductEao)1 OkCancelDialog (eu.ggnet.dwoss.util.OkCancelDialog)1 Validator (javax.validation.Validator)1 Ignore (org.junit.Ignore)1