Commit graph

134 commits

Author SHA1 Message Date
Chris Beams
935785e611
Organize imports 2014-11-10 00:44:48 +01:00
Chris Beams
b5f95e00a3
Supply appName via properties as well
Like all other command-line options and/or configuration file
properties, appName is now parsed for early in #main and its value
(default or custom) is then used to populate the Properties object made
available to all Guice modules. See the previous commit for additional
details.
2014-11-09 23:42:57 +01:00
Chris Beams
162fc3da0e
Favor use of Properties vs. for configuration
This reverts a number of changes made in commit 3033a19. Primary changes
include:

 - Restoring the immutability of the Node class

 - The argparse4j Namespace object is no longer passed down through
   Guice modules

 - Instead, arguments are eagerly read from the Namespace object by the
   #main method and these values are used to populate the Properties
   object that is already supplied to each Guice module

Other changes include:

 - The addition of a BootstrapNodes#DEFAULT_BOOTSTRAP_NODE field as
   a convenient alias to BootstrapNodes#DIGITAL_OCEAN_1 (or whatever the
   future default bootstrap node may be)

 - A Node#getPortAsString method has been added for convenience when
   dealing with String-based properties

 - A variant of the Node#at static factory method has been added which
   accepts the port value as a String vs. an int--again this is for
   convenience when dealing with String-based properties

 - Tests have been added to NodeTests to reflect the above
2014-11-09 23:14:46 +01:00
Chris Beams
017ebb3f38
Polish whitespace
Run "Reformat code" and "Optimize Imports" from within IDEA, cleaning up
trailing whitespace and other issues.
2014-11-09 23:10:58 +01:00
Manfred Karrer
d9372383bf Fix test 2014-11-08 16:38:09 +01:00
Manfred Karrer
3033a19b46 Change default port, Add ip to args, pass namespace to messageModule 2014-11-08 16:28:49 +01:00
Manfred Karrer
d72d7299df Add missing RepeatRule, Simplify SeedNodeForTesting 2014-11-07 18:33:59 +01:00
Manfred Karrer
089be0ca16 Use compatible version with latest TomP2P lib 2014-11-07 00:58:24 +01:00
Chris Beams
5d56dc62c9
Merge branch 'wip-cbeams'
Additional changes during the process of isolating TomP2P. High-level
changes include:

 - Beginning to break up the monolithic MessageFacade into modular
   repository classes, starting with the OfferRepository interface and
   its TomP2P implementation

 - Major refactoring of the CreateOfferCoordinator class, eliminating
   the never-completely-implemented resume logic. This class still needs
   quite a bit of work, but it's now considerably simpler than it was

 - Refactoring the Node and BootstrapNode types for greater clarity and
   ease of use

 - Most classes that use the net.tomp2p API have been moved into tomp2p
   subpackages, e.g. io.bitsquare.offer.tomp2p. Classes within have been
   made package private wherever possible.

 - The Guice module structure has evolved. For example, note the
   relationship between offer.OfferModule and offer.tomp2p.TomP2POfferModule,
   and note how the latter is consumed by app.AppModule. This arrangement
   provides for clear contracts as to what is required to assemble a
   functioning Bitsquare application, while allowing implementation-specific
   modules to be swapped in and out with ease and still allowing
   implementation-specific classes to remain package-private.

See extended commit comments for further details.

* wip-cbeams:
  Rename io.bitsquare.{Abstract=>}BitsquareModule
  Move io.bitsquare.{network=>util}.tomp2p.BaseFutureUtil
  Introduce app.gui.MainModule
  Optimize imports
  Introduce io.bitsquare.msg.tomp2p package
  Introduce io.bitsquare.offer.tomp2p package
  Extract isSuccess(BaseFuture) method into util class
  Remove offer creation recovery from CreateOfferCoordinator
  Remove unused MessageFacade from CreateOfferCoordinator
  Inline BroadCastOfferFeeTx#run into CreateOfferCoordinator
  Inline CreateOfferFeeTx#run into CreateOfferCoordinator
  Replace VerifyOffer class with Offer#validate method
  Inline CreateOfferCoordinator#onFailed
  Rename methods used to implement *Handler lambdas
  Rename *Handler methods
  Move generic *Handler types to new util.task package
  Replace AddOfferListener Result/Fault handlers
  Introduce OfferRepository interface and TomP2P impl
2014-11-06 17:05:01 +01:00
Chris Beams
486cd9824e
Introduce app.gui.MainModule 2014-11-06 16:58:23 +01:00
Chris Beams
21098afd45
Optimize imports 2014-11-06 16:58:22 +01:00
Chris Beams
96fa93f608
Introduce io.bitsquare.msg.tomp2p package 2014-11-06 16:58:20 +01:00
Manfred Karrer
1dde1f361f Use compatible version with latest TomP2P lib 2014-11-06 16:43:09 +01:00
Chris Beams
e201bf88ce
Rename i.b.network.{BootstrapNode=>BootstrapNodes} 2014-11-06 14:00:36 +01:00
Chris Beams
640a736ec3
Repeat TomP2PTests tests using @Repeat vs. loops 2014-11-06 13:17:54 +01:00
Chris Beams
1a92b05bf4
Introduce @Repeat and RepeatRule for repeatable @Test methods
With thanks to original author Frank Appel (@fappel)

See:
 - https://gist.github.com/fappel/8bcb2aea4b39ff9cfb6e
 - http://www.codeaffine.com/2013/04/10/running-junit-tests-repeatedly-without-loops/
2014-11-06 13:17:28 +01:00
Chris Beams
8b6f0ac64e
Refactor TomP2PTests
- Introduce use of Node abstraction for concision
 - Use to BootstrapNode#LOCALHOST and #DIGITAL_OCEAN1 vs. repeating info
 - Make all configuration variables static and final constants
