samples/individualsamples/test/org/apidesign/samples/CodeThatCanBeCalledOnlyByTestTest.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:57:12 +0200
changeset 143 20dad4daf81b
permissions -rw-r--r--
Special project for inidividual samples, used to show code that can be called only from test
     1 package org.apidesign.samples;
     2 
     3 import org.junit.Test;
     4 import static org.junit.Assert.*;
     5 
     6 public class CodeThatCanBeCalledOnlyByTestTest {
     7 
     8     public CodeThatCanBeCalledOnlyByTestTest() {
     9     }
    10 
    11     @Test
    12     public void setNumber() {
    13         CodeThatCanBeCalledOnlyByTest.setNumber(111);
    14         assertEquals(
    15             "Changing number is OK from tests", 
    16             111, 
    17             CodeThatCanBeCalledOnlyByTest.getNumber()
    18         );
    19     }
    20 
    21 }