Skip to content

Commit f59b908

Browse files
committed
Add Junit and Mockito programs
1 parent ce8f3e4 commit f59b908

23 files changed

Lines changed: 553 additions & 2 deletions

File tree

Chapter 14 JUnit/JUnit 04 - HttpUnit/target/m2e-wtp/web-resources/META-INF/maven/ineuron/HttpUnit-LoginApp/pom.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Generated by Maven Integration for Eclipse
2-
#Sat May 11 14:54:43 IST 2024
3-
m2e.projectLocation=V\:\\Java Programs\\Testing\\JUnit 04 - HttpUnit
2+
#Sat Jul 13 11:32:17 IST 2024
3+
m2e.projectLocation=S\:\\iNeuron Codebase\\Chapter 14 JUnit\\JUnit 04 - HttpUnit
44
m2e.projectName=JUnit 04 - HttpUnit
55
groupId=ineuron
66
artifactId=HttpUnit-LoginApp
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
10+
<attributes>
11+
<attribute name="test" value="true"/>
12+
<attribute name="optional" value="true"/>
13+
<attribute name="maven.pomderived" value="true"/>
14+
</attributes>
15+
</classpathentry>
16+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
17+
<attributes>
18+
<attribute name="maven.pomderived" value="true"/>
19+
</attributes>
20+
</classpathentry>
21+
<classpathentry kind="src" path="target/generated-sources/annotations">
22+
<attributes>
23+
<attribute name="ignore_optional_problems" value="true"/>
24+
<attribute name="optional" value="true"/>
25+
<attribute name="maven.pomderived" value="true"/>
26+
<attribute name="m2e-apt" value="true"/>
27+
</attributes>
28+
</classpathentry>
29+
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
30+
<attributes>
31+
<attribute name="ignore_optional_problems" value="true"/>
32+
<attribute name="test" value="true"/>
33+
<attribute name="optional" value="true"/>
34+
<attribute name="maven.pomderived" value="true"/>
35+
<attribute name="m2e-apt" value="true"/>
36+
</attributes>
37+
</classpathentry>
38+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
39+
<classpathentry kind="output" path="target/classes"/>
40+
</classpath>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>MockitUnitTesting-LoginApp</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
eclipse.preferences.version=1
2+
encoding//src/main/java=UTF-8
3+
encoding//src/test/java=UTF-8
4+
encoding/<project>=UTF-8
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.apt.aptEnabled=false
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4+
org.eclipse.jdt.core.compiler.compliance=1.8
5+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6+
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
7+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
8+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
9+
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
10+
org.eclipse.jdt.core.compiler.processAnnotations=disabled
11+
org.eclipse.jdt.core.compiler.release=enabled
12+
org.eclipse.jdt.core.compiler.source=1.8
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
activeProfiles=
2+
eclipse.preferences.version=1
3+
resolveWorkspaceProjects=true
4+
version=1
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>ineuron</groupId>
8+
<artifactId>MockitUnitTesting-LoginApp</artifactId>
9+
<version>1.0</version>
10+
11+
<name>MockitUnitTesting-LoginApp</name>
12+
<!-- FIXME change it to the project's website -->
13+
<url>http://www.example.com</url>
14+
15+
<properties>
16+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17+
<maven.compiler.source>1.8</maven.compiler.source>
18+
<maven.compiler.target>1.8</maven.compiler.target>
19+
</properties>
20+
21+
<dependencies>
22+
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
23+
<dependency>
24+
<groupId>org.junit.jupiter</groupId>
25+
<artifactId>junit-jupiter-api</artifactId>
26+
<version>5.7.0</version>
27+
<scope>test</scope>
28+
</dependency>
29+
30+
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine -->
31+
<dependency>
32+
<groupId>org.junit.jupiter</groupId>
33+
<artifactId>junit-jupiter-engine</artifactId>
34+
<version>5.7.0</version>
35+
<scope>test</scope>
36+
</dependency>
37+
38+
<!-- https://mvnrepository.com/artifact/org.mockito/mockito-core -->
39+
<dependency>
40+
<groupId>org.mockito</groupId>
41+
<artifactId>mockito-core</artifactId>
42+
<version>3.6.28</version>
43+
<scope>test</scope>
44+
</dependency>
45+
46+
</dependencies>
47+
48+
<build>
49+
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
50+
<plugins>
51+
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
52+
<plugin>
53+
<artifactId>maven-clean-plugin</artifactId>
54+
<version>3.1.0</version>
55+
</plugin>
56+
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
57+
<plugin>
58+
<artifactId>maven-resources-plugin</artifactId>
59+
<version>3.0.2</version>
60+
</plugin>
61+
<plugin>
62+
<artifactId>maven-compiler-plugin</artifactId>
63+
<version>3.8.0</version>
64+
</plugin>
65+
<plugin>
66+
<artifactId>maven-surefire-plugin</artifactId>
67+
<version>2.22.1</version>
68+
</plugin>
69+
<plugin>
70+
<artifactId>maven-jar-plugin</artifactId>
71+
<version>3.0.2</version>
72+
</plugin>
73+
<plugin>
74+
<artifactId>maven-install-plugin</artifactId>
75+
<version>2.5.2</version>
76+
</plugin>
77+
<plugin>
78+
<artifactId>maven-deploy-plugin</artifactId>
79+
<version>2.8.2</version>
80+
</plugin>
81+
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
82+
<plugin>
83+
<artifactId>maven-site-plugin</artifactId>
84+
<version>3.7.1</version>
85+
</plugin>
86+
<plugin>
87+
<artifactId>maven-project-info-reports-plugin</artifactId>
88+
<version>3.0.0</version>
89+
</plugin>
90+
</plugins>
91+
</pluginManagement>
92+
</build>
93+
</project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package in.ineuron.nitin.dao;
2+
3+
public interface ILoginDao {
4+
public int authenticate(String username,String password);
5+
public int addUser(String username,String role);
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package in.ineuron.nitin.service;
2+
3+
public interface ILoginService {
4+
public boolean login(String username,String password);
5+
public String registerUser(String username,String role);
6+
}

0 commit comments

Comments
 (0)