use of com.oracle.bedrock.runtime.MetaClass in project oracle-bedrock by coherence-community.
the class JprofilerProfileTest method shouldSetDefaultStack.
@Test
public void shouldSetDefaultStack() throws Exception {
Platform platform = LocalPlatform.get();
MetaClass metaClass = new JavaApplication.MetaClass();
OptionsByType optionsByType = OptionsByType.empty();
JprofilerProfile profile = JprofilerProfile.enabled("mylib").stack(1234).defaultStack();
profile.onLaunching(platform, metaClass, optionsByType);
assertAgentString(optionsByType, "-agentpath:mylib=", "port=8849");
}
use of com.oracle.bedrock.runtime.MetaClass in project oracle-bedrock by coherence-community.
the class JprofilerProfileTest method shouldCreateDisabledProfile.
@Test
public void shouldCreateDisabledProfile() throws Exception {
Platform platform = LocalPlatform.get();
MetaClass metaClass = new JavaApplication.MetaClass();
OptionsByType optionsByType = OptionsByType.empty();
JprofilerProfile profile = JprofilerProfile.disabled();
assertThat(profile.isEnabled(), is(false));
profile.onLaunching(platform, metaClass, optionsByType);
Freeforms freeforms = optionsByType.get(Freeforms.class);
assertThat(freeforms, is(notNullValue()));
assertThat(freeforms.iterator().hasNext(), is(false));
}
use of com.oracle.bedrock.runtime.MetaClass in project oracle-bedrock by coherence-community.
the class JprofilerProfileTest method shouldSetOfflineModeWithFileAndSession.
@Test
public void shouldSetOfflineModeWithFileAndSession() throws Exception {
Platform platform = LocalPlatform.get();
MetaClass metaClass = new JavaApplication.MetaClass();
OptionsByType optionsByType = OptionsByType.empty();
File file = new File("config.xml");
int session = 1234;
JprofilerProfile profile = JprofilerProfile.enabled("mylib").offlineMode(file, session);
profile.onLaunching(platform, metaClass, optionsByType);
assertAgentString(optionsByType, "-agentpath:mylib=offline", "id=1234", "nowait", "config=config.xml");
}
use of com.oracle.bedrock.runtime.MetaClass in project oracle-bedrock by coherence-community.
the class JprofilerProfileTest method shouldCreateEnabledNoWaitProfile.
@Test
public void shouldCreateEnabledNoWaitProfile() throws Exception {
Platform platform = LocalPlatform.get();
MetaClass metaClass = new JavaApplication.MetaClass();
OptionsByType optionsByType = OptionsByType.empty();
JprofilerProfile profile = JprofilerProfile.enabledNoWait("mylib");
assertThat(profile.isEnabled(), is(true));
profile.onLaunching(platform, metaClass, optionsByType);
assertAgentString(optionsByType, "-agentpath:mylib=", "port=8849", "nowait");
}
use of com.oracle.bedrock.runtime.MetaClass in project oracle-bedrock by coherence-community.
the class JprofilerProfileTest method shouldSetDefaultSamplingStack.
@Test
public void shouldSetDefaultSamplingStack() throws Exception {
Platform platform = LocalPlatform.get();
MetaClass metaClass = new JavaApplication.MetaClass();
OptionsByType optionsByType = OptionsByType.empty();
JprofilerProfile profile = JprofilerProfile.enabled("mylib").samplingStack(1234).defaultSamplingStack();
profile.onLaunching(platform, metaClass, optionsByType);
assertAgentString(optionsByType, "-agentpath:mylib=", "port=8849");
}
Aggregations