Package org.springframework.xd.analytics.metrics.core

Examples of org.springframework.xd.analytics.metrics.core.CounterRepository.save()


    String myCounterName = "myCounter";
    String yourCounterName = "yourCounter";

    // Create and save a Counter named 'myCounter'
    Counter c1 = new Counter(myCounterName);
    Counter myCounter = repo.save(c1);
    assertThat(myCounter.getName(), is(notNullValue()));
    // Create and save a Counter named 'yourCounter'
    Counter c2 = new Counter(yourCounterName);
    Counter yourCounter = repo.save(c2);
    assertThat(yourCounter.getName(), is(notNullValue()));
View Full Code Here


    Counter c1 = new Counter(myCounterName);
    Counter myCounter = repo.save(c1);
    assertThat(myCounter.getName(), is(notNullValue()));
    // Create and save a Counter named 'yourCounter'
    Counter c2 = new Counter(yourCounterName);
    Counter yourCounter = repo.save(c2);
    assertThat(yourCounter.getName(), is(notNullValue()));
    assertTrue(repo.exists(yourCounterName));

    // Retrieve by name and compare for equality to previously saved instance.
    Counter result = repo.findOne(myCounterName);
View Full Code Here

    repo.delete(yourCounter.getName());
    assertThat(repo.findOne(yourCounterName), is(nullValue()));
    assertThat(repo.count(), equalTo(0L));

    repo.save(Arrays.asList(c1, c2));
    assertThat(repo.count(), equalTo(2L));

    repo.delete(Arrays.asList(c1, c2));
    assertEquals(0, repo.count());
  }
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.