Ignore:
Timestamp:
07/02/13 16:20:07 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

CHANGELOG:
Make ProcedureParam? hold only ValueParams?.

Use id instead of names when naming gui components internally.

Basic procedure calling in GUI.

The actual procedure call is currently only backed
by the ObjectInstance?.

Add UnimplementedException?.

Improve naming of various gui elements.

Allow easy navigating in FEST Swing testing.

Add optional explicit order attribute to FramsClassAnnotation?.

That's because java reflection does return declared members
in any specific order. That ordering is needed only for
classes that have no representation in framsticks and need
a deterministic ordering of params.

Add ControlOwner? interface.

Add test for procedure calling in Browser.

First version of ParamAnnotation? for procedures.

Development of ProcedureParam?.

Add draft version of ProcedureParam? implementation in ReflectionAccess?.

Allow viewing FramsClasses? in gui Browser.

Extract ResourceBuilder? from ModelBuilder?.

Remove internalId from Param.

It was currently completely not utilised. Whether it is still needed
after introduction of ParamAnnotation? is arguable.

Add remaining param attributes to ParamAnnotation?.

Change AutoBuilder? semantics.

AutoBuilder? returns list of objects that are to be appended
with methods @AutoAppendAnnotation?.

This allows to omit explicit addition of ModelPackage? to instance
if the instance uses ModelBuilder? (registration of ModelPackage? comes
from schema).

Fix params ordering problem in auto created FramsClasses?.

Improve ObjectInstance?.

Several fixes to ModelBuilder?.

Improve test for ObjectInstance? in Browser.

Make initialization of robot static.

With robot recreated for second browser test, the test hanged
deep in AWT.

Add base convenience base test for Browser tests.

More tests to ObjectInstance?.

Rename Dispatcher.invokeLater() to dispatch().

Add assertDispatch.

It allows assertions in other threads, than TestNGInvoker.
Assertions are gathered after each method invocation and rethrown.

Use timeOut annotation attribute for tests involving some waiting.

Remove firstTask method (merge with joinableStart).

Clean up leftovers.

Remove unused FavouritesXMLFactory (the reading part is already
completely done with generic XmlLoader?, and writing part will be done
based on the same approach if needed).
Move UserFavourite? to the com.framsticks.gui.configuration package.

Remove GenotypeBrowser? as to specific.

This functionality will be available in ObjectInstance?.

Add interface ParamsPackage?.

Package containing registration of Java classes meant to use with
ReflectionAccess? may be in Instance using configuration.

Minor changes.

Make Group immutable.

Add AutoBuilder? interface extending Builder - only those would
be used to automatically build from XML.

Fix groups in FramsClass?.

Minor naming cleanup in Registry.

Add ModelComponent? interface.

All class creating the Model are implementing that interface.

Extract Model.build into ModelBuilder?.

ModelBuilder? will be compatible with other builders
and allow using it from configuration.

Fix NeuroConnection?.

Add synchronous get operation for dispatchers.

Rename JoinableMonitor? to Monitor.

Add ObjectInstance?.

This class is mainly for demonstration
and testing purposes.

Improve FramsServer? runner.

  • improve ExternalProcess? runner,
  • runner can kill the server but also react properly, when the server exists on it's own,
  • set default path to search for framsticks server installation,
  • add LoggingOutputListener?.
File:
1 edited

