congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
AbstractMuleContextTestCase
Code IndexAdd Tabnine to your IDE (free)

How to use
AbstractMuleContextTestCase
in
org.mule.tck.junit4

Best Java code snippets using org.mule.tck.junit4.AbstractMuleContextTestCase (Showing top 20 results out of 315)

origin: mulesoft/mule

protected MuleContext createMuleContext() throws Exception {
 if (isDisposeContextPerClass() && muleContext != null) {
  context = muleContext;
 } else {
  final ClassLoader executionClassLoader = getExecutionClassLoader();
  final ClassLoader originalContextClassLoader = currentThread().getContextClassLoader();
  try {
   builders.add(new SimpleConfigurationBuilder(getStartUpRegistryObjects()));
   addBuilders(builders);
   builders.add(new MockExtensionManagerConfigurationBuilder());
   builders.add(getBuilder());
   MuleContextBuilder contextBuilder = MuleContextBuilder.builder(APP);
   DefaultMuleConfiguration muleConfiguration = new DefaultMuleConfiguration();
   contextBuilder.setMuleConfiguration(muleConfiguration);
   contextBuilder.setExecutionClassLoader(executionClassLoader);
   contextBuilder.setObjectSerializer(getObjectSerializer());
   contextBuilder.setDeploymentProperties(getDeploymentProperties());
   configureMuleContext(contextBuilder);
   context = muleContextFactory.createMuleContext(builders, contextBuilder);
   recordSchedulersOnInit(context);
   if (!isGracefulShutdown()) {
origin: mulesoft/mule

@Override
protected void doSetUp() throws Exception {
 super.doSetUp();
 scheduler = muleContext.getSchedulerService().cpuIntensiveScheduler();
}
origin: mulesoft/mule

@After
public final void disposeContextPerTest() throws Exception {
 try {
  doTearDown();
 } finally {
  if (!isDisposeContextPerClass()) {
   if (isStartContext() && muleContext != null && muleContext.isStarted()) {
    muleContext.stop();
   }
   disposeContext();
   if (testServicesConfigurationBuilder != null) {
    testServicesConfigurationBuilder.stopServices();
   }
   doTearDownAfterMuleContextDispose();
  }
  // When an Assumption fails then junit doesn't call @Before methods so we need to avoid
  // executing delete if there's no root folder.
  workingDirectory.delete();
 }
}
origin: mulesoft/mule

@Before
public final void setUpMuleContext() throws Exception {
 if (!logConfigured) {
  configureLoggingForTest(getClass());
  logConfigured = true;
 }
 workingDirectory.create();
 String workingDirectoryOldValue =
   System.setProperty(WORKING_DIRECTORY_SYSTEM_PROPERTY_KEY, workingDirectory.getRoot().getAbsolutePath());
 try {
  doSetUpBeforeMuleContextCreation();
  muleContext = createMuleContext();
  if (doTestClassInjection()) {
   muleContext.getInjector().inject(this);
  }
  if (isStartContext() && muleContext != null && !muleContext.isStarted()) {
   startMuleContext();
  }
  doSetUp();
 } finally {
  if (workingDirectoryOldValue != null) {
   System.setProperty(WORKING_DIRECTORY_SYSTEM_PROPERTY_KEY, workingDirectoryOldValue);
  } else {
   System.clearProperty(WORKING_DIRECTORY_SYSTEM_PROPERTY_KEY);
  }
 }
}
origin: mulesoft/mule

@Override
protected void doTearDown() throws Exception {
 synchronized (runners) {
  tearingDown = true;
  for (FlowRunner runner : runners) {
   runner.dispose();
  }
 }
 super.doTearDown();
}
origin: mulesoft/mule

@Override
protected Map<String, Object> getStartUpRegistryObjects() {
 final Map<String, Object> objects = new HashMap<>();
 objects.putAll(super.getStartUpRegistryObjects());
 objects.put(COMPATIBILITY_PLUGIN_INSTALLED, new Object());
 return objects;
}
origin: mulesoft/mule

@Override
protected void addBuilders(List<ConfigurationBuilder> builders) {
 super.addBuilders(builders);
 builders.add(0, new AbstractConfigurationBuilder() {
  @Override
  protected void doConfigure(MuleContext muleContext) throws Exception {
   registryHelper = (MuleRegistryHelper) ((MuleContextWithRegistry) muleContext).getRegistry();
   registryHelper = spy(registryHelper);
   ((DefaultMuleContext) muleContext).setRegistry(registryHelper);
  }
 });
}
origin: org.mule.tests/mule-tests-unit

@Before
public final void setUpMuleContext() throws Exception {
 if (!logConfigured) {
  configureLoggingForTest(getClass());
  logConfigured = true;
 }
 workingDirectory.create();
 String workingDirectoryOldValue =
   System.setProperty(WORKING_DIRECTORY_SYSTEM_PROPERTY_KEY, workingDirectory.getRoot().getAbsolutePath());
 try {
  doSetUpBeforeMuleContextCreation();
  muleContext = createMuleContext();
  if (doTestClassInjection()) {
   muleContext.getInjector().inject(this);
  }
  if (isStartContext() && muleContext != null && !muleContext.isStarted()) {
   startMuleContext();
  }
  doSetUp();
 } finally {
  if (workingDirectoryOldValue != null) {
   System.setProperty(WORKING_DIRECTORY_SYSTEM_PROPERTY_KEY, workingDirectoryOldValue);
  } else {
   System.clearProperty(WORKING_DIRECTORY_SYSTEM_PROPERTY_KEY);
  }
 }
}
origin: mulesoft/mule

@Override
protected void doTearDown() throws Exception {
 scheduler.stop();
 super.doTearDown();
}
origin: mulesoft/mule

@Override
protected Map<String, Object> getStartUpRegistryObjects() {
 final Map<String, Object> objects = new HashMap<>();
 objects.putAll(super.getStartUpRegistryObjects());
 objects.put(COMPATIBILITY_PLUGIN_INSTALLED, new Object());
 return objects;
}
origin: mulesoft/mule

@Override
protected void addBuilders(List<ConfigurationBuilder> builders) {
 builders.add(0, createBootstrapServiceDiscovererContextBuilder());
 super.addBuilders(builders);
}
origin: org.mule.tests/mule-tests-unit

protected MuleContext createMuleContext() throws Exception {
 if (isDisposeContextPerClass() && muleContext != null) {
  context = muleContext;
 } else {
  final ClassLoader executionClassLoader = getExecutionClassLoader();
  final ClassLoader originalContextClassLoader = currentThread().getContextClassLoader();
  try {
   builders.add(new SimpleConfigurationBuilder(getStartUpRegistryObjects()));
   addBuilders(builders);
   builders.add(getBuilder());
   MuleContextBuilder contextBuilder = MuleContextBuilder.builder(APP);
   DefaultMuleConfiguration muleConfiguration = new DefaultMuleConfiguration();
   contextBuilder.setMuleConfiguration(muleConfiguration);
   contextBuilder.setExecutionClassLoader(executionClassLoader);
   contextBuilder.setObjectSerializer(getObjectSerializer());
   contextBuilder.setDeploymentProperties(getDeploymentProperties());
   configureMuleContext(contextBuilder);
   context = muleContextFactory.createMuleContext(builders, contextBuilder);
   recordSchedulersOnInit(context);
   if (!isGracefulShutdown()) {
origin: mulesoft/mule

@Override
protected void doSetUp() throws Exception {
 super.doSetUp();
 el = muleContext.getExpressionManager();
}
origin: org.mule.tests/mule-tests-unit

@After
public final void disposeContextPerTest() throws Exception {
 try {
  doTearDown();
 } finally {
  if (!isDisposeContextPerClass()) {
   if (isStartContext() && muleContext != null && muleContext.isStarted()) {
    muleContext.stop();
   }
   disposeContext();
   if (testServicesConfigurationBuilder != null) {
    testServicesConfigurationBuilder.stopServices();
   }
   doTearDownAfterMuleContextDispose();
  }
  // When an Assumption fails then junit doesn't call @Before methods so we need to avoid
  // executing delete if there's no root folder.
  workingDirectory.delete();
 }
}
origin: mulesoft/mule

@Override
protected void doTearDown() throws Exception {
 super.doTearDown();
 managerStopped.set(true);
 managerStoppedEvents.set(0);
}
origin: mulesoft/mule

@Override
protected Map<String, Object> getStartUpRegistryObjects() {
 Map<String, Object> objects = new HashMap<>();
 objects.putAll(super.getStartUpRegistryObjects());
 objects.put(COMPATIBILITY_PLUGIN_INSTALLED, new Object());
 return objects;
}
origin: org.mule.runtime/mule-core-tests

@Override
protected void addBuilders(List<ConfigurationBuilder> builders) {
 super.addBuilders(builders);
 builders.add(0, new AbstractConfigurationBuilder() {
  @Override
  protected void doConfigure(MuleContext muleContext) throws Exception {
   registryHelper = (MuleRegistryHelper) ((MuleContextWithRegistries) muleContext).getRegistry();
   registryHelper = spy(registryHelper);
   ((DefaultMuleContext) muleContext).setMuleRegistry(registryHelper);
  }
 });
}
origin: mulesoft/mule

@Override
protected void doSetUp() throws Exception {
 super.doSetUp();
 directInboundMessageSource = new DirectInboundMessageSource();
}
origin: mulesoft/mule

@After
public void doTeardown() throws Exception {
 untilSuccessful.dispose();
 super.doTearDown();
}
origin: mulesoft/mule

@Override
protected Map<String, Object> getStartUpRegistryObjects() {
 Map<String, Object> objects = new HashMap<>();
 objects.putAll(super.getStartUpRegistryObjects());
 objects.put(COMPATIBILITY_PLUGIN_INSTALLED, new Object());
 return objects;
}
org.mule.tck.junit4AbstractMuleContextTestCase

Javadoc

Extends AbstractMuleTestCase providing access to a MuleContext instance and tools for manage it.

Most used methods

  • addBuilders
  • doSetUp
    Enables the adding of extra behavior on the set up stage of a test right after the creation of the m
  • doTearDown
    Enables the adding of extra behavior on the tear down stage of a test before the mule context is dis
  • getStartUpRegistryObjects
  • configureMuleContext
    Override this method to set properties of the MuleContextBuilder before it is used to create the Mul
  • createMuleContext
  • disposeContext
  • doSetUpBeforeMuleContextCreation
  • doTearDownAfterMuleContextDispose
  • doTestClassInjection
  • getBuilder
  • getDeploymentProperties
  • getBuilder,
  • getDeploymentProperties,
  • getExecutionClassLoader,
  • getFlowComponentLocationAnnotations,
  • getObjectSerializer,
  • getPayload,
  • getWorkingDirectory,
  • isDisposeContextPerClass,
  • isGracefulShutdown,
  • isStartContext

Popular in Java

  • Making http post requests using okhttp
  • putExtra (Intent)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getExternalFilesDir (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Join (org.hibernate.mapping)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now