Search in sources :

Example 1 with ProductFamilyEmo

use of eu.ggnet.dwoss.spec.ee.emo.ProductFamilyEmo in project dwoss by gg-net.

the class ProductModelEmoIT method testRequestBrandGroupNameByHand.

@Test
public void testRequestBrandGroupNameByHand() throws Exception {
    TradeName sb = TradeName.HP;
    ProductGroup sg = ProductGroup.PROJECTOR;
    String sn = "SERIES";
    String fn = "FAMILY";
    String mn = "MODEL";
    utx.begin();
    em.joinTransaction();
    new ProductSeriesEmo(em).request(sb, sg, sn);
    utx.commit();
    utx.begin();
    em.joinTransaction();
    new ProductFamilyEmo(em).request(sb, sg, sn, fn);
    utx.commit();
    utx.begin();
    em.joinTransaction();
    ProductModel model = new ProductModelEmo(em).request(sb, sg, sn, fn, mn);
    assertNotNull(model);
    utx.commit();
}
Also used : TradeName(eu.ggnet.dwoss.rules.TradeName) ProductGroup(eu.ggnet.dwoss.rules.ProductGroup) ProductModelEmo(eu.ggnet.dwoss.spec.ee.emo.ProductModelEmo) ProductFamilyEmo(eu.ggnet.dwoss.spec.ee.emo.ProductFamilyEmo) ProductSeriesEmo(eu.ggnet.dwoss.spec.ee.emo.ProductSeriesEmo) ProductModel(eu.ggnet.dwoss.spec.ee.entity.ProductModel) Test(org.junit.Test)

Example 2 with ProductFamilyEmo

use of eu.ggnet.dwoss.spec.ee.emo.ProductFamilyEmo in project dwoss by gg-net.

the class ProductModelEmoIT method testHalfRequestBrandGroupName.

@Test
public void testHalfRequestBrandGroupName() throws Exception {
    TradeName sb = TradeName.HP;
    ProductGroup sg = ProductGroup.PROJECTOR;
    String sn = "SERIES";
    String fn = "FAMILY";
    String mn = "MODEL";
    utx.begin();
    em.joinTransaction();
    new ProductFamilyEmo(em).request(sb, sg, sn, fn);
    utx.commit();
    utx.begin();
    em.joinTransaction();
    ProductModelEmo modelEmo = new ProductModelEmo(em);
    ProductModel model = modelEmo.request(sb, sg, sn, fn, mn);
    assertNotNull(model);
    assertEquals(mn, model.getName());
    assertEquals(fn, model.getFamily().getName());
    assertEquals(sb, model.getFamily().getSeries().getBrand());
    assertEquals(sg, model.getFamily().getSeries().getGroup());
    assertEquals(sn, model.getFamily().getSeries().getName());
    long fid = model.getFamily().getId();
    long mid = model.getId();
    long sid = model.getFamily().getSeries().getId();
    utx.commit();
    utx.begin();
    em.joinTransaction();
    model = modelEmo.request(sb, sg, sn, fn, mn);
    assertNotNull(model);
    assertEquals(mid, model.getId());
    assertEquals(fid, model.getFamily().getId());
    assertEquals(sid, model.getFamily().getSeries().getId());
    utx.commit();
}
Also used : TradeName(eu.ggnet.dwoss.rules.TradeName) ProductGroup(eu.ggnet.dwoss.rules.ProductGroup) ProductModelEmo(eu.ggnet.dwoss.spec.ee.emo.ProductModelEmo) ProductFamilyEmo(eu.ggnet.dwoss.spec.ee.emo.ProductFamilyEmo) ProductModel(eu.ggnet.dwoss.spec.ee.entity.ProductModel) Test(org.junit.Test)

Aggregations

ProductGroup (eu.ggnet.dwoss.rules.ProductGroup)2 TradeName (eu.ggnet.dwoss.rules.TradeName)2 ProductFamilyEmo (eu.ggnet.dwoss.spec.ee.emo.ProductFamilyEmo)2 ProductModelEmo (eu.ggnet.dwoss.spec.ee.emo.ProductModelEmo)2 ProductModel (eu.ggnet.dwoss.spec.ee.entity.ProductModel)2 Test (org.junit.Test)2 ProductSeriesEmo (eu.ggnet.dwoss.spec.ee.emo.ProductSeriesEmo)1