Changeset 2563
- Timestamp:
- 06/30/08 21:11:28 (5 months ago)
- Location:
- trunk/components
- Files:
-
- 3 modified
-
blitz/resources/omero/Constants.ice (modified) (1 diff)
-
model/src/ome/util/builders/PojoOptions.java (modified) (2 diffs)
-
server/test/ome/server/itests/PojosServiceTest.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/components/blitz/resources/omero/Constants.ice
r2270 r2563 63 63 const string POJOEXPERIMENTER = "experimenter"; // omero::RLong 64 64 const string POJOGROUP = "group"; // omero::RLong 65 65 const string POJOLIMIT = "limit"; // omero::RInt 66 const string POJOOFFSET = "offset"; // omero::RInt 67 const string POJOSTARTTIME = "startTime"; // omero::RTime 68 const string POJOENDTIME = "endTime"; // omero::RTime 66 69 /* 67 70 * Used by IPojos.findCGCPaths(...,string algo,...) -
trunk/components/model/src/ome/util/builders/PojoOptions.java
r2052 r2563 39 39 public static final String END_TIME = "endTime"; 40 40 41 public static final String OFFSET = "offset"; 42 43 public static final String LIMIT = "limit"; 44 41 45 private final Map options = new HashMap(); 42 46 … … 150 154 151 155 /* 156 * ============================== Pagination ============================== 157 */ 158 159 public PojoOptions paginate(int offset, int limit) { 160 options.put(OFFSET, offset); 161 options.put(LIMIT, limit); 162 return this; 163 } 164 165 public PojoOptions noPagination() { 166 remove(OFFSET); 167 remove(LIMIT); 168 return this; 169 } 170 171 public boolean isPagination() { 172 return options.containsKey(OFFSET); 173 } 174 175 public Integer getOffset() { 176 return (Integer) options.get(OFFSET); 177 } 178 179 public Integer getLimit() { 180 return (Integer) options.get(LIMIT); 181 } 182 183 /* 152 184 * ============================== Filtered by Group 153 185 * ============================== -
trunk/components/server/test/ome/server/itests/PojosServiceTest.java
r2259 r2563 37 37 /** 38 38 * 39 * @author Josh Moore <a 40 * href="mailto:josh.moore@gmx.de">josh.moore@gmx.de</a> 41 * @version 1.0 <small> (<b>Internal version:</b> $Rev$ $Date$) </small> 42 * @since 1.0 39 * @author Josh Moore, josh at glencoesoftware.com 43 40 */ 44 41 public class PojosServiceTest extends AbstractManagedContextTest { … … 123 120 } 124 121 125 // ticket 651122 @Test(groups = "ticket:651") 126 123 public void testIntervalInPojoOptions() { 127 124 Long userID = factory.getAdminService().getEventContext() … … 149 146 iPojos.getImages(Dataset.class, Collections.singleton(ds.getId()), 150 147 options.map()); 148 } 149 150 @Test(groups = "ticket:1018") 151 public void testIntervalPojoMethodsReturnsCounts() { 152 Long userID = factory.getAdminService().getEventContext() 153 .getCurrentUserId(); 154 // create 155 Dataset ds = new Dataset(); 156 ds.setName("ticket:1018"); 157 Image im = new Image(); 158 im.setName("ticket:1018"); 159 Pixels pi = ObjectFactory.createPixelGraph(null); 160 im.addPixels(pi); 161 ds.linkImage(im); 162 ds = iUpdate.saveAndReturnObject(ds); 163 164 // test 165 Timestamp startTime = getDate("before"); 166 Timestamp endTime = getDate("after"); 167 168 PojoOptions options = new PojoOptions(); 169 options.exp(userID); 170 options.startTime(startTime); 171 options.endTime(endTime); 172 173 Set<Image> images = iPojos.getImagesByOptions(options.map()); 174 Image i = images.iterator().next(); 175 assertTrue(i.getAnnotationLinksCountPerOwner() != null); 176 151 177 } 152 178
