    1   package test.net.sourceforge.pmd.dfa;
    2
    3   import junit.framework.TestCase;
    4   import net.sourceforge.pmd.dfa.variableaccess.VariableAccess;
    5
    6   public class VariableAccessTest extends TestCase {
    7
    8       public void testGetVariableName() {
    9           VariableAccess va = new VariableAccess(VariableAccess.DEFINITION, "foo.bar");
    10          assertEquals("foo", va.getVariableName());
    11          va = new VariableAccess(VariableAccess.DEFINITION, ".foobar");
    12          assertEquals("", va.getVariableName());
    13          va = new VariableAccess(VariableAccess.DEFINITION, "foobar.");
    14          assertEquals("foobar", va.getVariableName());
    15          va = new VariableAccess(VariableAccess.DEFINITION, "foobar");
    16          assertEquals("foobar", va.getVariableName());
    17      }
    18  }