Search in sources :

Example 16 with MetaClass

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");
}
Also used : LocalPlatform(com.oracle.bedrock.runtime.LocalPlatform) Platform(com.oracle.bedrock.runtime.Platform) MetaClass(com.oracle.bedrock.runtime.MetaClass) OptionsByType(com.oracle.bedrock.OptionsByType) Test(org.junit.Test)

Example 17 with MetaClass

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));
}
Also used : LocalPlatform(com.oracle.bedrock.runtime.LocalPlatform) Platform(com.oracle.bedrock.runtime.Platform) MetaClass(com.oracle.bedrock.runtime.MetaClass) OptionsByType(com.oracle.bedrock.OptionsByType) Freeforms(com.oracle.bedrock.runtime.java.options.Freeforms) Test(org.junit.Test)

Example 18 with MetaClass

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");
}
Also used : LocalPlatform(com.oracle.bedrock.runtime.LocalPlatform) Platform(com.oracle.bedrock.runtime.Platform) MetaClass(com.oracle.bedrock.runtime.MetaClass) OptionsByType(com.oracle.bedrock.OptionsByType) File(java.io.File) Test(org.junit.Test)

Example 19 with MetaClass

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");
}
Also used : LocalPlatform(com.oracle.bedrock.runtime.LocalPlatform) Platform(com.oracle.bedrock.runtime.Platform) MetaClass(com.oracle.bedrock.runtime.MetaClass) OptionsByType(com.oracle.bedrock.OptionsByType) Test(org.junit.Test)

Example 20 with MetaClass

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");
}
Also used : LocalPlatform(com.oracle.bedrock.runtime.LocalPlatform) Platform(com.oracle.bedrock.runtime.Platform) MetaClass(com.oracle.bedrock.runtime.MetaClass) OptionsByType(com.oracle.bedrock.OptionsByType) Test(org.junit.Test)

Aggregations

MetaClass (com.oracle.bedrock.runtime.MetaClass)25 OptionsByType (com.oracle.bedrock.OptionsByType)23 Test (org.junit.Test)22 LocalPlatform (com.oracle.bedrock.runtime.LocalPlatform)19 Platform (com.oracle.bedrock.runtime.Platform)19 Application (com.oracle.bedrock.runtime.Application)5 ClassPath (com.oracle.bedrock.runtime.java.ClassPath)4 Arguments (com.oracle.bedrock.runtime.options.Arguments)4 Remove (com.oracle.bedrock.runtime.docker.commands.Remove)3 Matchers.anyString (org.mockito.Matchers.anyString)3 Profile (com.oracle.bedrock.runtime.Profile)2 CoherenceClusterMember (com.oracle.bedrock.runtime.coherence.CoherenceClusterMember)2 Table (com.oracle.bedrock.table.Table)2 ConfigurableCacheFactory (com.tangosol.net.ConfigurableCacheFactory)2 ScopedCacheFactoryBuilder (com.tangosol.net.ScopedCacheFactoryBuilder)2 InetAddress (java.net.InetAddress)2 Properties (java.util.Properties)2 Option (com.oracle.bedrock.Option)1 AbstractPlatform (com.oracle.bedrock.runtime.AbstractPlatform)1 ApplicationLauncher (com.oracle.bedrock.runtime.ApplicationLauncher)1