Commit graph

7 commits

Author SHA1 Message Date
Trevor Parscal 2cee2adb6d Split node factory into dm specific implementation
* Added support for asking if a given node type can have children or grandchildren and what types of nodes can be it's parent or child
* Removed canHaveChildren methods from leaf and branch nodes and converted use of them to depend on factory to read static rules from constructor lookup by type

Change-Id: I9769f95647066576416bacb791c4b68dd0285b35
2012-04-30 15:42:36 -07:00
Trevor Parscal b1d0ed052d Added more canHaveChildren tests
These are needed to make sure the base classes behave correctly, the ones in sub classes are needed to make sure the prototypes of the base class are correctly inherited

Change-Id: I334cc3ce1c4c0ce2eed23c79e8877332a953f7c3
2012-04-30 14:43:02 -07:00
Trevor Parscal d4a99f2d26 Removed "prototype." prefix from test names
Change-Id: I9d8993c95782b700d0b8b45b253a3c4c689381a5
2012-04-27 11:03:08 -07:00
Trevor Parscal 3d6391419d Added more nodes and removed canHave[Grandc|C]hildren methods
Replacing them with static members on each node type

Change-Id: I455debf880bef4e280eea072364f5f57308ec2b1
2012-04-20 16:34:47 -07:00
Trevor Parscal fd49e8df32 Added more tests for ve.*Node and ve.dm.*Node classes
In this commit several methods (child node add/remove and parent/root modification) were also moved to ve.dm.BranchNode ve.dm.Node respectively. ve.Node and ve.BranchNode are immutable. ve.dm.Node and ve.dm.BranchNode are mutable. Other subclasses of ve.Node and ve.BranchNode should implement functionality to mimic changes made to a data model.

Change-Id: Ia9ff78764f8f50f99fc8f9f9593657c0a0bf287e
2012-04-19 16:03:59 -07:00
Trevor Parscal c9ce7dbffe Added some basic coverage for ve.*Node classes
* prototype.canHaveChildren
* prototype.canHaveGrandchildren
* prototype.getType
* prototype.getParent
* prototype.getRoot
* prototype.setRoot
* prototype.attach
* prototype.detach

Change-Id: I920f7c9504e467f4818df537608760165c28d432
2012-04-19 14:43:58 -07:00
Trevor Parscal b16ed2b12d Setup tests, which are still empty
Had to fix a few namespace typos too

Change-Id: I3ebdc418f374bd3e151c516e1c0cfe85398772f0
2012-04-19 14:17:59 -07:00