Environment:
Windows 7 + jdk8 + eclipse
Directory:
Source code E: \ SRC \ samscdrental-prefactoring
Data E: \ Temp
Steps:
- Import the project to eclipse
- E: \ SRC \ samscdrental-prefactoring \ samscdrental contains the. Project File
- Import an existing project in eclipse and specify the directory containing the. project file.
- Remove references to JUnit. jar from the project.
- JUnit. jar in the original project property is on disk D, so it should be removed from the project property.
- Select JUnit. jar in project properties/Java build path/libraries and select the Remove button on the right.
- Add JUnit. jar to the Project
- JUnit. jar is available under E: \ SRC \ samscdrental-prefactoring \ samscdrental.
- Import JUnit. Jar under the source code directory in the project properties/Java build path/libraries.
- Modify the data file directory c:/temp to E:/temp
- Com. samscdrental. configuration. configuration. Java
- Change the variable value in the data file path from the linux root directory to E:/temp
- Create E:/TEMP directory
- Execute migration to import test data first (otherwise the test and display will not run properly)
- Modify the variable at the bottom of COM. samscdrental. Migration. migratemain. Java that represents the file path of the test data
- In the Eclipse project view, right-click com. samscdrental. Migration. migratemain under SRC and choose run
- Select Java application to create a data file.
- Execute unit test
- Modify the PATH variable in COM. samscdrental. Tests. checkincheckouttests. java.
- In the Eclipse project view, right-click com. samscdrental. Tests Under SRC and choose run
- Both JUnit and Java application can run
Source code compilation for software pre-construction