[CSV-183] Drop ferc.gov tests.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1745410 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7587f0dc78
commit
d5d2547cb3
|
@ -41,6 +41,7 @@
|
|||
<release version="1.4" date="2016-MM-DD" description="Feature and bug fix release">
|
||||
<action issue="CSV-181" type="update" dev="ggregory" due-to="Gary Gregory">Make CSVPrinter.print(Object) GC-free.</action>
|
||||
<action issue="CSV-182" type="add" dev="ggregory" due-to="Gary Gregory">Allow some printing operations directly from CSVFormat.</action>
|
||||
<action issue="CSV-183" type="update" dev="ggregory">Drop ferc.gov tests.</action>
|
||||
</release>
|
||||
<release version="1.3" date="2016-05-09" description="Feature and bug fix release">
|
||||
<action issue="CSV-179" type="add" dev="britter">Add shortcut method for using first record as header to CSVFormat</action>
|
||||
|
|
|
@ -1,89 +0,0 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.commons.csv;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Real world examples from http://www.ferc.gov/docs-filing/eqr/soft-tools/sample-csv.asp
|
||||
*/
|
||||
public class FercGovTest {
|
||||
|
||||
private enum ContractColumnNames {
|
||||
contract_id, seller_company_name, customer_company_name, customer_duns_number, contract_affiliate,
|
||||
FERC_tariff_reference, contract_service_agreement_id, contract_execution_date, contract_commencement_date,
|
||||
contract_termination_date, actual_termination_date, extension_provision_description, class_name, term_name,
|
||||
increment_name, increment_peaking_name, product_type_name, product_name, quantity, units_for_contract, rate,
|
||||
rate_minimum, rate_maximum, rate_description, units_for_rate, point_of_receipt_control_area,
|
||||
point_of_receipt_specific_location, point_of_delivery_control_area, point_of_delivery_specific_location,
|
||||
begin_date, end_date, time_zone;
|
||||
}
|
||||
|
||||
private static final Charset US_ASCII = Charset.forName("US-ASCII");
|
||||
|
||||
@Test
|
||||
public void testContractFile() throws IOException {
|
||||
final URL contractData = ClassLoader.getSystemClassLoader().getResource("ferc.gov/contract.txt");
|
||||
final CSVParser parser = CSVParser.parse(contractData, US_ASCII, CSVFormat.DEFAULT.withHeader());
|
||||
try {
|
||||
final List<CSVRecord> records = parser.getRecords();
|
||||
CSVRecord record = records.get(0);
|
||||
Assert.assertEquals(22, records.size());
|
||||
// first record
|
||||
Assert.assertEquals("C71", record.get(ContractColumnNames.contract_id));
|
||||
Assert.assertEquals("The Electric Company", record.get(ContractColumnNames.seller_company_name));
|
||||
Assert.assertEquals("ES", record.get(ContractColumnNames.time_zone));
|
||||
// last record
|
||||
record = records.get(records.size() - 1);
|
||||
// first record
|
||||
Assert.assertEquals("C78", record.get(ContractColumnNames.contract_id));
|
||||
Assert.assertEquals("The Electric Company", record.get(ContractColumnNames.seller_company_name));
|
||||
Assert.assertEquals("EP", record.get(ContractColumnNames.time_zone));
|
||||
} finally {
|
||||
parser.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTransactionFile() throws IOException {
|
||||
final URL transactionData = ClassLoader.getSystemClassLoader().getResource("ferc.gov/transaction.txt");
|
||||
final CSVParser parser = CSVParser.parse(transactionData, US_ASCII,
|
||||
CSVFormat.DEFAULT.withHeader());
|
||||
try {
|
||||
final List<CSVRecord> records = parser.getRecords();
|
||||
Assert.assertEquals(24, records.size());
|
||||
CSVRecord record = records.get(0);
|
||||
// first record
|
||||
Assert.assertEquals("T1", record.get("transaction_unique_identifier"));
|
||||
Assert.assertEquals("The Electric Company", record.get("seller_company_name"));
|
||||
Assert.assertEquals("880386", record.get("transaction_charge"));
|
||||
// last record
|
||||
record = records.get(records.size() - 1);
|
||||
Assert.assertEquals("T15", record.get("transaction_unique_identifier"));
|
||||
Assert.assertEquals("The Electric Company", record.get("seller_company_name"));
|
||||
Assert.assertEquals("1800", record.get("transaction_charge"));
|
||||
} finally {
|
||||
parser.close();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
contract_id,seller_company_name,customer_company_name,customer_duns_number,contract_affiliate,FERC_tariff_reference,contract_service_agreement_id,contract_execution_date,contract_commencement_date,contract_termination_date,actual_termination_date,extension_provision_description,class_name,term_name,increment_name,increment_peaking_name,product_type_name,product_name,quantity,units_for_contract,rate,rate_minimum,rate_maximum,rate_description,units_for_rate,point_of_receipt_control_area,point_of_receipt_specific_location,point_of_delivery_control_area,point_of_delivery_specific_location,begin_date,end_date,time_zone
|
||||
C71,The Electric Company,The Power Company,456543333,N,FERC Electric Tariff Original Volume No. 10,2,2/15/2001,2/15/2001,,,Evergreen,N/A,N/A,N/A,N/A,MB,ENERGY,0,, , , ,Market Based,,,,,,,,ES
|
||||
C72,The Electric Company,Utility A,38495837,n,FERC Electric Tariff Original Volume No. 10,15,7/25/2001,8/1/2001,,,Evergreen,N/A,N/A,N/A,N/A,MB,ENERGY,0,, , , ,Market Based,,,,,,,,ES
|
||||
C73,The Electric Company,Utility B,493758794,N,FERC Electric Tariff Original Volume No. 10,7,6/8/2001,7/6/2001,,,Evergreen,N/A,N/A,N/A,N/A,MB,ENERGY,0,, , , ,Market Based,,,, , ,,,ep
|
||||
C74,The Electric Company,Utility C,594739573,n,FERC Electric Tariff Original Volume No. 10,25,6/8/2001,7/6/2001,,,Evergreen,N/A,N/A,N/A,N/A,MB,ENERGY,0,, , , ,Market Based,,,, , ,,,ep
|
||||
C75,The Electric Company,The Power Company,456543333,N,FERC Electric Tariff Third Revised Volume No. 7,94,2/13/2001,7/1/2001,12/31/2006,,None,F,LT,M,P,T,ENERGY,2000,KWh,.1475, , ,Max amount of capacity and energy to be transmitted. Bill based on monthly max delivery to City.,$/KWh,PJM,Point A,PJM,Point B,,,ep
|
||||
C75,The Electric Company,The Power Company,456543333,N,FERC Electric Tariff Third Revised Volume No. 7,94,2/13/2001,7/1/2001,12/31/2006,,None,F,LT,M,P,T,point-to-point agreement,2000,KW,0.01, , ,,$/kw-mo,PJM,Point A,PJM,Point B,,,ep
|
||||
C75,The Electric Company,The Power Company,456543333,N,FERC Electric Tariff Third Revised Volume No. 7,94,2/13/2001,7/1/2001,12/31/2006,,None,F,LT,M,P,T,network,2000,KW,0.2, , ,,$/kw-mo,PJM,Point A,PJM,Point B,,,ep
|
||||
C75,The Electric Company,The Power Company,456543333,N,FERC Electric Tariff Third Revised Volume No. 7,94,2/13/2001,7/1/2001,12/31/2006,,None,F,LT,M,P,T,BLACK START SERVICE,2000,KW,0.22, , ,,$/kw-mo,PJM,Point A,PJM,Point B,,,ep
|
||||
C75,The Electric Company,The Power Company,456543333,N,FERC Electric Tariff Third Revised Volume No. 7,94,2/13/2001,7/1/2001,12/31/2006,,None,F,LT,M,P,T,CAPACITY,2000,KW,0.04, , ,,$/kw-mo,PJM,Point A,PJM,Point B,,,ep
|
||||
C75,The Electric Company,The Power Company,456543333,N,FERC Electric Tariff Third Revised Volume No. 7,94,2/13/2001,7/1/2001,12/31/2006,,None,F,LT,M,P,T,regulation & frequency response,2000,KW,0.1, , ,,$/kw-mo,PJM,Point A,PJM,Point B,,,ep
|
||||
C75,The Electric Company,The Power Company,456543333,N,FERC Electric Tariff Third Revised Volume No. 7,94,2/13/2001,7/1/2001,12/31/2006,,None,F,LT,M,P,T,real power transmission loss,2000,KW,7, , ,,$/kw-mo,PJM,Point A,PJM,Point B,,,ep
|
||||
C76,The Electric Company,The Power Company,456534333,N,FERC Electric Tariff Original Volume No. 10,132,12/15/2001,1/1/2002,12/31/2004,12/31/2004,None,F,LT,M,FP,MB,CAPACITY,70,MW,3750, , ,70MW for each and every hour over the term of the agreement (7x24 schedule).,$/MW,,,,,,,ep
|
||||
C78,The Electric Company,"The Electric Marketing Co., LLC",23456789,Y,FERC Electric Tariff Original Volume No. 2,Service Agreement 1,1/2/1992,1/2/1992,1/1/2012,,Renewable annually by mutual agreement after termination date.,UP,LT,Y,FP,CB,ENERGY,0,MWH,35, , ,,$/MWH,,,PJM,Bus 4321,20020101,20030101,EP
|
||||
C78,The Electric Company,"The Electric Marketing Co., LLC",23456789,Y,FERC Electric Tariff Original Volume No. 2,Service Agreement 1,1/2/1992,1/2/1992,1/1/2012,,Renewable annually by mutual agreement after termination date.,UP,LT,Y,FP,CB,ENERGY,0,MWH,37, , ,,$/MWH,,,PJM,Bus 4321,20030101,20040101,EP
|
||||
C78,The Electric Company,"The Electric Marketing Co., LLC",23456789,Y,FERC Electric Tariff Original Volume No. 2,Service Agreement 1,1/2/1992,1/2/1992,1/1/2012,,Renewable annually by mutual agreement after termination date.,UP,LT,Y,FP,CB,ENERGY,0,MWH,39, , ,,$/MWH,,,PJM,Bus 4321,20040101,20050101,EP
|
||||
C78,The Electric Company,"The Electric Marketing Co., LLC",23456789,Y,FERC Electric Tariff Original Volume No. 2,Service Agreement 1,1/2/1992,1/2/1992,1/1/2012,,Renewable annually by mutual agreement after termination date.,UP,LT,Y,FP,CB,ENERGY,0,MWH,41, , ,,$/MWH,,,PJM,Bus 4321,20050101,20060101,EP
|
||||
C78,The Electric Company,"The Electric Marketing Co., LLC",23456789,Y,FERC Electric Tariff Original Volume No. 2,Service Agreement 1,1/2/1992,1/2/1992,1/1/2012,,Renewable annually by mutual agreement after termination date.,UP,LT,Y,FP,CB,ENERGY,0,MWH,43, , ,,$/MWH,,,PJM,Bus 4321,20060101,20070101,EP
|
||||
C78,The Electric Company,"The Electric Marketing Co., LLC",23456789,Y,FERC Electric Tariff Original Volume No. 2,Service Agreement 1,1/2/1992,1/2/1992,1/1/2012,,Renewable annually by mutual agreement after termination date.,UP,LT,Y,FP,CB,ENERGY,0,MWH,45, , ,,$/MWH,,,PJM,Bus 4321,20070101,20080101,EP
|
||||
C78,The Electric Company,"The Electric Marketing Co., LLC",23456789,Y,FERC Electric Tariff Original Volume No. 2,Service Agreement 1,1/2/1992,1/2/1992,1/1/2012,,Renewable annually by mutual agreement after termination date.,UP,LT,Y,FP,CB,ENERGY,0,MWH,47, , ,,$/MWH,,,PJM,Bus 4321,20080101,20090101,EP
|
||||
C78,The Electric Company,"The Electric Marketing Co., LLC",23456789,Y,FERC Electric Tariff Original Volume No. 2,Service Agreement 1,1/2/1992,1/2/1992,1/1/2012,,Renewable annually by mutual agreement after termination date.,UP,LT,Y,FP,CB,ENERGY,0,MWH,49, , ,,$/MWH,,,PJM,Bus 4321,20090101,20100101,EP
|
||||
C78,The Electric Company,"The Electric Marketing Co., LLC",23456789,Y,FERC Electric Tariff Original Volume No. 2,Service Agreement 1,1/2/1992,1/2/1992,1/1/2012,,Renewable annually by mutual agreement after termination date.,UP,LT,Y,FP,CB,ENERGY,0,MWH,51, , ,,$/MWH,,,PJM,Bus 4321,20100101,20110101,EP
|
||||
C78,The Electric Company,"The Electric Marketing Co., LLC",23456789,Y,FERC Electric Tariff Original Volume No. 2,Service Agreement 1,1/2/1992,1/2/1992,1/1/2012,,Renewable annually by mutual agreement after termination date.,UP,LT,Y,FP,CB,ENERGY,0,MWH,53, , ,,$/MWH,,,PJM,Bus 4321,20110101,20120101,EP
|
|
@ -1,2 +0,0 @@
|
|||
Real world examples from http://www.ferc.gov/docs-filing/eqr/soft-tools/sample-csv.asp
|
||||
These files are included discussion in https://issues.apache.org/jira/browse/LEGAL-175.
|
|
@ -1,25 +0,0 @@
|
|||
transaction_unique_identifier,seller_company_name,customer_company_name,customer_duns_number,tariff_reference,contract_service_agreement,trans_id,transaction_begin_date,transaction_end_date,time_zone,point_of_delivery_control_area,specific location,class_name,term_name,increment_name,increment_peaking_name,product_name,transaction_quantity,price,units,total_transmission_charge,transaction_charge
|
||||
T1,The Electric Company,"The Electric Marketing Co., LLC",23456789,FERC Electric Tariff Original Volume No. 2,Service Agreement 1,8700,200401010000,200403312359,ES,PJM,BUS 4321,UP,LT,Y,FP,ENERGY,22574,39,$/MWH,0,880386
|
||||
T2,The Electric Company,The Power Company,45653333,FERC Electric Tariff Original Volume No. 10,2,8701,200401010000,200402010000,CS,DPL,Green Sub Busbar,F,ST,M,FP,ENERGY,16800,32,$/MWH,0,537600
|
||||
T3,The Electric Company,The Power Company,45653333,FERC Electric Tariff Original Volume No. 10,2,8702,200402010000,200403010000,CS,DPL,Green Sub Busbar,F,ST,M,FP,ENERGY,16800,32,$/MWH,0,537600
|
||||
T4,The Electric Company,The Power Company,45653333,FERC Electric Tariff Original Volume No. 10,2,8703,200403010000,200404010000,CS,DPL,Green Sub Busbar,F,ST,M,FP,ENERGY,16800,32,$/MWH,0,537600
|
||||
T5,The Electric Company,The Power Company,45653333,FERC Electric Tariff Original Volume No. 10,2,8704,200401111600,200401121559,CS,AEP,Tile Busbar,F,ST,D,FP,ENERGY,1200,50,$/MWH,0,60000
|
||||
T6,The Electric Company,The Power Company,45653333,FERC Electric Tariff Original Volume No. 10,2,8801,200402011300,20040215061900,ES,HUB,Entergy (into),NF,ST,H,FP,ENERGY,1875,13.75,$/MWH,6675,32456.25
|
||||
T7,The Electric Company,The Power Company,45653333,FERC Electric Tariff Original Volume No. 10,2,8802,20040202110000,200402021800,ES,HUB,PJM-W,NF,ST,H,FP,BOOKED OUT POWER,350,32,$/MWH,0,11200
|
||||
T8,The Electric Company,The Power Company,45653333,FERC Electric Tariff Original Volume No. 10,2,8803,20040203060500,20040210112200,ES,HUB,PJM-W,NF,ST,H,FP,ENERGY,1875,44,$/MWH,0,82500
|
||||
T9,The Electric Company,The Power Company,45653333,FERC Electric Tariff Original Volume No. 10,2,8804,20040211062300,20040219081200,PP,HUB,Four Corners,NF,ST,H,FP,ENERGY,1875,48,$/MWH,0,90000
|
||||
T10,The Electric Company,The Power Company,45653333,FERC Electric Tariff Original Volume No. 10,132,7125,20040109081100,20040309082300,CS,HUB,AEP (into),F,ST,H,OP,ENERGY,150,22,$/MWH,4264,7564
|
||||
T10,The Electric Company,The Power Company,45653333,FERC Electric Tariff Original Volume No. 10,132,7125,20040201010000,20040225080800,CS,HUB,AEP (into),F,ST,H,OP,ENERGY,150,28,$/MWH,0,4200
|
||||
T10,The Electric Company,The Power Company,45653333,FERC Electric Tariff Original Volume No. 10,132,7125,20040108111100,20040301121200,CS,HUB,AEP (into),F,ST,H,OP,ENERGY,150,44,$/MWH,0,6600
|
||||
T10,The Electric Company,The Power Company,45653333,FERC Electric Tariff Original Volume No. 10,132,7125,20040322112200,20040325120000,CS,HUB,AEP (into),F,ST,H,OP,ENERGY,150,44,$/MWH,0,6600
|
||||
T10,The Electric Company,The Power Company,45653333,FERC Electric Tariff Original Volume No. 10,132,7125,20040323191900,20040328191700,CS,HUB,AEP (into),F,ST,H,OP,ENERGY,150,58,$/MWH,0,8700
|
||||
T10,The Electric Company,The Power Company,45653333,FERC Electric Tariff Original Volume No. 10,132,7125,20040111010000,20040122022200,CS,HUB,AEP (into),F,ST,H,OP,CAPACITY,150,20,$/MW-DAY,0,3000
|
||||
T11,The Electric Company,Utility A,38495837,FERC Electric Tariff Original Volume No. 10,15,8711,200403150800,200403150859,ES,ISNE,NEPOOL Mass HUB,F,ST,H,P,Energy,100,50,$/MWH,0,5000
|
||||
T11,The Electric Company,Utility A,38495837,FERC Electric Tariff Original Volume No. 10,15,8711,200403150800,200403150859,ES,ISNE,NEPOOL Mass HUB,F,ST,H,P,Energy,-10,60,$/MWH,0,-600
|
||||
T12,The Electric Company,Utility A,38495837,FERC Electric Tariff Original Volume No. 10,15,8711,200403150900,200403150959,ES,ISNE,NEPOOL Mass HUB,F,ST,H,P,Energy,100,55,$/MWH,0,5500
|
||||
T12,The Electric Company,Utility A,38495837,FERC Electric Tariff Original Volume No. 10,15,8711,200403150900,200403150959,ES,ISNE,NEPOOL Mass HUB,F,ST,H,P,Energy,-5,59,$/MWH,0,-295
|
||||
T13,The Electric Company,Utility A,38495837,FERC Electric Tariff Original Volume No. 10,15,8711,200403151000,200403151059,ES,ISNE,NEPOOL Mass HUB,F,ST,H,P,Energy,100,62,$/MWH,0,6200
|
||||
T13,The Electric Company,Utility A,38495837,FERC Electric Tariff Original Volume No. 10,15,8711,200403151000,200403151059,ES,ISNE,NEPOOL Mass HUB,F,ST,H,P,Energy,-10,60,$/MWH,0,-600
|
||||
T14,The Electric Company,Utility A,38495837,FERC Electric Tariff Original Volume No. 10,15,8711,200403151100,200403151159,ES,ISNE,NEPOOL Mass HUB,F,ST,H,P,Energy,100,62,$/MWH,0,6200
|
||||
T14,The Electric Company,Utility A,38495837,FERC Electric Tariff Original Volume No. 10,15,8711,200403151100,200403151159,ES,ISNE,NEPOOL Mass HUB,F,ST,H,P,Energy,-10,59,$/MWH,0,-590
|
||||
T15,The Electric Company,Utility B,493758794,FERC Electric Tariff Original Volume No. 10,7,8712,200402140200,200402140259,EP,NYIS,Zone A,F,ST,H,FP,Booked out power,60,30,$/MWH,0,1800
|
Loading…
Reference in New Issue