2014-11-06 13:17:28 +01:00
Chris Beams
655100e69f
Introduce Node#at static factory and NodeTests 2014-11-06 11:25:52 +01:00
Chris Beams
da163bcc97
Introduce io.bitsquare.network.Node#DEFAULT_PORT 2014-11-06 11:25:51 +01:00
Manfred Karrer
4fb8030a43 Add loops, add extra SeedNode class, remove LanTest class 2014-11-05 20:41:34 +01:00
Manfred Karrer
bcaa8b9946 Fix random ports 2014-11-05 17:02:26 +01:00
Manfred Karrer
96f8a6c281 Use @Ignore 2014-11-05 16:47:12 +01:00
Manfred Karrer
ef68e08b50 Fix return value 2014-11-05 16:44:59 +01:00
Manfred Karrer
c8a470fb7b Add test with pong reply 2014-11-05 16:20:07 +01:00
Manfred Karrer
25be5bdbe1 Finished tests for localhost case 2014-11-05 15:37:27 +01:00
Manfred Karrer
afe7ec295b Add shutdown method 2014-11-05 15:09:37 +01:00
Manfred Karrer
879c5ca244 Use @Ignore for class, add Put test 2014-11-05 15:06:04 +01:00
Manfred Karrer
5533be6e57 Rename to TomP2PTests, add logs 2014-11-05 14:59:59 +01:00
Manfred Karrer
7fa631dfde Refactor tests (WIP) 2014-11-05 14:45:50 +01:00
Manfred Karrer
28b6e0ad9d WIP 2014-11-05 02:05:42 +01:00
Manfred Karrer
58da80ca2d Add bootstrapping methods 2014-11-05 02:05:42 +01:00
Chris Beams
dc7d861f8e
Rename io.bitsquare.{=>gui}.FatalException
Localize this exception within the gui package for now, as it's the only
place where it's used at the moment.
2014-11-05 01:13:31 +01:00
Chris Beams
55ef0b43d7
Rename io.bitsquare.{di=>app}.BitsquareModule 2014-11-05 01:13:30 +01:00
Chris Beams
11b6a4a341
Remove BitsquareTestSuite
This class is unnecessary; Gradle runs all JUnit test classes by
default, and IDEA and other IDEs automatically detect JUnit test classes
as well.
2014-11-05 01:13:28 +01:00
Chris Beams
fe3985a510
Rename io.bitsquare.{util=>gui}.ViewLoader 2014-11-05 01:13:28 +01:00
Chris Beams
865cf39e64
Remove static access to Bitsquare#getAppName 2014-11-05 01:13:26 +01:00
Chris Beams
6f27c5ce29
Remove static access to BitsquareUI#getPrimaryStage
- Bind BitsquareUI#start's primaryStage for DI
 - Statically inject primaryStage directly into Help and Popups
2014-11-05 01:13:25 +01:00
Chris Beams
6f830d20c9
Introduce ViewLoaderTest and FxmlResource interface
Tests basic loading of FXML resources via the ViewLoader API. Also
introduces the FxmlResource abstraction, an interface which the
Nagivation.Items enum now implements. This simplifies the process of
testing, e.g. in this case testing a non-existent resource without
having to add a bogus value to the enum itself.

Note the @BeforeClass logic necessary to initialize the JavaFX platform.
This is necessary in order to avoid "Toolkit not initialized"
exceptions. See http://stackoverflow.com/q/11385604 for details.
2014-11-05 01:13:21 +01:00
Chris Beams
c71d9a0fb8
Remove UI test runner classes and .fxml files
These classes were used during individual screen creation but are now
effectively dead test code.
2014-11-05 01:13:18 +01:00
Chris Beams
830932d93d
Strip trailing whitespace 2014-11-03 12:33:41 +01:00
Manfred Karrer
4e5fbb5f0b Add chaching flag to tests 2014-11-02 20:36:20 +01:00
Manfred Karrer
03f158f61d Use testnet and server seed as default, fix logs 2014-11-01 14:38:20 +01:00
Manfred Karrer
0831052d77 Update UtilsDHT2 2014-10-31 18:43:01 +01:00
Chris Beams
00af59aa20
Introduce network package and Peer abstraction
Prior to this change, TomP2P's 'PeerAddress' was used heavily throughout
Bitsquare, effectively tying many parts of the system to the TomP2P API
when they otherwise had no need to be aware of TomP2P at all.

The Peer interface (and the new 'network' package to which it belongs)
is designed to provide this missing abstraction and is a step toward
isolating TomP2P functionality as completely as possible--so as to make
the latter easy to test (and easy to replace if necessary).

A very simple TomP2PPeer implementation of the Peer interface has been
provided in the new 'network.tomp2p' package. It is currently just a
wrapper for an underlying PeerAddress object, but it is reasonable to
expect that more functionality will find its way into this class over
time.
2014-10-30 16:52:46 +01:00
Chris Beams
88951d71b8
Capitalize 'Bitsquare' consistently 2014-10-30 15:52:19 +01:00
Manfred Karrer
9c8b76d2b6 Update to latest TomP2P master 2014-10-27 15:09:52 +01:00
Manfred Karrer
52da080f22 Add simple Seednode for testing 2014-10-26 16:32:53 +01:00
Manfred Karrer
1184476448 Rename orders to portfolio, orderbook to offerbook 2014-10-25 01:25:01 +02:00
Manfred Karrer
68387eb13d Rename orders to portfolio, orderbook to offerbook 2014-10-25 01:18:38 +02:00
Manfred Karrer
12bbfd91f2 Updae for port forwarding 2014-10-24 23:38:04 +02:00