@SuppressWarnings({ "rawtypes", "unchecked" })

@Test
public void testInputMismatchExceptions() {
	
	RichMapFunction<?, ?> function = new RichMapFunction<Tuple2<String, String>, String>() {
		private static final long serialVersionUID = 1L;
		@Override
		public String map(Tuple2<String, String> value) throws Exception {
			return null;
		}
	};
	
	try {
		TypeExtractor.getMapReturnTypes(function, (TypeInformation) TypeInfoParser.parse("Tuple2<Integer, String>"));
		Assert.fail("exception expected");
	} catch (InvalidTypesException e) {
		// right
	}
	
	try {
		TypeExtractor.getMapReturnTypes(function, (TypeInformation) TypeInfoParser.parse("Tuple3<String, String, String>"));
		Assert.fail("exception expected");
	} catch (InvalidTypesException e) {
		// right
	}
	
	RichMapFunction<?, ?> function2 = new RichMapFunction<StringValue, String>() {
		private static final long serialVersionUID = 1L;
		@Override
		public String map(StringValue value) throws Exception {
			return null;
		}
	};
	
	try {
		TypeExtractor.getMapReturnTypes(function2, (TypeInformation) TypeInfoParser.parse("IntValue"));
		Assert.fail("exception expected");
	} catch (InvalidTypesException e) {
		// right
	}
	
	RichMapFunction<?, ?> function3 = new RichMapFunction<Tuple1<Integer>[], String>() {
		private static final long serialVersionUID = 1L;
		@Override
		public String map(Tuple1<Integer>[] value) throws Exception {
			return null;
		}
	};
	
	try {
		TypeExtractor.getMapReturnTypes(function3, (TypeInformation) TypeInfoParser.parse("Integer[]"));
		Assert.fail("exception expected");
	} catch (InvalidTypesException e) {
		// right
	}
}