当前位置: 首页>>代码示例>>Java>>正文


Java ResultSequence.hasNext方法代码示例

本文整理汇总了Java中com.marklogic.xcc.ResultSequence.hasNext方法的典型用法代码示例。如果您正苦于以下问题:Java ResultSequence.hasNext方法的具体用法?Java ResultSequence.hasNext怎么用?Java ResultSequence.hasNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.marklogic.xcc.ResultSequence的用法示例。


在下文中一共展示了ResultSequence.hasNext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testImportDelimitedTextUTF16LEZip

import com.marklogic.xcc.ResultSequence; //导入方法依赖的package包/类
@Test
public void testImportDelimitedTextUTF16LEZip() throws Exception {
    String cmd = "IMPORT -host localhost -username admin -password admin"
        + " -input_file_path " + Constants.TEST_PATH.toUri()
        + "/encoding/samplecsv.utf16le.zip -content_encoding utf-16le"
        + " -delimited_uri_id first -input_compressed"
        + " -output_uri_replace " + Constants.MLCP_HOME + ",'/space/workspace/xcc/mlcp'"
        + " -input_file_type delimited_text"
        + " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" ");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);

    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);

    ResultSequence result = Utils.runQuery(
        Utils.getTestDbXccUri(), "fn:count(fn:collection())");
    assertTrue(result.hasNext());
    assertEquals("3", result.next().asString());
    Utils.closeSession();

    result = Utils.getNonEmptyDocsURIs(Utils.getTestDbXccUri());

    StringBuilder sb = new StringBuilder();
    while(result.hasNext()) {
        String s = result.next().asString();
        sb.append(s);
    }
    Utils.closeSession();

    String key = Utils.readSmallFile(Constants.TEST_PATH.toUri().getPath()
        + "/keys/TestImportDelimitedText#testImportDelimitedTextUTF16LEZip.txt");
    assertTrue(sb.toString().equals(key));
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:38,代码来源:TestImportDelimitedText.java

示例2: getForestSplits

import com.marklogic.xcc.ResultSequence; //导入方法依赖的package包/类
protected void getForestSplits(JobContext jobContext,
        ResultSequence result, 
        List<ForestSplit> forestSplits,
        List<String> ruleUris,
        String[] inputHosts) throws IOException {
    Configuration jobConf = jobContext.getConfiguration();
    super.getForestSplits(jobContext, result, forestSplits, ruleUris, inputHosts);
    // Third while loop: audit settings
    while (result.hasNext()) {
        ResultItem item = result.next();
        if (ItemType.XS_STRING != item.getItemType()) {
            throw new IOException("Unexpected item type " + item.getItemType().toString());
        }
        String itemStr = ((XSString)item.getItem()).asString();
        if ("AUDIT".equals(itemStr)) {
            continue;
        } else if (ConfigConstants.AUDIT_MLCPSTART_EVENT.
                equalsIgnoreCase(itemStr)) {
            mlcpStartEventEnabled = true;
        } else if (ConfigConstants.AUDIT_MLCPFINISH_EVENT.
                equalsIgnoreCase(itemStr)) {
            mlcpFinishEventEnabled = true;
        } else {
            throw new IOException("Unrecognized audit event " + itemStr);
        }                
    }
    if (ruleUris != null && ruleUris.size() > 0) {
        AuditUtil.prepareAuditMlcpFinish(jobConf, ruleUris.size());
        if (LOG.isDebugEnabled()) {
            // TODO: Use this version if only JAVA 8 is supported
            // String logMessage = String.join(", ", ruleUris);
            LOG.debug("Redaction rules applied: " + StringUtils.join(ruleUris, ", "));
        }
    }
    if (mlcpStartEventEnabled) {
        AuditUtil.auditMlcpStart(jobConf, jobContext.getJobName());
    }
    jobConf.setBoolean(ConfigConstants.CONF_AUDIT_MLCPFINISH_ENABLED, mlcpFinishEventEnabled);
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:40,代码来源:DocumentInputFormat.java

示例3: testImportDelimitedText

import com.marklogic.xcc.ResultSequence; //导入方法依赖的package包/类
@Test
public void testImportDelimitedText() throws Exception {
    String cmd = 
        "IMPORT -host localhost -username admin -password admin"
        + " -input_file_path " + Constants.TEST_PATH.toUri() + "/csv"
        + " -hadoop_conf_dir " + Constants.HADOOP_CONF_DIR
        + " -delimited_uri_id first"
        + " -input_file_type delimited_text -input_file_pattern .*\\.csv"
        + " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" ");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);

    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);

    ResultSequence result = Utils.runQuery(
        Utils.getTestDbXccUri(), "fn:count(fn:collection())");
    assertTrue(result.hasNext());
    assertEquals("7", result.next().asString());
    Utils.closeSession();
    
    result = Utils.getNonEmptyDocsURIs(Utils.getTestDbXccUri());

    StringBuilder sb = new StringBuilder();
    while(result.hasNext()) {
        String s = result.next().asString();
        sb.append(s);
    }
    Utils.closeSession();
    
    String key = Utils.readSmallFile(Constants.TEST_PATH.toUri().getPath()
        + "/keys/TestImportDelimitedText#testImportDelimitedText.txt");
    assertTrue(sb.toString().equals(key));
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:38,代码来源:TestDistributedImportDelimitedText.java

示例4: testImportDelimitedJSONZip

import com.marklogic.xcc.ResultSequence; //导入方法依赖的package包/类
@Test
public void testImportDelimitedJSONZip() throws Exception {
    String cmd = "IMPORT -host localhost -username admin -password admin"
            + " -input_file_path " + Constants.TEST_PATH.toUri() + "/delimitedJson/zip/sample.zip"
            + " -uri_id name -generate_uri false -input_compressed true -input_compression_codec zip"
            + " -input_file_type delimited_json"
            + " -port " + Constants.port + " -database " + Constants.testDb;
    
    String[] args = cmd.split(" ");
    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);
    
    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);
    
    ResultSequence result = Utils.runQuery(Utils.getTestDbXccUri(),
            "fn:count(fn:doc())");
    assertTrue(result.hasNext());
    assertEquals("5", result.next().asString());
    
    Utils.closeSession();
    
    result = Utils.assertDocsFormat(Utils.getTestDbXccUri(),"JSON");
    assertTrue(result.hasNext());
    assertTrue(result.next().asString().equals("true"));
    
    Utils.closeSession();
    
    result = Utils.getAllDocs(Utils.getTestDbXccUri());
    StringBuilder sb = new StringBuilder();
    while (result.hasNext()) {
        String s = result.next().asString();
        sb.append(s);
    }
    
    String key = Utils
            .readSmallFile(Constants.TEST_PATH.toUri().getPath()
                    + "/keys/TestImportDelimitedJson#testImportDelimitedJsonDir.txt");
    assertTrue(sb.toString().equals(key));
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:41,代码来源:TestImportDelimitedJson.java

