RHAPSODY4YOU

--Independent Rational Rhapsody Forum--
It is currently Thu Sep 09, 2010 11:09 am

All times are UTC



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.




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Test Conductor and singletons
PostPosted: Thu Dec 24, 2009 12:45 pm 
Offline

Joined: Wed May 07, 2008 3:50 pm
Posts: 94
Location: Crawley, 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?


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

Joined: Fri Jan 16, 2009 2:02 pm
Posts: 12
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


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

Joined: Wed May 07, 2008 3:50 pm
Posts: 94
Location: Crawley, 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?


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

Joined: Mon Jan 25, 2010 11:40 am
Posts: 11
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 6 times
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: MSN [Bot] 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: