Skip to content

Commit

Permalink
Refactored unit test classes. Added older version of mongodb for olde…
Browse files Browse the repository at this point in the history
…r support/testing
  • Loading branch information
Paul Knopf committed Jan 13, 2013
1 parent acf65cf commit fa029af
Show file tree
Hide file tree
Showing 30 changed files with 1,130 additions and 93 deletions.
661 changes: 661 additions & 0 deletions Dependencies/mongodb-win32-x86_64-2.0.8/GNU-AGPL-3.0

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions Dependencies/mongodb-win32-x86_64-2.0.8/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
MongoDB README

Welcome to MongoDB!

COMPONENTS

bin/mongod - The database process.
bin/mongos - Sharding controller.
bin/mongo - The database shell (uses interactive javascript).

UTILITIES

bin/mongodump - MongoDB dump tool - for backups, snapshots, etc..
bin/mongorestore - MongoDB restore a dump
bin/mongoexport - Export a single collection to test (JSON, CSV)
bin/mongoimport - Import from JSON or CSV
bin/mongofiles - Utility for putting and getting files from MongoDB GridFS
bin/mongostat - Show performance statistics

RUNNING

For command line options invoke:

$ ./mongod --help

To run a single server database:

$ mkdir /data/db
$ ./mongod
$
$ # The mongo javascript shell connects to localhost and test database by default:
$ ./mongo
> help

DRIVERS

Client drivers for most programming languages are available at mongodb.org. Use the
shell ("mongo") for administrative tasks.

DOCUMENTATION

http://www.mongodb.org/

MAIL LISTS AND IRC

http://www.mongodb.org/display/DOCS/Community

32 BIT BUILD NOTES

MongoDB uses memory mapped files. If built as a 32 bit executable, you will
not be able to work with large (multi-gigabyte) databases. However, 32 bit
builds work fine with small development databases.
233 changes: 233 additions & 0 deletions Dependencies/mongodb-win32-x86_64-2.0.8/THIRD-PARTY-NOTICES
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
MongoDB uses third-party libraries or other resources that may
be distributed under licenses different than the MongoDB software.

In the event that we accidentally failed to list a required notice,
please bring it to our attention through any of the ways detailed here :

[email protected]

The attached notices are provided for information only.


1) License Notice for Boost
---------------------------

http://www.boost.org/LICENSE_1_0.txt

Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.


2) License Notice for V8
-------------------------

http://code.google.com/p/v8/source/browse/trunk/LICENSE

This license applies to all parts of V8 that are not externally
maintained libraries. The externally maintained libraries used by V8
are:

- Jscre, located under third_party/jscre. This code is copyrighted
by the University of Cambridge and Apple Inc. and released under a
2-clause BSD license.

- Dtoa, located under third_party/dtoa. This code is copyrighted by
David M. Gay and released under an MIT license.

- Strongtalk assembler, the basis of the files assembler-arm-inl.h,
assembler-arm.cc, assembler-arm.h, assembler-ia32-inl.h,
assembler-ia32.cc, assembler-ia32.h, assembler.cc and assembler.h.
This code is copyrighted by Sun Microsystems Inc. and released
under a 3-clause BSD license.

These libraries have their own licenses; we recommend you read them,
as their terms may differ from the terms below.

Copyright 2006-2008, Google Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

3) License Notice for PCRE
--------------------------

http://www.pcre.org/licence.txt

PCRE LICENCE
------------

PCRE is a library of functions to support regular expressions whose syntax
and semantics are as close as possible to those of the Perl 5 language.

Release 7 of PCRE is distributed under the terms of the "BSD" licence, as
specified below. The documentation for PCRE, supplied in the "doc"
directory, is distributed under the same terms as the software itself.

The basic library functions are written in C and are freestanding. Also
included in the distribution is a set of C++ wrapper functions.


THE BASIC LIBRARY FUNCTIONS
---------------------------

Written by: Philip Hazel
Email local part: ph10
Email domain: cam.ac.uk

University of Cambridge Computing Service,
Cambridge, England.

Copyright (c) 1997-2008 University of Cambridge
All rights reserved.


THE C++ WRAPPER FUNCTIONS
-------------------------

Contributed by: Google Inc.

Copyright (c) 2007-2008, Google Inc.
All rights reserved.


THE "BSD" LICENCE
-----------------

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

* Neither the name of the University of Cambridge nor the name of Google
Inc. nor the names of their contributors may be used to endorse or
promote products derived from this software without specific prior
written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.


4) License notice for Aladdin MD5
---------------------------------

Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved.

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

L. Peter Deutsch
[email protected]

5) License notice for Snappy - http://code.google.com/p/snappy/
---------------------------------
Copyright 2005 and onwards Google Inc.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

