Search in sources :

Example 1 with DesktopBundleView

use of eu.ggnet.dwoss.receipt.product.DesktopBundleView in project dwoss by gg-net.

the class DesktopBundleViewTryout method tryoutView.

@Test
public void tryoutView() throws InterruptedException {
    final ProductSpec spec = new SpecGenerator().makeSpec();
    DesktopBundleView view = new DesktopBundleView(new Mandators() {

        @Override
        public Mandator loadMandator() {
            return Mandator.builder().defaultMailSignature(null).smtpConfiguration(null).mailTemplateLocation(null).company(CompanyGen.makeCompany()).dossierPrefix("DW").documentIntermix(null).documentIdentifierGeneratorConfigurations(new EnumMap<>(DocumentType.class)).build();
        }

        @Override
        public DefaultCustomerSalesdata loadSalesdata() {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("loadSalesdata - Not supported yet.");
        }

        @Override
        public ReceiptCustomers loadReceiptCustomers() {
            return ReceiptCustomers.builder().build();
        }

        @Override
        public SpecialSystemCustomers loadSystemCustomers() {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("loadSystemCustomers - Not supported yet.");
        }

        @Override
        public Contractors loadContractors() {
            return new Contractors(EnumSet.of(TradeName.ALSO, TradeName.ACER), EnumSet.of(TradeName.ACER));
        }

        @Override
        public PostLedger loadPostLedger() {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("loadPostLedger - Not supported yet.");
        }

        @Override
        public ShippingTerms loadShippingTerms() {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("loadShippingTerms - Not supported yet.");
        }
    }, new SpecAgent() {

        @Override
        public ProductSpec findProductSpecByPartNoEager(String partNo) {
            if (partNo == null)
                return null;
            if (partNo.startsWith("X"))
                return null;
            spec.setPartNo(partNo);
            return spec;
        }

        // <editor-fold defaultstate="collapsed" desc="Unneeded Methods">
        @Override
        public <T> long count(Class<T> entityClass) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public <T> List<T> findAll(Class<T> entityClass) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public <T> List<T> findAll(Class<T> entityClass, int start, int amount) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public <T> List<T> findAllEager(Class<T> entityClass) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public <T> List<T> findAllEager(Class<T> entityClass, int start, int amount) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public <T> T findById(Class<T> entityClass, Object id) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public <T> T findById(Class<T> entityClass, Object id, LockModeType lockModeType) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public <T> T findByIdEager(Class<T> entityClass, Object id) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public <T> T findByIdEager(Class<T> entityClass, Object id, LockModeType lockModeType) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }
    }, new ProductProcessorStub(), TradeName.ACER, TradeName.ACER, ProductGroup.DESKTOP, ProductGroup.MONITOR);
    view.setSpec(new DesktopBundle());
    OkCancelDialog<DesktopBundleView> dialog = new OkCancelDialog<>("BundleView", view);
    dialog.setVisible(true);
    dialog.dispose();
}
Also used : ProductProcessorStub(eu.ggnet.dwoss.receipt.stub.ProductProcessorStub) SpecAgent(eu.ggnet.dwoss.spec.ee.SpecAgent) SpecGenerator(eu.ggnet.dwoss.spec.ee.assist.gen.SpecGenerator) OkCancelDialog(eu.ggnet.dwoss.util.OkCancelDialog) ProductSpec(eu.ggnet.dwoss.spec.ee.entity.ProductSpec) DesktopBundle(eu.ggnet.dwoss.spec.ee.entity.DesktopBundle) DesktopBundleView(eu.ggnet.dwoss.receipt.product.DesktopBundleView) Mandators(eu.ggnet.dwoss.mandator.Mandators) LockModeType(javax.persistence.LockModeType) Test(org.junit.Test)

Aggregations

Mandators (eu.ggnet.dwoss.mandator.Mandators)1 DesktopBundleView (eu.ggnet.dwoss.receipt.product.DesktopBundleView)1 ProductProcessorStub (eu.ggnet.dwoss.receipt.stub.ProductProcessorStub)1 SpecAgent (eu.ggnet.dwoss.spec.ee.SpecAgent)1 SpecGenerator (eu.ggnet.dwoss.spec.ee.assist.gen.SpecGenerator)1 DesktopBundle (eu.ggnet.dwoss.spec.ee.entity.DesktopBundle)1 ProductSpec (eu.ggnet.dwoss.spec.ee.entity.ProductSpec)1 OkCancelDialog (eu.ggnet.dwoss.util.OkCancelDialog)1 LockModeType (javax.persistence.LockModeType)1 Test (org.junit.Test)1