Skip to content

Commit

Permalink
feat: Add a way to send a notification to the user through a visualiz…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
jecisc committed Jul 4, 2022
1 parent 0a8eeb0 commit 908fcfb
Show file tree
Hide file tree
Showing 33 changed files with 1,606 additions and 1,611 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
smalltalk: [ Pharo64-6.1, Pharo64-7.0, Pharo64-8.0, Pharo64-9.0, Pharo64-10 ]
smalltalk: [ Pharo64-6.1, Pharo64-7.0, Pharo64-8.0, Pharo64-9.0 ]
name: ${{ matrix.smalltalk }}
steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ Examples can be found in the CytoscapeJs connector repository.
| Telescope version | Compatible Pharo versions |
|------------------- |--------------------------- |
| v1.x.x | Pharo 61, 70 |
| v2.x.x | Pharo 61, 70, 80, 90, 10 |
| development | Pharo 61, 70, 80, 90, 10 |
| v2.x.x | Pharo 61, 70, 80, 90 |
| development | Pharo 61, 70, 80, 90 |

## Contact

Expand Down
16 changes: 8 additions & 8 deletions src/Telescope-Core-Tests/ManifestTelescopeCoreTests.class.st
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"
I store metadata for this package. These meta data are used by other tools such as the SmalllintManifestChecker and the critics Browser
"
Class {
#name : #ManifestTelescopeCoreTests,
#superclass : #PackageManifest,
#category : #'Telescope-Core-Tests-Manifest'
}
"
I store metadata for this package. These meta data are used by other tools such as the SmalllintManifestChecker and the critics Browser
"
Class {
#name : #ManifestTelescopeCoreTests,
#superclass : #PackageManifest,
#category : #'Telescope-Core-Tests-Manifest'
}
56 changes: 28 additions & 28 deletions src/Telescope-Core-Tests/TLAbstractNodeTest.class.st
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
Class {
#name : #TLAbstractNodeTest,
#superclass : #TestCase,
#instVars : [
'node'
],
#category : #'Telescope-Core-Tests-Model'
}

