This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @SeleniumGridConfiguration(url = "http://0.0.0.0:4444") | |
| class GridDemoTest { | |
| @SeleniumGridTest | |
| fun demo(driver: WebDriver) { | |
| driver.get("https://blog.codefx.org") | |
| val homeUrl = driver.findElement(By.className("img-hyperlink")).getAttribute("href") | |
| assertThat(homeUrl).contains("blog.codefx.org") | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| com.oracle.tools.packager.Bundler | |
| com.oracle.tools.packager.Bundlers | |
| com.sun.jdi.connect.Connector | |
| com.sun.jdi.connect.spi.TransportService | |
| com.sun.net.httpserver.spi.HttpServerProvider | |
| com.sun.source.util.Plugin | |
| com.sun.tools.attach.spi.AttachProvider | |
| com.sun.tools.internal.ws.wscompile.Plugin | |
| com.sun.tools.internal.xjc.Plugin | |
| com.sun.tools.javac.platform.PlatformProvider |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * RELEASED UNDER CC-0 (https://creativecommons.org/publicdomain/zero/1.0/): | |
| * | |
| * You can copy, modify, distribute and perform the work, even for commercial | |
| * purposes, all without asking permission. | |
| */ | |
| import java.lang.reflect.Method; | |
| public class JavaVersionSniffer { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.codefx.demo.junit5.extensions.RandomParameterExtensionTest.RandomProvider; | |
| import org.junit.jupiter.api.AfterAll; | |
| import org.junit.jupiter.api.AfterEach; | |
| import org.junit.jupiter.api.BeforeAll; | |
| import org.junit.jupiter.api.BeforeEach; | |
| import org.junit.jupiter.api.Test; | |
| import org.junit.jupiter.api.extension.ExtendWith; | |
| import org.junit.jupiter.api.extension.ExtensionContext; | |
| import org.junit.jupiter.api.extension.ParameterContext; | |
| import org.junit.jupiter.api.extension.ParameterResolutionException; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0"> | |
| <persistence-unit name="statistics-unit" transaction-type="RESOURCE_LOCAL"> | |
| <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> | |
| <exclude-unlisted-classes>true</exclude-unlisted-classes> | |
| <properties> | |
| <property name="javax.persistence.jdbc.driver" value="org.h2.Driver" /> | |
| <property name="javax.persistence.jdbc.url" | |
| value="jdbc:h2:mem:test;INIT=CREATE SCHEMA IF NOT EXISTS test\;RUNSCRIPT FROM 'classpath:META-INF/init.sql'" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This is the Gist for a post I wrote about publishing snapshots with Gradle's maven-publish plugin: | |
| // http://blog.codefx.org/tools/snapshots-gradle-maven-publish-plugin | |
| // PROJECT_NAME is defined in settings.gradle | |
| group 'PROJECT_GROUP' | |
| version 'PROJECT_VERSION' | |
| apply plugin: 'java' | |
| apply plugin: 'maven-publish' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.codefx.lab.stream; | |
| import java.util.concurrent.CountDownLatch; | |
| import java.util.concurrent.ForkJoinPool; | |
| import java.util.function.Consumer; | |
| import java.util.stream.IntStream; | |
| public class ParallelStream { | |
| public static void main(String[] args) throws InterruptedException { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MethodReferencesToStaticMethodsDemo { | |
| public Optional<String> firstSpecialString(Collection<String> strings) { | |
| return strings.stream() | |
| .filter(MethodReferencesToStaticMethodsDemo::isSpecial) | |
| .findFirst(); | |
| } | |
| public Optional<String> anySpecialString(Collection<String> strings) { | |
| return strings.stream() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.codefx.lab.visibility; | |
| class PackagePrivate { | |
| public String publicToUpper(String s) { | |
| return s.toUpperCase(); | |
| } | |
| String packageToUpper(String s) { | |
| return s.toUpperCase(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Reordering { | |
| private static Constructed constructed; | |
| public static void main(String[] args) throws Exception { | |
| new Thread(Reordering::constructForever).start(); | |
| Thread.sleep(100); | |
| checkInitializationUntilFails(); | |
| } |