First connection to Blue Mind

This small tutorial will show you how to establish a programmatic connection to Blue Mind core server with its client APIs.

To do that, you will need to the jar files from the client SDK.

Setting up your eclipse project

For the purpose of this tutorial, we will setup an eclipse project with junit tests that connect to Blue Mind APIs.

Create a new java project

In eclipse menus, select File, New, Project...

file_new_project

Then select "Java project"

Java project

And fill in a project name (eg. net.bluemind.tutos.first)

Fill name

Then click next

Add dependencies

In the libraries tab, select add external jars

External jars

And select all the jars from our Blue Mind APIs zip

Select jars

Then select Add library

Add library

Junit, as shown belown

Junit

And then finish when your setup looks like this:

Finish

Create a unit test

Now that your project setup is fine, you can create our first unit test that will import Blue Mind APIs. Select the src directory in your brand new project, right click and select "new > class" as shown below.

New class

Then fill the form as indicated in the next screenshot.

New class form

An editor opens with the following empty class:

			package net.bluemind.totos.first;

import junit.framework.TestCase;

public class FirstConnectionTest extends TestCase {

}

We will add some code into it to ensure everything can run:

			package net.bluemind.totos.first;

import junit.framework.TestCase;
import net.bluemind.core.api.calendar.Event;

public class FirstConnectionTest extends TestCase {

	public void testSetupIsOk() {
		Event ev = new Event();
		assertNotNull(ev);
	}

}

Run the test

To run our (over)simple test, we will right click on our test method in the eclipse outline and select "run as junit test".

run as junit

An eclipse view should show successfull test execution

junit result