Examples of StringRecord


Examples of eu.stratosphere.core.io.StringRecord

    Whitebox.setInternalState(writer, "input", this.recordReader);
    when(this.environment.getTaskConfiguration()).thenReturn(this.conf);

    when(this.conf.getString("outputPath", null)).thenReturn(this.file.toURI().toString());
    when(this.recordReader.hasNext()).thenReturn(true, true, true, false);
    StringRecord in = new StringRecord("abc");
    try {
      when(this.recordReader.next()).thenReturn(in);
    } catch (IOException e) {
      fail();
      e.printStackTrace();
    } catch (InterruptedException e) {
      fail();
      e.printStackTrace();
    }
    writer.invoke();

    final FileInputSplit split = new FileInputSplit(0, new Path(this.file.toURI().toString()), 0,
      this.file.length(), null);
    when(this.environment.getInputSplitProvider()).thenReturn(this.inputSplitProvider);
    when(this.inputSplitProvider.getNextInputSplit()).thenReturn(split, (FileInputSplit) null);

    FileLineReader reader = new FileLineReader();
    Whitebox.setInternalState(reader, "environment", this.environment);
    Whitebox.setInternalState(reader, "output", this.recordWriter);
    StringRecord record = mock(StringRecord.class);

    whenNew(StringRecord.class).withNoArguments().thenReturn(record);

    reader.invoke();
View Full Code Here

Examples of org.apache.flink.core.io.StringRecord

   * This test checks the channel selection
   */
  @Test
  public void channelSelect() {

    final StringRecord dummyRecord = new StringRecord("abc");
    final RoundRobinChannelSelector<StringRecord> selector = new RoundRobinChannelSelector<StringRecord>();
    // Test with two channels
    final int numberOfOutputChannels = 2;
    int[] selectedChannels = selector.selectChannels(dummyRecord, numberOfOutputChannels);
    assertEquals(1, selectedChannels.length);
View Full Code Here

Examples of org.apache.poi.hssf.record.StringRecord

   
    row = new RowRecord();
    row.setRowNumber(1);
    records.add(row);

    records.add(new StringRecord());
   
    row = new RowRecord();
    row.setRowNumber(2);
    records.add(row);
   
View Full Code Here

Examples of org.apache.poi.hssf.record.StringRecord

        super(arg);
    }
   
    public void testClone() {
        FormulaRecord f = new FormulaRecord();
        StringRecord s = new StringRecord();
        FormulaRecordAggregate fagg = new FormulaRecordAggregate(f,s);
        FormulaRecordAggregate newFagg = (FormulaRecordAggregate) fagg.clone();
        assertTrue("objects are different", fagg!=newFagg);
        assertTrue("deep clone", fagg.getFormulaRecord() != newFagg.getFormulaRecord());
        assertTrue("deep clone",  fagg.getStringRecord() != newFagg.getStringRecord());
View Full Code Here

Examples of org.apache.poi.hssf.record.StringRecord

                }
                break;
            case StringRecord.sid: // 文本记录
                if (outputNextStringRecord) {
                    // String for formula
                    StringRecord srec = (StringRecord) record;
                    thisStr = srec.getString();
                    thisRow = nextRow;
                    thisColumn = nextColumn;
                    outputNextStringRecord = false;
                }
                break;
View Full Code Here

Examples of org.apache.poi.hssf.record.StringRecord

        }
        break;
      case StringRecord.sid:
        if(outputNextStringValue) {
          // String for formula
          StringRecord srec = (StringRecord)record;
          thisText = srec.getString();
          thisRow = nextRow;
          outputNextStringValue = false;
        }
        break;
      case LabelRecord.sid:
View Full Code Here

Examples of org.apache.poi.hssf.record.StringRecord

  public void setCachedStringResult(String value) {

    // Save the string into a String Record, creating one if required
    if(_stringRecord == null) {
      _stringRecord = new StringRecord();
    }
    _stringRecord.setString(value);
    if (value.length() < 1) {
      _formulaRecord.setCachedResultTypeEmptyString();
    } else {
View Full Code Here

Examples of org.apache.poi.hssf.record.StringRecord

public final class TestFormulaRecordAggregate extends TestCase {

  public void testBasic() throws Exception {
    FormulaRecord f = new FormulaRecord();
    f.setCachedResultTypeString();
    StringRecord s = new StringRecord();
    s.setString("abc");
    FormulaRecordAggregate fagg = new FormulaRecordAggregate(f, s, SharedValueManager.EMPTY);
    assertEquals("abc", fagg.getStringValue());
  }
View Full Code Here

Examples of org.apache.poi.hssf.record.StringRecord

   * the extra record.  POI should do the same.
   */
  public void testExtraStringRecord_bug46213() {
    FormulaRecord fr = new FormulaRecord();
    fr.setValue(2.0);
    StringRecord sr = new StringRecord();
    sr.setString("NA");
    SharedValueManager svm = SharedValueManager.EMPTY;
    FormulaRecordAggregate fra;
   
    try {
      fra = new FormulaRecordAggregate(fr, sr, svm);
View Full Code Here

Examples of org.apache.poi.hssf.record.StringRecord

    records.add(new RowRecord(0));
    records.add(new RowRecord(1));
    FormulaRecord formulaRecord = new FormulaRecord();
    formulaRecord.setCachedResultTypeString();
    records.add(formulaRecord);
    records.add(new StringRecord());
    records.add(new RowRecord(2));
    records.add(createWindow2Record());
    records.add(EOFRecord.instance);

    Sheet sheet = createSheet(records);
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.