@ -0,0 +1,26 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<classpath> | |||
<classpathentry kind="src" output="target/classes" path="src/main/java"> | |||
<attributes> | |||
<attribute name="optional" value="true"/> | |||
<attribute name="maven.pomderived" value="true"/> | |||
</attributes> | |||
</classpathentry> | |||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> | |||
<attributes> | |||
<attribute name="optional" value="true"/> | |||
<attribute name="maven.pomderived" value="true"/> | |||
</attributes> | |||
</classpathentry> | |||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"> | |||
<attributes> | |||
<attribute name="maven.pomderived" value="true"/> | |||
</attributes> | |||
</classpathentry> | |||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | |||
<attributes> | |||
<attribute name="maven.pomderived" value="true"/> | |||
</attributes> | |||
</classpathentry> | |||
<classpathentry kind="output" path="target/classes"/> | |||
</classpath> |
@ -0,0 +1,8 @@ | |||
# Default ignored files | |||
/shelf/ | |||
/workspace.xml | |||
# Editor-based HTTP Client requests | |||
/httpRequests/ | |||
# Datasource local storage ignored files | |||
/dataSources/ | |||
/dataSources.local.xml |
@ -0,0 +1,6 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project version="4"> | |||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="openjdk-17" project-jdk-type="JavaSDK"> | |||
<output url="file://$PROJECT_DIR$/classes" /> | |||
</component> | |||
</project> |
@ -0,0 +1,6 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project version="4"> | |||
<component name="VcsDirectoryMappings"> | |||
<mapping directory="$PROJECT_DIR$" vcs="Git" /> | |||
</component> | |||
</project> |
@ -0,0 +1,23 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<projectDescription> | |||
<name>s00.badcoupledsample</name> | |||
<comment></comment> | |||
<projects> | |||
</projects> | |||
<buildSpec> | |||
<buildCommand> | |||
<name>org.eclipse.jdt.core.javabuilder</name> | |||
<arguments> | |||
</arguments> | |||
</buildCommand> | |||
<buildCommand> | |||
<name>org.eclipse.m2e.core.maven2Builder</name> | |||
<arguments> | |||
</arguments> | |||
</buildCommand> | |||
</buildSpec> | |||
<natures> | |||
<nature>org.eclipse.jdt.core.javanature</nature> | |||
<nature>org.eclipse.m2e.core.maven2Nature</nature> | |||
</natures> | |||
</projectDescription> |
@ -0,0 +1,4 @@ | |||
eclipse.preferences.version=1 | |||
encoding//src/main/java=UTF-8 | |||
encoding//src/test/java=UTF-8 | |||
encoding/<project>=UTF-8 |
@ -0,0 +1,5 @@ | |||
eclipse.preferences.version=1 | |||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 | |||
org.eclipse.jdt.core.compiler.compliance=1.5 | |||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning | |||
org.eclipse.jdt.core.compiler.source=1.5 |
@ -0,0 +1,4 @@ | |||
activeProfiles= | |||
eclipse.preferences.version=1 | |||
resolveWorkspaceProjects=true | |||
version=1 |
@ -0,0 +1,25 @@ | |||
<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/xsd/maven-4.0.0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<groupId>es.anaya.spring.badcode</groupId> | |||
<artifactId>s00.badcoupled</artifactId> | |||
<version>0.0.1-SNAPSHOT</version> | |||
<packaging>jar</packaging> | |||
<name>s00.badcoupled</name> | |||
<url>http://maven.apache.org</url> | |||
<properties> | |||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |||
</properties> | |||
<dependencies> | |||
<dependency> | |||
<groupId>junit</groupId> | |||
<artifactId>junit</artifactId> | |||
<version>3.8.1</version> | |||
<scope>test</scope> | |||
</dependency> | |||
</dependencies> | |||
</project> |
@ -0,0 +1,55 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<class-diagram version="1.2.2" icons="false" automaticImage="JPEG" always-add-relationships="true" | |||
generalizations="true" realizations="true" associations="true" dependencies="true" nesting-relationships="true" | |||
router="FAN"> | |||
<class id="1" language="java" name="es.anaya.spring.badcode.s00.badcoupled.App" project="s00.badcoupledsample" | |||
file="/s00.badcoupledsample/src/main/java/es/anaya/spring/badcode/s00/badcoupled/App.java" binary="false" | |||
corner="BOTTOM_RIGHT"> | |||
<position height="-1" width="-1" x="208" y="296"/> | |||
<display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
sort-features="false" accessors="false" visibility="true"> | |||
<attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
<operations public="true" package="true" protected="true" private="true" static="true"/> | |||
</display> | |||
</class> | |||
<class id="2" language="java" name="es.anaya.spring.badcode.s00.badcoupled.CsvFileDataSource" | |||
project="s00.badcoupledsample" | |||
file="/s00.badcoupledsample/src/main/java/es/anaya/spring/badcode/s00/badcoupled/CsvFileDataSource.java" | |||
binary="false" corner="BOTTOM_RIGHT"> | |||
<position height="-1" width="-1" x="704" y="296"/> | |||
<display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
sort-features="false" accessors="false" visibility="true"> | |||
<attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
<operations public="true" package="true" protected="true" private="true" static="true"/> | |||
</display> | |||
</class> | |||
<class id="3" language="java" name="es.anaya.spring.badcode.s00.badcoupled.CustomerList" | |||
project="s00.badcoupledsample" | |||
file="/s00.badcoupledsample/src/main/java/es/anaya/spring/badcode/s00/badcoupled/CustomerList.java" binary="false" | |||
corner="BOTTOM_RIGHT"> | |||
<position height="-1" width="-1" x="396" y="296"/> | |||
<display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
sort-features="false" accessors="false" visibility="true"> | |||
<attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
<operations public="true" package="true" protected="true" private="true" static="true"/> | |||
</display> | |||
</class> | |||
<association id="4"> | |||
<end type="SOURCE" refId="3" navigable="false"> | |||
<attribute id="5" name="csvFileDataSource"/> | |||
<multiplicity id="6" minimum="0" maximum="1"/> | |||
</end> | |||
<end type="TARGET" refId="2" navigable="true"/> | |||
<display labels="true" multiplicity="true"/> | |||
</association> | |||
<dependency id="7"> | |||
<end type="SOURCE" refId="1"/> | |||
<end type="TARGET" refId="3"/> | |||
</dependency> | |||
<classifier-display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
sort-features="false" accessors="false" visibility="true"> | |||
<attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
<operations public="true" package="true" protected="true" private="true" static="true"/> | |||
</classifier-display> | |||
<association-display labels="true" multiplicity="true"/> | |||
</class-diagram> |
@ -0,0 +1,59 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<class-diagram version="1.2.2" icons="false" automaticImage="PNG" always-add-relationships="false" | |||
generalizations="true" realizations="true" associations="true" dependencies="true" nesting-relationships="true" | |||
router="FAN"> | |||
<class id="1" language="java" name="es.anaya.spring.badcode.s00.badcoupled.App" project="s00.badcoupledsample" | |||
file="/s00.badcoupledsample/src/main/java/es/anaya/spring/badcode/s00/badcoupled/App.java" binary="false" | |||
corner="BOTTOM_RIGHT"> | |||
<position height="-1" width="-1" x="119" y="165"/> | |||
<display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
sort-features="false" accessors="false" visibility="true"> | |||
<attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
<operations public="true" package="true" protected="true" private="true" static="true"/> | |||
</display> | |||
</class> | |||
<class id="2" language="java" name="es.anaya.spring.badcode.s00.badcoupled.CsvFileDataSource" | |||
project="s00.badcoupledsample" | |||
file="/s00.badcoupledsample/src/main/java/es/anaya/spring/badcode/s00/badcoupled/CsvFileDataSource.java" | |||
binary="false" corner="BOTTOM_RIGHT"> | |||
<position height="-1" width="-1" x="597" y="165"/> | |||
<display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
sort-features="false" accessors="false" visibility="true"> | |||
<attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
<operations public="true" package="true" protected="true" private="true" static="true"/> | |||
</display> | |||
</class> | |||
<class id="3" language="java" name="es.anaya.spring.badcode.s00.badcoupled.CustomerList" | |||
project="s00.badcoupledsample" | |||
file="/s00.badcoupledsample/src/main/java/es/anaya/spring/badcode/s00/badcoupled/CustomerList.java" binary="false" | |||
corner="BOTTOM_RIGHT"> | |||
<position height="-1" width="-1" x="301" y="165"/> | |||
<display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
sort-features="false" accessors="false" visibility="true"> | |||
<attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
<operations public="true" package="true" protected="true" private="true" static="true"/> | |||
</display> | |||
</class> | |||
<dependency id="4"> | |||
<end type="SOURCE" refId="1"/> | |||
<end type="TARGET" refId="3"/> | |||
</dependency> | |||
<association id="5"> | |||
<end type="SOURCE" refId="3" navigable="false"> | |||
<attribute id="6" name="csvFileDataSource"> | |||
<position height="0" width="0" x="-21" y="4"/> | |||
</attribute> | |||
<multiplicity id="7" minimum="0" maximum="1"> | |||
<position height="0" width="0" x="-21" y="4"/> | |||
</multiplicity> | |||
</end> | |||
<end type="TARGET" refId="2" navigable="true"/> | |||
<display labels="true" multiplicity="true"/> | |||
</association> | |||
<classifier-display autosize="true" stereotype="false" package="false" initial-value="false" signature="true" | |||
sort-features="false" accessors="false" visibility="true"> | |||
<attributes public="true" package="true" protected="true" private="true" static="true"/> | |||
<operations public="true" package="true" protected="true" private="true" static="true"/> | |||
</classifier-display> | |||
<association-display labels="true" multiplicity="true"/> | |||
</class-diagram> |
@ -0,0 +1,9 @@ | |||
package es.anaya.spring.badcode.s00.badcoupled; | |||
public class App { | |||
public static void main(String[] args) { | |||
CustomerList customerList = new CustomerList(); | |||
customerList.loadFile("samplefile.csv", ";"); | |||
System.out.println(customerList.showAll()); | |||
} | |||
} |
@ -0,0 +1,24 @@ | |||
package es.anaya.spring.badcode.s00.badcoupled; | |||
import java.util.ArrayList; | |||
public class CsvFileDataSource { | |||
private String filename; | |||
private String separator; | |||
public CsvFileDataSource(String filename, String separator) { | |||
this.filename = filename; | |||
this.separator = separator; | |||
} | |||
public ArrayList<String> loadData() { | |||
ArrayList<String> lines = new ArrayList<String>(); | |||
lines.add("Customer1, [email protected], 234 street"); | |||
lines.add("Customer2, [email protected], 523 street"); | |||
lines.add("Customer3, [email protected], 231 street"); | |||
return lines; | |||
} | |||
} |
@ -0,0 +1,21 @@ | |||
package es.anaya.spring.badcode.s00.badcoupled; | |||
import java.util.ArrayList; | |||
public class CustomerList { | |||
private CsvFileDataSource csvFileDataSource; | |||
private ArrayList<String> customerData; | |||
public CustomerList () { | |||
this.customerData = new ArrayList<String>(); | |||
} | |||
public void loadFile (String filename, String separator) { | |||
csvFileDataSource = new CsvFileDataSource(filename, separator); | |||
customerData = csvFileDataSource.loadData(); | |||
} | |||
public String showAll () { | |||
return customerData.toString(); | |||
} | |||
} |
@ -0,0 +1,38 @@ | |||
package es.anaya.spring.badcode.s00.badcoupledsample; | |||
import junit.framework.Test; | |||
import junit.framework.TestCase; | |||
import junit.framework.TestSuite; | |||
/** | |||
* Unit test for simple App. | |||
*/ | |||
public class AppTest | |||
extends TestCase | |||
{ | |||
/** | |||
* Create the test case | |||
* | |||
* @param testName name of the test case | |||
*/ | |||
public AppTest( String testName ) | |||
{ | |||
super( testName ); | |||
} | |||
/** | |||
* @return the suite of tests being tested | |||
*/ | |||
public static Test suite() | |||
{ | |||
return new TestSuite( AppTest.class ); | |||
} | |||
/** | |||
* Rigourous Test :-) | |||
*/ | |||
public void testApp() | |||
{ | |||
assertTrue( true ); | |||
} | |||
} |