package org.kurento.modulecreator.test;

import static org.junit.Assert.assertThat;
import junit.framework.Assert;

import org.junit.Test;
import org.junit.internal.matchers.StringContains;
import org.kurento.modulecreator.KurentoModuleCreator;
import org.kurento.modulecreator.KurentoModuleCreatorException;
import org.kurento.modulecreator.PathUtils;

public class ReleaseModuleWithDevDependTest {

	@Test
	public void test() throws Exception {

		KurentoModuleCreator modCreator = new KurentoModuleCreator();

		modCreator.addDependencyKmdFile(PathUtils
				.getPathInClasspath("/releaseversion/moduleA.kmd.json"));

		modCreator.addKmdFileToGen(PathUtils
				.getPathInClasspath("/releaseversion/moduleB.kmd.json"));

		modCreator.addDependencyKmdFile(PathUtils
				.getPathInClasspath("/fakecore.kmd.json"));

		modCreator.addDependencyKmdFile(PathUtils
				.getPathInClasspath("/fakeelements.kmd.json"));

		modCreator.addDependencyKmdFile(PathUtils
				.getPathInClasspath("/fakefilters.kmd.json"));

		try {

			modCreator.loadModulesFromKmdFiles();

			Assert.fail("Exception KurentoModuleCreatorException for dev dependencies in release should be thrown");

		} catch (KurentoModuleCreatorException e) {

			assertThat(
					e.getMessage(),
					StringContains
							.containsString("All dependencies of a release version must be also release versions"));
		}
	}

}

@@ -38,51 +38,8 @@
 t;%0A%0A
-import static org.junit.Assert.assertThat;%0A
 impo
@@ -93,59 +93,8 @@
 st;%0A
-import org.junit.internal.matchers.StringContains;%0A
 impo
@@ -1121,60 +1121,217 @@
 %0A%09%09%09
-assertThat(%0A%09%09%09%09%09e.getMessage(),%0A%09%09%09%09%09StringContains
+Assert.assertTrue(%0A%09%09%09%09%09%22Exception message should be: %22%0A%09%09%09%09%09%09%09+ %22%5C%22All dependencies of a release version must be also release versions%5C%22%22%0A%09%09%09%09%09%09%09+ %22 but it is: %5C%22%22 + e.getMessage() + %22%5C%22%22,%0A%09%09%09%09%09e.getMessage()
 %0A%09%09%09
@@ -1347,15 +1347,19 @@
 ains
-String(
+(%0A%09%09%09%09%09%09%09%09%09
 %22All
@@ -1431,14 +1431,14 @@
 ));%0A
+%0A
 %09%09%7D%0A
+
 %09%7D%0A
-%0A
 %7D%0A

Remove StingContains from tests that does not work with debian