Package org.springsource.loaded.test.infra

Examples of org.springsource.loaded.test.infra.Result


  public void invokeStaticReloading_gh4_4() throws Exception {
    TypeRegistry tr = getTypeRegistry("invokestatic..*");
    ReloadableType A = tr.addType("invokestatic.issue4.A", loadBytesForClass("invokestatic.issue4.A"));
    ReloadableType B = tr.addType("invokestatic.issue4.B", loadBytesForClass("invokestatic.issue4.B"));
   
    Result r = runUnguarded(B.getClazz(), "getMessage");
    assertEquals("String1",(String)r.returnValue);

    A.loadNewVersion(A.bytesInitial);
    B.loadNewVersion(B.bytesInitial);

View Full Code Here


  @Test
  public void invokeStaticReloading_gh4_5() throws Exception {
    TypeRegistry tr = getTypeRegistry("invokestatic.issue4..*");
    ReloadableType B = tr.addType("invokestatic.issue4.BBBB", loadBytesForClass("invokestatic.issue4.BBBB"));
   
    Result r = runUnguarded(B.getClazz(), "getMessage");
    assertEquals("Hello",(String)r.returnValue);
   
    ReloadableType thesuper = B.getSuperRtype();
    assertNull(thesuper);
    thesuper = tr.getReloadableType("invokestatic/issue4/subpkg/AAAA");
View Full Code Here

    // When run via this test, we see: byteinfo:len=98:crc=7e07276a
    // Tried running the Serialize code directly but with a clinit in the Person class: 2b4c0df4

    ReloadableType runner = tr.addType("remote.Serialize", loadBytesForClass("remote.Serialize"));
   
    Result r = null;
    r = runUnguarded(runner.getClazz(), "run");
    assertContains("check ok", r.stdout);

    person.loadNewVersion("2",retrieveRename("remote.Person", "remote.Person2"));
   
View Full Code Here

    ReloadableType runner = tr.addType("remote.Serialize", loadBytesForClass("remote.Serialize"));
   
    Class<?> clazz = runner.getClazz();
    Object instance = clazz.newInstance();
   
    Result r = null;
   
    // Basic: write and read the same Person
    r = runOnInstance(clazz,instance,"writePerson");
    assertStdoutContains("Person stored ok", r);
    r = runOnInstance(clazz,instance,"readPerson");
View Full Code Here

    ReloadableType runner = tr.addType("remote.SerializeB", loadBytesForClass("remote.SerializeB"));
   
    Class<?> clazz = runner.getClazz();
    Object instance = clazz.newInstance();
   
    Result r = null;
   
    // Basic: write and read the same Person
    r = runOnInstance(runner.getClazz(),instance,"writePerson");
    assertStdoutContains("Person stored ok", r);
    r = runOnInstance(runner.getClazz(),instance,"readPerson");
View Full Code Here

    // When the Serialize class is run directly, we see: byteinfo:len=98:crc=c1047cf6
    // When run via this test, we see: byteinfo:len=98:crc=7e07276a
    ReloadableType runner = tr.addType("remote.Serialize", loadBytesForClass("remote.Serialize"));
    Class<?> clazz = runner.getClazz();
    Object instance = clazz.newInstance();   
    Result r = runOnInstance(clazz,instance,"checkPredeserializedData");
    assertStdoutContains("Person stored ok", r);
  }
View Full Code Here

  public void invokeStaticReloading_gh4_6() throws Exception {
    TypeRegistry tr = getTypeRegistry("invokestatic.issue4..*");
    tr.addType("invokestatic.issue4.AB", loadBytesForClass("invokestatic.issue4.AB"));
    ReloadableType B = tr.addType("invokestatic.issue4.BBBBB", loadBytesForClass("invokestatic.issue4.BBBBB"));
   
    Result r = runUnguarded(B.getClazz(), "getMessage");
    assertEquals("Hello",(String)r.returnValue);
   
    ReloadableType thesuper = B.getSuperRtype();
    thesuper = tr.getReloadableType("invokestatic/issue4/subpkg/AAAA");
    assertNull(thesuper);
View Full Code Here

  public void verifyingAssociatedTypesInfo() throws Exception {
    TypeRegistry tr = getTypeRegistry("invokestatic..*");
    ReloadableType mid = tr.addType("invokestatic.issue4.AB", loadBytesForClass("invokestatic.issue4.AB"));
    ReloadableType B = tr.addType("invokestatic.issue4.BBBBB", loadBytesForClass("invokestatic.issue4.BBBBB"));
   
    Result r = runUnguarded(B.getClazz(), "getMessage");
    assertEquals("Hello",(String)r.returnValue);
   
    ReloadableType thesuper = B.getSuperRtype();
    thesuper = tr.getReloadableType("invokestatic/issue4/subpkg/AAAA");
    assertNull(thesuper);
View Full Code Here

    TypeRegistry typeRegistry = getTypeRegistry("basic.Basic");
    byte[] sc = loadBytesForClass("basic.Basic");
    ReloadableType rtype = typeRegistry.addType("basic.Basic", sc);

    Class<?> simpleClass = rtype.getClazz();
    Result r = runUnguarded(simpleClass, "foo");

    r = runUnguarded(simpleClass, "getValue");
    assertEquals(5, r.returnValue);

    int rc = SpringLoaded.loadNewVersionOfType(rtype.getClazz(), retrieveRename("basic.Basic", "basic.Basic002"));
View Full Code Here

    TypeRegistry typeRegistry = getTypeRegistry("inners.Outer$Inner");
    byte[] sc = loadBytesForClass("inners.Outer$Inner");
    ReloadableType rtype = typeRegistry.addType("inners.Outer$Inner", sc);
       
    Class<?> simpleClass = rtype.getClazz();
    Result r = null;
   
    r = runUnguarded(simpleClass, "foo");
    assertEquals("foo!", r.returnValue);
    assertTrue(Modifier.isPublic((Integer)runUnguarded(simpleClass, "getModifiers").returnValue));
    assertTrue(Modifier.isStatic((Integer)runUnguarded(simpleClass, "getModifiers").returnValue));
View Full Code Here

TOP

Related Classes of org.springsource.loaded.test.infra.Result

Copyright © 2018 www.massapicom. 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.