@org.junit.Test
 public void testGetJedisPoolByName() throws Exception {
   JedisPoolService jedisPoolService = JedisPoolServiceImpl.getJedisPoolService();
   JedisPool jedisPool = jedisPoolService.getJedisPoolByName("test01");
   if (jedisPool != null) {
     Util.report("get suc");
     Jedis jedis = jedisPool.getResource();
     String v = jedisPool.getResource().get("foo");
     Util.report(v);
     jedisPool.returnResource(jedis);
   }
 }
Пример #2
0
 public static void main(String[] args) throws FileNotFoundException, DocumentException {
   SAXReader saxReader = new SAXReader();
   String path = System.getProperty("user.dir", "<NA>") + "/target/classes/Test.tld";
   FileInputStream inputStream = new FileInputStream(new File(path));
   Document document = saxReader.read(inputStream, "GBK");
   Element rootElement = document.getRootElement();
   String varsion = rootElement.elementText("tlib-version");
   Util.report(varsion);
 }
Пример #3
0
  public static void main(String[] args) {
    ActorSystem system = ActorSystem.create("MySystem");
    long now = System.currentTimeMillis();
    //        ActorRef smsA = system.actorOf(Props.create(SmsActor.class), "sms_" + "" + "");

    for (int i = 0; i < 1000; i++) {
      ActorRef smsA = system.actorOf(Props.create(SmsActor.class), "sms_" + i + "");
      Sms sms = new Sms();
      sms.content = "hello wj + " + i;
      sms.sender = "wj +" + i;
      sms.receiver = "jj +" + i;
      smsA.tell(sms, ActorRef.noSender());
    }
    Util.report(System.currentTimeMillis() - now);
  }