Codota Logo
NodeRepository.exists
Code IndexAdd Codota to your IDE (free)

How to use
exists
method
in
de.juplo.yourshouter.api.persistence.NodeRepository

Best Java code snippets using de.juplo.yourshouter.api.persistence.NodeRepository.exists (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: de.juplo.yourshouter.api/persistence

@Test
public void testExists()
{
 LOG.debug("<-- start of new test-case");
 assertFalse(nodeRepository.exists(uriPerson));
 assertFalse(nodeRepository.exists(uriVenue));
 nodeRepository.store(person);
 assertTrue(nodeRepository.exists(uriPerson));
 assertFalse(nodeRepository.exists(uriVenue));
 nodeRepository.store(venue);
 assertTrue(nodeRepository.exists(uriPerson));
 assertTrue(nodeRepository.exists(uriVenue));
 nodeRepository.remove(uriPerson);
 assertFalse(nodeRepository.exists(uriPerson));
 assertTrue(nodeRepository.exists(uriVenue));
 // Remove non-existent should not change anything
 nodeRepository.remove(uriPerson);
 assertFalse(nodeRepository.exists(uriPerson));
 assertTrue(nodeRepository.exists(uriVenue));
 nodeRepository.remove(uriVenue);
 assertFalse(nodeRepository.exists(uriPerson));
 assertFalse(nodeRepository.exists(uriVenue));
}
origin: de.juplo.yourshouter.api/persistence

@Test
public void testStoreAndGetPerson() throws Exception
{
 LOG.debug("<-- start of new test-case");
 Set<Uri> stored;
 assertFalse(nodeRepository.exists(uriPerson));
 notifier.clear();
 nodeRepository.store(person);
 flush();
 assertEquals(1, notifier.created.size());
 assertEquals(uriPerson, notifier.created.iterator().next());
 assertEquals(0, notifier.updated.size());
 assertEquals(0, notifier.removed.size());
 assertTrue(nodeRepository.exists(uriPerson));
 assertEquals(person, nodeRepository.get(uriPerson));
 stored = nodeRepository.stored(uriPerson.getType());
 assertEquals(1, stored.size());
 assertEquals(uriPerson, stored.iterator().next());
 Storage.openStage(nodeRepository, null, config, (NodeData n) -> {}, null, null);
 try
 {
  assertEquals(person, nodeRepository.getPerson(uriPerson.getId()));
 }
 finally
 {
  Storage.closeStage();
 }
}
origin: de.juplo.yourshouter.api/persistence

@Test
public void testStoreAndGetVenue() throws Exception
{
 LOG.debug("<-- start of new test-case");
 Set<Uri> stored;
 assertFalse(nodeRepository.exists(uriVenue));
 notifier.clear();
 nodeRepository.store(venue);
 flush();
 assertEquals(1, notifier.created.size());
 assertEquals(uriVenue, notifier.created.iterator().next());
 assertEquals(0, notifier.updated.size());
 assertEquals(0, notifier.removed.size());
 assertTrue(nodeRepository.exists(uriVenue));
 assertEquals(venue, nodeRepository.get(uriVenue));
 stored = nodeRepository.stored(uriVenue.getType());
 assertEquals(1, stored.size());
 assertEquals(uriVenue, stored.iterator().next());
 Storage.openStage(nodeRepository, null, config, (NodeData n) -> {}, null, null);
 try
 {
  assertEquals(venue, nodeRepository.getVenue(uriVenue.getId()));
 }
 finally
 {
  Storage.closeStage();
 }
}
origin: de.juplo.yourshouter.api/persistence

assertFalse(nodeRepository.exists(uriLocation));
assertEquals(0, notifier.removed.size());
assertTrue(nodeRepository.exists(uriLocation));
assertEquals(location, nodeRepository.get(uriLocation));
stored = nodeRepository.stored(uriLocation.getType());
assertFalse(nodeRepository.exists(uriEvent));
assertEquals(0, notifier.removed.size());
assertTrue(nodeRepository.exists(uriEvent));
assertEquals(event, nodeRepository.get(uriEvent));
assertEquals(location, ((EventData)nodeRepository.get(uriEvent)).getGenerator());
origin: de.juplo.yourshouter.api/persistence

@Test
public void testStoreAndGetDateWithType() throws Exception
{
 LOG.debug("<-- start of new test-case");
 config.createType("START|END");
 DetachedDate detached = (DetachedDate)parse("/xml/nodes/date.xml");
 notifier.clear();
 nodeRepository.store(detached.getNodeData());
 flush();
 assertEquals(1, notifier.created.size());
 assertEquals(detached.getUri(), notifier.created.iterator().next());
 assertEquals(0, notifier.updated.size());
 assertEquals(0, notifier.removed.size());
 assertTrue(nodeRepository.exists(detached.getUri()));
 NodeData node = nodeRepository.get(detached.getUri());
 assertNotNull(node);
 assertEquals(DATE, node.getNodeType());
 assertEquals("114095325941506", node.getId());
 DateData date = (DateData)node;
 assertEquals(detached.getType(), date.getType());
}
de.juplo.yourshouter.api.persistenceNodeRepositoryexists

Popular methods of NodeRepository

  • store
  • get
  • remove
  • stored
  • flush
  • getCategory
  • getCity
  • getCountry
  • getCustom
  • getDate
  • getDistrict
  • getEvent
  • getDistrict,
  • getEvent,
  • getExhibition,
  • getGroup,
  • getLocation,
  • getMedia,
  • getOrganization,
  • getPerson,
  • getPlace

Popular in Java

  • Making http post requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • addToBackStack (FragmentTransaction)
  • setContentView (Activity)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now