Legend:

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

    r88 r90  
    11package com.framsticks.gui;
    22
    3 import javax.swing.JFrame;
     3import static org.fest.assertions.Assertions.assertThat;
     4import static org.fest.swing.edt.GuiActionRunner.execute;
     5
    46
    57import org.apache.log4j.Logger;
    6 import org.fest.swing.edt.FailOnThreadViolationRepaintManager;
    7 import org.fest.swing.edt.GuiActionRunner;
    8 import org.fest.swing.edt.GuiQuery;
    98import org.fest.swing.edt.GuiTask;
    10 import org.fest.swing.fixture.FrameFixture;
    11 import org.fest.swing.fixture.JTreeFixture;
    12 // import static org.fest.swing.edt.GuiActionRunner.*;
    13 import org.testng.annotations.*;
     9import org.testng.annotations.Test;
    1410
     11import com.framsticks.model.ModelPackage;
    1512import com.framsticks.remote.RemoteInstance;
    16 import com.framsticks.test.TestConfiguration;
    17 import com.framsticks.util.dispatching.Dispatching;
    18 import com.framsticks.util.dispatching.JoinableMonitor;
    19 // import com.framsticks.util.dispatching.Dispatching;
    2013
    21 import static org.fest.assertions.Assertions.*;
    22 import static org.fest.swing.core.BasicRobot.robotWithNewAwtHierarchy;
    23 import static org.fest.swing.edt.GuiActionRunner.*;
    24 import org.fest.swing.core.Robot;
     14public class BrowserTest extends BrowserBaseTest {
    2515
    26 public class BrowserTest extends TestConfiguration {
    2716        private static final Logger log = Logger.getLogger(BrowserTest.class);
    2817
    29         JoinableMonitor monitor;
    30         Browser browser;
    31         Robot robot;
    32         FrameFixture frame;
     18        RemoteInstance localhost;
    3319
    34         @BeforeClass
    35         public void setUp() {
    36                 FailOnThreadViolationRepaintManager.install();
    37                 assertThat(executeInEDT()).isTrue();
     20        @Override
     21        protected void configureBrowser() {
     22                browser = new Browser();
    3823
    39                 robot = robotWithNewAwtHierarchy();
    40 
    41                 browser = new Browser();
    42                 monitor = new JoinableMonitor(browser);
    43 
    44                 RemoteInstance localhost = new RemoteInstance();
     24                localhost = new RemoteInstance();
    4525                localhost.setName("localhost");
    4626                localhost.setAddress("localhost:9009");
     27                localhost.usePackage(new ModelPackage());
    4728
    4829                browser.addInstance(localhost);
    4930
    50                 monitor.use();
    51                 // robot.waitForIdle();
    52                 frame = new FrameFixture(robot,
    53                                 GuiActionRunner.execute(new GuiQuery<JFrame>() {
    54                                         @Override
    55                                         protected JFrame executeInEDT() throws Throwable {
    56                                                 return browser.getMainFrame().getSwing();
    57                                         }
    58                                 }));
    59 
    60                 log.info("frame fixture done");
    61                 // frame.show();
    62                 // log.info("frame fixture shown");
    6331        }
    6432
    65         public void clickAndExpandPath(JTreeFixture tree, String path) {
    66                 tree.clickPath(path).expandPath(path);
    67                 robot.waitForIdle();
    68         }
    69 
    70         @Test
     33        @Test(timeOut = 10000)
    7134        public void testShow() {
    7235                log.info("testing");
    73                 JTreeFixture tree = frame.tree("tree");
    7436                tree.clickRow(0).expandRow(0);
    7537                robot.waitForIdle();
     
    8143                        @Override
    8244                        protected void executeInEDT() throws Throwable {
    83                                 assertThat(frame.panel("o Simulator").component().isVisible())
    84                                                 .isTrue();
     45                                assertThat(frame.panel("Simulator").component().isVisible()).isTrue();
    8546                        }
    8647                });
    8748
    88                 clickAndExpandPath(tree, "localhost/simulator/genepools");
    89                 clickAndExpandPath(tree, "localhost/simulator/genepools/groups");
    90                 clickAndExpandPath(tree, "localhost/simulator/genepools/groups/Genotypes");
     49                clickAndExpandPath("localhost/simulator/genepools");
     50                clickAndExpandPath("localhost/simulator/genepools/groups");
     51                clickAndExpandPath("localhost/simulator/genepools/groups/Genotypes");
     52        }
    9153
    9254
    9355
    94 
    95 
    96 
    97                 // tree.clickPath("localhost/simulator/genepools/groups/Genotypes/genotypes");
    98                 // robot.waitForIdle();
    99                 // sleep(2);
    100                 // tree.expandPath("localhost/simulator/genepools/groups/Genotypes/genotypes");
    101 
    102                 // tree.expandRow(tree.component().getLeadSelectionRow() + 1);
    103                 // robot.waitForIdle();
    104 
    105                 // sleep(2);
    106         }
    107 
    108 
    109         @AfterClass
    110         public void tearDown() {
    111                 log.info("before close");
    112 
    113                 monitor.drop();
    114 
    115                 Dispatching.joinAbsolutely(browser);
    116                 // frame.cleanUp();
    117                 // log.info("before close");
    118                 // browser.interrupt();
    119 
    120                 // try {
    121                 //      // frame.close();
    122                 // } catch (Throwable t) {
    123                 //      log.error("caught ", t);
    124                 // }
    125                 // log.info("after close");
    126                 // // frame.close();
    127                 // // frame.cleanUp();
    128 
    129 
    130 
    131                 // Dispatching.join(browser);
    132         }
    133 
    13456}
Note: See TracChangeset for help on using the changeset viewer.