@Test public void testMatchesWildcardWithSuffix() throws ClientVersionOutOfDateException { VersionVerifier.verify( WILDCARD_VERSION_WITH_SUFFIX, createVersionInfo("1.2.4.1xyzFOO")); // $NON-NLS-1$ VersionVerifier.verify( WILDCARD_VERSION_WITH_SUFFIX, createVersionInfo("1.2.4.1FOO")); // $NON-NLS-1$ }
@Test public void testInspectClientVersionOutOfDateMessages() { try { VersionVerifier.verify(ACCEPTED_VERSIONS, createVersionInfo("1.1.1")); // $NON-NLS-1$ } catch (final ClientVersionOutOfDateException ex) { assertEquals( "Client version: " + "1.1.1" //$NON-NLS-1$ //$NON-NLS-2$ + " - Accepted versions: " + "1.2.3, 1.2.4.", ex.getMessage()); // $NON-NLS-1$ //$NON-NLS-2$ } }
@Test(expected = ClientVersionOutOfDateException.class) public void testMatchesNotWildcardWithSuffix1() throws ClientVersionOutOfDateException { VersionVerifier.verify( WILDCARD_VERSION_WITH_SUFFIX, createVersionInfo("1.2.4.1xyz")); // $NON-NLS-1$ }
@Test(expected = ClientVersionOutOfDateException.class) public void testMatchesNotWildcard3() throws ClientVersionOutOfDateException { VersionVerifier.verify(WILDCARD_VERSION, createVersionInfo("1.2.3.4")); // $NON-NLS-1$ }
@Test public void testMatchesWildcard() throws ClientVersionOutOfDateException { VersionVerifier.verify(WILDCARD_VERSION, createVersionInfo("1.2.4.1")); // $NON-NLS-1$ VersionVerifier.verify(WILDCARD_VERSION, createVersionInfo("1.2.4.1xyz")); // $NON-NLS-1$ }
@Test public void testMathesOne() throws ClientVersionOutOfDateException { VersionVerifier.verify(ACCEPTED_VERSIONS, createVersionInfo("1.2.3")); // $NON-NLS-1$ }
@Test public void testSupplyNoVersions() throws ClientVersionOutOfDateException { VersionVerifier.verify(null, createVersionInfo("1.2.3")); // $NON-NLS-1$ }
@Test(expected = ClientVersionOutOfDateException.class) public void testVerifyNull() throws ClientVersionOutOfDateException { VersionVerifier.verify(ACCEPTED_VERSIONS, null); }
@Test public void testMatchesAny() throws ClientVersionOutOfDateException { VersionVerifier.verify(ANY_VERSION, createVersionInfo("abc")); // $NON-NLS-1$ }