Skip to content

Commit

Permalink
2.0.0 Fixed Packaging (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottf authored Jun 24, 2024
1 parent 36ac396 commit 56f264e
Show file tree
Hide file tree
Showing 19 changed files with 41 additions and 34 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ try (NatsServerRunner server = new NatsServerRunner()) {
System.out.println("Server running on port: " + server.getPort())
Connection c = Nats.connect(server.getURI());
...
}
}
```

### Builder
Expand Down
7 changes: 1 addition & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
id 'signing'
}

def jarVersion = "1.2.8"
def jarVersion = "2.0.0"
group = 'io.nats'

def isMerge = System.getenv("BUILD_EVENT") == "push"
Expand All @@ -38,11 +38,6 @@ dependencies {

test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
events "started", "passed", "skipped", "failed"
showStandardStreams = true
}
}

javadoc {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package nats.io;
package io.nats;

public class ClusterInsert {
public final ClusterNode node;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package nats.io;
package io.nats;

import java.nio.file.Path;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package nats.io;
package io.nats;

import java.util.function.Supplier;
import java.util.logging.Level;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package nats.io;
package io.nats;

public enum DebugLevel {
DEBUG("-D"), // Enable debugging output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package nats.io;
package io.nats;

import java.util.function.Supplier;
import java.util.logging.Level;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package nats.io;
package io.nats;

import java.io.BufferedReader;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package nats.io;
package io.nats;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
Expand Down Expand Up @@ -240,6 +241,10 @@ public static List<ClusterInsert> createClusterInserts(int count, String cluster
return createClusterInserts(createNodes(count, clusterName, serverNamePrefix, monitor, jsStoreDirBase));
}

public static Path getTemporaryJetStreamStoreDirBase() throws IOException {
return Files.createTempDirectory(null);
}

public static void defaultHost(String defaultHost) {
DEFAULT_HOST = defaultHost;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package nats.io;
package io.nats;

import java.io.*;
import java.net.ConnectException;
Expand All @@ -28,7 +28,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static nats.io.NatsRunnerUtils.*;
import static io.nats.NatsRunnerUtils.*;

/**
* Server Runner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package nats.io;
package io.nats;

import java.nio.file.Path;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package nats.io;
package io.nats;

import java.nio.file.Path;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package nats.io;
package io.nats;

import java.util.function.Supplier;
import java.util.logging.Level;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,38 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package nats.io;

package io.nats;

import org.junit.jupiter.api.Test;

import java.util.Collections;
import java.util.List;

import static nats.io.NatsRunnerUtils.*;
import static io.nats.NatsRunnerUtils.*;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class NatsClusterTest extends TestBase {

@Test
public void testCreateCluster() throws Exception {
_testCreateCluster(createClusterInserts());
_testCreateCluster(createClusterInserts(3));
_testCreateCluster(createClusterInserts(), false);
_testCreateCluster(createClusterInserts(3), false);
_testCreateCluster(createClusterInserts(getTemporaryJetStreamStoreDirBase()), true);
_testCreateCluster(createClusterInserts(3, getTemporaryJetStreamStoreDirBase()), true);
}

private void _testCreateCluster(List<ClusterInsert> clusterInserts) throws Exception {
private void _testCreateCluster(List<ClusterInsert> clusterInserts, boolean js) throws Exception {
for (ClusterInsert ci : clusterInserts) {
String s = ci.toString();
assertTrue(s.contains("port:" + ci.node.port));
assertTrue(s.contains("server_name=" + DEFAULT_SERVER_NAME_PREFIX));
assertTrue(s.contains("listen: " + DEFAULT_HOST + ":" + ci.node.listen));
assertTrue(s.contains("name: " + DEFAULT_CLUSTER_NAME));
if (js) {
assertTrue(s.contains("jetstream"));
assertTrue(s.contains("store_dir="));
}
}

ClusterInsert ci0 = clusterInserts.get(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package nats.io;
package io.nats;

import org.junit.jupiter.api.Test;

import static com.github.stefanbirkner.systemlambda.SystemLambda.withEnvironmentVariable;
import static nats.io.NatsRunnerUtils.*;
import static io.nats.NatsRunnerUtils.*;
import static org.junit.jupiter.api.Assertions.*;

public class NatsRunnerUtilsTest extends TestBase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package nats.io;
package io.nats;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
Expand All @@ -26,9 +26,9 @@
import java.util.logging.Logger;
import java.util.stream.Stream;

import static nats.io.NatsRunnerUtils.*;
import static nats.io.NatsServerRunner.DefaultLoggingSupplier;
import static nats.io.NatsServerRunner.getDefaultOutputSupplier;
import static io.nats.NatsRunnerUtils.*;
import static io.nats.NatsServerRunner.DefaultLoggingSupplier;
import static io.nats.NatsServerRunner.getDefaultOutputSupplier;
import static org.junit.jupiter.api.Assertions.*;

public class NatsServerRunnerTest extends TestBase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package nats.io;
package io.nats;

import org.junit.jupiter.api.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package nats.io;
package io.nats;

import org.junit.jupiter.api.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package nats.io;
package io.nats;

import java.io.File;
import java.io.IOException;
Expand All @@ -23,8 +23,8 @@
import java.util.List;
import java.util.logging.Level;

import static io.nats.NatsRunnerUtils.JETSTREAM_OPTION;
import static java.util.stream.Collectors.toList;
import static nats.io.NatsRunnerUtils.JETSTREAM_OPTION;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.platform.commons.util.CollectionUtils.toUnmodifiableList;
Expand Down

0 comments on commit 56f264e

Please sign in to comment.