Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/.idea/
/.idea/
74 changes: 74 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>

<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>org.example</groupId>
<artifactId>HomeWork04</artifactId>
<version>1.0-SNAPSHOT</version>

<name>HomeWork04</name>
<url>https://github.com/serhijd/java/tree/HomeWork04</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
21 changes: 21 additions & 0 deletions src/main/java/org/example/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.example;

import org.example.controller.Controller;
import org.example.model.Model;
import org.example.view.View;

/**
* Hello world!
*
*/
public class Main
{
public static void main(String[] args) {
// Initialization
Model model = new Model();
View view = new View();
Controller controller = new Controller(model, view);
// Run
controller.processUser();
}
}
22 changes: 22 additions & 0 deletions src/main/java/org/example/controller/Controller.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.example.controller;

import org.example.model.Model;
import org.example.view.View;

import java.util.Scanner;

public class Controller {
// Constructor
private Model model;
private View view;

public Controller(Model model, View view) {
this.model = model;
this.view = view;
}

// The Work method
public void processUser() {
Scanner sc = new Scanner(System.in);
}
}
4 changes: 4 additions & 0 deletions src/main/java/org/example/model/Model.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.example.model;

public class Model {
}
6 changes: 6 additions & 0 deletions src/main/java/org/example/view/View.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.example.view;

public class View {
public void printMessage(String message){ System.out.print(message); }
public void printLnMessage(String message){ System.out.println(message); }
}
20 changes: 20 additions & 0 deletions src/test/java/org/example/MainTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.example;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

/**
* Unit test for simple App.
*/
public class MainTest
{
/**
* Rigorous Test :-)
*/
@Test
public void shouldAnswerWithTrue()
{
assertTrue( true );
}
}