lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r888553 - in /incubator/lucene.net/trunk/C#/src: Lucene.Net/Messages/NLS.cs Test/Messages/TestNLS.cs Test/Test.csproj
Date Tue, 08 Dec 2009 20:02:59 GMT
Author: digy
Date: Tue Dec  8 20:02:58 2009
New Revision: 888553

URL: http://svn.apache.org/viewvc?rev=888553&view=rev
Log:
LUCENENET-323 Test cases of Messages

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Messages/NLS.cs
    incubator/lucene.net/trunk/C#/src/Test/Messages/TestNLS.cs
    incubator/lucene.net/trunk/C#/src/Test/Test.csproj

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Messages/NLS.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Messages/NLS.cs?rev=888553&r1=888552&r2=888553&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Messages/NLS.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Messages/NLS.cs Tue Dec  8 20:02:58 2009
@@ -134,7 +134,7 @@
 			{
 				System.Type clazz = (System.Type) bundles[(System.String) it.Current];
 				System.Threading.Thread.CurrentThread.CurrentUICulture = locale;
-				System.Resources.ResourceManager resourceBundle = System.Resources.ResourceManager.CreateFileBasedResourceManager(clazz.FullName,
"", null);
+                System.Resources.ResourceManager resourceBundle = System.Resources.ResourceManager.CreateFileBasedResourceManager(clazz.Name,
"Messages", null); //{{Lucene.Net-2.9.1}} Can we make resourceDir "Messages" more general?
 				if (resourceBundle != null)
 				{
 					try

Modified: incubator/lucene.net/trunk/C#/src/Test/Messages/TestNLS.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Messages/TestNLS.cs?rev=888553&r1=888552&r2=888553&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Messages/TestNLS.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Messages/TestNLS.cs Tue Dec  8 20:02:58 2009
@@ -30,7 +30,7 @@
 		public virtual void  TestMessageLoading()
 		{
 			Message invalidSyntax = new MessageImpl(MessagesTestBundle.Q0001E_INVALID_SYNTAX, new
System.Object[]{"XXX"});
-			Assert.AreEqual("Syntax Error: XXX", invalidSyntax.GetLocalizedMessage());
+            Assert.AreEqual("Syntax Error: XXX", invalidSyntax.GetLocalizedMessage());
 		}
 		
 		[Test]
@@ -63,7 +63,15 @@
 		[Test]
 		public virtual void  TestNLSLoading_xx_XX()
 		{
-			System.Globalization.CultureInfo locale = new System.Globalization.CultureInfo("xx" +
"-" + "XX");
+            System.Globalization.CultureInfo locale;
+            try
+            {
+                locale = new System.Globalization.CultureInfo("xx" + "-" + "XX");
+            }
+            catch
+            {
+                locale = System.Threading.Thread.CurrentThread.CurrentUICulture;
+            }
 			System.String message = NLS.GetLocalizedMessage(MessagesTestBundle.Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION,
locale);
 			Assert.AreEqual("Truncated unicode escape sequence.", message);
 			

Modified: incubator/lucene.net/trunk/C#/src/Test/Test.csproj
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Test/Test.csproj?rev=888553&r1=888552&r2=888553&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Test/Test.csproj (original)
+++ incubator/lucene.net/trunk/C#/src/Test/Test.csproj Tue Dec  8 20:02:58 2009
@@ -473,8 +473,12 @@
     <None Include="Index\index.24.nocfs.zip" />
   </ItemGroup>
   <ItemGroup>
-    <EmbeddedResource Include="Messages\MessagesTestBundle.ja.resources" />
-    <EmbeddedResource Include="Messages\MessagesTestBundle.resources" />
+    <EmbeddedResource Include="Messages\MessagesTestBundle.ja.resources">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Messages\MessagesTestBundle.resources">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </EmbeddedResource>
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\Lucene.Net\Lucene.Net.csproj">



Mime
View raw message