Search in sources :

Example 1 with StockAgent

use of eu.ggnet.dwoss.stock.ee.StockAgent in project dwoss by gg-net.

the class AnnulationViewTryout method main.

public static void main(String[] args) {
    StockAgent stockStub = mock(StockAgent.class);
    Dl.remote().add(StockAgent.class, stockStub);
    Position p1 = Position.builder().amount(1).name("P1").price(12.).tax(1.19).build();
    Position p2 = Position.builder().amount(1).name("P2").price(20.).tax(1.19).build();
    Position p3 = Position.builder().amount(1).name("P3").price(13.24).tax(1.19).build();
    Position p4 = Position.builder().amount(1).name("P4").price(400.).tax(1.19).build();
    Position p5 = Position.builder().amount(1).name("P5").price(1234.).tax(1.19).build();
    List<AfterInvoicePosition> positions = new ArrayList<>();
    positions.add(new AfterInvoicePosition(p1));
    positions.add(new AfterInvoicePosition(p2));
    positions.add(new AfterInvoicePosition(p3));
    positions.add(new AfterInvoicePosition(p4));
    positions.add(new AfterInvoicePosition(p5));
    CreditMemoView view = new CreditMemoView(positions);
    OkCancelDialog<CreditMemoView> dialog = new OkCancelDialog<>("Test", view);
    dialog.setVisible(true);
    System.out.println(view.getPositions());
    System.exit(0);
}
Also used : AfterInvoicePosition(eu.ggnet.dwoss.redtapext.ui.cao.document.AfterInvoicePosition) Position(eu.ggnet.dwoss.redtape.ee.entity.Position) AfterInvoicePosition(eu.ggnet.dwoss.redtapext.ui.cao.document.AfterInvoicePosition) StockAgent(eu.ggnet.dwoss.stock.ee.StockAgent) ArrayList(java.util.ArrayList) OkCancelDialog(eu.ggnet.dwoss.util.OkCancelDialog) CreditMemoView(eu.ggnet.dwoss.redtapext.ui.cao.document.annulation.CreditMemoView)

Example 2 with StockAgent

use of eu.ggnet.dwoss.stock.ee.StockAgent in project dwoss by gg-net.

the class ConsumerFactoryOfStockTransactions method of.

@Override
public List<DescriptiveConsumer<PicoUnit>> of(PicoUnit t) {
    StockAgent stockAgent = Dl.remote().lookup(StockAgent.class);
    StockUnit su = stockAgent.findStockUnitByUniqueUnitIdEager(t.uniqueUnitId);
    if (su == null || su.isInTransaction())
        return Collections.EMPTY_LIST;
    Guardian guardian = Dl.local().lookup(Guardian.class);
    if (!guardian.hasRight(CREATE_TRANSACTION_FOR_SINGLE_UNIT))
        return Collections.EMPTY_LIST;
    return stockAgent.findAll(Stock.class).stream().filter(s -> !s.equals(su.getStock())).map(destination -> {
        return new DescriptiveConsumer<>("Umfuhr von " + su.getStock().getName() + " nach " + destination.getName(), (PicoUnit t1) -> {
            Ui.exec(() -> {
                Ui.build().dialog().eval(() -> new CreateQuestionModel(su, destination, "Umfuhr direkt durch Nutzer erzeugt"), () -> new CreateQuestionView()).opt().map(v -> ReplyUtil.wrap(() -> Dl.remote().lookup(StockTransactionProcessor.class).perpareTransfer(v.stockUnits, v.destination.getId(), Dl.local().lookup(Guardian.class).getUsername(), v.comment))).filter(Ui.failure()::handle).ifPresent(u -> Ui.build().alert("Umfuhr angelegt"));
            });
        });
    }).collect(Collectors.toList());
}
Also used : StockTransactionProcessor(eu.ggnet.dwoss.stock.ee.StockTransactionProcessor) DescriptiveConsumer(eu.ggnet.saft.core.ops.DescriptiveConsumer) StockUnit(eu.ggnet.dwoss.stock.ee.entity.StockUnit) PicoUnit(eu.ggnet.dwoss.uniqueunit.api.PicoUnit) Ui(eu.ggnet.saft.Ui) Collectors(java.util.stream.Collectors) Dl(eu.ggnet.saft.Dl) StockAgent(eu.ggnet.dwoss.stock.ee.StockAgent) Guardian(eu.ggnet.saft.core.auth.Guardian) List(java.util.List) ReplyUtil(eu.ggnet.dwoss.common.ReplyUtil) Stock(eu.ggnet.dwoss.stock.ee.entity.Stock) DescriptiveConsumerFactory(eu.ggnet.saft.core.ops.DescriptiveConsumerFactory) CREATE_TRANSACTION_FOR_SINGLE_UNIT(eu.ggnet.dwoss.rights.api.AtomicRight.CREATE_TRANSACTION_FOR_SINGLE_UNIT) Collections(java.util.Collections) StockAgent(eu.ggnet.dwoss.stock.ee.StockAgent) Guardian(eu.ggnet.saft.core.auth.Guardian) PicoUnit(eu.ggnet.dwoss.uniqueunit.api.PicoUnit) StockUnit(eu.ggnet.dwoss.stock.ee.entity.StockUnit)

