Merge pull request 'cleaning up some stuff don't worry' (#16) from test into master
Reviewed-on: #16
This commit is contained in:
commit
acd786744b
@ -27,7 +27,7 @@ dependencies {
|
|||||||
|
|
||||||
application {
|
application {
|
||||||
// Define the main class for the application.
|
// Define the main class for the application.
|
||||||
mainClass = 'school_project.App'
|
mainClass = 'school_project.Controller'
|
||||||
}
|
}
|
||||||
|
|
||||||
javafx {
|
javafx {
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
/*
|
|
||||||
* This Java source file was generated by the Gradle 'init' task.
|
|
||||||
*/
|
|
||||||
package school_project;
|
|
||||||
|
|
||||||
public class App {
|
|
||||||
public String getGreeting() {
|
|
||||||
return "Hello World!";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
System.out.println(new App().getGreeting());
|
|
||||||
}
|
|
||||||
}
|
|
32
app/src/main/java/school_project/Controller.java
Normal file
32
app/src/main/java/school_project/Controller.java
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* This Java source file was generated by the Gradle 'init' task.
|
||||||
|
*/
|
||||||
|
package school_project;
|
||||||
|
|
||||||
|
import javafx.application.Application;
|
||||||
|
import javafx.scene.Group;
|
||||||
|
import javafx.scene.Scene;
|
||||||
|
import javafx.scene.control.Button;
|
||||||
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
|
public class Controller extends Application {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void start(Stage primaryStage) throws Exception {
|
||||||
|
primaryStage.setTitle("test");
|
||||||
|
Button btn = new Button("test");
|
||||||
|
btn.setOnAction(event -> System.out.println("hey"));
|
||||||
|
|
||||||
|
Group root = new Group();
|
||||||
|
root.getChildren().add(btn);
|
||||||
|
|
||||||
|
Scene scene = new Scene(root, 300,300);
|
||||||
|
primaryStage.setScene(scene);
|
||||||
|
|
||||||
|
primaryStage.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
launch();
|
||||||
|
}
|
||||||
|
}
|
@ -4,11 +4,9 @@
|
|||||||
package school_project;
|
package school_project;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
|
||||||
|
|
||||||
class AppTest {
|
class AppTest {
|
||||||
@Test void appHasAGreeting() {
|
@Test void appHasAGreeting() {
|
||||||
App classUnderTest = new App();
|
Controller classUnderTest = new Controller();
|
||||||
assertNotNull(classUnderTest.getGreeting(), "app should have a greeting");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user