示例5: testImportDelimitedJSONZipDir

import com.marklogic.xcc.ResultSequence; //导入方法依赖的package包/类
@Test
public void testImportDelimitedJSONZipDir() throws Exception {
    String cmd = "IMPORT -host localhost -username admin -password admin"
            + " -input_file_path " + Constants.TEST_PATH.toUri() + "/delimitedJson/zip"
            + " -uri_id name -generate_uri false -input_compressed true -input_compression_codec zip"
            + " -input_file_type delimited_json"
            + " -port " + Constants.port + " -database " + Constants.testDb;
    
    String[] args = cmd.split(" ");
    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);
    
    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);
    
    ResultSequence result = Utils.runQuery(Utils.getTestDbXccUri(),
            "fn:count(fn:doc())");
    assertTrue(result.hasNext());
    assertEquals("6", result.next().asString());
    
    Utils.closeSession();
    
    result = Utils.assertDocsFormat(Utils.getTestDbXccUri(),"JSON");
    assertTrue(result.hasNext());
    assertTrue(result.next().asString().equals("true"));
    
    Utils.closeSession();
    
    result = Utils.getAllDocs(Utils.getTestDbXccUri());
    StringBuilder sb = new StringBuilder();
    while (result.hasNext()) {
        String s = result.next().asString();
        sb.append(s);
    }
    
    String key = Utils
            .readSmallFile(Constants.TEST_PATH.toUri().getPath()
                    + "/keys/TestImportDelimitedJson#testImportDelimitedJSONZipDir.txt");
    assertTrue(sb.toString().equals(key));
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:41,代码来源:TestImportDelimitedJson.java

示例6: testImportDelimitedJSONGzip

