use of org.apache.commons.collections.list.GrowthList in project gradle by gradle.
the class TestTest method method.
public void method() {
FilenameUtils.separatorsToUnix("my/unix/filename");
ToStringBuilder.reflectionToString(new Person("name"));
new GrowthList();
// compile with api-spi, runtime with api
new PersonList().doSomethingWithImpl();
}
use of org.apache.commons.collections.list.GrowthList in project gradle by gradle.
the class PersonIntegrationTest method canConstructAPersonWithAName.
@Test
public void canConstructAPersonWithAName() {
// check our classpath
List list = new GrowthList();
// check Jar exists
File jarFile = new File(System.getProperty("jar.path"));
assertTrue(jarFile.isFile());
Person person = PersonTestFixture.create("Larry");
assertEquals("Larry", person.getName());
}
use of org.apache.commons.collections.list.GrowthList in project simplejpa by appoxy.
the class LazyList method loadAtleastItems.
private synchronized void loadAtleastItems(int index) {
if ((backingList != null && nextToken == null) || (!noLimit() && index >= maxResults)) {
return;
}
if (backingList == null) {
backingList = new GrowthList();
}
while (backingList.size() <= index) {
SelectResult qr;
try {
if (logger.isLoggable(Level.FINER))
logger.finer("query for lazylist=" + origQuery);
int limit = maxResults - backingList.size();
String limitQuery = realQuery + " limit " + (noLimit() ? maxResultsPerToken : Math.min(maxResultsPerToken, limit));
if (em.getFactory().isPrintQueries())
System.out.println("query in lazylist=" + limitQuery);
qr = DomainHelper.selectItems(this.em.getSimpleDb(), limitQuery, nextToken, isConsistentRead());
if (logger.isLoggable(Level.FINER))
logger.finer("got items for lazylist=" + qr.getItems().size());
for (Item item : qr.getItems()) {
backingList.add((E) em.buildObject(genericReturnType, item.getName(), item.getAttributes()));
}
if (qr.getNextToken() == null || (!noLimit() && qr.getItems().size() == limit)) {
nextToken = null;
break;
}
if (!noLimit() && qr.getItems().size() > limit) {
throw new PersistenceException("Got more results than the limit.");
}
nextToken = qr.getNextToken();
} catch (AmazonClientException e) {
throw new PersistenceException("Query failed: Domain=" + domainName + " -> " + origQuery, e);
}
}
}
Aggregations