Changeset 4 for trunk/testsrc


Ignore:
Timestamp:
08/12/2005 07:01:46 PM (21 years ago)
Author:
dsowen
Message:

Feature: can automatically fill missing parts of a graph.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/testsrc/ws/fugue88/jpath/ContextTest.java

    r2 r4  
    33 *
    44 * $Log$
     5 * Revision 1.2  2005/08/12 19:01:46  dsowen
     6 * Feature: can automatically fill missing parts of a graph.
     7 *
    58 * Revision 1.1  2005/08/03 00:35:29  dsowen
    69 * Initial commit.
     
    101104                assertEquals("done", a.b.get("c"));
    102105        }
     106
     107        public void testEarlyNull() throws Exception
     108        {
     109                class A {
     110
     111                        String s;
     112                }
     113                class B {
     114
     115                        A a;
     116                }
     117                B b = new B();
     118
     119                ContextFactory factory = new ContextFactory();
     120                Context context = factory.createContext(b);
     121                assertNull(context.getTarget(new Path("/a/s")));
     122                assertNull(b.a);
     123        }
     124
     125        static class A {
     126
     127                String s;
     128        }
     129
     130        public void testAutoGraph() throws Exception
     131        {
     132                class B {
     133
     134                        A a;
     135                }
     136                B b = new B();
     137
     138                ContextFactory factory = new ContextFactory();
     139                Context context = factory.createModifyingContext(b);
     140                assertNull(context.getTarget(new Path("/a/s")));
     141                assertNotNull(b.a);
     142                assertNull(b.a.s);
     143        }
    103144}
Note: See TracChangeset for help on using the changeset viewer.