{ #category : #running }
TLAbstractNodeTest >> setUp [
super setUp.
node := TLAbstractNode new
]

{ #category : #tests }
TLAbstractNodeTest >> testNotDuplicateAdjacentNodes [
| in inOut out adjacents |
in:= TLAbstractNode withEntity: 'in'.
inOut:= TLAbstractNode withEntity: 'inOut'.
out:= TLAbstractNode withEntity: 'out'.
TLConnection from: in to: node visualization: nil.
TLConnection from: inOut to: node visualization: nil.
TLConnection from: node to: inOut visualization: nil.
TLConnection from: node to: out visualization: nil.
adjacents:= node adjacentNodes.
self assert: adjacents size equals: 3
]
Class {
#name : #TLAbstractNodeTest,
#superclass : #TestCase,
#instVars : [
'node'
],
#category : #'Telescope-Core-Tests-Model'
}

{ #category : #running }
TLAbstractNodeTest >> setUp [
super setUp.
node := TLAbstractNode new
]

{ #category : #tests }
TLAbstractNodeTest >> testNotDuplicateAdjacentNodes [
| in inOut out adjacents |
in:= TLAbstractNode withEntity: 'in'.
inOut:= TLAbstractNode withEntity: 'inOut'.
out:= TLAbstractNode withEntity: 'out'.
TLConnection from: in to: node visualization: nil.
TLConnection from: inOut to: node visualization: nil.
TLConnection from: node to: inOut visualization: nil.
TLConnection from: node to: out visualization: nil.
adjacents:= node adjacentNodes.
self assert: adjacents size equals: 3
]
142 changes: 71 additions & 71 deletions src/Telescope-Core-Tests/TLCompositeNodeTest.class.st
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
Class {
#name : #TLCompositeNodeTest,
#superclass : #TestCase,
#instVars : [
'node'
],
#category : #'Telescope-Core-Tests-Model'
}

{ #category : #running }
TLCompositeNodeTest >> setUp [
super setUp.
node := TLCompositeNode new.
node childrenNodeCreationStrategy: TLNodeCreationStrategy default.

]

{ #category : #tests }
TLCompositeNodeTest >> testChildrenCreationWithBlock [
node entity: 42.
node childrenProperty: [ :entity |
self assert: entity equals: 42.
#(1 2 3) ].
node createChildrenNodes.
self assert: node childrenNodes size equals: 3.
self assert: node childrenNodes first entity equals: 1.
self assert: node childrenNodes second entity equals: 2.
self assert: node childrenNodes third entity equals: 3
]

{ #category : #tests }
TLCompositeNodeTest >> testChildrenCreationWithCollectionOfEntities [
node childrenProperty: #(1 2 3).
node createChildrenNodes.
self assert: node childrenNodes size equals: 3.
self assert: node childrenNodes first entity equals: 1.
self assert: node childrenNodes second entity equals: 2.
self assert: node childrenNodes third entity equals: 3
]

{ #category : #tests }
TLCompositeNodeTest >> testChildrenCreationWithProperty [
node entity: 30.
node childrenProperty: #primeFactors.
node createChildrenNodes.
self assert: node childrenNodes size equals: 3.
self assert: node childrenNodes first entity equals: 2.
self assert: node childrenNodes second entity equals: 3.
self assert: node childrenNodes third entity equals: 5
]

{ #category : #tests }
TLCompositeNodeTest >> testMoveChildNodeFromOneParentToAnother [
| childNode anotherNode |
childNode := node addChildNodeFromEntity: #child.
anotherNode := TLCompositeNode new.
node childrenNodes first parent: anotherNode.
self assert: node childrenNodes isEmpty.
self assert: anotherNode childrenNodes size equals: 1.
self assert: childNode parent equals: anotherNode
]

{ #category : #tests }
TLCompositeNodeTest >> testMoveChildNodeFromOneParentToTheSame [
| childNode |
childNode := node addChildNodeFromEntity: #child.
childNode parent: node.
childNode parent: node.
self assert: node childrenNodes size equals: 1.
self assert: childNode parent equals: node
]
Class {
#name : #TLCompositeNodeTest,
#superclass : #TestCase,
#instVars : [
'node'
],
#category : #'Telescope-Core-Tests-Model'
}

{ #category : #running }
TLCompositeNodeTest >> setUp [
super setUp.
node := TLCompositeNode new.
node childrenNodeCreationStrategy: TLNodeCreationStrategy default.

]

{ #category : #tests }
TLCompositeNodeTest >> testChildrenCreationWithBlock [
node entity: 42.
node childrenProperty: [ :entity |
self assert: entity equals: 42.
#(1 2 3) ].
node createChildrenNodes.
self assert: node childrenNodes size equals: 3.
self assert: node childrenNodes first entity equals: 1.
self assert: node childrenNodes second entity equals: 2.
self assert: node childrenNodes third entity equals: 3
]

{ #category : #tests }
TLCompositeNodeTest >> testChildrenCreationWithCollectionOfEntities [
node childrenProperty: #(1 2 3).
node createChildrenNodes.
self assert: node childrenNodes size equals: 3.
self assert: node childrenNodes first entity equals: 1.
self assert: node childrenNodes second entity equals: 2.
self assert: node childrenNodes third entity equals: 3
]

{ #category : #tests }
TLCompositeNodeTest >> testChildrenCreationWithProperty [
node entity: 30.
node childrenProperty: #primeFactors.
node createChildrenNodes.
self assert: node childrenNodes size equals: 3.
self assert: node childrenNodes first entity equals: 2.
self assert: node childrenNodes second entity equals: 3.
self assert: node childrenNodes third entity equals: 5
]

{ #category : #tests }
TLCompositeNodeTest >> testMoveChildNodeFromOneParentToAnother [
| childNode anotherNode |
childNode := node addChildNodeFromEntity: #child.
anotherNode := TLCompositeNode new.
node childrenNodes first parent: anotherNode.
self assert: node childrenNodes isEmpty.
self assert: anotherNode childrenNodes size equals: 1.
self assert: childNode parent equals: anotherNode
]

{ #category : #tests }
TLCompositeNodeTest >> testMoveChildNodeFromOneParentToTheSame [
| childNode |
childNode := node addChildNodeFromEntity: #child.
childNode parent: node.
childNode parent: node.
self assert: node childrenNodes size equals: 1.
self assert: childNode parent equals: node
]
72 changes: 36 additions & 36 deletions src/Telescope-Core-Tests/TLConnectActionTest.class.st
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
Class {
#name : #TLConnectActionTest,
#superclass : #TestCase,
#category : #'Telescope-Core-Tests-Actions'
}

{ #category : #tests }
TLConnectActionTest >> testTriggerAction [
| connectAction sourceNode targetNode |
sourceNode := TLSimpleNode withEntity: 4.
targetNode := TLSimpleNode withEntity: 2.
connectAction := TLConnectAction
property: [ :e | {e sqrt} ]
context: (TLDrawableCollection with: sourceNode with: targetNode).
connectAction actionOn: sourceNode.
self assert: sourceNode outgoingConnections size equals: 1.
self assert: targetNode incomingConnections size equals: 1.
self
assert: sourceNode outgoingConnections anyOne
equals: targetNode incomingConnections anyOne
]

{ #category : #tests }
TLConnectActionTest >> testTriggerActionTwiceForReversibility [
"this test is valid only if testTriggerAction is valid"
| connectAction sourceNode targetNode |
sourceNode := TLSimpleNode withEntity: 4.
targetNode := TLSimpleNode withEntity: 2.
connectAction := TLConnectAction
property: [ :e | {e sqrt} ]
context: (TLDrawableCollection with: sourceNode with: targetNode).
connectAction actionOn: sourceNode.
connectAction actionOn: sourceNode.
self assert: sourceNode outgoingConnections isEmpty.
self assert: targetNode incomingConnections isEmpty
]
Class {
#name : #TLConnectActionTest,
#superclass : #TestCase,
#category : #'Telescope-Core-Tests-Actions'
}

{ #category : #tests }
TLConnectActionTest >> testTriggerAction [
| connectAction sourceNode targetNode |
sourceNode := TLSimpleNode withEntity: 4.
targetNode := TLSimpleNode withEntity: 2.
connectAction := TLConnectAction
property: [ :e | {e sqrt} ]
context: (TLDrawableCollection with: sourceNode with: targetNode).
connectAction actionOn: sourceNode.
self assert: sourceNode outgoingConnections size equals: 1.
self assert: targetNode incomingConnections size equals: 1.
self
assert: sourceNode outgoingConnections anyOne
equals: targetNode incomingConnections anyOne
]

{ #category : #tests }
TLConnectActionTest >> testTriggerActionTwiceForReversibility [
"this test is valid only if testTriggerAction is valid"
| connectAction sourceNode targetNode |
sourceNode := TLSimpleNode withEntity: 4.
targetNode := TLSimpleNode withEntity: 2.
connectAction := TLConnectAction
property: [ :e | {e sqrt} ]
context: (TLDrawableCollection with: sourceNode with: targetNode).
connectAction actionOn: sourceNode.
connectAction actionOn: sourceNode.
self assert: sourceNode outgoingConnections isEmpty.
self assert: targetNode incomingConnections isEmpty
]
76 changes: 38 additions & 38 deletions src/Telescope-Core-Tests/TLConnectWithEntityActionTest.class.st
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
Class {
#name : #TLConnectWithEntityActionTest,
#superclass : #TestCase,
#category : #'Telescope-Core-Tests-Actions'
}

{ #category : #tests }
TLConnectWithEntityActionTest >> testTriggerAction [
| connectAction sourceNode targetNode |
sourceNode := TLSimpleNode withEntity: 4.
targetNode := TLSimpleNode withEntity: 2.
connectAction := TLConnectWithEntityAction
connectionProperty: [ :e | {e squared} ]
property: [ :connectionEntity | connectionEntity / 8 ]
context: (TLDrawableCollection with: sourceNode with: targetNode).
connectAction actionOn: sourceNode.
self assert: sourceNode outgoingConnections size equals: 1.
self assert: targetNode incomingConnections size equals: 1.
self
assert: sourceNode outgoingConnections anyOne
equals: targetNode incomingConnections anyOne
]

{ #category : #tests }
TLConnectWithEntityActionTest >> testTriggerActionTwiceForReversibility [
"this test is valid only if testTriggerAction is valid"
| connectAction sourceNode targetNode |
sourceNode := TLSimpleNode withEntity: 4.
targetNode := TLSimpleNode withEntity: 2.
connectAction := TLConnectWithEntityAction
connectionProperty: [ :e | {e squared} ]
property: [ :connectionEntity | connectionEntity / 8 ]
context: (TLDrawableCollection with: sourceNode with: targetNode).
connectAction actionOn: sourceNode.
connectAction actionOn: sourceNode.
self assert: sourceNode outgoingConnections isEmpty.
self assert: targetNode incomingConnections isEmpty
]
Class {
#name : #TLConnectWithEntityActionTest,
#superclass : #TestCase,
#category : #'Telescope-Core-Tests-Actions'
}

{ #category : #tests }
TLConnectWithEntityActionTest >> testTriggerAction [
| connectAction sourceNode targetNode |
sourceNode := TLSimpleNode withEntity: 4.
targetNode := TLSimpleNode withEntity: 2.
connectAction := TLConnectWithEntityAction
connectionProperty: [ :e | {e squared} ]
property: [ :connectionEntity | connectionEntity / 8 ]
context: (TLDrawableCollection with: sourceNode with: targetNode).
connectAction actionOn: sourceNode.
self assert: sourceNode outgoingConnections size equals: 1.
self assert: targetNode incomingConnections size equals: 1.
self
assert: sourceNode outgoingConnections anyOne
equals: targetNode incomingConnections anyOne
]

{ #category : #tests }
TLConnectWithEntityActionTest >> testTriggerActionTwiceForReversibility [
"this test is valid only if testTriggerAction is valid"
| connectAction sourceNode targetNode |
sourceNode := TLSimpleNode withEntity: 4.
targetNode := TLSimpleNode withEntity: 2.
connectAction := TLConnectWithEntityAction
connectionProperty: [ :e | {e squared} ]
property: [ :connectionEntity | connectionEntity / 8 ]
context: (TLDrawableCollection with: sourceNode with: targetNode).
connectAction actionOn: sourceNode.
connectAction actionOn: sourceNode.
self assert: sourceNode outgoingConnections isEmpty.
self assert: targetNode incomingConnections isEmpty
]
Loading

0 comments on commit 908fcfb

Please sign in to comment.