Search in sources :

Example 16 with SubMonitor

use of eu.ggnet.dwoss.progress.SubMonitor in project dwoss by gg-net.

the class SubMonitorUnitTest method testChildChain.

@Test
public void testChildChain() {
    JUnitMonitor m = new JUnitMonitor(1000);
    SubMonitor sm = SubMonitor.convert(m);
    sm.setWorkRemaining(500);
    sm.start();
    sm.worked(100);
    m.testRemaining(800, 2);
    SubMonitor c1 = SubMonitor.convert(sm.newChild(200));
    c1.setWorkRemaining(800);
    c1.worked(100);
    m.testRemaining(750, 2);
    c1.worked(100);
    m.testRemaining(700, 2);
    SubMonitor c2 = SubMonitor.convert(c1.newChild(400));
    c2.setWorkRemaining(100);
    c2.worked(50);
    m.testRemaining(600, 1);
    c2.finish();
    m.testRemaining(500, 1);
}
Also used : SubMonitor(eu.ggnet.dwoss.progress.SubMonitor) Test(org.junit.Test)

Example 17 with SubMonitor

use of eu.ggnet.dwoss.progress.SubMonitor in project dwoss by gg-net.

the class SubMonitorUnitTest method testBarSmall.

@Test
public void testBarSmall() {
    JUnitMonitor jm = new JUnitMonitor(10);
    SubMonitor subM = SubMonitor.convert(jm);
    subM.setWorkRemaining(1000);
    for (int i = 0; i < 600; i++) {
        subM.worked(1);
    }
    jm.testRemaining(4, 1);
}
Also used : SubMonitor(eu.ggnet.dwoss.progress.SubMonitor) Test(org.junit.Test)

Example 18 with SubMonitor

use of eu.ggnet.dwoss.progress.SubMonitor in project dwoss by gg-net.

the class SubMonitorUnitTest method testBarValues2.

@Test
public void testBarValues2() {
    JUnitMonitor m2 = new JUnitMonitor(10);
    SubMonitor sm = SubMonitor.convert(m2);
    m2.testRemaining(10, 1);
    sm.setWorkRemaining(20);
    sm.worked(6);
    m2.testRemaining(7, 1);
    sm.setWorkRemaining(10);
    sm.worked(6);
    m2.testRemaining(3, 2);
    sm.worked(4);
    m2.testRemaining(0, 1);
}
Also used : SubMonitor(eu.ggnet.dwoss.progress.SubMonitor) Test(org.junit.Test)

Example 19 with SubMonitor

use of eu.ggnet.dwoss.progress.SubMonitor in project dwoss by gg-net.

the class SubMonitorUnitTest method testBar.

@Test
public void testBar() {
    JUnitMonitor m = new JUnitMonitor(1000);
    SubMonitor sm = SubMonitor.convert(m);
    sm.title("Der Testtask");
    sm.start();
    sm.message("Message One");
    sm.setWorkRemaining(1000);
    for (int i = 0; i < 400; i++) {
        sm.worked(1);
    }
    m.testConsumed(400, 2);
    sm.setWorkRemaining(20);
    sm.message("Message Two");
    for (int i = 0; i < 10; i++) {
        sm.worked(1);
    }
    m.testRemaining(300, 1);
    sm.message("Message Three");
    sm.setWorkRemaining(100);
    for (int i = 0; i < 70; i++) {
        sm.worked(1);
    }
    m.testRemaining(90, 1);
    sm.message("Message Four");
    sm.finish();
}
Also used : SubMonitor(eu.ggnet.dwoss.progress.SubMonitor) Test(org.junit.Test)

Example 20 with SubMonitor

use of eu.ggnet.dwoss.progress.SubMonitor in project dwoss by gg-net.

the class SubMonitorUnitTest method testConvert.

@Test
public void testConvert() {
    JUnitMonitor m = new JUnitMonitor(1000);
    SubMonitor sm = SubMonitor.convert(m, "Bla", 100);
    sm.start();
    m.testRemaining(1000, 1);
    sm.worked(50);
    m.testRemaining(500, 1);
}
Also used : SubMonitor(eu.ggnet.dwoss.progress.SubMonitor) Test(org.junit.Test)

Aggregations

SubMonitor (eu.ggnet.dwoss.progress.SubMonitor)63 UniqueUnitEao (eu.ggnet.dwoss.uniqueunit.ee.eao.UniqueUnitEao)23 UniqueUnit (eu.ggnet.dwoss.uniqueunit.ee.entity.UniqueUnit)21 FileJacket (eu.ggnet.dwoss.util.FileJacket)18 Document (eu.ggnet.dwoss.redtape.ee.entity.Document)16 Product (eu.ggnet.dwoss.uniqueunit.ee.entity.Product)14 StockUnitEao (eu.ggnet.dwoss.stock.ee.eao.StockUnitEao)12 File (java.io.File)12 StockUnit (eu.ggnet.dwoss.stock.ee.entity.StockUnit)11 UiCustomer (eu.ggnet.dwoss.customer.opi.UiCustomer)9 ProductEao (eu.ggnet.dwoss.uniqueunit.ee.eao.ProductEao)8 MonitorFactory (eu.ggnet.dwoss.progress.MonitorFactory)7 Inject (javax.inject.Inject)7 Test (org.junit.Test)7 PriceEngineResult (eu.ggnet.dwoss.price.engine.PriceEngineResult)6 DocumentEao (eu.ggnet.dwoss.redtape.ee.eao.DocumentEao)6 CCalcDocument (eu.ggnet.lucidcalc.CCalcDocument)6 CFormat (eu.ggnet.lucidcalc.CFormat)6 CSheet (eu.ggnet.lucidcalc.CSheet)6 STable (eu.ggnet.lucidcalc.STable)6