Examples of Hash


Examples of org.jboss.seam.wiki.util.Hash

                assert user == null;

                UserDAO dao = (UserDAO)getInstance(UserDAO.class);
                User dbUser = dao.findUser(3l);
                assert dbUser.getActivationCode() == null;
                Hash hashUtil = (Hash)getInstance(Hash.class);
                assert dbUser.getPasswordHash().equals(hashUtil.hash("foo123"));
            }
        }.run();

    }
View Full Code Here

Examples of org.jruby.compiler.ir.operands.Hash

        return rv;
    }

    public Operand buildHash(HashNode hashNode, IRScope m) {
        if (hashNode.getListNode() == null || hashNode.getListNode().size() == 0) {
            return new Hash(new ArrayList<KeyValuePair>());
        }
        else {
            int     i     = 0;
            Operand key   = null;
            Operand value = null;
            List<KeyValuePair> args = new ArrayList<KeyValuePair>();
            for (Node nextNode : hashNode.getListNode().childNodes()) {
                Operand v = build(nextNode, m);
                if (key == null) {
                    key = v;
                }
                else {
                    args.add(new KeyValuePair(key, v));
                    key = null;
                }
            }
            return new Hash(args);
        }
    }
View Full Code Here

Examples of org.jruby.ir.operands.Hash

        return rv;
    }

    public Operand buildHash(HashNode hashNode, IRScope s) {
        if (hashNode.getListNode() == null || hashNode.getListNode().size() == 0) {
            return copyAndReturnValue(s, new Hash(new ArrayList<KeyValuePair>()));
        } else {
            int     i     = 0;
            Operand key   = null;
            Operand value = null;
            List<KeyValuePair> args = new ArrayList<KeyValuePair>();
            for (Node nextNode : hashNode.getListNode().childNodes()) {
                Operand v = build(nextNode, s);
                if (key == null) {
                    key = v;
                } else {
                    args.add(new KeyValuePair(key, v));
                    key = null;
                }
            }
            return copyAndReturnValue(s, new Hash(args));
        }
    }
View Full Code Here

Examples of org.moparscape.msc.gs.util.Hash

      byte[] password = null;

      int lenU = p.readInt();
      username = p.readString(lenU).trim();
      int len = p.readInt();
      password = new Hash(p.readBytes(len)).value();

      if (world.countPlayers() >= Config.MAX_PLAYERS) {
        loginCode = 10;
      } else if (clientVersion < Config.SERVER_VERSION) {
        loginCode = 4;
View Full Code Here

Examples of org.moparscape.msc.ls.util.Hash

          world = new World(id, session);
          if (!Server.devMode) {
            int passL = p.readInt();
            byte[] pass = p.readBytes(passL);
            if (!Arrays.equals(
                new Hash(Config.LS_CONNECT_PASS.getBytes())
                    .value(), pass)) {
              System.out
                  .println("World provided invalid password.");
              LSPacket temp = builder.getPacket();
              if (temp != null) {
View Full Code Here

Examples of org.rendersnake.Hash

public class HashTest extends TestCase {

   
    public void testEscape(){
        Hash h = new Hash("key","<&>");
        assertEquals(" key=\"&lt;&amp;&gt;\"", h.asCharSequence());
    }
View Full Code Here

Examples of org.rendersnake.Hash

        Hash h = new Hash("key","<&>");
        assertEquals(" key=\"&lt;&amp;&gt;\"", h.asCharSequence());
    }
    public void testFail(){
        try {
            new Hash("key");
            fail("should raise ex");
        } catch (IllegalArgumentException iex) {
            assertTrue(true);
        }
       
View Full Code Here

Examples of org.rendersnake.Hash

            assertTrue(true);
        }
       
    }
    public void testJavascript(){
        Hash h = new Hash("key","value");
        assertEquals("{key:'value'}", h.toJavascript());
    }
View Full Code Here

Examples of org.rendersnake.Hash

    public void testJavascript(){
        Hash h = new Hash("key","value");
        assertEquals("{key:'value'}", h.toJavascript());
    }
    public void testMultiKey(){
        Hash h = new Hash("key","value","key2","value2");
        assertTrue(h.toJavascript().indexOf("value2") != -1);
    }
View Full Code Here

Examples of org.rendersnake.Hash

    public void testMultiKey(){
        Hash h = new Hash("key","value","key2","value2");
        assertTrue(h.toJavascript().indexOf("value2") != -1);
    }
    public void testJavascriptBoolean(){
        Hash h = new Hash("bool",true);
        assertEquals("{bool:true}", h.toJavascript());
    }   
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.