Example 3 with StockAgent

use of eu.ggnet.dwoss.stock.ee.StockAgent in project dwoss by gg-net.

the class SalesChannelManager method testSalesChannelManager.

@Test
public void testSalesChannelManager() {
    try {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (ClassNotFoundException | IllegalAccessException | InstantiationException | UnsupportedLookAndFeelException ex) {
    }
    final Stock laden = new Stock(0, "Laden");
    final Stock lager = new Stock(1, "Lager");
    Dl.remote().add(StockAgent.class, new StockAgent() {

        @Override
        public <T> List<T> findAll(Class<T> entityClass) {
            if (entityClass.equals(Stock.class))
                return (List<T>) Arrays.asList(laden, lager);
            return null;
        }

        // <editor-fold defaultstate="collapsed" desc="properties">
        @Override
        public StockUnit findStockUnitByUniqueUnitIdEager(Integer uniqueUnitId) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

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

        @Override
        public List<StockTransaction> findStockTransactionEager(StockTransactionType type, StockTransactionStatusType statusType) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public List<StockTransaction> findStockTransactionEager(StockTransactionType type, StockTransactionStatusType statusType, int start, int amount) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public List<StockUnit> findStockUnitsByRefurbishIdEager(List<String> refurbishIds) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

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

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

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

        @Override
        public StockTransaction findOrCreateRollInTransaction(int stockId, String userName, String comment) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @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, 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.");
        }
    });
    JFrame f = new JFrame();
    SalesChannelManagerDialog dialog = new SalesChannelManagerDialog(f);
    List<SalesChannelLine> lines = new ArrayList<>();
    lines.add(new SalesChannelLine(0, "22231", "Acer Aspire 3222-üäö", "gebraucht", 10, 10, "Lager", SalesChannel.UNKNOWN, lager.getId()));
    lines.add(new SalesChannelLine(1, "23212", "Acer Aspire 5102WLMi-€", "gebraucht", 10, 10, "Lager", SalesChannel.RETAILER, lager.getId()));
    lines.add(new SalesChannelLine(2, "43521", "Acer Aspire X3200", "gebraucht", 10, 10, "Lager", SalesChannel.RETAILER, lager.getId()));
    lines.add(new SalesChannelLine(4, "58247", "Acer Aspire One A150X blau", "gebraucht", 10, 10, "Lager", SalesChannel.CUSTOMER, laden.getId()));
    lines.add(new SalesChannelLine(5, "82235", "Acer Aspire 8930G-583G32Bn", "gebraucht", 10, 10, "Lager", SalesChannel.CUSTOMER, laden.getId()));
    lines.add(new SalesChannelLine(6, "19262", "Acer Aspire 8920G-834G32Bn", "gebraucht", 10, 10, "Lager", SalesChannel.CUSTOMER, lager.getId()));
    lines.add(new SalesChannelLine(7, "17239", "Acer Aspire 7330-572G16Mn", "Originalkarton, nahezu neuwertig", 10, 10, "Lager", SalesChannel.UNKNOWN, lager.getId()));
    Map<SalesChannel, Stock> stockToChannel = new EnumMap<>(SalesChannel.class);
    stockToChannel.put(CUSTOMER, laden);
    stockToChannel.put(RETAILER, lager);
    dialog.setModel(new SalesChannelTableModel(lines, stockToChannel));
    Dimension dim = dialog.getToolkit().getScreenSize();
    Rectangle abounds = dialog.getBounds();
    dialog.setLocation((int) ((dim.width - abounds.width) / 3), (dim.height - abounds.height) / 2);
    dialog.setVisible(true);
    System.out.println("OK = " + dialog.isOk());
    Map<Stock, List<String>> destinationsWithStockUnitIds = lines.stream().filter(// No Destination change
    l -> l.getDestination() != null).sorted(// Sort
    new LastCharsRefurbishIdSorter()).collect(Collectors.groupingBy(SalesChannelLine::getDestination, Collectors.mapping(SalesChannelLine::getRefurbishedId, Collectors.toList())));
    for (Entry<Stock, List<String>> entry : destinationsWithStockUnitIds.entrySet()) {
        System.out.println(entry.getKey().getName() + ",refurbishIds=" + entry.getValue());
    }
    f.dispose();
}
Also used : Rectangle(java.awt.Rectangle) LastCharsRefurbishIdSorter(eu.ggnet.dwoss.misc.ee.SalesChannelHandlerOperation.LastCharsRefurbishIdSorter) SalesChannel(eu.ggnet.dwoss.rules.SalesChannel) SalesChannelTableModel(eu.ggnet.dwoss.misc.saleschannel.SalesChannelTableModel) StockTransactionType(eu.ggnet.dwoss.stock.ee.entity.StockTransactionType) StockUnit(eu.ggnet.dwoss.stock.ee.entity.StockUnit) StockTransactionStatusType(eu.ggnet.dwoss.stock.ee.entity.StockTransactionStatusType) StockTransaction(eu.ggnet.dwoss.stock.ee.entity.StockTransaction) SalesChannelManagerDialog(eu.ggnet.dwoss.misc.saleschannel.SalesChannelManagerDialog) Dimension(java.awt.Dimension) SalesChannelLine(eu.ggnet.dwoss.stock.ee.model.SalesChannelLine) StockAgent(eu.ggnet.dwoss.stock.ee.StockAgent) LockModeType(javax.persistence.LockModeType) Stock(eu.ggnet.dwoss.stock.ee.entity.Stock) Test(org.junit.Test)

