Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: java
jdk: openjdk8
jdk: openjdk12
sudo: false

services:
Expand All @@ -26,7 +26,7 @@ deploy:
branch: master

script:
- mvn clean package cobertura:cobertura
- mvn clean package

after_success:
- echo "Build was successful. $TRAVIS_TEST_RESULT"
Expand Down
84 changes: 55 additions & 29 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

<groupId>ru.shemplo</groupId>
<artifactId>chat.neerc</artifactId>
<version>0.1.17</version>
<version>0.1.18</version>
<packaging>jar</packaging>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>12</maven.compiler.source>
<maven.compiler.target>12</maven.compiler.target>

<junit.jupiter.version>5.2.0</junit.jupiter.version>
<junit.platform.version>1.2.0</junit.platform.version>
<junit.jupiter.version>5.5.2</junit.jupiter.version>
<junit.platform.version>1.5.2</junit.platform.version>
</properties>

<build>
Expand Down Expand Up @@ -72,49 +72,75 @@

<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>${junit.platform.version}</version>
</dependency>
</dependencies>
<version>2.22.2</version>
<configuration>
<includes>
<include>**/*Test*.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.2</version>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
<configuration>
<formats>
<format>html</format>
<format>xml</format>
</formats>
<check/>
</configuration>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-base</artifactId>
<version>12.0.2</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>12.0.2</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>12.0.2</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>12.0.2</version>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
<artifactId>junit-jupiter-api</artifactId>
<version>5.5.2</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>${junit.platform.version}</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.5.2</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/ru/shemplo/chat/neerc/RunNeercChatClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@

import javafx.application.Application;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import ru.shemplo.chat.neerc.gfx.ClientAdapter;
import ru.shemplo.chat.neerc.gfx.WindowManager;
import ru.shemplo.chat.neerc.network.ConnectionService;
import ru.shemplo.snowball.annot.Snowflake;
import ru.shemplo.snowball.annot.processor.Snowball;

@Slf4j
public class RunNeercChatClient extends Snowball {

/*
* TODO: change sequence of initializations
* Now it's: Snowball.shape () -> Application.launch ()
* Project: Application.launch () -> Snowball.shape ()
*/

public static void main (String... args) { shape (args); }

private ConnectionService connectionService;
Expand All @@ -29,7 +37,7 @@ protected void onShaped (String ... args) {

while (!window.isInitialized ()) {} // Waiting for initialization of graphics
connectionService.connect (); /* First auto connection */
} catch (Exception es) { es.printStackTrace(); }
} catch (Exception | Error es) { log.error (es.getMessage ()); }
}

}
2 changes: 1 addition & 1 deletion src/main/java/ru/shemplo/chat/neerc/gfx/WindowManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void switchScene (ClientScene scene) {
boolean listenerWasNull = sceneHolder == null;
this.sceneHolder = scene.getHolder ();
if (listenerWasNull) {
synchronized (this) { this.notify (); }
synchronized (this) { this.notifyAll (); }
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package ru.shemplo.chat.neerc.test;

import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;

import ru.shemplo.chat.neerc.config.ConfigStorage;

public class TestConfigurationReader {

@Test
public void test () {
ConfigStorage storage = ConfigStorage.shapeConfigStorage ();
assertEquals ("test", storage.get ("login").orElse (null));
}

}
8 changes: 8 additions & 0 deletions src/test/java/ru/shemplo/chat/neerc/test/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
*
*/
/**
* @author Shemplo
*
*/
package ru.shemplo.chat.neerc.test;