Examples of SimpleObject


Examples of com.google.gwt.inject.client.SimpleObject

*/
public class HierarchicalTest extends GWTTestCase {
  public void testHierarchicalInjector() {
    HierarchicalMyAppGinjector injector = GWT.create(HierarchicalMyAppGinjector.class);

    SimpleObject simple = injector.getSimple();
    assertNotNull(simple);

    SimpleObject unnamedSimple = injector.getUnnamedSimple();
    assertNotNull(unnamedSimple);
    assertSame(simple, unnamedSimple);

    SimpleObject purple = injector.getSimplePurple();
    assertNotNull(purple);
    assertSame(simple, purple);

    SimpleObject red = injector.getSimpleRed();
    assertNotNull(red);
    assertSame(purple, red);

    SimpleObject blue = injector.getSimpleBlue();
    assertNotNull(blue);
    assertSame(blue, red);
  }
View Full Code Here

Examples of com.hp.mwtests.ts.txoj.common.resources.SimpleObject

    {
    }
      }
  }
 
  SimpleObject foo = new SimpleObject();
  long t1 = System.currentTimeMillis();

  for (int c = 0; c < iters; c++)
  {
      foo.set(c);
  }

  long t2 = System.currentTimeMillis();

  System.out.print("Time taken to perform "+iters+" iterations on a simple object: ");
View Full Code Here

Examples of dom.simple.SimpleObject

           
            @Override
            public Object invoke(Invocation invocation) throws Throwable {
                final InMemoryDB inMemoryDB = getVar("isis", "in-memory-db", InMemoryDB.class);
                final String name = (String)invocation.getParameter(0);
                final SimpleObject obj = new SimpleObject();
                obj.setName(name);
                inMemoryDB.put(SimpleObject.class, name, obj);
                return obj;
            }
           
            @Override
View Full Code Here

Examples of dom.simple.SimpleObject

     * Hook to initialize if possible.
     */
    @Override
    protected void init(Object obj, String str) {
        if(obj instanceof SimpleObject) {
            SimpleObject toDoItem = (SimpleObject) obj;
            toDoItem.setName(str);
        }
    }
View Full Code Here

Examples of dom.simple.SimpleObject

    public void listAll() throws Exception {

        final List<SimpleObject> all = wrap(simpleObjects).listAll();
        assertThat(all.size(), is(3));
       
        SimpleObject simpleObject = wrap(all.get(0));
        assertThat(simpleObject.getName(), is("Foo"));
    }
View Full Code Here

Examples of dom.simple.SimpleObject

    public void listAll() throws Exception {

        final List<SimpleObject> all = wrap(simpleObjects).listAll();
        assertThat(all.size(), is(3));
       
        SimpleObject simpleObject = wrap(all.get(0));
        assertThat(simpleObject.getName(), is("Foo"));
    }
View Full Code Here

Examples of dom.simple.SimpleObject

   
    @Test
    public void happyCase() throws Exception {
       
        // given
        final SimpleObject simpleObject = new SimpleObject();
       
        final Sequence seq = context.sequence("create");
        context.checking(new Expectations() {
            {
                oneOf(mockContainer).newTransientInstance(SimpleObject.class);
                inSequence(seq);
                will(returnValue(simpleObject));
               
                oneOf(mockContainer).persistIfNotAlready(simpleObject);
                inSequence(seq);
            }
        });
       
        // when
        final SimpleObject obj = simpleObjects.create("Foobar");
       
        // then
        assertThat(obj, is(simpleObject));
        assertThat(obj.getName(), is("Foobar"));
    }
View Full Code Here

Examples of org.conserve.objects.SimpleObject

  @Test
  public void testAddObject() throws Exception
  {
    PersistenceManager persist = new PersistenceManager(driver, database, login, password);
    // create a test object
    SimpleObject so = new SimpleObject();
    so.setAge(1000L);
    so.setCount(3);
    so.setName("foo bar");
    so.setScale(0.67);
    persist.saveObject(so);
    LessSimpleObject lso = new LessSimpleObject();
    lso.setAge(1000000L);
    lso.setCount(123456);
    lso.setKey((short) 99);
View Full Code Here

Examples of org.conserve.objects.SimpleObject

  @Test
  public void testGetObjectFromInterface() throws Exception
  {
    PersistenceManager persist = new PersistenceManager(driver, database, login, password);
    // create a test object
    SimpleObject so = new SimpleObject();
    so.setAge(1000L);
    so.setCount(3);
    so.setName("foo bar");
    so.setScale(0.67);
    persist.saveObject(so);
    LessSimpleObject lso = new LessSimpleObject();
    lso.setAge(1000000L);
    lso.setCount(123456);
    lso.setKey((short) 99);
View Full Code Here

Examples of org.conserve.objects.SimpleObject

  public void testGetObjectFromClass() throws Exception
  {

    PersistenceManager persist = new PersistenceManager(driver, database, login, password);
    // create a test object
    SimpleObject so = new SimpleObject();
    so.setAge(1000L);
    so.setCount(3);
    so.setName("foo bar");
    so.setScale(0.67);
    persist.saveObject(so);
    LessSimpleObject lso = new LessSimpleObject();
    lso.setAge(1000000L);
    lso.setCount(123456);
    lso.setKey((short) 99);
    lso.setName("j random");
    lso.setScale(-9.0);
    persist.saveObject(lso);
    // insert the same object again
    persist.saveObject(lso);
    persist.close();

    persist = new PersistenceManager(driver, database, login, password);
    // try getting all the objects
    SimpleObject pattern = new SimpleObject();
    pattern.setCount(3);
    List<SimpleObject> obs = persist.getObjects(SimpleObject.class, new GreaterOrEqual(pattern));
    assertEquals(2, obs.size());
    pattern.setCount(4);
    obs = persist.getObjects(SimpleObject.class, new GreaterOrEqual(pattern));
    assertEquals(1, obs.size());
    pattern.setCount(3);
    List<LessSimpleObject> obs2 = persist.getObjects(LessSimpleObject.class, new GreaterOrEqual(pattern));
    assertEquals(1, obs2.size());

    // assert that two objects are equal if they are the result of the same
    // search
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.