Skip to content

Commit

Permalink
Initial Project Structure and files.
Browse files Browse the repository at this point in the history
  • Loading branch information
atifiu committed Jul 7, 2019
0 parents commit fe07679
Show file tree
Hide file tree
Showing 9 changed files with 121 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?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="test" value="true"/>
<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>
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target/
23 changes: 23 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Sample-Projects</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>
6 changes: 6 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
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.release=disabled
org.eclipse.jdt.core.compiler.source=1.5
4 changes: 4 additions & 0 deletions .settings/org.eclipse.m2e.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Sample-Project
Java Full Stack Program
15 changes: 15 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<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>com.faceprep.Sample</groupId>
<artifactId>Sample-Projects</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Sample-project</name>
<description>this is for testing and having a prctice run for you run and compile a project</description>
<dependencies>
<dependency>
<groupId>junit</groupId> <!-- NOT org.junit here -->
<artifactId>junit-dep</artifactId>
<version>4.8.2</version>
</dependency>
</dependencies>
</project>
18 changes: 18 additions & 0 deletions src/main/java/main/SampleProject.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package main;

public class SampleProject {
//print Hello world! in the console
public static String printHello() {
//print Hello world! in the console!
String c = "Hello rvabddld!";
return c;
}
public static int add(int a,int b) {
int c = a+b;
return c;
}
public static void main(String args[]) {
System.out.println(printHello());
System.out.println(add(23,45));
}
}
25 changes: 25 additions & 0 deletions src/test/java/main/TestCase.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package main;

import static org.junit.Assert.*;

import org.junit.Test;

public class TestCase {
SampleProject sm;
@SuppressWarnings("static-access")
@Test
public void testHello() {
sm = new SampleProject();

assertEquals("Hello World!",sm.printHello());
}

@SuppressWarnings("static-access")
@Test
public void testAdd() {
sm = new SampleProject();
int a = 23+45;
assertEquals(a,sm.add(23, 45));
}

}

0 comments on commit fe07679

Please sign in to comment.