Examples of Telex


Examples of org.telehash.model.Telex

      assertEquals(i + 1, ((Integer)a.get(i)).intValue());
    }
  }
 
  public void testWrite() throws Exception {
    Telex telex = TelehashFactory.eINSTANCE.createTelex();
    telex.setTo(new InetSocketAddress(Inet4Address.getLocalHost(), 40104));
    telex.setEnd(Hash.of(telex.getTo()));
    telex.setLine(2323);
    telex.getUnmatched().put("master_shake", "shakezoola");
    telex.getUnmatched().put("frylock", "on_top");
    telex.getUnmatched().put("meatwad", "making_money_see");
    String jsonTxt = JsonMapper.toJson(telex);
    System.out.println(jsonTxt);
  }
View Full Code Here

Examples of org.telehash.model.Telex

    String jsonTxt = JsonMapper.toJson(telex);
    System.out.println(jsonTxt);
  }
 
  public void testWrite2() throws Exception {
    Telex telex = TelehashFactory.eINSTANCE.createTelex();
    telex.setTo(new InetSocketAddress(Inet4Address.getLocalHost(), 40104));
    telex.setEnd(Hash.of(telex.getTo()));
    telex.setLine(2323);
    telex.getSee().add(new InetSocketAddress(Inet4Address.getLocalHost(), 30103));
    telex.getUnmatched().put("master_shake", "shakezoola");
    telex.getUnmatched().put("frylock", "on_top");
    telex.getUnmatched().put("meatwad", "making_money_see");
    String jsonTxt = JsonMapper.toJson(telex);
    System.out.println(jsonTxt);
  }
View Full Code Here

Examples of org.telehash.model.Telex

  }
 
  public void testParseTaps() throws Exception {
    String msg =
      "{\".tap\":[{\"has\":[\"+pop\"],\"is\":{\"+end\":\"38666817e1b38470644e004b9356c1622368fa57\"}}],\"_line\":346630599,\"_br\":18218,\"+end\":\"38666817e1b38470644e004b9356c1622368fa57\",\"_to\":\"24.155.138.225:54782\"}"
    Telex telex = (Telex) JsonMapper.fromJson(msg, TelehashPackage.Literals.TELEX);
    Assert.assertTrue(telex.getTap().get(0).getHas().contains("+pop"));
    Assert.assertTrue(
        ((String) telex.getTap().get(0).getIs().get("+end")).startsWith("38666"));
  }
View Full Code Here

Examples of org.telehash.model.Telex

  }
 
  public void testFieldsAndTheWaysWeCanAccessThem() throws Exception {
    String msg =
      "{\".tap\":[{\"has\":[\"+pop\"],\"is\":{\"+end\":\"38666817e1b38470644e004b9356c1622368fa57\"}}],\"_line\":346630599,\"_br\":18218,\"+end\":\"38666817e1b38470644e004b9356c1622368fa57\",\"_to\":\"24.155.138.225:54782\"}"
    Telex telex = (Telex) JsonMapper.fromJson(msg, TelehashPackage.Literals.TELEX);
    Assert.assertTrue(telex.getTap().get(0).getHas().contains("+pop"));
   
    Assert.assertEquals(346630599, telex.getLine());
    Assert.assertEquals(346630599, telex.get("_line"));
   
    JsObject thObj = telex.getTap().get(0).getIs();
    Assert.assertEquals("38666817e1b38470644e004b9356c1622368fa57", thObj.get("+end"));
  }
View Full Code Here

Examples of org.telehash.model.Telex

    JsObject thObj = telex.getTap().get(0).getIs();
    Assert.assertEquals("38666817e1b38470644e004b9356c1622368fa57", thObj.get("+end"));
  }
 
  public void testWallTelex() throws Exception {
    Telex telex = (Telex) tf.createTelex()
      .withTo(new InetSocketAddress(Inet4Address.getLocalHost(), 40104))
      .withEnd(Hash.of("42"))
      .with("+guid", System.currentTimeMillis())
      .with("_hop", 1)
      .with("+wall", "hello world");
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.