public <E extends BusinessEntity> List<E> store(E e1, E e2, E... eN) { List<E> es = new ArrayList<E>(eN.length + 2); Collections.addAll(es, e1, e2); Collections.addAll(es, eN); List<E> result = store(es); return result; }
public <E extends BusinessEntity> E store(E e) { Wikitty w = ((BusinessEntityImpl)e).getWikitty(); store(w); return e; }
/** * Add new lable to the wikitty object. You must only used this method, if * you don't have the Wikitty Object because this method restore and save * version in WikittyService. If you have Wikitty present in your space, your * wikitty become obsolete and you lose your change :( * * If you have wikitty or business entity you must used {@link #} * * @param proxy * @param wikittyId object'id * @param label label to add * @deprecated since 3.4 use {@link #addLabel(org.nuiton.wikitty.WikittyClient, java.lang.String, java.lang.String) } */ @Deprecated static public void addLabel(WikittyProxy proxy, String wikittyId, String label) { Wikitty w = proxy.restore(wikittyId); WikittyLabelImpl l = new WikittyLabelImpl(w); l.addLabels(label); proxy.store(l); }
@Test public void testCajo() throws Exception { // this test always fails on jenkins try { WikittyService server = startServer(); WikittyService client = getClient(); WikittyProxy proxy = new WikittyProxy(client); Wikitty w = new WikittyImpl(); proxy.store(w); List<Wikitty> list = server.restore(null, Collections.singletonList(w.getWikittyId())); Assert.assertEquals(1, list.size()); stopServer(server); } catch (Exception ex) { if (ex.getCause() instanceof ConnectException) { if (log.isErrorEnabled()) { log.error("Cajo test failed !!!", ex); } } else { throw ex; } } }