Skip to content

Commit

Permalink
Merge pull request #121 from OpenSmock/dev-97
Browse files Browse the repository at this point in the history
Instanciate isn't the correct form
  • Loading branch information
labordep authored Oct 24, 2023
2 parents 2d57172 + 8b57428 commit 2fb52ca
Show file tree
Hide file tree
Showing 14 changed files with 1,271 additions and 764 deletions.
10 changes: 6 additions & 4 deletions src/Molecule-Tests/MolComponentImplTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -586,14 +586,15 @@ MolComponentImplTest >> testServicesProviders [

{ #category : #'test - component creation' }
MolComponentImplTest >> testStart [

MolCompleteComponentImpl deploy.
MolCompleteComponentImpl instanciate.
MolCompleteComponentImpl instantiate.
self assert: (MolUtils instanceOf: MolCompleteComponentImpl) notNil.
MolCompleteComponentImpl activate.
MolCompleteComponentImpl passivate.
MolCompleteComponentImpl remove.
self assert: (MolUtils instanceOf: MolCompleteComponentImpl) isNil.
MolCompleteComponentImpl undeploy.
MolCompleteComponentImpl undeploy
]

{ #category : #'test - component creation' }
Expand All @@ -612,14 +613,15 @@ MolComponentImplTest >> testStart2 [

{ #category : #'test - component creation' }
MolComponentImplTest >> testStartWithName [

MolCompleteComponentImpl deploy.
MolCompleteComponentImpl instanciate: #myComponent.
MolCompleteComponentImpl instantiate: #myComponent.
self assert: (MolUtils instanceOf: MolCompleteComponentImpl named: #myComponent) notNil.
MolCompleteComponentImpl activate: #myComponent.
MolCompleteComponentImpl passivate: #myComponent.
MolCompleteComponentImpl remove: #myComponent.
self assert: (MolUtils instanceOf: MolCompleteComponentImpl named: #myComponent) isNil.
MolCompleteComponentImpl undeploy.
MolCompleteComponentImpl undeploy
]

{ #category : #'test - component creation' }
Expand Down
49 changes: 31 additions & 18 deletions src/Molecule-Tests/MolComponentManagerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,27 @@ MolComponentManagerTest >> testCleanUpIgnoreErrors [
{ #category : #'tests - component start & stop' }
MolComponentManagerTest >> testComponentTree [
"Start a component Tree : a component which is starting sub components, etc."

| nb |
MolComponentManager default deploymentServices deployComponentImplementation: MolTestComponentTreeLevel0Impl.
MolComponentManager default homeServices instanciateComponent: MolTestComponentTreeLevel0Impl.
MolComponentManager default homeServices activateComponent: MolTestComponentTreeLevel0Impl.

MolComponentManager default deploymentServices
deployComponentImplementation: MolTestComponentTreeLevel0Impl.
MolComponentManager default homeServices instantiateComponent:
MolTestComponentTreeLevel0Impl.
MolComponentManager default homeServices activateComponent:
MolTestComponentTreeLevel0Impl.

"Check started components"
nb := 0.
MolComponentManager default homeServices deployedComponents valuesDo:[ :compList | nb := nb + (compList size) ].
MolComponentManager default homeServices deployedComponents
valuesDo: [ :compList | nb := nb + compList size ].
self assert: nb equals: 13.

MolComponentManager default homeServices passivateComponent: MolTestComponentTreeLevel0Impl.
MolComponentManager default homeServices removeComponent: MolTestComponentTreeLevel0Impl.
MolComponentManager default deploymentServices undeployComponentImplementation: MolTestComponentTreeLevel2Impl.

MolComponentManager default homeServices passivateComponent:
MolTestComponentTreeLevel0Impl.
MolComponentManager default homeServices removeComponent:
MolTestComponentTreeLevel0Impl.
MolComponentManager default deploymentServices
undeployComponentImplementation: MolTestComponentTreeLevel2Impl
]

{ #category : #tests }
Expand Down Expand Up @@ -196,20 +204,25 @@ MolComponentManagerTest >> testIsRunningComponents [
{ #category : #'tests - general' }
MolComponentManagerTest >> testIsRunningComponentsAllSteps [

MolComponentManager default deploymentServices deployComponentImplementation: MolCompleteComponentImpl.
MolComponentManager default deploymentServices
deployComponentImplementation: MolCompleteComponentImpl.
self assert: MolComponentManager isRunningComponents equals: false.

MolComponentManager default homeServices instanciateComponent: MolCompleteComponentImpl.

MolComponentManager default homeServices instantiateComponent:
MolCompleteComponentImpl.
self assert: MolComponentManager isRunningComponents equals: true.

MolComponentManager default homeServices activateComponent: MolCompleteComponentImpl.

MolComponentManager default homeServices activateComponent:
MolCompleteComponentImpl.
self assert: MolComponentManager isRunningComponents equals: true.

MolComponentManager default homeServices passivateComponent: MolCompleteComponentImpl.

MolComponentManager default homeServices passivateComponent:
MolCompleteComponentImpl.
self assert: MolComponentManager isRunningComponents equals: true.

MolComponentManager default homeServices removeComponent: MolCompleteComponentImpl.
self assert: MolComponentManager isRunningComponents equals: false.
MolComponentManager default homeServices removeComponent:
MolCompleteComponentImpl.
self assert: MolComponentManager isRunningComponents equals: false
]

{ #category : #tests }
Expand Down
Loading

0 comments on commit 2fb52ca

Please sign in to comment.