Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a simple test for configurable strings with multiple words #70

Merged
merged 4 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 2-Clause License

Copyright (c) 2017, 2023 Oracle Inc (Previously Sun Microsystems Inc)
Copyright (c) 2023, Oracle and/or its affiliates.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,6 @@ public void testMultipleLoading() {
Configurable c = cm.lookup("default");
assertNotNull(c);

assertEquals(12,cm.getComponentNames().size());
assertEquals(13,cm.getComponentNames().size());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.oracle.labs.mlrg.olcut.test.config_tests;
Craigacp marked this conversation as resolved.
Show resolved Hide resolved

import com.oracle.labs.mlrg.olcut.config.ConfigurationManager;
import com.oracle.labs.mlrg.olcut.test.config.StringConfigurable;
import org.junit.jupiter.api.Test;

import java.io.IOException;

import static com.oracle.labs.mlrg.olcut.config.ConfigurationManager.createModuleResourceString;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class StringMultiwordTest {

@Test
public void multiWord() throws IOException {
ConfigurationManager cm = new ConfigurationManager(createModuleResourceString(this.getClass(), "stringConfig.xml"));
StringConfigurable sc = (StringConfigurable) cm.lookup(
"words");
assertEquals("rhesus monkey", sc.one);
assertEquals("-Xmx16g -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005", sc.two);
assertEquals("test/value whitespace", sc.three);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,10 @@
<property name="two" value="e"/>
<property name="three" value="f"/>
</component>

<component name="words" type="com.oracle.labs.mlrg.olcut.test.config.StringConfigurable">
<property name="one" value="rhesus monkey"/>
<property name="two" value="-Xmx16g -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"/>
<property name="three" value="test/value whitespace"/>
</component>
</config>