Browse Source

added test shell script for bash and the team.md changed test method names in order to let them be executed by mvn test. added dependencies to the pom

remotes/origin/develop
fdai6499 2 years ago
parent
commit
f449d63121
  1. 8
      ProjectDiary.md
  2. 92
      README.md
  3. 3
      build-project.sh
  4. 32
      pom.xml
  5. 101
      src/main/java/src/Main.java
  6. 4
      src/main/java/src/MainFrame.java
  7. 16
      src/test/java/GameFieldTest.java
  8. 7
      src/test/java/MainFrameTest.java
  9. 13
      src/test/java/MainTest.java
  10. 10
      src/test/java/NotesTest.java
  11. 10
      src/test/java/src/MainFrameTest.java
  12. 2
      team.md

8
ProjectDiary.md

@ -1,8 +0,0 @@
Projektstart
---------------
### 1. Meeting und Repository aufstellen
Meeting im bib
Besprechung des Projektablaufs
Projektentwurf gestalten durch "Stories"
Einblick in Java
Einrichtung von JetBrain

92
README.md

@ -1,92 +0,0 @@
# Sudoku_Team_Deepthought
## Getting started
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://gitlab2.informatik.hs-fulda.de/fdai7460/sudoku_team_deepthought.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](https://gitlab2.informatik.hs-fulda.de/fdai7460/sudoku_team_deepthought/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.

3
build-project.sh

@ -0,0 +1,3 @@
#!/bin/bash
mvn compile test

32
pom.xml

@ -2,24 +2,44 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> 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>
<modelVersion>4.0.0</modelVersion>
<groupId>groupId</groupId>
<groupId>de.sudoku.dt</groupId>
<artifactId>sudoku_team_deepthought</artifactId> <artifactId>sudoku_team_deepthought</artifactId>
<version>1.0-SNAPSHOT</version>
<version>0.2-SNAPSHOT</version>
<packaging>jar</packaging>
<properties> <properties>
<maven.compiler.source>8</maven.compiler.source> <maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target> <maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
</plugin>
</plugins>
</build>
<dependencies> <dependencies>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
</dependency>
<dependency> <dependency>
<groupId>org.junit.jupiter</groupId> <groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.1</version>
<scope>test</scope>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.9.2</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

101
src/main/java/src/Main.java

@ -1,22 +1,9 @@
package src; package src;
import javax.swing.*;
import java.awt.*;
import java.lang.String; import java.lang.String;
public class Main { public class Main {
// private static JPanel[][] gameField;
// private static JLabel[][] labelField;
//
// public static JPanel[][] getGameField() {
// return gameField;
// }
//
// public static JLabel[][] getLabelField() {
// return labelField;
// }
public static void main(String[] args) { public static void main(String[] args) {
java.awt.EventQueue.invokeLater(new Runnable() { java.awt.EventQueue.invokeLater(new Runnable() {
@ -29,90 +16,4 @@ public class Main {
} }
}); });
} }
// protected static JPanel setupGameField(int widthHeight) {
//
// int nrOfFields = 9;
// int border = 1;
// int size = widthHeight/nrOfFields - (nrOfFields*border)/nrOfFields;
//
// JPanel fieldRoot = new JPanel();
// fieldRoot.setVisible(true);
// fieldRoot.setLayout(null);
//
// gameField = new JPanel[nrOfFields][];
// labelField = new JLabel[nrOfFields][];
//
// int gapi = 0, gapj = 0;
//
// for (int i = 0; i < nrOfFields; i++) {
//
// gameField[i] = new JPanel[nrOfFields];
// labelField[i] = new JLabel[nrOfFields];
//
// for (int j = 0; j < nrOfFields; j++) {
//
// gameField[i][j] = new JPanel();
// gameField[i][j].setBounds(
// j * size + border*(j+1),
// i * size + border*(i+1),
// size, size);
// gameField[i][j].setBackground(Color.BLUE);
// gameField[i][j].setVisible(true);
// fieldRoot.add(gameField[i][j]);
//
// labelField[i][j] = new JLabel("", SwingConstants.CENTER);
// labelField[i][j].setBackground(Color.GREEN);
// labelField[i][j].setForeground(Color.MAGENTA);
// labelField[i][j].setFont(new Font("Times new Roman", Font.BOLD, 25));
//
// labelField[i][j].setBackground(Color.CYAN);
// labelField[i][j].setText("0");
//
// gameField[i][j].add(labelField[i][j]);
//
// }
// }
//
// return fieldRoot;
// }
}
// JFrame jFrame = new JFrame();
// jFrame.setVisible(true);
// jFrame.setBounds(300, 300, 500, 500);
//
// JPanel yPanel = new JPanel();
// yPanel.setLayout(new BoxLayout(yPanel, BoxLayout.Y_AXIS));
// yPanel.setBorder(new EmptyBorder(1, 0, 1,0));
//
// JButton jButton1 = new JButton();
// jButton1.setText("Test Button 1");
//
// yPanel.add(jButton1);
//
// JButton jButton2 = new JButton();
// jButton2.setText("Test Button 2");
// yPanel.add(jButton2);
//
// for (int i = 0; i < 9; i++) {
//
// JPanel xPanel = new JPanel();
// xPanel.setLayout(new BoxLayout(xPanel, BoxLayout.X_AXIS));
// xPanel.setBorder(new EmptyBorder(0, 1, 0,1));
//
// for (int j = 0; j < 9; j++) {
//
// JTextField jTextField = new JTextField();
// jTextField.setColumns(1);
// jTextField.setBounds(0, 0, 10, 10);
//
// xPanel.add(jTextField);
//
// }
//
// yPanel.add(xPanel);
// }
//
// jFrame.setContentPane(yPanel);
}