Example 4 with StockAgent

use of eu.ggnet.dwoss.stock.ee.StockAgent in project dwoss by gg-net.

the class CreateSelectionTryout method tryout.

@Test
public void tryout() throws InterruptedException {
    JButton b = new JButton("Press to close");
    b.setPreferredSize(new Dimension(200, 50));
    CountDownLatch l = new CountDownLatch(1);
    b.addActionListener(e -> {
        l.countDown();
    });
    Dl.remote().add(StockAgent.class, new StockAgent() {

        @Override
        public <T> List<T> findAll(Class<T> entityClass) {
            if (entityClass.equals(Stock.class))
                return (List<T>) Arrays.asList(new Stock(0, "Rotes Lager"), new Stock(1, "Blaues Lager"));
            return null;
        }

        // <editor-fold defaultstate="collapsed" desc="Unused Methodes">
        @Override
        public StockUnit findStockUnitByUniqueUnitIdEager(Integer uniqueUnitId) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

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

        @Override
        public List<StockTransaction> findStockTransactionEager(StockTransactionType type, StockTransactionStatusType statusType) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public List<StockTransaction> findStockTransactionEager(StockTransactionType type, StockTransactionStatusType statusType, int start, int amount) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public List<StockUnit> findStockUnitsByRefurbishIdEager(List<String> refurbishIds) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

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

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

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

        @Override
        public StockTransaction findOrCreateRollInTransaction(int stockId, String userName, String comment) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @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, 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.");
        }
    });
    UiCore.startSwing(() -> b);
    Ui.exec(() -> {
        Ui.build().fxml().eval(CreateSelectionController.class).opt().ifPresent(System.out::println);
    });
    l.await();
}
Also used : JButton(javax.swing.JButton) Dimension(java.awt.Dimension) CountDownLatch(java.util.concurrent.CountDownLatch) StockTransactionType(eu.ggnet.dwoss.stock.ee.entity.StockTransactionType) StockAgent(eu.ggnet.dwoss.stock.ee.StockAgent) LockModeType(javax.persistence.LockModeType) List(java.util.List) StockUnit(eu.ggnet.dwoss.stock.ee.entity.StockUnit) Stock(eu.ggnet.dwoss.stock.ee.entity.Stock) StockTransactionStatusType(eu.ggnet.dwoss.stock.ee.entity.StockTransactionStatusType) StockTransaction(eu.ggnet.dwoss.stock.ee.entity.StockTransaction) Test(org.junit.Test)

Example 5 with StockAgent

use of eu.ggnet.dwoss.stock.ee.StockAgent in project dwoss by gg-net.

the class CreateSimpleActionTryout method tryout.

