Package com.bj58.spat.gaea.server.core.convert

Examples of com.bj58.spat.gaea.server.core.convert.JsonConvert


    TestEntity te = TestEntity.createInstrance();
    String jsonStr = JsonHelper.toJsonExt(te);

    JSONObject jsonObj = new JSONObject(jsonStr);

    TestEntityII actual = (TestEntityII) new JsonConvert().convertToT(
        jsonObj.get("fObject"), TestEntityII.class);

    junit.framework.Assert.assertEquals(
        ((TestEntityII) te.getFObject()).getId(), actual.getId());
    junit.framework.Assert.assertEquals(
View Full Code Here


 
  private static String jarPath = "E:\\javaproject\\bj58.gaea.server\\lib";
 
  @Test
  public void testContract() {
    ClassInfo ciMulti = ScanClass.contract(IMulti.class);
    List<MethodInfo> miList1 = ciMulti.getMethodList();
    Assert.assertEquals("loadByID", miList1.get(0).getMethod().getName());
    Assert.assertEquals("loadByName", miList1.get(1).getMethod().getName());

   
    ClassInfo ciSingle = ScanClass.contract(ISingle.class);
    List<MethodInfo> miList2 = ciSingle.getMethodList();
    Assert.assertEquals("loadByID", miList2.get(0).getMethod().getName());
  }
View Full Code Here

  @SuppressWarnings("rawtypes")
  @Test
  public void testGetContractInfo() throws Exception {
    DynamicClassLoader classLoader = new DynamicClassLoader();
    classLoader.addFolder(jarPath);
    ContractInfo ci = ScanClass.getContractInfo(jarPath, classLoader);
    for(SessionBean sb : ci.getSessionBeanList()) {
     
      Assert.assertEquals("com.bj58.spat.servicedemo.contract.INewsService", sb.getInterfaceName());
     
      Map<String, String> map = sb.getInstanceMap();
      Iterator it = map.entrySet().iterator();
View Full Code Here

        }
        allMethodList.add(m);
      }
    }

    ProxyClassCreater pcc = new ProxyClassCreater();
    // method
    for (Method m : uniqueMethodList) {
      System.out.println("create method:" + m.getName());
      String methodStr = pcc.createMethods("TestClass", m.getName(),
          allMethodList, uniqueNameList);
      System.out.println("method(" + m.getName() + ") source code:"
          + methodStr);

      TestEntity te = new TestEntity();
View Full Code Here

 
  @SuppressWarnings("rawtypes")
  @Test
  public void testGetContractInfo() throws Exception {
    DynamicClassLoader classLoader = new DynamicClassLoader();
    classLoader.addFolder(jarPath);
    ContractInfo ci = ScanClass.getContractInfo(jarPath, classLoader);
    for(SessionBean sb : ci.getSessionBeanList()) {
     
      Assert.assertEquals("com.bj58.spat.servicedemo.contract.INewsService", sb.getInterfaceName());
     
View Full Code Here

 
 

  @Test
  public void testGetContractClassInfos() throws Exception {
    DynamicClassLoader classLoader = new DynamicClassLoader();
    classLoader.addFolder(jarPath);
    List<ClassInfo> ciList = ScanClass.getContractClassInfos(jarPath, classLoader);
   
    for(int i=0; i<ciList.size(); i++) {
      if(i == 0) {
        Assert.assertEquals("com.bj58.spat.servicedemo.contract.INewsService",
View Full Code Here

 
 

  @Test
  public void testGetBehaviorClassInfos() throws Exception {
    DynamicClassLoader classLoader = new DynamicClassLoader();
    classLoader.addFolder(jarPath);
    List<ClassInfo> ciList = ScanClass.getBehaviorClassInfos(jarPath, classLoader);
   
    for(int i=0; i<ciList.size(); i++) {
      if(i == 0) {
        Assert.assertEquals("NewsService",
View Full Code Here

  }
 
  @Test
  public void hotDeploy() throws Exception {
   
    DynamicURLClassLoader classLoader = new DynamicURLClassLoader();
    classLoader.addURL("D:/serviceframe_v2_online/lib/serviceframe/serviceframe-2.0.1.beta.jar");
    classLoader.addFolder("D:/serviceframe_v2_online/service/deploy/imc/");
    Class<?> cmCls = classLoader.loadClass("com.bj58.sfft.serviceframe.deploy.bytecode.CreateManager");
   
    Method createProxy = cmCls.getDeclaredMethod("careteProxy", new Class[] { String.class });
    IProxyFactory pf = (IProxyFactory)createProxy.invoke(cmCls.newInstance(), "D:/serviceframe_v2_online/service/deploy/imc/");
    System.out.println("pf:" + pf);
  }
View Full Code Here

public class ProtocolParseFilterTest {

  @Test
  public void testFilter() {
    byte[] buf = new byte[]{1,-79,0,0,0,1,0,0,0,101,2,0,4,1,-5,107,-6,25,0,-23,3,0,0,19,0,0,0,19,0,0,0,0,-22,3,0,0,1,0,0,0,39,5,-10,-65,39,5,-10,-65,0,-21,3,0,0,18,0,0,0,0,-20,3,0,0,4,0,0,0,85,115,101,114,17,-116,74,-65,17,-116,74,-65,0,-19,3,0,0,24,0,0,0,24,0,0,0,0,-18,3,0,0,1,0,0,0,5,0,0,0,29,18,0,0,0,0,-17,3,0,0,19,0,0,0,49,107,99,54,54,52,53,56,56,64,107,117,99,104,101,46,99,111,109,11,0,0,0,116,72,-59,0,0,0,0,0,18,0,0,0,1,-20,3,0,0,18,0,0,0,0,-16,3,0,0,6,0,0,0,117,112,100,97,116,101};
    ProtocolParseFilter filter = new ProtocolParseFilter();
  }
View Full Code Here

public class CountTest {

  @Test
  public void testCreateCommand() {
    Count count = new Count();
    Command command1 = count.createCommand("count");
    Assert.assertEquals(CommandType.Count, command1.getCommandType());
    Assert.assertEquals("#all#", command1.getMethod());
    Assert.assertEquals(1, command1.getSecond());
   
   
    Command command2 = count.createCommand("count|second 2|method getInfo");
    Assert.assertEquals(CommandType.Count, command2.getCommandType());
    Assert.assertEquals("getInfo", command2.getMethod());
    Assert.assertEquals(2, command2.getSecond());
  }
View Full Code Here

TOP

Related Classes of com.bj58.spat.gaea.server.core.convert.JsonConvert

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.