F2k3 Translation - UML 2 Test Profile Example



What difficulties are likely if I attempt to translate the following language mappings for the UML 2 "test profile" to F2k3 or k8? It looks straightforward superficially anyway, although I don't know what assertTrue does or how to handle the throw.

public class MoneyTest extends TestCase
{

public void addSameMoney()
{
Money money1 = new Money(20, "USD"));
Money money2 = new Money(50, "USD"));
money1.add(money2);
assertTrue(money1.equals(new Money(70,"USD")));
}

public void addDifferentMoney()
{
Money money1 = new Money(20, "USD"));
Money money2 = new Money(50, "USD"));
Money bag1 = money1.add(money2);
assertTrue(bag1.contains(money1));
assertTrue(bag1.contains(money2));
}

protected void runTest throws Throwable()
{
addSameMoney();
addDifferentMoney();
}
}




--

Gary Scott
mailto:garylscott@sbcglobal dot net

Fortran Library: http://www.fortranlib.com

Support the Original G95 Project: http://www.g95.org
-OR-
Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html

If you want to do the impossible, don't hire an expert because he knows it can't be done.

-- Henry Ford
.



Relevant Pages

  • RE: MoveNext() method not covered by unit testing?
    ... public void ItemsConstructorTest() ... coverage. ... Microsoft Online Community Support ... nature are best handled working with a dedicated Microsoft Support Engineer ...
    (microsoft.public.vsnet.enterprise.tools)
  • RE: Delegates/events
    ... public void OnMyEvent ... public class Second ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Using overload to implement the equivalent of a switch
    ... public abstract void doSomething(Object anObject); ... public void doSomething{ ... AbstractBase reference = new ResponsibleChild; ... Java does not support this concept at the language level. ...
    (comp.lang.java.programmer)
  • Re: Unit testing - Breaking bad habits
    ... // Test setters and getters ... Or are there some subtleties in your code (assertTrue, ... private double x; ... public void setX ...
    (comp.lang.java.programmer)
  • Re: How do I use Generics with interfaces?
    ... "AlexS" wrote: ... public void doSomething{... ... support for generic covariance. ...
    (microsoft.public.dotnet.languages.csharp)