Skip to content

Commit ac7e7d0

Browse files
committed
Initial push
0 parents  commit ac7e7d0

File tree

13 files changed

+884
-0
lines changed

13 files changed

+884
-0
lines changed

.gitignore

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
target/
2+
!.mvn/wrapper/maven-wrapper.jar
3+
!**/src/main/**/target/
4+
!**/src/test/**/target/
5+
.kotlin
6+
7+
**/src/main/java/dev/**
8+
**/src/test/java/dev/**
9+
**/src/main/java/local/**
10+
**/src/test/java/local/**
11+
12+
13+
### IntelliJ IDEA ###
14+
.idea/modules.xml
15+
.idea/jarRepositories.xml
16+
.idea/compiler.xml
17+
.idea/libraries/
18+
*.iws
19+
*.iml
20+
*.ipr
21+
22+
### Eclipse ###
23+
.apt_generated
24+
.classpath
25+
.factorypath
26+
.project
27+
.settings
28+
.springBeans
29+
.sts4-cache
30+
31+
### NetBeans ###
32+
/nbproject/private/
33+
/nbbuild/
34+
/dist/
35+
/nbdist/
36+
/.nb-gradle/
37+
build/
38+
!**/src/main/**/build/
39+
!**/src/test/**/build/
40+
41+
### VS Code ###
42+
.vscode/
43+
44+
### Mac OS ###
45+
.DS_Store

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/dictionaries/project.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/markdown.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Java Assignment Testing Frame
2+
3+
The goal of this testing framework is to make it easier to write automated tests for checking course work where Java 25 is used.
4+
5+
---
6+
7+
## Technology
8+
9+
> Java 25
10+
11+
> JUnit 6
12+
13+
---
14+
15+
# How to use:
16+
17+
> Meant to be used within IntelliJ IDEA, recommended version: 2025.3
18+
>
19+
> Tests can also be run via `mvn test` (For use with GitHub Actions)
20+
21+
## `src/main/java/assignment/`
22+
23+
Code goes here
24+
25+
### `src/main/java/assignment/README.md`
26+
27+
Assignment text goes here
28+
29+
## `src/test/java/assignment/`
30+
31+
### `src/test/java/assignment/TestAssignment.java`
32+
33+
Code that tests the assignment goes here
34+
35+
---
36+
37+
# Examples
38+
39+
> Examples below are just a subset of what is available, docs are work-in-progress
40+
41+
```java
42+
testClass("assignment.Person", () -> {
43+
assertTrue(fieldExists("name"));
44+
assertTrue(methodExists("getName"));
45+
assertTrue(methodExists("setName", String.class));
46+
assertTrue(methodExists("printName"));
47+
48+
var Person = getScopedClass();
49+
50+
testClass("assignment.Student", () -> {
51+
assertTrue(classInheritsFrom(Person));
52+
});
53+
});
54+
55+
testClass("assignment.Student", () -> {
56+
var name = "Alice";
57+
var student = classCreateInstance(name);
58+
59+
classInstanceInvokeMethod(instance, "printName");
60+
61+
assertStandardOutputEquals(name);
62+
});
63+
64+
testClassMethod("assignment.Person", "getName", () -> {
65+
assertFalse(methodIsStatic());
66+
67+
assertTrue(methodHasModifiers(AccessFlag.PUBLIC));
68+
69+
assertTrue(methodReturns(String.class));
70+
});
71+
```
72+
73+
74+
### Tips:
75+
76+
- Use `message` parameter in `assert*()`-methods to provide more detailed feedback
77+
- If you are writing tests locally and from time to time are pulling changes from origin or upstream (in a fork), use `src/main/java/[local|dev]/**` and `src/test/java/[local|dev]/**` as these are included in the gitignore
78+
79+
80+
## Plans
81+
82+
- File I/O
83+
- Database I/O (JDBC)
84+
- Snapshot testing
85+
- Relevant unit testing as part of the framework
86+
- Testing the testing framework + solve "Quid revera probationes probabunt?"
87+
- Deeper testing via bytecode analysis
88+
- Testing of algorithmic complexity via bytecode analysis

pom.xml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
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>programkode.java.assignment.testing.framework</groupId>
8+
<artifactId>JavaAssignmentTestingFramework</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
11+
<properties>
12+
<maven.compiler.source>25</maven.compiler.source>
13+
<maven.compiler.target>25</maven.compiler.target>
14+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
</properties>
16+
17+
<build>
18+
<plugins>
19+
<plugin>
20+
<groupId>org.apache.maven.plugins</groupId>
21+
<artifactId>maven-compiler-plugin</artifactId>
22+
<version>3.13.0</version>
23+
<configuration>
24+
<source>25</source>
25+
<target>25</target>
26+
</configuration>
27+
</plugin>
28+
<plugin>
29+
<groupId>org.apache.maven.plugins</groupId>
30+
<artifactId>maven-surefire-plugin</artifactId>
31+
<version>3.5.2</version>
32+
</plugin>
33+
</plugins>
34+
</build>
35+
36+
<dependencyManagement>
37+
<dependencies>
38+
<dependency>
39+
<groupId>org.junit</groupId>
40+
<artifactId>junit-bom</artifactId>
41+
<version>6.0.1</version>
42+
<type>pom</type>
43+
<scope>import</scope>
44+
</dependency>
45+
</dependencies>
46+
</dependencyManagement>
47+
48+
<dependencies>
49+
<dependency>
50+
<groupId>org.junit.jupiter</groupId>
51+
<artifactId>junit-jupiter-engine</artifactId>
52+
<scope>test</scope>
53+
</dependency>
54+
<dependency>
55+
<groupId>org.junit.jupiter</groupId>
56+
<artifactId>junit-jupiter-api</artifactId>
57+
<scope>test</scope>
58+
</dependency>
59+
<dependency>
60+
<groupId>org.junit.jupiter</groupId>
61+
<artifactId>junit-jupiter-params</artifactId>
62+
<scope>test</scope>
63+
</dependency>
64+
<dependency>
65+
<groupId>org.junit-pioneer</groupId>
66+
<artifactId>junit-pioneer</artifactId>
67+
<version>2.3.0</version>
68+
<scope>test</scope>
69+
</dependency>
70+
</dependencies>
71+
</project>

src/main/java/assignment/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Assignment Text

0 commit comments

Comments
 (0)