@Test
public void tryout() throws InterruptedException {
    JPanel p = new JPanel();
    JButton b = new JButton("Press to close");
    b.setPreferredSize(new Dimension(200, 50));
    CountDownLatch l = new CountDownLatch(1);
    b.addActionListener(e -> {
        l.countDown();
    });
    p.add(new JButton(new CreateSimpleAction()));
    p.add(b);
    Dl.remote().add(StockAgent.class, new StockAgent() {

        @Override
        public <T> List<T> findAll(Class<T> entityClass) {
            if (entityClass.equals(Stock.class))
                return (List<T>) Arrays.asList(new Stock(0, "Rotes Lager"), new Stock(1, "Blaues Lager"));
            return null;
        }

        @Override
        public List<StockUnit> findStockUnitsByRefurbishIdEager(List<String> refurbishIds) {
            if (refurbishIds.contains("1")) {
                Stock s = new Stock(0, "Lager1");
                StockUnit s1 = new StockUnit("1", "Gerät Eins", 1);
                s1.setStock(s);
                return Arrays.asList(s1);
            }
            return Collections.EMPTY_LIST;
        }

        // <editor-fold defaultstate="collapsed" desc="Unused Methodes">
        @Override
        public StockUnit findStockUnitByUniqueUnitIdEager(Integer uniqueUnitId) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

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

        @Override
        public List<StockTransaction> findStockTransactionEager(StockTransactionType type, StockTransactionStatusType statusType) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public List<StockTransaction> findStockTransactionEager(StockTransactionType type, StockTransactionStatusType statusType, int start, int amount) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

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

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

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

        @Override
        public StockTransaction findOrCreateRollInTransaction(int stockId, String userName, String comment) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @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, 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.");
        }
    });
    Dl.remote().add(StockTransactionProcessor.class, new StockTransactionProcessor() {

        @Override
        public SortedMap<Integer, String> perpareTransfer(List<StockUnit> stockUnits, int destinationStockId, String arranger, String comment) throws UserInfoException {
            SortedMap<Integer, String> r = new TreeMap<>();
            r.put(1, "1");
            return r;
        }

        // <editor-fold defaultstate="collapsed" desc="Unused Methodes">
        @Override
        public List<Integer> rollIn(List<StockTransaction> detachtedTransactions, String arranger) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public void cancel(StockTransaction transaction, String arranger, String comment) throws UserInfoException {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public void commission(List<StockTransaction> transactions, String picker, String deliverer) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public void receive(List<StockTransaction> transactions, String deliverer, String reciever) {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }

        @Override
        public void removeFromPreparedTransaction(String refurbishId, String arranger, String comment) throws UserInfoException {
            // To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }
    });
    Guardian guardianMock = mock(Guardian.class);
    given(guardianMock.getUsername()).willAnswer(i -> "Testuser");
    Dl.local().add(Guardian.class, guardianMock);
    UiCore.startSwing(() -> p);
    l.await();
}
Also used : JPanel(javax.swing.JPanel) JButton(javax.swing.JButton) StockTransactionType(eu.ggnet.dwoss.stock.ee.entity.StockTransactionType) Guardian(eu.ggnet.saft.core.auth.Guardian) StockUnit(eu.ggnet.dwoss.stock.ee.entity.StockUnit) StockTransactionStatusType(eu.ggnet.dwoss.stock.ee.entity.StockTransactionStatusType) StockTransaction(eu.ggnet.dwoss.stock.ee.entity.StockTransaction) Dimension(java.awt.Dimension) CountDownLatch(java.util.concurrent.CountDownLatch) StockAgent(eu.ggnet.dwoss.stock.ee.StockAgent) LockModeType(javax.persistence.LockModeType) UserInfoException(eu.ggnet.dwoss.util.UserInfoException) CreateSimpleAction(eu.ggnet.dwoss.stock.transactions.CreateSimpleAction) StockTransactionProcessor(eu.ggnet.dwoss.stock.ee.StockTransactionProcessor) Stock(eu.ggnet.dwoss.stock.ee.entity.Stock) Test(org.junit.Test)

Aggregations

StockAgent (eu.ggnet.dwoss.stock.ee.StockAgent)5 Stock (eu.ggnet.dwoss.stock.ee.entity.Stock)4 StockUnit (eu.ggnet.dwoss.stock.ee.entity.StockUnit)4 StockTransaction (eu.ggnet.dwoss.stock.ee.entity.StockTransaction)3 StockTransactionStatusType (eu.ggnet.dwoss.stock.ee.entity.StockTransactionStatusType)3 StockTransactionType (eu.ggnet.dwoss.stock.ee.entity.StockTransactionType)3 Dimension (java.awt.Dimension)3 LockModeType (javax.persistence.LockModeType)3 Test (org.junit.Test)3 StockTransactionProcessor (eu.ggnet.dwoss.stock.ee.StockTransactionProcessor)2 Guardian (eu.ggnet.saft.core.auth.Guardian)2 List (java.util.List)2 CountDownLatch (java.util.concurrent.CountDownLatch)2 JButton (javax.swing.JButton)2 ReplyUtil (eu.ggnet.dwoss.common.ReplyUtil)1 LastCharsRefurbishIdSorter (eu.ggnet.dwoss.misc.ee.SalesChannelHandlerOperation.LastCharsRefurbishIdSorter)1 SalesChannelManagerDialog (eu.ggnet.dwoss.misc.saleschannel.SalesChannelManagerDialog)1 SalesChannelTableModel (eu.ggnet.dwoss.misc.saleschannel.SalesChannelTableModel)1 Position (eu.ggnet.dwoss.redtape.ee.entity.Position)1 AfterInvoicePosition (eu.ggnet.dwoss.redtapext.ui.cao.document.AfterInvoicePosition)1