Ignore:
Timestamp:
07/04/13 20:29:50 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • cleanup Instance management
    • extract Instance interface
    • extract Instance common algorithms to InstanceUtils?
  • fix closing issues: Ctrl+C or window close button

properly shutdown whole program

by Java Framsticks framework

  • fix parsing and printing of all request types
  • hide exception passing in special handle method of closures
    • substantially improve readability of closures
    • basically enable use of exception in asynchronous closures

(thrown exception is transported back to the caller)

  • implement call request on both sides

CHANGELOG:
Further improve calling.

Improve instance calling.

Calling is working on both sides.

Improve exception handling in testing.

Waiters do not supercede other apllication exception being thrown.

Finished parsing and printing of all request types (with tests).

Move implementation and tests of request parsing to Request.

Add tests for Requests.

Improve waits in asynchronours tests.

Extract more algorithms to InstanceUtils?.

Extract Instance.resolve to InstanceUtils?.

Improve naming.

Improve passing exception in InstanceClient?.

Hide calling of passed functor in StateCallback?.

Hide Exception passing in asynchronous closures.

Hide exception passing in Future.

Make ResponseCallback? an abstract class.

Make Future an abstract class.

Minor change.

Move getPath to Path.to()

Move bindAccess to InstanceUtils?.

Extract common things to InstanceUtils?.

Fix synchronization bug in Connection.

Move resolve to InstanceUtils?.

Allow names of Joinable to be dynamic.

Add support for set request server side.

More fixes in communication.

Fix issues with parsing in connection.

Cut new line characters when reading.

More improvements.

Migrate closures to FramsticksException?.

Several changes.

Extract resolveAndFetch to InstanceUtils? algorithms.

Test resolving and fetching.

More fixes with function signature deduction.

Do not print default values in SimpleAbstractAccess?.

Add test of FramsClass? printing.

Improve FramsticksException? messages.

Add explicit dispatcher synchronization feature.

Rework assertions in tests.

Previous solution was not generic enough.

Allow addition of joinables to collection after start.

Extract SimulatorInstance? from RemoteInstance?.

Remove PrivateJoinableCollection?.

Improve connections.

Move shutdown hook to inside the Monitor.

It should work in TestNG tests, but it seems that
hooks are not called.

In ServerTest? client connects to testing server.

Move socket initialization to receiver thread.

