New unit test format

This commit is contained in:
Nick
2019-08-30 21:11:18 +01:00
parent db85c8f275
commit 6cd385e4c0
19972 changed files with 1626600 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
/target/
.classpath
.project
.settings
/.settings/
/settings/
.tern-project
+3
View File
@@ -0,0 +1,3 @@
### Relevant articles
- [A Guide to the Java Web Start](http://www.baeldung.com/java-web-start)
Binary file not shown.
Binary file not shown.
+90
View File
@@ -0,0 +1,90 @@
<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 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>jws</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>jws</name>
<packaging>war</packaging>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<repositories>
<repository>
<id>OpenNMS Repository</id>
<url>http://repo.opennms.org/maven2/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax.samples.jnlp</groupId>
<artifactId>jnlp-servlet</artifactId>
<version>${jnlp-servlet.version}</version>
</dependency>
<dependency>
<groupId>javax.samples.jnlp</groupId>
<artifactId>jnlp-jardiff</artifactId>
<version>${jnlp-jardiff.version}</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>com.example.Hello</mainClass>
</manifest>
</archive>
<outputDirectory>${project.basedir}/target/jws</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
</execution>
</executions>
<configuration>
<webResources>
<resource>
<directory>${project.basedir}/java-core-samples-lib/</directory>
<includes>
<include>**/*.jar</include>
</includes>
<targetPath>WEB-INF/lib</targetPath>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<maven-jar-plugin.version>3.0.2</maven-jar-plugin.version>
<jnlp-jardiff.version>1.6.0</jnlp-jardiff.version>
<jnlp-servlet.version>1.6.0</jnlp-servlet.version>
</properties>
</project>
+15
View File
@@ -0,0 +1,15 @@
package com.example;
import javax.swing.*;
public class Hello {
public static void main(String[] args) {
JFrame f = new JFrame("main");
f.setSize(200, 100);
f.setLocationRelativeTo(null);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel label = new JLabel("Hello, world!");
f.add(label);
f.setVisible(true);
}
}
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>
+24
View File
@@ -0,0 +1,24 @@
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Java Web Start</display-name>
<description>JNLP Example for Java Web Start Article</description>
<servlet>
<servlet-name>JnlpDownloadServlet</servlet-name>
<servlet-class>jnlp.sample.servlet.JnlpDownloadServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>JnlpDownloadServlet</servlet-name>
<url-pattern>*.jar</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>JnlpDownloadServlet</servlet-name>
<url-pattern>*.jnlp</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="$$codebase">
<information>
<title>Hello</title>
<vendor>Example</vendor>
</information>
<resources>
<j2se version="1.2+"/>
<jar href="jws.jar" main="true" />
</resources>
<application-desc/>
</jnlp>
+10
View File
@@ -0,0 +1,10 @@
<html>
<head>
<title>Hello World JNLP</title>
</head>
<body>
<p>
<a href="hello.jnlp">Launch the example</a>
</p>
</body>
</html>