import com.marklogic.xcc.ResultSequence; //导入方法依赖的package包/类
@Test
public void testImportDelimitedJSONGzip() throws Exception {
    String cmd = "IMPORT -host localhost -username admin -password admin"
            + " -input_file_path " + Constants.TEST_PATH.toUri() + "/delimitedJson/gzip/sample.gz"
            + " -uri_id name -generate_uri false -input_compressed true -input_compression_codec gzip"
            + " -input_file_type delimited_json"
            + " -port " + Constants.port + " -database " + Constants.testDb;
    
    String[] args = cmd.split(" ");
    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);
    
    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);
    
    ResultSequence result = Utils.runQuery(Utils.getTestDbXccUri(),
            "fn:count(fn:doc())");
    assertTrue(result.hasNext());
    assertEquals("5", result.next().asString());
    
    Utils.closeSession();
    
    result = Utils.assertDocsFormat(Utils.getTestDbXccUri(),"JSON");
    assertTrue(result.hasNext());
    assertTrue(result.next().asString().equals("true"));
    
    Utils.closeSession();
    
    result = Utils.getAllDocs(Utils.getTestDbXccUri());
    StringBuilder sb = new StringBuilder();
    while (result.hasNext()) {
        String s = result.next().asString();
        sb.append(s);
    }
    
    String key = Utils
            .readSmallFile(Constants.TEST_PATH.toUri().getPath()
                    + "/keys/TestImportDelimitedJson#testImportDelimitedJsonDir.txt");
    assertTrue(sb.toString().equals(key));
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:41,代码来源:TestImportDelimitedJson.java

示例7: testImportDelimitedJSONGzipDir

import com.marklogic.xcc.ResultSequence; //导入方法依赖的package包/类
@Test
public void testImportDelimitedJSONGzipDir() throws Exception {
    String cmd = "IMPORT -host localhost -username admin -password admin"
            + " -input_file_path " + Constants.TEST_PATH.toUri() + "/delimitedJson/gzip"
            + " -uri_id name -generate_uri false -input_compressed true -input_compression_codec gzip"
            + " -input_file_type delimited_json"
            + " -port " + Constants.port + " -database " + Constants.testDb;
    
    String[] args = cmd.split(" ");
    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);
    
    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);
    
    ResultSequence result = Utils.runQuery(Utils.getTestDbXccUri(),
            "fn:count(fn:doc())");
    assertTrue(result.hasNext());
    assertEquals("6", result.next().asString());
    
    Utils.closeSession();
    
    result = Utils.assertDocsFormat(Utils.getTestDbXccUri(),"JSON");
    assertTrue(result.hasNext());
    assertTrue(result.next().asString().equals("true"));
    
    Utils.closeSession();
    
    result = Utils.getAllDocs(Utils.getTestDbXccUri());
    StringBuilder sb = new StringBuilder();
    while (result.hasNext()) {
        String s = result.next().asString();
        sb.append(s);
    }
    
    String key = Utils
            .readSmallFile(Constants.TEST_PATH.toUri().getPath()
                    + "/keys/TestImportDelimitedJson#testImportDelimitedJSONZipDir.txt");
    assertTrue(sb.toString().equals(key));
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:41,代码来源:TestImportDelimitedJson.java

示例8: testImportDelimitedTextSplit

import com.marklogic.xcc.ResultSequence; //导入方法依赖的package包/类
@Test
public void testImportDelimitedTextSplit() throws Exception {
    String cmd =
        "IMPORT -host localhost -username admin -password admin"
        + " -input_file_path " + Constants.TEST_PATH.toUri() + "/csv"
        + " -delimited_uri_id first"
        + " -split_input -max_split_size 50"
        + " -input_file_type delimited_text"
        + " -input_file_pattern .*\\.csv"
        + " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" ");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);

    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);

    ResultSequence result = Utils.runQuery(
        Utils.getTestDbXccUri(), "fn:count(fn:collection())");
    assertTrue(result.hasNext());
    assertEquals("7", result.next().asString());
    Utils.closeSession();

    result = Utils.getNonEmptyDocsURIs(Utils.getTestDbXccUri());

    StringBuilder sb = new StringBuilder();
    while(result.hasNext()) {
        String s = result.next().asString();
        sb.append(s);
    }
    Utils.closeSession();

    String key = Utils.readSmallFile(Constants.TEST_PATH.toUri().getPath()
        + "/keys/TestImportDelimitedText#testImportDelimitedText.txt");
    assertTrue(sb.toString().equals(key));
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:39,代码来源:TestImportDelimitedText.java

示例9: testImportDelimitedJSONArray