Add proper closing on Ctrl+C (don't use signals).

Fix bugs with server accepting connections.

Merge Entity into Joinable.

Reworking ServerInstance?.

Extract more algorithm to InstanceUtils?.

Extract some common functionality from AbstractInstance?.

Functions were placed in InstanceUtils?.

Hide registry of Instance.

Use ValueParam? in Instance interface.

Minor change.

Extract Instance interface.

Old Instance is now AbstractInstance?.

Location:
java/main/src/test/java/com/framsticks/gui
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/test/java/com/framsticks/gui/BrowserBaseTest.java

    r90 r96  
    99import org.fest.swing.fixture.FrameFixture;
    1010import org.fest.swing.fixture.JTreeFixture;
    11 import org.testng.annotations.AfterClass;
    12 import org.testng.annotations.BeforeClass;
    1311import org.testng.annotations.Test;
    1412
    15 import com.framsticks.test.TestConfiguration;
    16 import com.framsticks.util.dispatching.Monitor;
     13import com.framsticks.test.MonitorBasedTest;
     14import com.framsticks.util.dispatching.Joinable;
    1715
    1816import static org.fest.assertions.Assertions.assertThat;
     
    2220
    2321@Test
    24 public abstract class BrowserBaseTest extends TestConfiguration {
     22public abstract class BrowserBaseTest extends MonitorBasedTest {
    2523
    2624        private static final Logger log = Logger.getLogger(BrowserTest.class);
    2725
    28         protected Monitor monitor;
    2926        protected Browser browser;
    3027        protected static Robot robot;
     
    3936        }
    4037
    41         @BeforeClass(timeOut = 5000)
    42         public void setUp() {
     38        @Override
     39        protected Joinable createSubject() {
     40                configureBrowser();
     41                return browser;
     42        }
    4343
    44                 configureBrowser();
    45 
    46                 monitor = new Monitor(browser);
    47 
    48                 monitor.use();
    49 
     44        protected void setUpAfterUse() {
    5045                frame = new FrameFixture(robot,
    5146                                GuiActionRunner.execute(new GuiQuery<JFrame>() {
     
    5752
    5853                tree = frame.tree("tree");
     54
    5955                log.debug("frame fixture done");
    6056        }
     57
    6158
    6259        protected abstract void configureBrowser();
     
    7168        }
    7269
    73         @AfterClass(timeOut = 5000)
    74         public void tearDown() {
    75                 monitor.drop().join();
    76         }
    77 
    7870}
  • java/main/src/test/java/com/framsticks/gui/BrowserTest.java

    r90 r96  
    1010
    1111import com.framsticks.model.ModelPackage;
    12 import com.framsticks.remote.RemoteInstance;
     12import com.framsticks.remote.SimulatorInstance;
    1313
    1414public class BrowserTest extends BrowserBaseTest {
     
    1616        private static final Logger log = Logger.getLogger(BrowserTest.class);
    1717
    18         RemoteInstance localhost;
     18        SimulatorInstance localhost;
    1919
    2020        @Override
     
    2222                browser = new Browser();
    2323
    24                 localhost = new RemoteInstance();
     24                localhost = new SimulatorInstance();
    2525                localhost.setName("localhost");
    2626                localhost.setAddress("localhost:9009");
  • java/main/src/test/java/com/framsticks/gui/ObjectInstanceBrowserTest.java

    r90 r96  
    1111import com.framsticks.parsers.XmlLoader;
    1212import com.framsticks.util.dispatching.RunAt;
     13
     14import static com.framsticks.core.InstanceUtils.*;
    1315
    1416@Test
     
    2931        @Test(timeOut = 10000)
    3032        public void testShow() {
    31                 assertDispatch(instance, new RunAt<Instance>() {
     33                instance.dispatch(new RunAt<Instance>() {
    3234                        @Override
    3335                        public void run() {
     
    4042                clickAndExpandPath("model/parts/2");
    4143
    42                 assertDispatch(instance, new RunAt<Instance>() {
     44                instance.dispatch(new RunAt<Instance>() {
    4345                        @Override
    4446                        public void run() {
    45                                 assertThat(instance.bindAccess("/parts/2").getFramsClass().getParamEntry("m", FloatParam.class).getMax(Double.class)).isEqualTo(999.0);
     47                                assertThat(bindAccess(instance, "/parts/2").getFramsClass().getParamEntry("m", FloatParam.class).getMax(Double.class)).isEqualTo(999.0);
    4648                        }
    4749                });
  • java/main/src/test/java/com/framsticks/gui/ProcedureBrowserTest.java

    r90 r96  
    1616import com.framsticks.test.TestClass;
    1717import com.framsticks.util.dispatching.RunAt;
     18import static com.framsticks.core.InstanceUtils.*;
    1819
    1920@Test
     
    3435        @Test(timeOut = 10000)
    3536        public void testShow() {
    36                 assertDispatch(instance, new RunAt<Instance>() {
     37                instance.dispatch(new RunAt<Instance>() {
    3738                        @Override
    3839                        public void run() {
     
    4344                clickAndExpandPath("test");
    4445
    45                 assertDispatch(instance, new RunAt<Instance>() {
     46                instance.dispatch(new RunAt<Instance>() {
    4647                        @Override
    4748                        public void run() {
    48                                 assertThat(instance.bindAccess("/").getFramsClass().getParam("history")).isInstanceOf(StringParam.class);
     49                                assertThat(bindAccess(instance, "/").getFramsClass().getParam("history")).isInstanceOf(StringParam.class);
    4950                        }
    5051                });
     
    5253                // monitor.useFor(4.0);
    5354
    54                 assertDispatch(instance, new RunAt<Instance>() {
     55                instance.dispatch(new RunAt<Instance>() {
    5556                        @Override
    5657                        public void run() {
    57                                 AccessInterface access = instance.bindAccess("/");
     58                                AccessInterface access = bindAccess(instance, "/");
    5859                                assertThat(access).isInstanceOf(ReflectionAccess.class);
    5960                                FramsClass framsClass = access.getFramsClass();
     
    7475                waitForIdle();
    7576
    76                 assertDispatch(instance, new RunAt<Instance>() {
     77                instance.dispatch(new RunAt<Instance>() {
    7778                        @Override
    7879                        public void run() {
    79                                 assertThat(instance.bindAccess("/").get("history", String.class)).isEqualTo("argument|");
     80                                assertThat(bindAccess(instance, "/").get("history", String.class)).isEqualTo("argument|");
    8081                        }
    8182                });
     
    8485                waitForIdle();
    8586
    86                 assertDispatch(instance, new RunAt<Instance>() {
     87                instance.dispatch(new RunAt<Instance>() {
    8788                        @Override
    8889                        public void run() {
    89                                 assertThat(instance.bindAccess("/").get("history", String.class)).isEqualTo("");
     90                                assertThat(bindAccess(instance, "/").get("history", String.class)).isEqualTo("");
    9091                        }
    9192                });
Note: See TracChangeset for help on using the changeset viewer.