Skip to content

Commit

Permalink
Broke out common model objects to new Maven module and refactored pac…
Browse files Browse the repository at this point in the history
…kage to be in concert with the rest of the solution
  • Loading branch information
ahenson committed Jun 16, 2016
1 parent b804b49 commit ad1e2ca
Show file tree
Hide file tree
Showing 35 changed files with 122 additions and 74 deletions.
7 changes: 7 additions & 0 deletions flatworm-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@

<dependencies>

<!-- Flatworm dependencies -->
<dependency>
<groupId>com.blackbear</groupId>
<artifactId>flatworm-test-model</artifactId>
<scope>test</scope>
</dependency>

<!-- External dependencies -->
<dependency>
<groupId>commons-beanutils</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
import java.io.InputStreamReader;
import java.text.SimpleDateFormat;

import domain.Book;
import domain.Dvd;
import domain.Film;
import domain.Videotape;
import com.blackbear.flatworm.test.domain.domain.Book;
import com.blackbear.flatworm.test.domain.domain.Dvd;
import com.blackbear.flatworm.test.domain.domain.Film;
import com.blackbear.flatworm.test.domain.domain.Videotape;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;

import domain.Film;
import com.blackbear.flatworm.test.domain.domain.Film;

public class EncodingTestCase extends TestCase {
protected FileFormat ff;
Expand All @@ -47,7 +47,7 @@ public class EncodingTestCase extends TestCase {
+ " <record-ident>\r\n"
+ " <length-ident minlength=\"0\" maxlength=\"9999\" />\r\n"
+ " </record-ident>\r\n" + " <record-definition>\r\n"
+ " <bean name=\"film\" class=\"domain.Film\" />\r\n" + " <line>\r\n"
+ " <bean name=\"film\" class=\"com.blackbear.flatworm.test.domain.domain.Film\" />\r\n" + " <line>\r\n"
+ " <record-element length=\"30\" beanref=\"film.title\"\r\n"
+ " type=\"char\">\r\n"
+ " <conversion-option name=\"justify\" value=\"left\" />\r\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
import java.text.SimpleDateFormat;
import java.util.List;

import domain.segment.Account;
import domain.segment.Address;
import domain.segment.Consumer;
import domain.segment.Phone;
import com.blackbear.flatworm.test.domain.domain.segment.Account;
import com.blackbear.flatworm.test.domain.domain.segment.Address;
import com.blackbear.flatworm.test.domain.domain.segment.Consumer;
import com.blackbear.flatworm.test.domain.domain.segment.Phone;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.io.InputStream;
import java.io.InputStreamReader;

import domain.segment.ClassPeriod;
import com.blackbear.flatworm.test.domain.domain.segment.ClassPeriod;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
Expand Down
10 changes: 5 additions & 5 deletions flatworm-core/src/test/resources/complex-example.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
<length-ident minlength="85" maxlength="85"/>
</record-ident>
<record-definition>
<bean name="dvd" class="domain.Dvd"/>
<bean name="film" class="domain.Film"/>
<bean name="dvd" class="com.blackbear.flatworm.test.domain.domain.Dvd"/>
<bean name="film" class="com.blackbear.flatworm.test.domain.domain.Film"/>
<line>
<record-element length="30" beanref="film.title" type="char">
<conversion-option name="justify" value="left"/>
Expand Down Expand Up @@ -62,8 +62,8 @@
</field-ident>
</record-ident>
<record-definition>
<bean name="video" class="domain.Videotape"/>
<bean name="film" class="domain.Film"/>
<bean name="video" class="com.blackbear.flatworm.test.domain.domain.Videotape"/>
<bean name="film" class="com.blackbear.flatworm.test.domain.domain.Film"/>
<line>
<record-element start="1" end="10" beanref="video.sku" type="char">
<conversion-option name="justify" value="right"/>
Expand Down Expand Up @@ -92,7 +92,7 @@
</record>
<record name="book">
<record-definition>
<bean name="book" class="domain.Book"/>
<bean name="book" class="com.blackbear.flatworm.test.domain.domain.Book"/>
<line>
<record-element length="9" beanref="book.sku" type="char"/>
<record-element length="30" beanref="book.title" type="char">
Expand Down
4 changes: 2 additions & 2 deletions flatworm-core/src/test/resources/segment-class-tabs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
</field-ident>
</record-ident>
<record-definition>
<bean name="class" class="domain.segment.ClassPeriod"/>
<bean name="student" class="domain.segment.Student"/>
<bean name="class" class="com.blackbear.flatworm.test.domain.domain.segment.ClassPeriod"/>
<bean name="student" class="com.blackbear.flatworm.test.domain.domain.segment.Student"/>
<line delimit="\t">
<record-element length="0" type="char"/>
<record-element length="0" beanref="class.subject" type="char"/>
Expand Down
4 changes: 2 additions & 2 deletions flatworm-core/src/test/resources/segment-class.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
</field-ident>
</record-ident>
<record-definition>
<bean name="class" class="domain.segment.ClassPeriod"/>
<bean name="student" class="domain.segment.Student"/>
<bean name="class" class="com.blackbear.flatworm.test.domain.domain.segment.ClassPeriod"/>
<bean name="student" class="com.blackbear.flatworm.test.domain.domain.segment.Student"/>
<line delimit="|">
<record-element length="0" type="char"/>
<record-element length="0" beanref="class.subject" type="char"/>
Expand Down
10 changes: 5 additions & 5 deletions flatworm-core/src/test/resources/segment-example.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
</field-ident>
</record-ident>
<record-definition>
<bean name="account" class="domain.segment.Account"/>
<bean name="consumer" class="domain.segment.Consumer"/>
<bean name="id" class="domain.segment.Identity"/>
<bean name="phone" class="domain.segment.Phone"/>
<bean name="address" class="domain.segment.Address"/>
<bean name="account" class="com.blackbear.flatworm.test.domain.domain.segment.Account"/>
<bean name="consumer" class="com.blackbear.flatworm.test.domain.domain.segment.Consumer"/>
<bean name="id" class="com.blackbear.flatworm.test.domain.domain.segment.Identity"/>
<bean name="phone" class="com.blackbear.flatworm.test.domain.domain.segment.Phone"/>
<bean name="address" class="com.blackbear.flatworm.test.domain.domain.segment.Address"/>
<line delimit="|">
<record-element length="0"/> <!-- Need to allow for the type identifier! -->
<record-element beanref="account.reportingDate" length="0" type="date">
Expand Down
4 changes: 1 addition & 3 deletions flatworm-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@
</dependency>
<dependency>
<groupId>com.blackbear</groupId>
<artifactId>flatworm-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<artifactId>flatworm-test-model</artifactId>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import com.blackbear.flatworm.MatchedRecord;

import domain.Employee;
import com.blackbear.flatworm.test.domain.domain.Employee;

/**
* @author e50633
Expand Down
10 changes: 5 additions & 5 deletions flatworm-examples/src/main/java/examples/InventoryFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
*/
package examples;

import domain.Book;
import domain.Dvd;
import domain.Film;
import domain.Inventory;
import domain.Videotape;
import com.blackbear.flatworm.test.domain.domain.Book;
import com.blackbear.flatworm.test.domain.domain.Dvd;
import com.blackbear.flatworm.test.domain.domain.Film;
import com.blackbear.flatworm.test.domain.domain.Inventory;
import com.blackbear.flatworm.test.domain.domain.Videotape;

/**
* @author e50633
Expand Down
10 changes: 5 additions & 5 deletions flatworm-examples/src/main/java/examples/InventoryHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@

import java.io.IOException;

import domain.Book;
import domain.Dvd;
import domain.Film;
import domain.Inventory;
import domain.Videotape;
import com.blackbear.flatworm.test.domain.domain.Book;
import com.blackbear.flatworm.test.domain.domain.Dvd;
import com.blackbear.flatworm.test.domain.domain.Film;
import com.blackbear.flatworm.test.domain.domain.Inventory;
import com.blackbear.flatworm.test.domain.domain.Videotape;

/**
* @author e50633
Expand Down
8 changes: 4 additions & 4 deletions flatworm-examples/src/main/java/examples/ProductHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@

import com.blackbear.flatworm.MatchedRecord;

import domain.Book;
import domain.Dvd;
import domain.Film;
import domain.Videotape;
import com.blackbear.flatworm.test.domain.domain.Book;
import com.blackbear.flatworm.test.domain.domain.Dvd;
import com.blackbear.flatworm.test.domain.domain.Film;
import com.blackbear.flatworm.test.domain.domain.Videotape;

/**
* @author e50633
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
import java.io.IOException;
import java.util.Date;

import domain.Book;
import domain.Dvd;
import domain.Film;
import domain.Videotape;
import com.blackbear.flatworm.test.domain.domain.Book;
import com.blackbear.flatworm.test.domain.domain.Dvd;
import com.blackbear.flatworm.test.domain.domain.Film;
import com.blackbear.flatworm.test.domain.domain.Videotape;

public class WriteFixedMovies {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</field-ident>
</record-ident>
<record-definition>
<bean name="employee" class="domain.Employee"/>
<bean name="employee" class="com.blackbear.flatworm.test.domain.domain.Employee"/>
<line delimit=",">
<record-element length="2"/>
<record-element length="15" beanref="employee.firstName"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</field-ident>
</record-ident>
<record-definition>
<bean name="employee" class="domain.Employee"/>
<bean name="employee" class="com.blackbear.flatworm.test.domain.domain.Employee"/>
<line>
<record-element length="2"/>
<record-element length="15" beanref="employee.firstName"
Expand Down
10 changes: 5 additions & 5 deletions flatworm-examples/src/main/java/examples/read_fixed_movies.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
<length-ident minlength="85" maxlength="85"/>
</record-ident>
<record-definition>
<bean name="dvd" class="domain.Dvd"/>
<bean name="film" class="domain.Film"/>
<bean name="dvd" class="com.blackbear.flatworm.test.domain.domain.Dvd"/>
<bean name="film" class="com.blackbear.flatworm.test.domain.domain.Film"/>
<line>
<record-element length="30" beanref="film.title"
type="char">
Expand Down Expand Up @@ -67,8 +67,8 @@
</field-ident>
</record-ident>
<record-definition>
<bean name="video" class="domain.Videotape"/>
<bean name="film" class="domain.Film"/>
<bean name="video" class="com.blackbear.flatworm.test.domain.domain.Videotape"/>
<bean name="film" class="com.blackbear.flatworm.test.domain.domain.Film"/>
<line>
<record-element start="1" end="10" beanref="video.sku"
type="char">
Expand Down Expand Up @@ -103,7 +103,7 @@
</record>
<record name="book">
<record-definition>
<bean name="book" class="domain.Book"/>
<bean name="book" class="com.blackbear.flatworm.test.domain.domain.Book"/>
<line>
<record-element length="9" beanref="book.sku"
type="char"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
method="convertDecimal" return-type="java.lang.Integer"/>
<record name="inventory">
<record-definition>
<bean name="inventory" class="domain.Inventory"/>
<bean name="inventory" class="com.blackbear.flatworm.test.domain.domain.Inventory"/>
<line delimit="~">
<record-element length="30" beanref="inventory.sku"
type="char">
Expand Down
10 changes: 5 additions & 5 deletions flatworm-examples/src/main/java/examples/write_fixed_movies.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
<length-ident minlength="85" maxlength="85"/>
</record-ident>
<record-definition>
<bean name="dvd" class="domain.Dvd"/>
<bean name="film" class="domain.Film"/>
<bean name="dvd" class="com.blackbear.flatworm.test.domain.domain.Dvd"/>
<bean name="film" class="com.blackbear.flatworm.test.domain.domain.Film"/>
<line>
<record-element length="30" beanref="film.title"
type="char">
Expand Down Expand Up @@ -65,8 +65,8 @@
</field-ident>
</record-ident>
<record-definition>
<bean name="video" class="domain.Videotape"/>
<bean name="film" class="domain.Film"/>
<bean name="video" class="com.blackbear.flatworm.test.domain.domain.Videotape"/>
<bean name="film" class="com.blackbear.flatworm.test.domain.domain.Film"/>
<line>
<record-element start="1" end="10" beanref="video.sku"
type="char">
Expand Down Expand Up @@ -100,7 +100,7 @@
</record>
<record name="book">
<record-definition>
<bean name="book" class="domain.Book"/>
<bean name="book" class="com.blackbear.flatworm.test.domain.domain.Book"/>
<line>
<record-element length="9" beanref="book.sku"
type="char"/>
Expand Down
38 changes: 38 additions & 0 deletions flatworm-test-model/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
~ Flatworm - A Java Flat File Importer/Exporter Copyright (C) 2004 James M. Turner.
~ Extended by James Lawrence 2005
~ Extended by Josh Brackett in 2011 and 2012
~ Extended by Alan Henson in 2016
~
~ Licensed 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.
-->

<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.blackbear</groupId>
<artifactId>flatworm-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
</parent>

<artifactId>flatworm-test-model</artifactId>
<packaging>jar</packaging>

<name>Flatworm Test Model</name>

<description>Common objects shared between testing and the examples.</description>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* and limitations under the License.
*/

package domain;
package com.blackbear.flatworm.test.domain.domain;

import java.util.Date;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* and limitations under the License.
*/

package domain;
package com.blackbear.flatworm.test.domain.domain;

/**
* Created by IntelliJ IDEA. User: turner Date: Jun 16, 2004 Time: 1:44:16 AM To change this template use File | Settings | File Templates.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* and limitations under the License.
*/

package domain;
package com.blackbear.flatworm.test.domain.domain;

/**
* Created by IntelliJ IDEA. User: james Date: Sep 18, 2003 Time: 2:56:46 AM To change this template use Options | File Templates.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* and limitations under the License.
*/

package domain;
package com.blackbear.flatworm.test.domain.domain;

import java.util.Date;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* To change the template for this generated file go to Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and
* Comments
*/
package domain;
package com.blackbear.flatworm.test.domain.domain;

/**
* @author e50633
Expand Down
Loading

0 comments on commit ad1e2ca

Please sign in to comment.