import com.marklogic.xcc.ResultSequence; //导入方法依赖的package包/类
@Test
public void testImportDelimitedJSONArray() throws Exception {
    String cmd = "IMPORT -host localhost -username admin -password admin"
            + " -input_file_path " + Constants.TEST_PATH.toUri() + "/delimitedJson/testUri2"
            + " -uri_id val -generate_uri false"
            + " -input_file_type delimited_json"
            + " -port " + Constants.port + " -database " + Constants.testDb;
    
    String[] args = cmd.split(" ");
    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);
    
    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);
    
    ResultSequence result = Utils.runQuery(Utils.getTestDbXccUri(),
            "fn:count(fn:doc())");
    assertTrue(result.hasNext());
    assertEquals("4", result.next().asString());
    
    Utils.closeSession();
    
    result = Utils.getAllDocs(Utils.getTestDbXccUri());
    StringBuilder sb = new StringBuilder();
    while (result.hasNext()) {
        String s = result.next().asString();
        sb.append(s);
    }
    
    String key = Utils
            .readSmallFile(Constants.TEST_PATH.toUri().getPath()
                    + "/keys/TestImportDelimitedJson#testImportDelimitedJSONArray.txt");
    assertTrue(sb.toString().equals(key));
    
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:36,代码来源:TestImportDelimitedJson.java

示例10: testImportMixedDocs

import com.marklogic.xcc.ResultSequence; //导入方法依赖的package包/类
@Test
public void testImportMixedDocs() throws Exception {
    String cmd = "IMPORT -password admin -username admin -host localhost"
        + " -input_file_path " + Constants.TEST_PATH.toUri() + "/wiki"
        + " -output_uri_prefix test/"
        + " -output_collections test,ML"
        + " -fastload false"
        + " -output_uri_replace wiki,'wiki1'"
        + " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" +");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);

    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);

    ResultSequence result = Utils.runQuery(
        Utils.getTestDbXccUri(),
        "fn:count(fn:collection(\"ML\"))");
    assertTrue(result.hasNext());
    assertEquals("93", result.next().asString());
    Utils.closeSession();
    
    result = Utils.runQuery(Utils.getTestDbXccUri(),
        "xdmp:directory(\"test/\", \"infinity\")");
    int count = 0;
    while (result.hasNext()) {
        ResultItem item = result.next();
        String uri = item.getDocumentURI();
        assertTrue(uri.contains("wiki1"));
        count++;
    }
    assertTrue(count == 93);
    Utils.closeSession();
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:38,代码来源:TestImportDocs.java

示例11: testImportDelimitedTextGenerateId

import com.marklogic.xcc.ResultSequence; //导入方法依赖的package包/类
@Test
public void testImportDelimitedTextGenerateId() throws Exception {
    String cmd = "IMPORT -host localhost -username admin -password admin"
        + " -input_file_path " + Constants.TEST_PATH.toUri() + "/csv"
        + " -generate_uri"
        + " -output_uri_replace " + Constants.MLCP_HOME + ",'/space/workspace/xcc/mlcp'"
        + " -input_file_type delimited_text -input_file_pattern .*\\.csv"
        + " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" ");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);

    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);

    ResultSequence result = Utils.runQuery(
        Utils.getTestDbXccUri(), "fn:count(fn:collection())");
    assertTrue(result.hasNext());
    assertEquals("7", result.next().asString());
    Utils.closeSession();

    result = Utils.getNonEmptyDocsURIs(Utils.getTestDbXccUri());

    StringBuilder sb = new StringBuilder();
    while(result.hasNext()) {
        String s = result.next().asString();
        sb.append(s);
    }
    Utils.closeSession();
    String key = Utils.readSmallFile(Constants.TEST_PATH.toUri().getPath()
        + "/keys/TestImportDelimitedText#testImportDelimitedGenerateId.txt");
    System.out.println("DUMP:" + cmd);
    System.out.println("DUMP:" + sb.length() +"@" + sb.toString());
    assertTrue(sb.toString().equals(key));
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:38,代码来源:TestImportDelimitedText.java

示例12: testImportDelimitedTextHardZip

import com.marklogic.xcc.ResultSequence; //导入方法依赖的package包/类
@Test
public void testImportDelimitedTextHardZip() throws Exception {
    String cmd = "IMPORT -host localhost -username admin -password admin"
        + " -input_file_path " + Constants.TEST_PATH.toUri() + "/csv/sample3.csv.hard.zip"
        + " -delimited_uri_id first -input_compressed"
        + " -input_file_type delimited_text"
        + " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" ");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);

    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);

    ResultSequence result = Utils.runQuery(
        Utils.getTestDbXccUri(), "fn:count(fn:collection())");
    assertTrue(result.hasNext());
    assertEquals("3", result.next().asString());
    Utils.closeSession();

    result = Utils.getAllDocs(Utils.getTestDbXccUri());

    StringBuilder sb = new StringBuilder();
    while(result.hasNext()) {
        String s = result.next().asString();
        sb.append(s);
    }
    Utils.closeSession();

    String key = Utils.readSmallFile(Constants.TEST_PATH.toUri().getPath()
        + "/keys/TestImportDelimitedText#testImportDelimitedTextHardZip.txt");
    assertTrue(sb.toString().equals(key));
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:36,代码来源:TestImportDelimitedText.java

