Package org.infinispan.cli.interpreter

Examples of org.infinispan.cli.interpreter.Interpreter.execute()


      Object a = cache.get("a");
      assert a.equals("a");
      interpreter.execute(sessionId, "replace 'a' 'b';");
      a = cache.get("a");
      assert a.equals("b");
      interpreter.execute(sessionId, "replace 'a' 'b' 'c';");
      a = cache.get("a");
      assert a.equals("c");
      interpreter.execute(sessionId, "replace 'a' 'b' 'd';");
      a = cache.get("a");
      assert a.equals("c");
View Full Code Here


      a = cache.get("a");
      assert a.equals("b");
      interpreter.execute(sessionId, "replace 'a' 'b' 'c';");
      a = cache.get("a");
      assert a.equals("c");
      interpreter.execute(sessionId, "replace 'a' 'b' 'd';");
      a = cache.get("a");
      assert a.equals("c");
   }

   public void testCreateLocal() throws Exception {
View Full Code Here

   }

   public void testCreateLocal() throws Exception {
      Interpreter interpreter = getInterpreter();
      String sessionId = interpreter.createSessionId(BasicCacheContainer.DEFAULT_CACHE_NAME);
      interpreter.execute(sessionId, "create newcache;");
      assert cacheManager.cacheExists("newcache");
      interpreter.execute(sessionId, "create anothercache like newcache;");
      assert cacheManager.cacheExists("anothercache");
   }
View Full Code Here

   public void testCreateLocal() throws Exception {
      Interpreter interpreter = getInterpreter();
      String sessionId = interpreter.createSessionId(BasicCacheContainer.DEFAULT_CACHE_NAME);
      interpreter.execute(sessionId, "create newcache;");
      assert cacheManager.cacheExists("newcache");
      interpreter.execute(sessionId, "create anothercache like newcache;");
      assert cacheManager.cacheExists("anothercache");
   }

   public void testUpgrade() throws Exception {
      Interpreter interpreter = getInterpreter();
View Full Code Here

   }

   public void testUpgrade() throws Exception {
      Interpreter interpreter = getInterpreter();
      String sessionId = interpreter.createSessionId(BasicCacheContainer.DEFAULT_CACHE_NAME);
      interpreter.execute(sessionId, "upgrade --dumpkeys;");
   }

   public void testInvalidSession() throws Exception {
      Interpreter interpreter = getInterpreter();
      String sessionId = "123";
View Full Code Here

   }

   public void testInvalidSession() throws Exception {
      Interpreter interpreter = getInterpreter();
      String sessionId = "123";
      Map<String, String> response = interpreter.execute(sessionId, "put 'a' 'a';");
      assert response.containsKey(ResultKeys.ERROR.toString());
   }

   public void testCacheNotYetSelected() throws Exception {
      GlobalComponentRegistry gcr = TestingUtil.extractGlobalComponentRegistry(this.cacheManager);
View Full Code Here

   public void testCacheNotYetSelected() throws Exception {
      GlobalComponentRegistry gcr = TestingUtil.extractGlobalComponentRegistry(this.cacheManager);
      Interpreter interpreter = gcr.getComponent(Interpreter.class);
      String sessionId = interpreter.createSessionId(null);
      Map<String, String> response = interpreter.execute(sessionId, "cache;");
      assert response.containsKey(ResultKeys.ERROR.toString());
      String errorMsg = LogFactory.getLog(CacheStatement.class, Log.class).noCacheSelectedYet().getMessage();
      assert response.get(ResultKeys.ERROR.toString()).contains(errorMsg);
   }
View Full Code Here

   public void testStats() throws Exception {
      GlobalComponentRegistry gcr = TestingUtil.extractGlobalComponentRegistry(this.cacheManager);
      Interpreter interpreter = gcr.getComponent(Interpreter.class);
      String sessionId = interpreter.createSessionId(BasicCacheContainer.DEFAULT_CACHE_NAME);
      Map<String, String> response = interpreter.execute(sessionId, "stats;");
      assert !response.containsKey(ResultKeys.ERROR.toString());
      response = interpreter.execute(sessionId, "stats --container;");
      assert !response.containsKey(ResultKeys.ERROR.toString());
   }
}
View Full Code Here

      GlobalComponentRegistry gcr = TestingUtil.extractGlobalComponentRegistry(this.cacheManager);
      Interpreter interpreter = gcr.getComponent(Interpreter.class);
      String sessionId = interpreter.createSessionId(BasicCacheContainer.DEFAULT_CACHE_NAME);
      Map<String, String> response = interpreter.execute(sessionId, "stats;");
      assert !response.containsKey(ResultKeys.ERROR.toString());
      response = interpreter.execute(sessionId, "stats --container;");
      assert !response.containsKey(ResultKeys.ERROR.toString());
   }
}
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.