package org.apache.aries.subsystem.core.internal;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;

import java.net.MalformedURLException;

import org.junit.Test;

public class LocationTest {
	@Test
	public void testAnyLocationString() {
		String locationStr = "anyLocation";
		try {
			Location location = new Location(locationStr);
			assertNull("Wrong symbolic name", location.getSymbolicName());
			assertEquals("Wrong value", locationStr, location.getValue());
			assertNull("Wrong version", location.getVersion());
			try {
				location.open();
				fail("Opening a location that does not represent a URL should fail");
			}
			catch (MalformedURLException e) {
				// Okay
			}
			catch (Throwable t) {
				t.printStackTrace();
				fail("Wrong exception");
			}
		}
		catch (Throwable t) {
			t.printStackTrace();
			fail("Any location string must be supported");
		}
	}
}

Test support for any location string.
Test support for any location string.

git-svn-id: f3027bd689517dd712b868b0d3f5f59c3162b83d@1397359 13f79535-47bb-0310-9956-ffa450edef68
