Skip to content

Commit

Permalink
Merge branch 'test' into Csongor
Browse files Browse the repository at this point in the history
  • Loading branch information
pupcs committed May 20, 2024
2 parents 2bfba38 + d4a4882 commit 3ca93c5
Show file tree
Hide file tree
Showing 74 changed files with 963 additions and 79 deletions.
2 changes: 1 addition & 1 deletion .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/libraries/Maven__javax_xml_bind_jaxb_api_2_3_0.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/libraries/Maven__joda_time_joda_time_2_9_2.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/libraries/Maven__junit_junit_4_12.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 73 additions & 10 deletions dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,81 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>7.17.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>apiguardian-api</artifactId>
<groupId>org.apiguardian</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-core</artifactId>
<version>7.17.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>cucumber-gherkin</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>cucumber-gherkin-messages</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>messages</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>testng-xml-formatter</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>tag-expressions</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>cucumber-expressions</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>datatable</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>cucumber-plugin</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>docstring</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>html-formatter</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>junit-xml-formatter</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>ci-environment</artifactId>
<groupId>io.cucumber</groupId>
</exclusion>
<exclusion>
<artifactId>apiguardian-api</artifactId>
<groupId>org.apiguardian</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<reporting>
<plugins>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.8.5.0</version>
</plugin>
</plugins>
</reporting>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>
</project>
14 changes: 14 additions & 0 deletions gs-maven.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="$MODULE_DIR$/pom.xml" external.system.module.type="SINGLE_MODULE" external.system.module.version="223-2" org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="AdditionalModuleElements">
<content url="file://$MODULE_DIR$" dumb="true">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/target/generated-sources/annotations" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/target/generated-test-sources/test-annotations" isTestSource="true" generated="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
</component>
</module>
26 changes: 15 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.springframework</groupId>
<artifactId>gs-maven</artifactId>
<packaging>jar</packaging>
Expand Down Expand Up @@ -40,6 +40,19 @@
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>7.17.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-core</artifactId>
<version>7.17.0</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand Down Expand Up @@ -67,13 +80,4 @@
</plugins>
</build>

<reporting>
<plugins>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.8.5.0</version>
</plugin>
</plugins>
</reporting>
</project>
</project>
1 change: 1 addition & 0 deletions src/main/java/program/main/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ public ArrayList<Pipe> Pipes() {
return pipes;
}


/**
* Futtatja a játék fő ciklusát.
*/
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/program/main/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
*/
public class Main {


public static Game game = new Game();
/**
* a cmd ArrayListben tároljuk el a konzolról beérkezett parancsokat
*/
static ArrayList<String> cmds = new ArrayList<>();


/**
* A játékban véletlenszerű események is szerpelnek, ezeket lehet véletlenszerure,
* vagy determinisztikusra állítani a random booleannal
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/program/main/NomadPipeInteraction.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,12 @@ public static boolean getendturn(){
public static void setendturn(boolean temp){
endturn = temp;
}

public Object getSlippery() {
return slippery;
}

public Object getEnd() {
return end;
}
}
13 changes: 13 additions & 0 deletions src/main/java/program/main/PlumberButtonPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,17 @@ public void actionPerformed(ActionEvent e) {
}
Main.game.gamePanel.repaint();
}

public Object getpickupnewpipe() {
return pickupnewpipe;
}

public Object getpickUpPump() {
return pickUpPump;
}

public Object getChangePipeIn() {return changePipeIn;}

public Object getChangePipeOut() { return changePipeOut;}

}
14 changes: 14 additions & 0 deletions src/main/java/program/main/PlumberPipeInteraction.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,18 @@ public static boolean getendturn(){
public static void setendturn(boolean temp){
endturn = temp;
}

public Object getSticky() {
return sticky;
}

public Object getDestroy() {return destroy;}

public Object getRepair(){
return repair;
}

public Object getEnd() {
return end;
}
}
4 changes: 3 additions & 1 deletion src/main/java/program/main/startMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,7 @@ public void actionPerformed(ActionEvent e) {
panel.add(settingsButton);
}


public JButton getStartButton(){
return startButton;
}
}
38 changes: 38 additions & 0 deletions src/test/java/com/stepDefinition/UIChangePipeIn.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.stepDefinition;

import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import program.main.PlumberButtonPanel;
import program.main.PlumberPipeInWindow;
import program.main.State;

import java.awt.event.ActionEvent;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static program.main.Main.game;

public class UIChangePipeIn {
private PlumberButtonPanel pbPanel = new PlumberButtonPanel();
private PlumberPipeInWindow ppWindow = new PlumberPipeInWindow(3);
@When("click on change pipe in")
public void click_on_change_pipe_in() {
System.out.println("test started");
ActionEvent event = new ActionEvent(pbPanel.getChangePipeIn(), ActionEvent.ACTION_PERFORMED, "change pipe in");
pbPanel.actionPerformed(event);
}
@When("select pipe in")
public void select_pipe_in() {
System.out.println("test started");
ppWindow.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "pipe8"));
}

@Then("check if pipe in has changed")
public void check_if_the_pipe_in_has_changed() {
System.out.println("test started");
assertEquals(game.Fields().get(0).getPipeIn(), game.Pipes().get(7));
}



}
Loading

0 comments on commit 3ca93c5

Please sign in to comment.