public void clear(String fileName, String boxName) { try { setProperty(fileName, boxName, new UserInfo.Val("")); } catch (RepositoryException e) { log.error("Unable to clear", e); throw new RulesRepositoryException(e); } }
public void clear(String fileName, String boxName) { try { setProperty(fileName, boxName, new UserInfo.Val("")); } catch (RepositoryException e) { log.error("Unable to clear", e); throw new RulesRepositoryException(e); } }
public void writeEntries(String fileName, String boxName, List<InboxEntry> entries) throws RulesRepositoryException { try { String entry = getXStream().toXML(entries); setProperty(fileName, boxName, new UserInfo.Val(entry)); } catch (RepositoryException e) { log.error("Unable to writeEntries", e); throw new RulesRepositoryException(e); } }
public void writeEntries(String fileName, String boxName, List<InboxEntry> entries) throws RulesRepositoryException { try { String entry = getXStream().toXML(entries); setProperty(fileName, boxName, new UserInfo.Val(entry)); } catch (RepositoryException e) { log.error("Unable to writeEntries", e); throw new RulesRepositoryException(e); } }
@Test public void testIterateOverUsers() throws Exception { RulesRepository repo = RepositorySessionUtil.getRepository(); final List<String> names = new ArrayList<String>(); UserInfo uf = new UserInfo(repo); uf.init(repo, "michael"); uf.setProperty("random", "property", new UserInfo.Val("hi")); UserInfo.eachUser(repo, new UserInfo.Command() { public void process(String toUser) { names.add(toUser); } }); assertTrue(names.size() > 0) ; assertTrue(names.contains("michael")); }
info.setProperty("inbox", "something", new UserInfo.Val("boo")); info.save(); info.setProperty("inbox", "something", new UserInfo.Val("boo")); info.save(); info.setProperty("inbox", "something", new UserInfo.Val("boo2")); info.setProperty("inbox", "another", new UserInfo.Val("boo")); assertEquals("boo", info.getProperty("inbox", "another").value); info.setProperty("inbox", "something", new UserInfo.Val("boo")); info.setProperty("inbox", "something", new UserInfo.Val("boo2")); info.setProperty("inbox", "another", new UserInfo.Val("boo")); assertEquals("boo", info.getProperty("inbox", "another").value); info.setProperty("inbox", "whee", new UserInfo.Val("boo")); info.setProperty("inbox", "hi", new UserInfo.Val("42")); assertEquals("42", info.getProperty("inbox", "hi").value); info.setProperty("inbox", "hi", new UserInfo.Val("43")); assertEquals("43", info.getProperty("inbox", "hi").value); info.setProperty("inbox", "hi", new UserInfo.Val("42")); assertEquals("42", info.getProperty("inbox", "hi").value);