|
Last change
on this file was
2,
checked in by dsowen, 21 years ago
|
|
Initial commit.
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
|
File size:
691 bytes
|
| Line | |
|---|
| 1 | /* |
|---|
| 2 | * Created on Aug 2, 2005 |
|---|
| 3 | * |
|---|
| 4 | * $Log$ |
|---|
| 5 | * Revision 1.1 2005/08/03 00:35:29 dsowen |
|---|
| 6 | * Initial commit. |
|---|
| 7 | * |
|---|
| 8 | */ |
|---|
| 9 | package ws.fugue88.jpath; |
|---|
| 10 | |
|---|
| 11 | import junit.framework.TestCase; |
|---|
| 12 | |
|---|
| 13 | /** |
|---|
| 14 | * @author dsowen |
|---|
| 15 | */ |
|---|
| 16 | public class FieldPropertyTest extends TestCase { |
|---|
| 17 | |
|---|
| 18 | public void testGet() throws Exception |
|---|
| 19 | { |
|---|
| 20 | class A { |
|---|
| 21 | |
|---|
| 22 | String b = "test"; |
|---|
| 23 | } |
|---|
| 24 | A a = new A(); |
|---|
| 25 | |
|---|
| 26 | FieldProperty property = new FieldProperty("b", A.class, "b"); |
|---|
| 27 | assertSame(a.b, property.getValue(a)); |
|---|
| 28 | } |
|---|
| 29 | |
|---|
| 30 | public void testSet() throws Exception |
|---|
| 31 | { |
|---|
| 32 | class A { |
|---|
| 33 | |
|---|
| 34 | String b = "test"; |
|---|
| 35 | } |
|---|
| 36 | A a = new A(); |
|---|
| 37 | |
|---|
| 38 | FieldProperty property = new FieldProperty("b", A.class, "b"); |
|---|
| 39 | property.setValue(a, "done"); |
|---|
| 40 | assertEquals("done", a.b); |
|---|
| 41 | } |
|---|
| 42 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.