4
src/main/java/src/MainFrame.java

@ -1,13 +1,9 @@
package src; package src;
import org.junit.Test;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
public class MainFrame extends JFrame { public class MainFrame extends JFrame {

16
src/test/java/GameFieldTest.java

@ -1,13 +1,15 @@
import org.junit.jupiter.api.Test;
import src.GameField; import src.GameField;
import src.Notes; import src.Notes;
import org.junit.jupiter.api.*;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
class GameFieldTest {
public class GameFieldTest {
@Test @Test
void setValue() {
public void test_setValue() {
GameField gameField = new GameField(360); GameField gameField = new GameField(360);
@ -34,7 +36,7 @@ class GameFieldTest {
} }
@Test @Test
void getValue() {
public void test_getValueTest() {
GameField gameField = new GameField(360); GameField gameField = new GameField(360);
@ -61,7 +63,7 @@ class GameFieldTest {
} }
@Test @Test
void setHint() {
public void test_setHintTest() {
GameField gameField = new GameField(360); GameField gameField = new GameField(360);
@ -92,7 +94,7 @@ class GameFieldTest {
} }
@Test @Test
void unsetHint() {
public void test_unsetHintTest() {
GameField gameField = new GameField(360); GameField gameField = new GameField(360);
@ -127,7 +129,7 @@ class GameFieldTest {
} }
@Test @Test
void unsetAllHintsFromField() {
public void test_unsetAllHintsFromFieldTest() {
GameField gameField = new GameField(360); GameField gameField = new GameField(360);

7
src/test/java/MainFrameTest.java

@ -0,0 +1,7 @@
import org.junit.jupiter.api.*;
import static org.junit.jupiter.api.Assertions.*;
public class MainFrameTest {
}

13
src/test/java/MainTest.java

@ -1,12 +1,13 @@
import src.GameField; import src.GameField;
import src.Main;
import org.junit.jupiter.api.*;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
class MainTest extends Main {
public class MainTest {
@org.junit.jupiter.api.Test
void testField() {
@Test
public void testFieldTest() {
GameField gameField = new GameField(360); GameField gameField = new GameField(360);
@ -31,8 +32,8 @@ class MainTest extends Main {
} }
@org.junit.jupiter.api.Test
void testBla() {
@Test
public void testBlaTest() {
assertTrue(true); assertTrue(true);
} }
} }

10
src/test/java/NotesTest.java

@ -1,14 +1,14 @@
import org.junit.jupiter.api.Test;
import src.Notes; import src.Notes;
import javax.swing.*; import javax.swing.*;
import org.junit.jupiter.api.*;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
class NotesTest {
public class NotesTest {
@Test @Test
void setHint() {
public void setHintTest() {
Notes notes = new Notes(50); Notes notes = new Notes(50);
@ -31,7 +31,7 @@ class NotesTest {
} }
@Test @Test
void isSet() {
public void isSetTest() {
Notes notes = new Notes(50); Notes notes = new Notes(50);
@ -52,7 +52,7 @@ class NotesTest {
} }
@Test @Test
void unsetHint() {
public void unsetHintTest() {
Notes notes = new Notes(50); Notes notes = new Notes(50);

10
src/test/java/src/MainFrameTest.java

@ -1,10 +0,0 @@
package src;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class MainFrameTest {
}

2
team.md

@ -0,0 +1,2 @@
- Jan Freirich, fdai6499
- jan-andre.freirich@informatik.hs-fulda.de
Loading…
Cancel
Save