A light-weight compression algorithm. It is designed for speed of
compression and decompression, rather than for the utmost in space
savings.

For getting better compression ratios when you are compressing data
with long repeated sequences or compressing data that is similar to
other data, while still compressing fast, you might look at first
using BMDiff and then compressing the output of BMDiff with
Snappy.



End
Binary file not shown.
Binary file added Dependencies/mongodb-win32-x86_64-2.0.8/mongo.exe
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void Can_get_resource_by_name()
var resource = _localizationService.InsertLocaleStringResource(CreateResource(1, _languageService.InsertLanguage(CreateLanguage()).Id));

// act
var dbResource = _localizationService.GetLocaleStringResourceByName(resource.ResourceName.ToUpper(), resource.LanguageId);
var dbResource = _localizationService.GetLocaleStringResourceByName(resource.ResourceName, resource.LanguageId);

// assert
dbResource.ShouldNotBeNull();
Expand Down
31 changes: 8 additions & 23 deletions Source/Modules/Noodle.Localization.Tests/LocalizationTestsBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,45 +16,30 @@ namespace Noodle.Localization.Tests
{
public class LocalizationTestsBase : DataTestBase
{
protected IKernel _kernel;
protected ILanguageService _languageService;
protected ILocalizationService _localizationService;
protected ILocalizedEntityService _localizedEntityService;
protected IDisposable _serverScope;

[SetUp]
public void Setup()
public override void SetUp()
{
_kernel = GetTestKernel();
_kernel.Resolve<MongoCollection<Language>>().RemoveAll();
_kernel.Resolve<MongoCollection<LocaleStringResource>>().RemoveAll();
_kernel.Resolve<MongoCollection<LocalizedProperty>>().RemoveAll();
_kernel.Resolve<MongoCollection<Setting>>().RemoveAll();
_languageService = _kernel.Resolve<ILanguageService>();
_localizationService = _kernel.Resolve<ILocalizationService>();
_localizedEntityService = _kernel.Resolve<ILocalizedEntityService>();
}

[TestFixtureSetUp]
public void SetupFixture()
{
_serverScope = ServerScope();
}

[TestFixtureTearDown]
public void TearDownFixture()
{
_serverScope.Dispose();
base.SetUp();
}

public override IKernel GetTestKernel(params Engine.IDependencyRegistrar[] dependencyRegistrars)
public override IEnumerable<Engine.IDependencyRegistrar> GetDependencyRegistrars()
{
var registrars = dependencyRegistrars.ToList();
registrars.Insert(0, new MongoDB.DependencyRegistrar());
registrars.Insert(0, new DependencyRegistrar());
registrars.Insert(0, new Settings.DependencyRegistrar());
var kernel = base.GetTestKernel(registrars.ToArray());
return kernel;
var registrars = base.GetDependencyRegistrars().ToList();
registrars.Add(new MongoDB.DependencyRegistrar());
registrars.Add(new DependencyRegistrar());
registrars.Add(new Settings.DependencyRegistrar());
return registrars;
}

public IEqualityComparer<Language> GetLanguageComparer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="..\..\..\Dependencies\mongodb-win32-x86_64-2.2.2\mongod.exe">
<Content Include="..\..\..\Dependencies\mongodb-win32-x86_64-2.0.8\mongod.exe">
<Link>mongod.exe</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Noodle.Localization.Services
{
/// <summary>
/// Install languages from an xml filel
/// Install languages from an xml file
/// </summary>
public interface ILanguageInstaller
{
Expand All @@ -17,10 +17,10 @@ public interface ILanguageInstaller
void Install(string languagesXmlFileLocation);

/// <summary>
/// Deserialize the xml language file to an inmemoy collection for modification (and maybe inserting?)
/// Deserialize the xml language file to an in memory collection for modification (and maybe inserting?)
/// </summary>
/// <param name="languagesXmlFileLocation"></param>
/// <returns></returns>
Dictionary<Language, List<LocaleStringResource>> DeserializeLanguagesFile(string languagesXmlFileLocation);
List<Pair<Language, List<LocaleStringResource>>> DeserializeLanguagesFile(string languagesXmlFileLocation);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ LocaleStringResource GetLocaleStringResourceByName(string resourceName, ObjectId
/// <param name="localeStringResource">Locale string resource</param>
LocaleStringResource InsertLocaleStringResource(LocaleStringResource localeStringResource);

/// <summary>
/// Inserts a locale string resources in a batch-like manner (for performance). The language installer uses this.
/// </summary>
/// <param name="localeStringResources">Locale string resources</param>
void InsertLocaleStringResources(params LocaleStringResource[] localeStringResources);

/// <summary>
/// Updates the locale string resource
/// </summary>
Expand Down
Loading

0 comments on commit fa029af

Please sign in to comment.