Test Specifications and Descriptions for StockSymbol



public StockSymbol(String symbol)

Description

Domain testing of input and output conditions, and external pre-conditions for class StockSymbol, constructor public StockSymbol(String symbol).

Equivalence Class Partitioning

symbol Expected results Test Case ID
Some String Creates a new StockSymbol object with the name specified StockSymbol2001
null throws NullPointerException StockSymbol2002

Boundary Value Analysis

symbol Expected results Test Case ID
Empty String, String of size 1 Creates a new StockSymbol object with the name specified StockSymbol2001

Assertion testing

Assertion Expected result Test Case ID
Creates a new StockSymbol object StockSymbol(symbol).getName().compareTo(symbol) == 0 StockSymbol2001
NullPointerException - if the specified symbol is null. NullPointerException StockSymbol2002

Test Descriptions

Test cases included:
StockSymbol2001, StockSymbol2002.

title public StockSymbol(String symbol) and public String getName() tests
source CtorNameTests.java SSymbol.java
executeClass com.sun.tdk.sampletck.tests.api.StockSymbol.CtorNameTests


public String getName()

Description

Domain testing of input and output conditions, and external pre-conditions for class StockSymbol, method public String getName().

Assertion testing

Assertion Expected result Test Case ID
Returns the name of the stock StockSymbol(symbol).getName() return 'symbol' StockSymbol2001

Test Descriptions

See:
Test descriptions for CtorNameTests.java (StockSymbol2001)


public abstract Quote getQuote()

Description

Domain testing of input and output conditions, and external pre-conditions for class StockSymbol, method public abstract Quote getQuote().

Assertion testing

Assertion Test Case ID
Gets the current quote of the stock. StockSymbol2005
Throws: GetQuoteException - if an i/o exception occurs during stock retrieval StockSymbol2005

Test Descriptions

Test cases included:
StockSymbol2003, StockSymbol2004, StockSymbol2005.

title public java.awt.Component getVisualComponent() and public abstract Quote getQuote() tests
source GetXXXTests.java SSymbol.java
executeClass com.sun.tdk.sampletck.tests.api.StockSymbol.GetXXXTests


public java.awt.Component getVisualComponent()

Description

Domain testing of input and output conditions, and external pre-conditions for class StockSymbol, method public java.awt.Component getVisualComponent().

Equivalence Class Partitioning

Pre-conditions Expected output value Test Case ID
getQuote() returns some Quote java.awt.Component object StockSymbol2005
getQuote() throws GetQuoteException java.awt.Component object StockSymbol2005

Assertion testing

Assertion Expected result Test Case ID
The quote info is obtained using getQuote method. SSymbol.getQuoteCalled will set to true StockSymbol2003
Component returned by a getVisualComponent() method initially invisible and is not added to any container returned component has parent set to null and is invisible StockSymbol2004
The same container will be returned for each repetitive call. StockSymbol2005

Test Descriptions

See:
Test descriptions for GetXXXTests.java (StockSymbol2003, StockSymbol2004, StockSymbol2005)


Last updated: 02/02/15
Copyright © 2002 Sun Microsystems, Inc. All rights reserved.
SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.