It is currently Thu Feb 09, 2012 12:13 am



Welcome
Welcome to RHAPSODY4YOU

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, respond to polls, upload and download content, and access many other special features. Registration is fast, simple, and absolutely free, so please, register to join our community today.





 Page 1 of 1 [ 4 posts ] 
Author Message
 Post subject: Test Conductor and singletons
PostPosted: Thu Dec 24, 2009 12:45 pm 

Joined: Wed May 07, 2008 3:50 pm
Posts: 148
Location: Horsham, W Sussex, England
I understand that Test Conductor autogenerates a 'Test Context' which contains the SUT and the objects that interact with it.
If the SUT also interacts with a singleton, how can this be added to the Test Context?
You can't just add the singleton object to the Text Context Diagram because the singleton obviously has a private constructor.
Anyone know how to do this?


Offline
 Profile  
 
 Post subject: Re: Test Conductor and singletons
PostPosted: Fri Jan 08, 2010 8:57 pm 

Joined: Fri Jan 16, 2009 2:02 pm
Posts: 14
Hi,

we solved this problem by using a pointer to the singleton class.
For this we put the sigleton class on the context diagram, changed it to an object and changed a property to "scalar" (at the moment I can't remember the property name, something about object or class type. But next week I can tell you the exact name).
In the constructor of the TestContext you must initialize/set this pointer and then you may use the instance in your Sequence-diagrams.

cu

Roy

/*============================================
Update 20.1.2010:

The following Properties habe to be set for the SUT object:
• CG::Implementation = Scalar
• CG::CreateComponentGenerate = off
• CG::DeleteComponentGenerate = off


Offline
 Profile  
 
 Post subject: Re: Test Conductor and singletons
PostPosted: Wed Jan 27, 2010 12:09 pm 

Joined: Wed May 07, 2008 3:50 pm
Posts: 148
Location: Horsham, W Sussex, England
Is this equivalent to the section in the RTC_User_Guide called, "Using Objects" where the stereotype <<instantiated>> is automatically added to the association and they talk about construction/initialization and Init().

Do you draw the singleton class inside or outside the TestContext box?


Offline
 Profile  
 
 Post subject: Re: Test Conductor and singletons
PostPosted: Thu Jan 28, 2010 9:33 am 

Joined: Mon Jan 25, 2010 11:40 am
Posts: 12
Hi shanz,

we do it like Roy has described it: put an object of the singleton class to the testcontext and instantiate it dynamically by setting some properties. Attached a small sample model.


Attachments:
SampleSingleton.zip [38.04 KiB]
Downloaded 35 times
Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 4 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

cron

suspicion-preferred