DXSearch { public static FindDataObjectsRequestBuilder<DXDataObject> findDataObjects() { return new FindDataObjectsRequestBuilder<DXDataObject>(); } private  DXSearch(); static FindDataObjectsRequestBuilder<DXDataObject> findDataObjects(); static FindDataObjectsRequestBuilder<DXDataObject> findDataObjectsWithEnvironment(
            DXEnvironment env); static FindExecutionsRequestBuilder<DXExecution> findExecutions(); static FindExecutionsRequestBuilder<DXExecution> findExecutionsWithEnvironment(
            DXEnvironment env); @Deprecated static FindExecutionsRequestBuilder<DXJob> findJobs(); @Deprecated static FindExecutionsRequestBuilder<DXJob> findJobsWithEnvironment(DXEnvironment env);  }
@Test public void testFindDataObjects() { DXRecord moo = DXRecord.newRecord().setProject(testProject).setName("Moo") .putProperty("sampleId", "1").putProperty("process", "a") .addTypes(ImmutableList.of("genome", "report")).build().close(); sleep(1500); DXRecord foo = DXRecord.newRecord().setProject(testProject).setName("foo") .putProperty("sampleId", "2").addTags(ImmutableList.of("mytag")) .addTypes(ImmutableList.of("genome")).build().close(); sleep(1500); DXRecord food = DXRecord.newRecord().setProject(testProject).setName("food") .putProperty("process", "a").setFolder("/subfolder", true) .addTypes(ImmutableList.of("report")).build().close(); sleep(1500); DXRecord open = DXRecord.newRecord().setProject(testProject).setName("open") .addTypes(ImmutableList.of("type")).build(); DXRecord invisible = DXRecord.newRecord().setProject(testProject).setName("invisible") .setVisibility(false).build().close(); assertEqualsAnyOrder( DXSearch.findDataObjects().nameMatchesExactly("foo").inProject(testProject) .execute().asList(), foo); assertEqualsAnyOrder( DXSearch.findDataObjects().nameMatchesGlob("foo*").inProject(testProject).execute() .asList(), foo, food); assertEqualsAnyOrder(DXSearch.findDataObjects().nameMatchesRegexp("[a-m]oo[^x]?") .inProject(testProject).execute().asList(), foo, food); assertEqualsAnyOrder(DXSearch.findDataObjects().nameMatchesRegexp("[a-m]oo[^x]?", true) .inProject(testProject).execute().asList(), moo, foo, food); List<DXDataObject> createdBeforeResults = DXSearch.findDataObjects().inProject(testProject) .createdBefore(moo.describe().getCreationDate()).execute().asList(); Assert.assertTrue(1 <= createdBeforeResults.size() && createdBeforeResults.size() <= 4); Assert.assertTrue(createdBeforeResults.contains(moo)); List<DXDataObject> createdAfterResults = DXSearch.findDataObjects().inProject(testProject) .createdAfter(food.describe().getCreationDate()).execute().asList(); Assert.assertTrue(2 <= createdAfterResults.size() && createdAfterResults.size() <= 4); Assert.assertTrue(createdAfterResults.contains(food)); Assert.assertTrue(createdAfterResults.contains(open)); assertEqualsAnyOrder( DXSearch.findDataObjects().inProject(testProject) .modifiedBefore(foo.describe().getModificationDate()).execute().asList(), moo, foo); assertEqualsAnyOrder( DXSearch.findDataObjects().inProject(testProject) .modifiedAfter(foo.describe().getModificationDate()).execute().asList(), foo, food, open); assertEqualsAnyOrder(DXSearch.findDataObjects().inFolder(testProject, "/").execute() .asList(), moo, foo, open); assertEqualsAnyOrder(DXSearch.findDataObjects().inFolderOrSubfolders(testProject, "/") .execute().asList(), moo, foo, food, open); assertEqualsOrdered(DXSearch.findDataObjects().inFolder(testProject, "/") .withSortBy("created", DXSearch.Ordering.ASCENDING) .execute().asList(), moo, foo, open); assertEqualsAnyOrder(DXSearch.findDataObjects().inFolderOrSubfolders(testProject, "/") .withSortBy("created", DXSearch.Ordering.DESCENDING) .execute().asList(), open, foo, food, moo); assertEqualsAnyOrder( DXSearch.findDataObjects().inProject(testProject).withProperty("sampleId") .execute().asList(), moo, foo); assertEqualsAnyOrder( DXSearch.findDataObjects().inProject(testProject).withProperty("sampleId", "2") .execute().asList(), foo); assertEqualsAnyOrder( DXSearch.findDataObjects() .inProject(testProject) .withProperties( PropertiesQuery.allOf(PropertiesQuery.withKey("sampleId"), PropertiesQuery.withKeyAndValue("process", "a"))).execute() .asList(), moo); assertEqualsAnyOrder( DXSearch.findDataObjects() .inProject(testProject) .withProperties( PropertiesQuery.anyOf(PropertiesQuery.withKey("sampleId"), PropertiesQuery.withKeyAndValue("process", "a"))).execute() .asList(), moo, foo, food); assertEqualsAnyOrder( DXSearch.findDataObjects().inProject(testProject) .withProperty("sampleId", false) .execute().asList(), open, food); Map<String, String> notEqualMap = new HashMap<String, String>() {{ put("$ne", "1"); }}; assertEqualsAnyOrder( DXSearch.findDataObjects().inProject(testProject) .withProperty("sampleId", notEqualMap) .execute().asList(), foo); Map<String, String> notEqual1 = new HashMap<String, String>() {{ put("$ne", "1"); }}; Map<String, String> notEqual2 = new HashMap<String, String>() {{ put("$ne", "2"); }}; assertEqualsAnyOrder( DXSearch.findDataObjects().inProject(testProject) .withProperties( PropertiesQuery.allOf(PropertiesQuery.withKeyAndMapValue("sampleId", notEqual1), PropertiesQuery.withKeyAndMapValue("sampleId", notEqual2)) ) .execute().asList()); assertEqualsAnyOrder( DXSearch.findDataObjects().inProject(testProject) .withProperties( PropertiesQuery.anyOf(PropertiesQuery.withKeyAndBoolean("sampleId", true), PropertiesQuery.withKeyAndBoolean("process", false)) ) .execute().asList(), moo, foo, open); assertEqualsAnyOrder( DXSearch.findDataObjects().inProject(testProject) .withProperties( PropertiesQuery.allOf(PropertiesQuery.withKeyAndBoolean("sampleId", true), PropertiesQuery.withKeyAndBoolean("sampleId", false)) ) .execute().asList()); assertEqualsAnyOrder( DXSearch.findDataObjects().inProject(testProject) .withProperty("xyzxyzxyz", false) .execute().asList(), moo, foo, food, open); assertEqualsAnyOrder( DXSearch.findDataObjects().inFolderOrSubfolders(testProject, "/subfolder") .withProperty("process", true) .execute().asList(), food); assertEqualsAnyOrder( DXSearch.findDataObjects().inProject(testProject).withState(DataObjectState.CLOSED) .execute().asList(), moo, foo, food); assertEqualsAnyOrder( DXSearch.findDataObjects().inProject(testProject).withState(DataObjectState.OPEN) .execute().asList(), open); assertEqualsAnyOrder(DXSearch.findDataObjects().inProject(testProject).withTag("mytag") .execute().asList(), foo); assertEqualsAnyOrder( DXSearch.findDataObjects().inProject(testProject) .withTags(DXSearch.TagsQuery.anyOf("mytag", "zyzzx")).execute().asList(), foo); assertEqualsAnyOrder(DXSearch.findDataObjects().inProject(testProject).withType("genome") .execute().asList(), moo, foo); assertEqualsAnyOrder( DXSearch.findDataObjects().inProject(testProject) .withTypes(TypeQuery.allOf("genome", "report")).execute().asList(), moo); assertEqualsAnyOrder( DXSearch.findDataObjects().inProject(testProject) .withTypes(TypeQuery.anyOf("genome", "report")).execute().asList(), moo, foo, food); assertEqualsAnyOrder( DXSearch.findDataObjects() .inProject(testProject) .withTypes( TypeQuery.anyOf(TypeQuery.allOf("genome", "report"), TypeQuery.of("type"))).execute().asList(), moo, open); assertEqualsAnyOrder( DXSearch.findDataObjects().inProject(testProject) .withVisibility(DXSearch.VisibilityQuery.HIDDEN).execute().asList(), invisible); assertEqualsAnyOrder( DXSearch.findDataObjects().inProject(testProject) .withVisibility(DXSearch.VisibilityQuery.VISIBLE).execute().asList(), moo, foo, food, open); assertEqualsAnyOrder( DXSearch.findDataObjects().inProject(testProject) .withVisibility(DXSearch.VisibilityQuery.EITHER).execute().asList(), moo, foo, food, open, invisible); assertEqualsAnyOrder(DXSearch.findDataObjects().withIdsIn(ImmutableList.of(moo, foo)) .execute().asList(), moo, foo); assertEqualsAnyOrder(DXSearch.findDataObjects().withIdsIn(ImmutableList.of(moo, invisible)) .execute().asList(), moo); assertEqualsAnyOrder(DXSearch.findDataObjects().withIdsIn(ImmutableList.of(moo, invisible)) .withVisibility(VisibilityQuery.EITHER).execute().asList(), moo, invisible); }
@Test public void testFindDataObjectsByClass() { DXRecord record = DXRecord.newRecord().setProject(testProject).setName("arecord").build(); DXFile file = DXFile.newFile().setProject(testProject).setName("afile").build(); DXApplet applet = DXApplet.newApplet().setProject(testProject).setName("anapplet") .setRunSpecification(RunSpecification.newRunSpec("bash", "", "Ubuntu", "14.04").build()) .build(); DXWorkflow workflow = DXWorkflow.newWorkflow().setProject(testProject).setName("aworkflow").build(); DXRecord recordResult = Iterables.getOnlyElement(DXSearch.findDataObjects().inProject(testProject) .withClassRecord().execute().asList()); Assert.assertEquals(record, recordResult); Assert.assertEquals("arecord", recordResult.describe().getName()); DXFile fileResult = Iterables.getOnlyElement(DXSearch.findDataObjects().inProject(testProject) .withClassFile().execute().asList()); Assert.assertEquals(file, fileResult); Assert.assertEquals("afile", fileResult.describe().getName()); DXApplet appletResult = Iterables.getOnlyElement(DXSearch.findDataObjects().inProject(testProject) .withClassApplet().execute().asList()); Assert.assertEquals(applet, appletResult); Assert.assertEquals("anapplet", appletResult.describe().getName()); DXWorkflow workflowResult = Iterables.getOnlyElement(DXSearch.findDataObjects().inProject(testProject) .withClassWorkflow().execute().asList()); Assert.assertEquals(workflow, workflowResult); Assert.assertEquals("aworkflow", workflowResult.describe().getName()); }
@Test public void testFindDataObjectsQuerySerialization() throws IOException { Assert.assertEquals( DXJSON.parseJson("{\"scope\": {\"project\":\"project-000000000000000000000000\"}}"), mapper.valueToTree(DXSearch.findDataObjects() .inProject(DXProject.getInstance("project-000000000000000000000000")) .buildRequestHash())); Assert.assertEquals( DXJSON.parseJson("{\"scope\": {\"project\":\"project-000000000000000000000000\", \"folder\": \"/my/subfolder\", \"recurse\": false}}"), mapper.valueToTree(DXSearch .findDataObjects() .inFolder(DXProject.getInstance("project-000000000000000000000000"), "/my/subfolder").buildRequestHash())); Assert.assertEquals( DXJSON.parseJson("{\"scope\": {\"project\": \"project-000000000000000000000000\"}, \"name\": \"dnanexus\"}"), mapper.valueToTree(DXSearch.findDataObjects() .inProject(DXProject.getInstance("project-000000000000000000000000")) .nameMatchesExactly("dnanexus").buildRequestHash())); Assert.assertEquals( DXJSON.parseJson("{\"name\": \"dnanexus\"}"), mapper.valueToTree(DXSearch.findDataObjects().nameMatchesExactly("dnanexus") .buildRequestHash())); Assert.assertEquals( DXJSON.parseJson("{\"name\": {\"regexp\": \"(DNA|dna)nexus\"}}"), mapper.valueToTree(DXSearch.findDataObjects().nameMatchesRegexp("(DNA|dna)nexus") .buildRequestHash())); Assert.assertEquals( DXJSON.parseJson("{\"name\": {\"regexp\": \"[dr]nanexus\"}}"), mapper.valueToTree(DXSearch.findDataObjects() .nameMatchesRegexp("[dr]nanexus", false).buildRequestHash())); Assert.assertEquals( DXJSON.parseJson("{\"name\": {\"regexp\": \"[dr]nanexus\", \"flags\": \"i\"}}"), mapper.valueToTree(DXSearch.findDataObjects() .nameMatchesRegexp("[dr]nanexus", true).buildRequestHash())); Assert.assertEquals( DXJSON.parseJson("{\"name\": {\"glob\": \"*nexus\"}}"), mapper.valueToTree(DXSearch.findDataObjects().nameMatchesGlob("*nexus") .buildRequestHash())); Assert.assertEquals( DXJSON.parseJson("{\"visibility\": \"hidden\"}"), mapper.valueToTree(DXSearch.findDataObjects() .withVisibility(DXSearch.VisibilityQuery.HIDDEN).buildRequestHash())); Assert.assertEquals( DXJSON.parseJson("{\"level\": \"ADMINISTER\"}"), mapper.valueToTree(DXSearch.findDataObjects() .withMinimumAccessLevel(AccessLevel.ADMINISTER).buildRequestHash())); Assert.assertEquals( DXJSON.parseJson("{\"describe\": true}"), mapper.valueToTree(DXSearch.findDataObjects().includeDescribeOutput() .buildRequestHash())); Assert.assertEquals( DXJSON.parseJson("{\"describe\": {\"properties\": true}}"), mapper.valueToTree(DXSearch.findDataObjects() .includeDescribeOutput(DXDataObject.DescribeOptions.get().withProperties()) .buildRequestHash())); Assert.assertEquals(DXJSON.parseJson("{\"tags\": \"a\"}"), mapper.valueToTree(DXSearch.findDataObjects().withTag("a").buildRequestHash())); Assert.assertEquals(DXJSON .parseJson("{\"tags\": {\"$or\": [{\"$and\": [\"a\", \"b\"]}, \"c\"]}}"), mapper .valueToTree(DXSearch .findDataObjects() .withTags( DXSearch.TagsQuery.anyOf(DXSearch.TagsQuery.allOf("a", "b"), DXSearch.TagsQuery.of("c"))).buildRequestHash())); Assert.assertEquals(DXJSON.parseJson("{\"type\": \"a\"}"), mapper.valueToTree(DXSearch.findDataObjects().withType("a").buildRequestHash())); Assert.assertEquals(DXJSON .parseJson("{\"type\": {\"$or\": [{\"$and\": [\"a\", \"b\"]}, \"c\"]}}"), mapper .valueToTree(DXSearch .findDataObjects() .withTypes( DXSearch.TypeQuery.anyOf(DXSearch.TypeQuery.allOf("a", "b"), DXSearch.TypeQuery.of("c"))).buildRequestHash())); Assert.assertEquals( DXJSON.parseJson("{\"properties\": {\"foo\": true}}"), mapper.valueToTree(DXSearch.findDataObjects().withProperty("foo") .buildRequestHash())); Assert.assertEquals(DXJSON .parseJson("{\"properties\": {\"$and\": [{\"foo\": true}, {\"bar\": \"a\"}]}}"), mapper.valueToTree(DXSearch.findDataObjects().withProperty("foo") .withProperty("bar", "a").buildRequestHash())); Assert.assertEquals( DXJSON.parseJson("{\"properties\": {\"$and\": [{\"foo\": true}, {\"bar\": \"a\"}, {\"baz\": \"b\"}]}}"), mapper.valueToTree(DXSearch.findDataObjects().withProperty("foo") .withProperty("bar", "a") .withProperties(PropertiesQuery.withKeyAndValue("baz", "b")) .buildRequestHash())); Assert.assertEquals(DXJSON.parseJson("{\"id\": [\"record-111100000000000000000000\"]}"), mapper.valueToTree(DXSearch .findDataObjects() .withIdsIn( ImmutableList.of(DXRecord .getInstance("record-111100000000000000000000"))) .buildRequestHash())); try { DXSearch.findDataObjects() .inProject(DXProject.getInstance("project-000000000000000000000000")) .inProject(DXProject.getInstance("project-111100000000000000000000")); Assert.fail("Expected double setting of inProject to fail"); } catch (IllegalStateException e) { } try { DXSearch.findDataObjects() .inFolder(DXProject.getInstance("project-000000000000000000000000"), "/1") .inFolder(DXProject.getInstance("project-000000000000000000000000"), "/2"); Assert.fail("Expected double setting of inFolder to fail"); } catch (IllegalStateException e) { } try { DXSearch.findDataObjects().nameMatchesExactly("ab").nameMatchesGlob("*b"); Assert.fail("Expected double setting of name parameters to fail"); } catch (IllegalStateException e) { } try { DXSearch.findDataObjects().withMinimumAccessLevel(AccessLevel.NONE); Assert.fail("Expected minimumAccessLevel=NONE to fail"); } catch (IllegalArgumentException e) { } try { DXSearch.findDataObjects().withClassApplet().withClassFile(); Assert.fail("Expected setting multiple class constraints to fail"); } catch (IllegalStateException e) { } try { DXSearch.findDataObjects().withIdsIn(ImmutableList.<DXDataObject>of()) .withIdsIn(ImmutableList.<DXDataObject>of()); Assert.fail("Expected double setting of withIdsIn to fail"); } catch (IllegalStateException e) { } }
@Test public void testFindDataObjectsSimple() { Assert.assertTrue(DXSearch.findDataObjects().inProject(testProject) .nameMatchesExactly("foobarbaz").execute().asList().isEmpty()); assertEqualsAnyOrder(DXSearch.findDataObjects().inProject(testProject) .nameMatchesExactly("foobarbaz").execute()); }
@Test public void testFindDataObjectsWithCustomPaging() { List<DXRecord> records = Lists.newArrayList(); Set<String> recordIds = Sets.newHashSet(); for (int i = 0; i < 8; ++i) { DXRecord record = DXRecord.newRecord().setProject(testProject) .setName("foo" + Integer.toString(i)).build(); records.add(record); recordIds.add(record.getId()); } List<DXRecord> outputRecords = DXSearch.findDataObjects().inProject(testProject).nameMatchesGlob("foo*") .withClassRecord().execute().asList(); Assert.assertEquals(8, outputRecords.size()); List<DXRecord> outputRecordsWithPaging = DXSearch.findDataObjects().inProject(testProject).nameMatchesGlob("foo*") .withClassRecord().execute(3).asList(); Assert.assertEquals(outputRecords, outputRecordsWithPaging); Set<String> outputRecordIds = Sets.newHashSet(); for (DXRecord record : outputRecordsWithPaging) { outputRecordIds.add(record.getId()); } Assert.assertEquals(recordIds, outputRecordIds); List<DXRecord> outputRecordStreamWithPaging = ImmutableList.copyOf(DXSearch.findDataObjects().inProject(testProject) .nameMatchesGlob("foo*").withClassRecord().execute(3)); Assert.assertEquals(outputRecords, outputRecordStreamWithPaging); DXSearch.FindDataObjectsResult<DXRecord> findResult = DXSearch.findDataObjects().inProject(testProject).nameMatchesGlob("foo*").withClassRecord().execute(3); Iterator<DXRecord> iter = findResult.iterator(); List<DXRecord> iterativelyFetchedRecords = Lists.newArrayList(iter); Assert.assertEquals(outputRecords, iterativelyFetchedRecords); Assert.assertEquals(3, ((DXSearch.FindDataObjectsResult<DXRecord>.ResultIterator) iter).pageNo()); }
@Test public void testFindDataObjectsWithDescribe() { DXRecord.newRecord().setProject(testProject).setName("record1") .putProperty("sampleId", "1234").build(); DXFile.newFile().setProject(testProject).setName("file1").putProperty("sampleId", "2345") .build(); DXApplet.newApplet().setProject(testProject).setName("applet1") .setRunSpecification(RunSpecification.newRunSpec("bash", "", "Ubuntu", "14.04").build()).build(); DXWorkflow.newWorkflow().setProject(testProject).setName("workflow1").build(); DXRecord recordResult = Iterables.getOnlyElement(DXSearch.findDataObjects().withClassRecord() .inProject(testProject).nameMatchesExactly("record1") .includeDescribeOutput(DXDataObject.DescribeOptions.get().withProperties()) .execute().asList()); Assert.assertEquals(recordResult.getCachedDescribe().getName(), "record1"); Assert.assertEquals(recordResult.getCachedDescribe().getProperties().get("sampleId"), "1234"); recordResult = Iterables.getOnlyElement(DXSearch.findDataObjects().withClassRecord() .inProject(testProject).nameMatchesExactly("record1") .includeDescribeOutput().execute().asList()); Assert.assertEquals(recordResult.getCachedDescribe().getName(), "record1"); try { recordResult.getCachedDescribe().getProperties(); Assert.fail("Expected IllegalStateException to be thrown because properties should not have been returned"); } catch (IllegalStateException e) { } Assert.assertEquals( Iterables .getOnlyElement( DXSearch.findDataObjects().inProject(testProject) .nameMatchesExactly("file1").includeDescribeOutput() .execute().asList()).getCachedDescribe().getName(), "file1"); Assert.assertEquals( Iterables .getOnlyElement( DXSearch.findDataObjects().inProject(testProject) .nameMatchesExactly("applet1").includeDescribeOutput() .execute().asList()).getCachedDescribe().getName(), "applet1"); Assert.assertEquals( Iterables .getOnlyElement( DXSearch.findDataObjects().inProject(testProject) .nameMatchesExactly("workflow1").includeDescribeOutput() .execute().asList()).getCachedDescribe().getName(), "workflow1"); DXRecord findWithoutDescribe = Iterables.getOnlyElement(DXSearch.findDataObjects().inProject(testProject) .nameMatchesExactly("record1").withClassRecord().execute().asList()); try { findWithoutDescribe.getCachedDescribe(); Assert.fail("Expected IllegalStateException to be thrown"); } catch (IllegalStateException e) { } }
@Test public void testFindDataObjectsWithExplicitPagination() { for (int i = 0; i < 8; ++i) { DXRecord.newRecord().setProject(testProject).setName("foo" + Integer.toString(i)).build(); } List<DXRecord> outputRecords = DXSearch.findDataObjects().inProject(testProject).nameMatchesGlob("foo*") .withClassRecord().execute().asList(); Assert.assertEquals(8, outputRecords.size()); DXSearch.FindDataObjectsResult<DXRecord> result = DXSearch.findDataObjects().inProject(testProject).nameMatchesGlob("foo*").withClassRecord().execute(); FindResultPage<DXRecord> page = result.getFirstPage(3); Assert.assertEquals(3, page.size()); Assert.assertEquals(true, page.hasNextPage()); Iterator<DXRecord> iter = page.iterator(); for (int i = 0; i < 3; i++) { Assert.assertEquals(true, iter.hasNext()); DXRecord r = iter.next(); Assert.assertEquals(outputRecords.get(i).getId(), r.getId()); } Assert.assertEquals(false, iter.hasNext()); page = result.getSubsequentPage(page.getNext(), 3); Assert.assertEquals(3, page.size()); Assert.assertEquals(true, page.hasNextPage()); iter = page.iterator(); for (int i = 3; i < 6; i++) { Assert.assertEquals(true, iter.hasNext()); DXRecord r = iter.next(); Assert.assertEquals(outputRecords.get(i).getId(), r.getId()); } Assert.assertEquals(false, iter.hasNext()); page = result.getSubsequentPage(page.getNext(), 3); Assert.assertEquals(2, page.size()); Assert.assertEquals(false, page.hasNextPage()); iter = page.iterator(); for (int i = 6; i < 8; i++) { Assert.assertEquals(true, iter.hasNext()); DXRecord r = iter.next(); Assert.assertEquals(outputRecords.get(i).getId(), r.getId()); } Assert.assertEquals(false, iter.hasNext()); page = result.getFirstPage(100); Assert.assertEquals(8, page.size()); Assert.assertEquals(false, page.hasNextPage()); int i = 0; for (DXRecord r : page) { Assert.assertEquals(outputRecords.get(i++).getId(), r.getId()); } try { result.getFirstPage(0); Assert.fail(); } catch (IllegalArgumentException e) { } try { result.getFirstPage(-2); Assert.fail(); } catch (IllegalArgumentException e) { } ObjectMapper mapper = new ObjectMapper(); try { result.getSubsequentPage(mapper.createObjectNode(), 0); Assert.fail(); } catch (IllegalArgumentException e) { } try { result.getSubsequentPage(mapper.createObjectNode(), -1); Assert.fail(); } catch (IllegalArgumentException e) { } try { result.getSubsequentPage(null, 10); Assert.fail(); } catch (NullPointerException e) { } }