FileDocCategorySizeDatePackage
TestOnlyOperations.javaAPI DocExample1320Wed May 04 06:18:22 BST 2005com.samscdrental.tests

TestOnlyOperations

public class TestOnlyOperations extends Object

Title: Sams CD Rental Store

Description:

Copyright: Copyright (c) 2004

Company:

author
Ken Pugh
version
1.0

Fields Summary
private StoreDataAccess
theCollections
private static TestOnlyOperations
theInstance
Constructors Summary
private TestOnlyOperations()


	 
	
	
Methods Summary
voidcollectionsClear()

		theCollections.theCDDiscDataAccess.removeAll_TestingOnly();
		theCollections.theCustomerDataAccess.removeAll_TestingOnly();
		theCollections.theCDReleaseDataAccess.removeAll_TestingOnly();
	
static com.samscdrental.tests.TestOnlyOperationsgetInstance()

		if ( theInstance == null )
		{
			theInstance = new TestOnlyOperations();
		}
		return theInstance;

	
voidsetStartTimeForRentalBackSomeDays(PhysicalID aPhysicalID, int days)

		CDDisc aCDDisc = theCollections.theCDDiscDataAccess.findByPhysicalID(
			aPhysicalID );
		if ( aCDDisc != null )
		{
			Rental rental = aCDDisc.getRental();
			Timestamp start = rental.getStartTime();
			start = start.addDays( -days );
			rental.setStartTime( start );
		}