示例13: testImportDelimitedTextJSONDataType

import com.marklogic.xcc.ResultSequence; //导入方法依赖的package包/类
@Test
public void testImportDelimitedTextJSONDataType() throws Exception {
    String cmd = "IMPORT -host localhost -username admin -password admin"
            + " -input_file_path "
            + Constants.TEST_PATH.toUri()
            + "/csv/sample4.txt"
            + " -input_file_type delimited_text -data_type zipcode,String,score,number"
            + " -document_type json"
            + " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" ");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);

    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);

    ResultSequence result = Utils.runQuery(Utils.getTestDbXccUri(),
                    "fn:count(fn:doc())");
    assertTrue(result.hasNext());
    assertEquals("2", result.next().asString());
    Utils.closeSession();

    result = Utils.getAllDocs(Utils.getTestDbXccUri());
    StringBuilder sb = new StringBuilder();
    while (result.hasNext()) {
        String s = result.next().asString();
        sb.append(s);
    }

    String key = Utils
            .readSmallFile(Constants.TEST_PATH.toUri().getPath()
                    + "/keys/TestImportDelimitedText#testImportDelimitedTextJSONDataType.txt");

    assertTrue(sb.toString().equals(key));
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:38,代码来源:TestImportDelimitedText.java

示例14: testImportDelimitedTextElemNamesSplit

import com.marklogic.xcc.ResultSequence; //导入方法依赖的package包/类
@Test
public void testImportDelimitedTextElemNamesSplit() throws Exception {
    String cmd = "IMPORT -host localhost -username admin -password admin"
        + " -input_file_path " + Constants.TEST_PATH.toUri() + "/csv/sample3.csv.ename"
        + " -split_input -max_split_size 50"
        + " -input_file_type delimited_text"
        + " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" ");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);

    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);

    ResultSequence result = Utils.runQuery(
        Utils.getTestDbXccUri(), "fn:count(fn:collection())");
    assertTrue(result.hasNext());
    assertEquals("3", result.next().asString());
    Utils.closeSession();

    result = Utils.getAllDocs(Utils.getTestDbXccUri());

    StringBuilder sb = new StringBuilder();
    while(result.hasNext()) {
        String s = result.next().asString();
        sb.append(s);
    }
    Utils.closeSession();
    String key = Utils.readSmallFile(Constants.TEST_PATH.toUri().getPath()
        + "/keys/TestImportDelimitedText#testImportDelimitedTextElemNamesSplit.txt");
    assertTrue(sb.toString().equals(key));
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:35,代码来源:TestImportDelimitedText.java

示例15: testImportAggZip

import com.marklogic.xcc.ResultSequence; //导入方法依赖的package包/类
@Test
public void testImportAggZip() throws Exception {
    String cmd = "IMPORT -host localhost" +
    		" -username admin" + " -password admin" + 
    		" -input_file_path " + Constants.TEST_PATH.toUri() + "/agg.zip" + 
    		" -aggregate_record_element p -aggregate_uri_id id" +
    		" -input_file_type aggregates -input_compressed true" +
    		" -input_compression_codec zip" +
    		" -namespace http://marklogic.com/foo"
    		+ " -port " + Constants.port + " -database " + Constants.testDb;
    String[] args = cmd.split(" ");
    assertFalse(args.length == 0);

    Utils.clearDB(Utils.getTestDbXccUri(), Constants.testDb);

    String[] expandedArgs = null;
    expandedArgs = OptionsFileUtil.expandArguments(args);
    ContentPump.runCommand(expandedArgs);

    ResultSequence result = Utils.runQuery(
        Utils.getTestDbXccUri(), "fn:count(fn:collection())");
    assertTrue(result.hasNext());
    assertEquals("4", result.next().asString());
    Utils.closeSession();
    
    result = Utils.getNonEmptyDocsURIs(Utils.getTestDbXccUri());

    StringBuilder sb = new StringBuilder();
    while(result.hasNext()) {
        String s = result.next().asString();
        sb.append(s);
    }
    Utils.closeSession();
    
    String key = Utils.readSmallFile(Constants.TEST_PATH.toUri().getPath() + "/keys/TestImportAggregate#testImportAggZip.txt");
    assertTrue(sb.toString().equals(key));
}
 
开发者ID:marklogic,项目名称:marklogic-contentpump,代码行数:38,代码来源:TestImportAggregate.java


注:本文中的com.marklogic.xcc.ResultSequence.hasNext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。