Package org.keplerproject.luajava

Examples of org.keplerproject.luajava.LuaState.openLibs()


   */
  public void testLoadRun() throws Exception
  {
    // test loadfile
    LuaState L = LuaStateFactory.newLuaState();
    L.openLibs();
   
    int loadRes = L.LloadFile("wrongLuaFile.lua");
    assertEquals(loadRes, LuaState.LUA_ERRSYNTAX.intValue());
    System.out.println(L.toString(-1));
    L.pop(1);
View Full Code Here


   * Test the check functions.
   */
  public void testChecks()
  {
    LuaState L = LuaStateFactory.newLuaState();
    L.openLibs();
   
    String testCheckStr = "testCheck";
   
    L.pushString(testCheckStr);
    assertEquals(testCheckStr, L.LcheckString(-1));
View Full Code Here

   * Checks the metamethods and metatable functions.
   */
  public void testMeta() throws LuaException
  {
    LuaState L = LuaStateFactory.newLuaState();
    L.openLibs();
   
    L.newTable();
    L.newTable();
    L.pushString("__index");
    L.LdoString("return function()" +
View Full Code Here

    {
      st.executeUpdate("INSERT INTO luatest (id, str, number) values(" + i + ", '" + 2*i + "', " + System.currentTimeMillis() + ")");
    }
   
    LuaState L = LuaStateFactory.newLuaState();
    L.openLibs();
   
    //L.pushString("st");
    L.pushObjectValue(st);
    //L.setTable(LuaState.LUA_GLOBALSINDEX.intValue());
    L.setGlobal("st");
View Full Code Here

    assertEquals(luaMap.size(), 0);
   
   
    // test using a lua table
    LuaState L = LuaStateFactory.newLuaState();
    L.openLibs();
    int err = L.LdoFile("testMap.lua");
    if(err != 0)
    {
      switch (err)
      {
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.