Package org.springsource.loaded.test.infra

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


  @Test
  public void rewriteWithPrimitiveReturnValues_double() throws Exception {
    TypeRegistry typeRegistry = getTypeRegistry("data.HelloWorldPrimitive");
    ReloadableType rtype = typeRegistry.addType("data.HelloWorldPrimitive", loadBytesForClass("data.HelloWorldPrimitive"));

    Result r = runUnguarded(rtype.getClazz(), "getValueDouble");
    assertTrue(r.returnValue instanceof Double);
    assertEquals(3.0D, r.returnValue);

    rtype.loadNewVersion("000", rtype.bytesInitial);
    r = runUnguarded(rtype.getClazz(), "getValueDouble");
View Full Code Here


  @Test
  public void rewriteWithPrimitiveReturnValues_char() throws Exception {
    TypeRegistry typeRegistry = getTypeRegistry("data.HelloWorldPrimitive");
    ReloadableType rtype = typeRegistry.addType("data.HelloWorldPrimitive", loadBytesForClass("data.HelloWorldPrimitive"));

    Result r = runUnguarded(rtype.getClazz(), "getValueChar");
    assertTrue(r.returnValue instanceof Character);
    assertEquals('c', r.returnValue);

    rtype.loadNewVersion("000", rtype.bytesInitial);
    r = runUnguarded(rtype.getClazz(), "getValueChar");
View Full Code Here

  @Test
  public void rewriteWithPrimitiveReturnValues_byte() throws Exception {
    TypeRegistry typeRegistry = getTypeRegistry("data.HelloWorldPrimitive");
    ReloadableType rtype = typeRegistry.addType("data.HelloWorldPrimitive", loadBytesForClass("data.HelloWorldPrimitive"));

    Result r = runUnguarded(rtype.getClazz(), "getValueByte");
    assertTrue(r.returnValue instanceof Byte);
    assertEquals((byte) 3, r.returnValue);

    rtype.loadNewVersion("000", rtype.bytesInitial);
    r = runUnguarded(rtype.getClazz(), "getValueByte");
View Full Code Here

  @Test
  public void rewriteWithPrimitiveReturnValues_intArray() throws Exception {
    TypeRegistry typeRegistry = getTypeRegistry("data.HelloWorldPrimitive");
    ReloadableType rtype = typeRegistry.addType("data.HelloWorldPrimitive", loadBytesForClass("data.HelloWorldPrimitive"));

    Result r = runUnguarded(rtype.getClazz(), "getArrayInt");
    assertTrue(r.returnValue instanceof int[]);
    assertEquals(3, ((int[]) r.returnValue)[0]);

    rtype.loadNewVersion("000", rtype.bytesInitial);
    r = runUnguarded(rtype.getClazz(), "getArrayInt");
View Full Code Here

  @Test
  public void rewriteWithPrimitiveReturnValues_stringArray() throws Exception {
    TypeRegistry typeRegistry = getTypeRegistry("data.HelloWorldPrimitive");
    ReloadableType rtype = typeRegistry.addType("data.HelloWorldPrimitive", loadBytesForClass("data.HelloWorldPrimitive"));

    Result r = runUnguarded(rtype.getClazz(), "getArrayString");
    assertTrue(r.returnValue instanceof String[]);
    assertEquals("ABC", ((String[]) r.returnValue)[0]);

    rtype.loadNewVersion("000", rtype.bytesInitial);
    r = runUnguarded(rtype.getClazz(), "getArrayString");
View Full Code Here

  @Test
  public void rewriteWithParams() throws Exception {
    TypeRegistry typeRegistry = getTypeRegistry("data.HelloWorld");
    ReloadableType rtype = typeRegistry.addType("data.HelloWorld", loadBytesForClass("data.HelloWorld"));

    Result r = runUnguarded(rtype.getClazz(), "getValueWithParams", "aaa", "bb");
    assertTrue(r.returnValue instanceof String);
    assertEquals("message with inserts aaa and bb", r.returnValue);

    rtype.loadNewVersion("000", rtype.bytesInitial);
    r = runUnguarded(rtype.getClazz(), "getValueWithParams", "c", "d");
View Full Code Here

  @Test
  public void rewriteStaticWithParams() throws Exception {
    TypeRegistry typeRegistry = getTypeRegistry("data.HelloWorld");
    ReloadableType rtype = typeRegistry.addType("data.HelloWorld", loadBytesForClass("data.HelloWorld"));

    Result r = runUnguarded(rtype.getClazz(), "getStaticValueWithParams", "aaa", "bb");
    assertTrue(r.returnValue instanceof String);
    assertEquals("static message with inserts aaa and bb", r.returnValue);

    rtype.loadNewVersion("000", rtype.bytesInitial);
    r = runUnguarded(rtype.getClazz(), "getStaticValueWithParams", "c", "d");
View Full Code Here

  @Test
  public void rewriteStaticWithPrimitiveParams() throws Exception {
    TypeRegistry typeRegistry = getTypeRegistry("data.HelloWorld");
    ReloadableType rtype = typeRegistry.addType("data.HelloWorld", loadBytesForClass("data.HelloWorld"));

    Result r = runUnguarded(rtype.getClazz(), "getStaticValueWithPrimitiveParams", "a", 2, 'c');
    assertTrue(r.returnValue instanceof String);
    assertEquals("message with inserts a and 2 and c", r.returnValue);

    rtype.loadNewVersion("000", rtype.bytesInitial);
    r = runUnguarded(rtype.getClazz(), "getStaticValueWithPrimitiveParams", "a", 2, 'c');
View Full Code Here

  @Test
  public void rewriteStaticWithPrimitiveDoubleSlottersParams() throws Exception {
    TypeRegistry typeRegistry = getTypeRegistry("data.HelloWorld");
    ReloadableType rtype = typeRegistry.addType("data.HelloWorld", loadBytesForClass("data.HelloWorld"));

    Result r = runUnguarded(rtype.getClazz(), "getStaticValueWithPrimitiveDSParams", 3L, "a", 2.0d, true);
    assertTrue(r.returnValue instanceof String);
    assertEquals("message with inserts 3 and a and 2.0 and true", r.returnValue);

    rtype.loadNewVersion("000", rtype.bytesInitial);
    r = runUnguarded(rtype.getClazz(), "getStaticValueWithPrimitiveDSParams", 3L, "a", 2.0d, true);
View Full Code Here

    ReloadableType rRunner = typeRegistry.addType(runner, loadBytesForClass(runner));

    String[] retargets = new String[] { theInterface + "002:" + theInterface, theImpl + "002:" + theImpl,
        runner + "002:" + runner };

    Result result = runUnguarded(rRunner.getClazz(), "run");
    assertNull(result.returnValue);

    rInterface.loadNewVersion("002", ClassRenamer.rename(theInterface, loadBytesForClass(theInterface + "002"), retargets));
    rImpl.loadNewVersion("002", ClassRenamer.rename(theImpl, loadBytesForClass(theImpl + "002"), retargets));
    rRunner.loadNewVersion("002", ClassRenamer.rename(runner, loadBytesForClass(runner + "002"), retargets));
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.