package com.artemis;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

/**
 * @author Daan van Yperen
 */
public class WireByConventionTest {

	@Test
	public void ensure_primitives_dont_cause_wire_exceptions() {

		class PrimitivesSystem extends BaseSystem {

			byte b;
			short s;
			int i;
			long l;
			float f;
			double d;
			boolean b2;
			char c;
			String z;

			@Override
			protected void processSystem() {
			}
		}

		new World(new WorldConfiguration().setSystem(new PrimitivesSystem()));
	}

	@Test
	public void ensure_explicit_wire_overrides_implicit_wire() {
		Assert.fail();
	}
}

@@ -26,24 +26,36 @@
 ort 
-org.junit.Assert
+com.artemis.annotations.Wire
 ;%0Aim
@@ -73,14 +73,14 @@
 nit.
-Before
+Assert
 ;%0Aim
@@ -608,22 +608,628 @@
 ) %7B%0A
-%09%09Assert.fail(
+%0A%09%09class TestSystem extends BaseSystem %7B%0A%09%09%09@Override%0A%09%09%09protected void processSystem() %7B%0A%09%09%09%7D%0A%09%09%7D%0A%0A%09%09class SuperSystem extends BaseSystem %7B%0A%0A%09%09%09TestSystem x;%0A%0A%09%09%09@Override%0A%09%09%09protected void processSystem() %7B%0A%09%09%09%7D%0A%09%09%7D%0A%0A%09%09@Wire(injectInherited = false)%0A%09%09class ExplicitlyWired extends SuperSystem %7B%0A%0A%09%09%09TestSystem y;%0A%0A%09%09%09@Override%0A%09%09%09protected void processSystem() %7B%0A%09%09%09%7D%0A%09%09%7D%0A%0A%09%09ExplicitlyWired explicitlyWired = new ExplicitlyWired();%0A%09%09new World(new WorldConfiguration()%0A%09%09%09%09.setSystem(explicitlyWired)%0A%09%09%09%09.setSystem(new TestSystem()));%0A%0A%09%09Assert.assertNotNull(explicitlyWired.y);%0A%09%09Assert.assertNull(explicitlyWired.x
 );%0A%09

Add ensure_explicit_wire_overrides_implicit_wire test.