Developer Programs

April 3rd, 2015

There are many developer programs available for software/applications/mobile developers nowadays to support and enable developers to integrate or even build applications using their APIs .
Here’s a list, sourced from DZone, in alphabetical order:

  1. ActiveState Code – http://code.activestate.com/
  2. Amazon Developer – http://developer.amazon.com/public/community/blog
  3. Android Developer – http://developer.android.com/
  4. Apple iOS Developer – http://developer.apple.com/
  5. AT&T Developer Program – http://developer.att.com/
  6. AutoDesk Developer Network – http://usa.autodesk.com/adsk/servlet/index%3FsiteID%3D123112%26id%3D19118898
  7. Avaya DevConnect – http://avaya.com/devconnect
  8. BestBuy APIs – http://developer.bestbuy.com/
  9. Bluetooth SIG Developer Showcase – http://developer.bluetooth.org/
  10. Braintree Developer Program – http://developers.braintreepayments.com/
  11. Carriots – http://carriots.com/
  12. Cisco DevNet – http://developer.cisco.com/
  13. DocuSign Developer Program – http://docusign.com/devcenter
  14. Dolby Developer Program – http://developer.dolby.com/
  15. Embarcadero Developer Program – http://embarcadero.com/services/partners
  16. EMC CODE – http://emccode.github.io/
  17. EVRYTHNG Developers – http://dashboard.evrythng.com/developers/quickstart
  18. Facebook Developers – http://developers.facebook.com/blog
  19. Ford Developer Program – http://developer.ford.com/
  20. GitHub Developer Program – http://developer.github.com/changes/
  21. Google Developers – http://developers.google.com/
  22. IBM developerWorks – http://ibm.com/developerworks
  23. Intel DeveloperZone – http://software.intel.com/
  24. Intuit Developer – http://developer.intuit.com/
  25. Magnolia Community – http://community.magnolia-cms.com/
  26. MapR Developer Central – http://mapr.com/developercentral
  27. Microsoft BizSpark – http://microsoft.com/bizspark
  28. MongoDB Masters – http://mongodb.org/about/community/masters
  29. Mozilla Developer Network – http://developer.mozilla.org/
  30. MuleSoft //Dev – http://mulesoft.org/
  31. Oracle Technology Network – http://community.oracle.com/
  32. OutSystems Developer Community – http://outsystems.com/forums
  33. Philips Hue Developer Program – http://developers.meethue.com/
  34. Qualcomm Developer Network – http://developer.qualcomm.com/
  35. Rackspace Developer+ – http://developer.rackspace.com/
  36. Red Hat Enterprise Linux Developer Program – http://developer.redhat.com/rhel
  37. Red Hat JBoss Developer Program – http://planet.jboss.org/
  38. SalesForce Developers – http://developer.salesforce.com/
  39. Samsung Developer Program – http://samsungdevus.com/blog
  40. SAP Developer Program – http://developers.sap.com/
  41. Shopify Partner Program – http://shopify.com/partners
  42. Twitter Developers – http://dev.twitter.com/
  43. Verizon M2M Developer Program – http://m2mdeveloper.verizon.com/

 

Software, Technology





Running JUnit tests in Maven with Surefire Plugin and skipTests in default packaging

March 3rd, 2015

Further to the JUnit test we have created, it’s time to have it built into a maven build script so that the test can be run.
Once you have JUnit in your pom.xml file, maven will run tests with JUnit and all valid JUnit test classes under src/test/java directory.
However if you are using more than one test framework such as both TestNG and JUnit, you will need to explicitly specify JUnit as the test provider.

<plugins>
[...]
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.18.1</version>
    <dependencies>
      <dependency>
        <groupId>org.apache.maven.surefire</groupId>
        <artifactId>surefire-junit47</artifactId>
        <version>2.18.1</version>
      </dependency>
    </dependencies>
  </plugin>
[...]
</plugins>

For the default maven packaging, you might not want to run test and the tests can be run as a separate job/task.
To address this, all you need to do is create a skipTests property in the pom.xml and have it set to false only when you need to run the tests.


    <properties> 
    	<skipTests>true</skipTests> 
    </properties>

Use skipTests in the configuration element.


<plugins>
[...]
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.18.1</version>
    <dependencies>
      <dependency>
        <groupId>org.apache.maven.surefire</groupId>
        <artifactId>surefire-junit47</artifactId>
        <version>2.18.1</version>
      </dependency>
    </dependencies>
    <configuration>
      <skipTests>${skipTests}</skipTests>
    </configuration>
  </plugin>
[...]
</plugins>

To run the tests:
mvn test -DskipTests=false

Java, Software , ,



Quick Guide to JUnit multiple parameter tests with Parameterized annotation

February 15th, 2015

It is extremely easy to create JUnit test classes to run and test your application or Java code.
JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks.
All it needs is to include the JUnit library and use the @Test annotation for the method you need to run as test.
However, sometimes we need the convenience of the same test method to run with different parameters.
Following is an example how it can be done easily with some changes to a single test method by adding @RunWith(Parameterized.class) before the class name and then initialize a collection of parameters with @Parameters.
You can also read the parameters from a data provider once using a initializing method with @BeforeClass.

package net.marvinlee.test;
 
import java.util.ArrayList;
import java.util.Collection;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
 

@RunWith(Parameterized.class)
public class JunitTest
{

	private String code;
	private String description;
	

	public JunitTest(String code, String description)
	{
		super();
		this.code = code;
		this.description = description;
	}

	 @Parameters
	 public static Collection getParameters() 
	 { 
		 ArrayList<Object[]> paramList = new ArrayList<Object[]>();
		 addTestcases(paramList);
		 return paramList;
	 }

	protected static void addTestcases(ArrayList<Object[]> paramList)
	{
		for(int i=1;i<=10;i++)
		{
			paramList.add(new Object[]{"Code" + i, "Description " + i});
		}
	}

	@BeforeClass
	public static void init() 
	{ 
		System.out.println("Current dir:" +  JunitTest.class.getClassLoader().getResource("").getPath()); 
	}
	 

	@Test
	public void validateCases() 
	{
		boolean matched = ((code.equals("Code5") && description.equals("Description 5"))
			|| (code.equals("Code6") && description.equals("Description 6")));
		Assert.assertTrue("Failed test=" + code, matched);
		 
	}
	 
}

JUnit test classes can be run with Eclipse IDE and the above test class will show run results similar to the following screenshot.
Only the 4th and 5th testcases that match with the hardcoded values will pass while we get remaining 8 failures.
junit

Have a run with it!

Java, Software ,