001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.commons.flatfile.conversion; 018 019public class NestedConversionTest extends ConversionTestBase { 020 protected TestPair[] getTestPairs() { 021 Foo[] foos = new Foo[] { new Foo("abcdefghij", 123456), 022 new Foo("abcdefg", 12345), new Foo("abcdefghijk", 1234567) }; 023 Bar bar1 = new Bar(); 024 bar1.setFoos(foos); 025 bar1.setX("X"); 026 bar1.setY("Y"); 027 028 Bar bar2 = new Bar(); 029 bar2.setX("X"); 030 bar2.setY("Y"); 031 bar2.setFoos(new Foo[0]); 032 Bar bar3 = new Bar(); 033 bar3.setX("x"); 034 bar3.setY("y"); 035 bar3.setFoos(null); 036 return new TestPair[] { 037 new TestPair( 038 "Xabcdefghij;123456abcdefg ;012345abcdefghij;234567Y", 039 bar1), new TestPair("XY", bar2), 040 new TestPair("xy", bar3) }; 041 } 042 043 protected String getSource() { 044 return "nested.test"; 045 } 046}