[twin] r15 committed - FrancoisReynaud: initial commit of Sam's work.

13 views
Skip to first unread message

tw...@googlecode.com

unread,
Apr 19, 2011, 5:40:02 AM4/19/11
to twin-c...@googlegroups.com
Revision: 15
Author: francois.reynaud
Date: Tue Apr 19 02:37:11 2011
Log: FrancoisReynaud: initial commit of Sam's work.
http://code.google.com/p/twin/source/detail?r=15

Added:
/trunk/twin/LICENSE.txt
/trunk/twin/README.txt
/trunk/twin/dotnet-logging
/trunk/twin/dotnet-logging/dotnet-logging.csproj
/trunk/twin/dotnet-logging/pom.xml
/trunk/twin/dotnet-logging/src
/trunk/twin/dotnet-logging/src/main
/trunk/twin/dotnet-logging/src/main/csharp
/trunk/twin/dotnet-logging/src/main/csharp/Logger.cs
/trunk/twin/dotnet-logging/src/main/csharp/TextWriterLogger.cs
/trunk/twin/json
/trunk/twin/json/pom.xml
/trunk/twin/json/src
/trunk/twin/json/src/main
/trunk/twin/json/src/main/java
/trunk/twin/json/src/main/java/org
/trunk/twin/json/src/main/java/org/ebayopensource
/trunk/twin/json/src/main/java/org/ebayopensource/twin
/trunk/twin/json/src/main/java/org/ebayopensource/twin/json
/trunk/twin/json/src/main/java/org/ebayopensource/twin/json/JSON.java

/trunk/twin/json/src/main/java/org/ebayopensource/twin/json/JSONRecognizer.java

/trunk/twin/json/src/main/java/org/ebayopensource/twin/json/JSONStaticRecognizer.java
/trunk/twin/json/src/main/java/org/ebayopensource/twin/json/JSONable.java
/trunk/twin/json/src/test
/trunk/twin/json/src/test/java
/trunk/twin/json/src/test/java/org
/trunk/twin/json/src/test/java/org/ebayopensource
/trunk/twin/json/src/test/java/org/ebayopensource/twin
/trunk/twin/json/src/test/java/org/ebayopensource/twin/json

/trunk/twin/json/src/test/java/org/ebayopensource/twin/json/JSONRecognizerTest.java
/trunk/twin/json/src/test/java/org/ebayopensource/twin/json/JSONTest.java

/trunk/twin/json/src/test/java/org/ebayopensource/twin/json/JSONableTest.java
/trunk/twin/maven-templates
/trunk/twin/maven-templates/dotnet-project
/trunk/twin/maven-templates/dotnet-project/pom.xml
/trunk/twin/maven-templates/java-project
/trunk/twin/maven-templates/java-project/pom.xml
/trunk/twin/packages
/trunk/twin/packages/client
/trunk/twin/packages/client/java
/trunk/twin/packages/client/java/pom.xml
/trunk/twin/packages/rc
/trunk/twin/packages/rc/pom.xml
/trunk/twin/packages/rc/src
/trunk/twin/packages/rc/src/main
/trunk/twin/packages/rc/src/main/assembly
/trunk/twin/packages/rc/src/main/assembly/assembly.xml
/trunk/twin/packages/rc/src/main/contents
/trunk/twin/packages/rc/src/main/contents/sharpclaws.xml
/trunk/twin/pom.xml
/trunk/twin/sharpclaws
/trunk/twin/sharpclaws/api
/trunk/twin/sharpclaws/api/API.csproj
/trunk/twin/sharpclaws/api/pom.xml
/trunk/twin/sharpclaws/api/src
/trunk/twin/sharpclaws/api/src/main
/trunk/twin/sharpclaws/api/src/main/csharp
/trunk/twin/sharpclaws/api/src/main/csharp/Headers.cs
/trunk/twin/sharpclaws/api/src/main/csharp/HttpException.cs
/trunk/twin/sharpclaws/api/src/main/csharp/IRequest.cs
/trunk/twin/sharpclaws/api/src/main/csharp/IResponse.cs
/trunk/twin/sharpclaws/api/src/main/csharp/Servlet.cs
/trunk/twin/sharpclaws/pom.xml
/trunk/twin/sharpclaws/server
/trunk/twin/sharpclaws/server/Server.csproj
/trunk/twin/sharpclaws/server/pom.xml
/trunk/twin/sharpclaws/server/src
/trunk/twin/sharpclaws/server/src/main
/trunk/twin/sharpclaws/server/src/main/csharp
/trunk/twin/sharpclaws/server/src/main/csharp/ChunkedStream.cs
/trunk/twin/sharpclaws/server/src/main/csharp/ConnectionHandler.cs
/trunk/twin/sharpclaws/server/src/main/csharp/ConnectionLogger.cs
/trunk/twin/sharpclaws/server/src/main/csharp/DefaultServlet.cs
/trunk/twin/sharpclaws/server/src/main/csharp/ErrorPage.cs
/trunk/twin/sharpclaws/server/src/main/csharp/LengthBoundStream.cs
/trunk/twin/sharpclaws/server/src/main/csharp/Request.cs
/trunk/twin/sharpclaws/server/src/main/csharp/Response.cs
/trunk/twin/sharpclaws/server/src/main/csharp/Server.cs
/trunk/twin/sharpclaws/server/src/main/csharp/StreamAsNeeded.cs
/trunk/twin/sharpclaws/server/src/main/csharp/UI
/trunk/twin/sharpclaws/server/src/main/csharp/UI/Program.cs
/trunk/twin/sharpclaws/server/src/main/csharp/UnbufferedStreamReader.cs
/trunk/twin/sharpclaws/server/src/main/win32icon
/trunk/twin/sharpclaws/server/src/main/win32icon/icon.ico
/trunk/twin/twin
/trunk/twin/twin/client
/trunk/twin/twin/client/java
/trunk/twin/twin/client/java/pom.xml
/trunk/twin/twin/client/java/src
/trunk/twin/twin/client/java/src/main
/trunk/twin/twin/client/java/src/main/java
/trunk/twin/twin/client/java/src/main/java/org
/trunk/twin/twin/client/java/src/main/java/org/ebayopensource
/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/Application.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/Attachment.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/Clipboard.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/Criteria.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/DesktopImpl.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/Element.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/ElementImpl.java
/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/IDE.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/MouseButton.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/Name.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/NameMappings.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/RemoteObject.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/RemoteResource.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/RemoteResourceInterface.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/Require.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/Screenshot.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/ScrollBar.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/ScrollBarImpl.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/TwinConnection.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/TwinError.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/TwinException.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/TwinInvalidElementStateException.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/TwinNoSuchElementException.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/TwinStaleElementException.java
/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/Button.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/CalendarControl.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/CheckBox.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/ComboBox.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/ControlType.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/Custom.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/DataGrid.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/DataItem.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/Desktop.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/Document.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/Edit.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/Group.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/Header.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/HeaderItem.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/Hyperlink.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/Image.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/ListControl.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/ListItem.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/Menu.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/MenuBar.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/MenuItem.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/Pane.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/ProgressBar.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/RadioButton.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/ScrollBarControl.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/Separator.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/Slider.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/Spinner.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/SplitButton.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/StatusBar.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/Tab.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/TabItem.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/Table.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/Text.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/Thumb.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/TitleBar.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/ToolBar.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/ToolTip.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/Tree.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/TreeItem.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/element/Window.java
/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/pattern

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/pattern/ControlPattern.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/pattern/Editable.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/pattern/Expandable.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/pattern/Selectable.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/pattern/SelectionContainer.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/pattern/Toggle.java

/trunk/twin/twin/client/java/src/main/java/org/ebayopensource/twin/pattern/Transformable.java
/trunk/twin/twin/client/java/src/test
/trunk/twin/twin/client/java/src/test/java
/trunk/twin/twin/client/java/src/test/java/examples
/trunk/twin/twin/client/java/src/test/java/examples/Notepad.java
/trunk/twin/twin/client/javascript
/trunk/twin/twin/client/javascript/twin.js
/trunk/twin/twin/ide
/trunk/twin/twin/ide/pom.xml
/trunk/twin/twin/ide/src
/trunk/twin/twin/ide/src/main
/trunk/twin/twin/ide/src/main/java
/trunk/twin/twin/ide/src/main/java/org
/trunk/twin/twin/ide/src/main/java/org/ebayopensource
/trunk/twin/twin/ide/src/main/java/org/ebayopensource/twin
/trunk/twin/twin/ide/src/main/java/org/ebayopensource/twin/ide

/trunk/twin/twin/ide/src/main/java/org/ebayopensource/twin/ide/ElementTreeModel.java

/trunk/twin/twin/ide/src/main/java/org/ebayopensource/twin/ide/RCBrowser.java

/trunk/twin/twin/ide/src/main/java/org/ebayopensource/twin/ide/ResultConsumer.java

/trunk/twin/twin/ide/src/main/java/org/ebayopensource/twin/ide/ScrollableImagePanel.java

/trunk/twin/twin/ide/src/main/java/org/ebayopensource/twin/ide/SessionConsole.java
/trunk/twin/twin/ide/src/main/java/org/ebayopensource/twin/ide/Utils.java

/trunk/twin/twin/ide/src/main/java/org/ebayopensource/twin/ide/WrappingPanel.java
/trunk/twin/twin/ide/src/main/java/org/ebayopensource/twin/ide/frob

/trunk/twin/twin/ide/src/main/java/org/ebayopensource/twin/ide/frob/AttributeFrobber.java

/trunk/twin/twin/ide/src/main/java/org/ebayopensource/twin/ide/frob/DefaultFrobber.java

/trunk/twin/twin/ide/src/main/java/org/ebayopensource/twin/ide/frob/ElementFrobPanel.java

/trunk/twin/twin/ide/src/main/java/org/ebayopensource/twin/ide/frob/Frobber.java
/trunk/twin/twin/ide/src/main/resources
/trunk/twin/twin/ide/src/main/resources/org
/trunk/twin/twin/ide/src/main/resources/org/ebayopensource
/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin
/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide
/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/Button.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/CalendarControl.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/CheckBox.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/ComboBox.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/Custom.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/DataGrid.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/Desktop.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/Document.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/Edit.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/Group.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/Hyperlink.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/Image.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/ListControl.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/ListItem.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/MenuBar.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/MenuItem.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/ProgressBar.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/RadioButton.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/ScrollBarControl.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/Separator.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/Slider.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/Spinner.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/SplitButton.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/StatusBar.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/Tab.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/TabItem.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/Table.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/Text.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/Thumb.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/TitleBar.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/ToolBar.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/ToolTip.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/Tree.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/Window.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/twinlogo16.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/twinlogo32.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/twinlogo48.png

/trunk/twin/twin/ide/src/main/resources/org/ebayopensource/twin/ide/icons/twinlogo64.png
/trunk/twin/twin/pom.xml
/trunk/twin/twin/rc
/trunk/twin/twin/rc/pom.xml
/trunk/twin/twin/rc/src
/trunk/twin/twin/rc/src/main
/trunk/twin/twin/rc/src/main/csharp
/trunk/twin/twin/rc/src/main/csharp/AutomationExtensions.cs
/trunk/twin/twin/rc/src/main/csharp/FileRef.cs
/trunk/twin/twin/rc/src/main/csharp/Generic
/trunk/twin/twin/rc/src/main/csharp/Generic/IJSONable.cs
/trunk/twin/twin/rc/src/main/csharp/Generic/JSON.cs
/trunk/twin/twin/rc/src/main/csharp/Generic/JasonServlet.cs
/trunk/twin/twin/rc/src/main/csharp/Generic/Responders.cs
/trunk/twin/twin/rc/src/main/csharp/Generic/Routes.cs
/trunk/twin/twin/rc/src/main/csharp/Grid
/trunk/twin/twin/rc/src/main/csharp/Grid/GridHub.cs
/trunk/twin/twin/rc/src/main/csharp/Model
/trunk/twin/twin/rc/src/main/csharp/Model/Attachment.cs
/trunk/twin/twin/rc/src/main/csharp/Model/Clipboard.cs
/trunk/twin/twin/rc/src/main/csharp/Model/Configuration.cs
/trunk/twin/twin/rc/src/main/csharp/Model/Desktop.cs
/trunk/twin/twin/rc/src/main/csharp/Model/Element.cs
/trunk/twin/twin/rc/src/main/csharp/Model/NativeElement.cs
/trunk/twin/twin/rc/src/main/csharp/Model/ResponseStatus.cs
/trunk/twin/twin/rc/src/main/csharp/Model/ScrollAxis.cs
/trunk/twin/twin/rc/src/main/csharp/Model/Session.cs
/trunk/twin/twin/rc/src/main/csharp/Model/SessionFactory.cs
/trunk/twin/twin/rc/src/main/csharp/Model/SessionSetup.cs
/trunk/twin/twin/rc/src/main/csharp/NameMappings.cs
/trunk/twin/twin/rc/src/main/csharp/Proxy
/trunk/twin/twin/rc/src/main/csharp/Proxy/IJSONProperties.cs
/trunk/twin/twin/rc/src/main/csharp/Proxy/PersistedObject.cs
/trunk/twin/twin/rc/src/main/csharp/STAHelper.cs
/trunk/twin/twin/rc/src/main/csharp/TwinException.cs
/trunk/twin/twin/rc/src/main/csharp/TwinRC.cs
/trunk/twin/twin/rc/src/main/csharp/View
/trunk/twin/twin/rc/src/main/csharp/View/Attachments.cs
/trunk/twin/twin/rc/src/main/csharp/View/Clipboards.cs
/trunk/twin/twin/rc/src/main/csharp/View/Dump.cs
/trunk/twin/twin/rc/src/main/csharp/View/Elements.cs
/trunk/twin/twin/rc/src/main/csharp/View/Keyboard.cs
/trunk/twin/twin/rc/src/main/csharp/View/Search.cs
/trunk/twin/twin/rc/src/main/csharp/View/Sessions.cs
/trunk/twin/twin/rc/src/main/csharp/View/Windows.cs
/trunk/twin/twin/rc/src/main/csharp/twin-rc.csproj
/trunk/twin/twin/rc/src/main/csharp/twin-rc.csproj.user
/trunk/twin/twin/rc/src/main/resources
/trunk/twin/twin/rc/src/main/resources/ide.html
/trunk/twin/twin/rc/src/main/resources/index.html
/trunk/twin/twin/rc/target
/trunk/twin/twin.sln
/trunk/twin/twin.suo

=======================================
--- /dev/null
+++ /trunk/twin/LICENSE.txt Tue Apr 19 02:37:11 2011
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other
modifications
+ represent, as a whole, an original work of authorship. For the
purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces
of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright
owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control
systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this
License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
=======================================
--- /dev/null
+++ /trunk/twin/README.txt Tue Apr 19 02:37:11 2011
@@ -0,0 +1,6 @@
+This is Twin.
+
+Twin is a tool for programmatic automation and testing of windows
applications.
+
+The documentation and the latest code can be found at:
+ http://twin.googlecode.com/
=======================================
--- /dev/null
+++ /trunk/twin/dotnet-logging/dotnet-logging.csproj Tue Apr 19 02:37:11
2011
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003"
ToolsVersion="4.0">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)'
== '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{03F44702-ADF8-48C0-A313-64427710C71C}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <NoStandardLibraries>false</NoStandardLibraries>
+ <AssemblyName>dotnet-logging</AssemblyName>
+ <RootNamespace>Twin.Logging</RootNamespace>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ <OldToolsVersion>2.0</OldToolsVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|
AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.\bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|
AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>.\bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="src\main\csharp\Logger.cs" />
+ <Compile Include="src\main\csharp\TextWriterLogger.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
+ <ProjectExtensions>
+ <VisualStudio AllowExistingFolder="true" />
+ </ProjectExtensions>
+</Project>
=======================================
--- /dev/null
+++ /trunk/twin/dotnet-logging/pom.xml Tue Apr 19 02:37:11 2011
@@ -0,0 +1,15 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.ebayopensource.twin</groupId>
+ <artifactId>dotnet-project</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.ebayopensource.twin</groupId>
+ <artifactId>dotnet-logging</artifactId>
+ <version>1.0.0.0-SNAPSHOT</version>
+ <name>dotnet-logging</name>
+ <description>Simple .NET logging, configured
programmatically</description>
+ <packaging>dotnet-library</packaging>
+</project>
=======================================
--- /dev/null
+++ /trunk/twin/dotnet-logging/src/main/csharp/Logger.cs Tue Apr 19
02:37:11 2011
@@ -0,0 +1,72 @@
+// [Twin] Copyright eBay Inc., Twin authors, and other contributors.
+// This file is provided to you under the terms of the Apache License,
Version 2.0.
+// See LICENSE.txt and NOTICE.txt for license and copyright information.
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Twin.Logging {
+ public enum LogLevel {
+ Trace,
+ Info,
+ Error,
+ }
+
+ public abstract class Logger {
+ private static NullLogger nullLogger = new NullLogger();
+ [ThreadStatic]
+ private static List<Logger> current; // cannot initialise
threadstatic variables here
+ /// <summary>
+ /// Stack of loggers for the current thread
+ /// </summary>
+ public static Logger Current {
+ get {
+ if (current == null)
+ current = new List<Logger>();
+ if (current.Count == 0)
+ return nullLogger;
+ return current[current.Count - 1];
+ }
+ set {
+ if (current == null)
+ current = new List<Logger>();
+ if (value == null) {
+ if (current.Count == 0)
+ throw new Exception("Logger not set, cannot
remove");
+ current.RemoveAt(current.Count - 1);
+ } else {
+ current.Add(value);
+ }
+ }
+ }
+
+ public abstract void Log(LogLevel level, string message, params
object[] details);
+ public abstract void Log(LogLevel level, Exception e);
+
+ public void Trace(string message, params object[] details) {
+ Log(LogLevel.Trace, message, details);
+ }
+ public void Info(string message, params object[] details) {
+ Log(LogLevel.Info, message, details);
+ }
+ public void Error(string message, params object[] details) {
+ Log(LogLevel.Error, message, details);
+ }
+
+ public void Trace(Exception e) {
+ Log(LogLevel.Trace, e);
+ }
+ public void Info(Exception e) {
+ Log(LogLevel.Info, e);
+ }
+ public void Error(Exception e) {
+ Log(LogLevel.Error, e);
+ }
+ }
+
+ public class NullLogger : Logger {
+ public override void Log(LogLevel level, Exception e) { }
+ public override void Log(LogLevel level, string message, params
object[] details) { }
+ }
+}
=======================================
--- /dev/null
+++ /trunk/twin/dotnet-logging/src/main/csharp/TextWriterLogger.cs Tue Apr
19 02:37:11 2011
@@ -0,0 +1,32 @@
+// [Twin] Copyright eBay Inc., Twin authors, and other contributors.
+// This file is provided to you under the terms of the Apache License,
Version 2.0.
+// See LICENSE.txt and NOTICE.txt for license and copyright information.
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+
+namespace Twin.Logging {
+ public class TextWriterLogger : Logger {
+ TextWriter writer;
+ LogLevel level;
+ public TextWriterLogger(LogLevel level, TextWriter writer) {
+ this.level = level;
+ this.writer = writer;
+ }
+ public override void Log(LogLevel level, Exception e) {
+ Log(level, "{0}", e);
+ }
+ public override void Log(LogLevel level, string message, params
object[] details) {
+ if (level < this.level)
+ return;
+
+ string levelStr = level.ToString().ToUpper();
+ string timestampStr =
DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");
+ string messageStr = string.Format(message, details);
+
+ writer.WriteLine("[{0}] {1}: {2}", levelStr, timestampStr,
messageStr);
+ }
+ }
+}
=======================================
--- /dev/null
+++ /trunk/twin/json/pom.xml Tue Apr 19 02:37:11 2011
@@ -0,0 +1,15 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.ebayopensource.twin</groupId>
+ <artifactId>json</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>json</name>
+ <description>JSON library with an API that doesn't suck as
much</description>
+
+ <parent>
+ <groupId>org.ebayopensource.twin</groupId>
+ <artifactId>java-project</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+</project>
=======================================
--- /dev/null
+++ /trunk/twin/json/src/main/java/org/ebayopensource/twin/json/JSON.java
Tue Apr 19 02:37:11 2011
@@ -0,0 +1,449 @@
+// [Twin] Copyright eBay Inc., Twin authors, and other contributors.
+// This file is provided to you under the terms of the Apache License,
Version 2.0.
+// See LICENSE.txt and NOTICE.txt for license and copyright information.
+
+package org.ebayopensource.twin.json;
+
+import java.io.*;
+import java.lang.reflect.*;
+import java.util.*;
+
+/**
+ * Utility methods for converting Java objects to and from JSON strings.
+ * <p>
+ * Objects implementing the JSONable interface will be so transformed
before serialization.
+ * <p>
+ * JSONRecognizers can be used to turn Maps into custom objects on
deserialization.
+ * <p>
+ * Wraps the json.org library. There were some methods to convert between
Java objects
+ * and json.org objects, but these are now deprecated.
+ */
+public class JSON {
+ /**
+ * Convert a Java object to a string using JSON serialization
+ * @throws IllegalArgumentException on serialization error
+ */
+ public static String toString(Object data) {
+ return encode(data);
+ }
+ /**
+ * Convert a Java object to a string using JSON serialization
+ * @throws IllegalArgumentException on serialization error
+ */
+ public static String encode(Object data) {
+ StringWriter sw = new StringWriter();
+ try {
+ encode(data, sw);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ return sw.toString();
+ }
+ public static void encode(Object data, OutputStream stream) throws
IOException {
+ Writer writer = new OutputStreamWriter(stream, "UTF-8");
+ encode(data, writer);
+ }
+ public static void encode(Object data, Writer writer) throws IOException {
+ while(data instanceof JSONable)
+ data = ((JSONable)data).toJSON();
+
+ if(data instanceof Double || data instanceof Short) {
+ double value = ((Number)data).doubleValue();
+ if(Double.isInfinite(value) || Double.isNaN(value)) // JSON can not
represent these
+ data = null;
+ else {
+ writer.write(String.valueOf(value));
+ return;
+ }
+ }
+
+ if(data == null) {
+ writer.write("null");
+ return;
+ }
+
+ // double and short already handled.
+ if(data instanceof Number || data instanceof Boolean) {
+ writer.write(data.toString());
+ return;
+ }
+ if(data instanceof Character)
+ data = data.toString();
+ if(data instanceof Enum<?>)
+ data = ((Enum<?>)data).name();
+
+ if(data.getClass().isArray()) {
+ ArrayList<Object> list = new ArrayList<Object>();
+ int length = Array.getLength(data);
+ for(int i=0; i<length; i++)
+ list.add(Array.get(data, i));
+ data = list; // continue
+ }
+ if(data instanceof Map<?,?>) {
+ writer.write('{');
+ boolean any=false;
+ for(Map.Entry<?, ?> entry : ((Map<?,?>)data).entrySet()) {
+ if(any)
+ writer.write(',');
+ encode(String.valueOf(entry.getKey()), writer);
+ writer.write(':');
+ encode(entry.getValue(), writer);
+ any = true;
+ }
+ writer.write('}');
+ return;
+ }
+ if(data instanceof List<?>) {
+ writer.write('[');
+ boolean any=false;
+ for(Object item : (List<?>)data) {
+ if(any)
+ writer.write(',');
+ encode(item, writer);
+ any = true;
+ }
+ writer.write(']');
+ return;
+ }
+ if(data instanceof String) {
+ String string = (String)data;
+ char[] hex = new char[]{'\\', 'u', '0', '0', '0', '0'};
+ writer.write('"');
+ for(int i=0; i<string.length(); i++) {
+ char c = string.charAt(i);
+ switch(c) {
+ case '\r':
+ writer.write("\\r");
+ break;
+ case '\n':
+ writer.write("\\n");
+ break;
+ case '\b':
+ writer.write("\\b");
+ break;
+ case '\f':
+ writer.write("\\f");
+ break;
+ case '\t':
+ writer.write("\\t");
+ break;
+ case '"':
+ case '\\':
+ writer.write('\\'); // fall thru
+ writer.write(c);
+ break;
+ default:
+ if(c < 0x20 || c >= 0x80) {
+ hex[2] = HEX[(c >> 12)&0xf];
+ hex[3] = HEX[(c >> 8)&0xf];
+ hex[4] = HEX[(c >> 4)&0xf];
+ hex[5] = HEX[(c >> 0)&0xf];
+ writer.write(hex);
+ } else {
+ writer.write(c);
+ }
+ break;
+ }
+ }
+ writer.write('"');
+ return;
+ }
+
+ throw new IllegalArgumentException("Cannot
encode "+data.getClass().getName()+": "+data);
+ }
+ private static final char[] HEX = "0123456789abcdef".toCharArray();
+
+ /**
+ * Convert a String to a Java object using JSON deserialization
+ * @throws IllegalArgumentException on deserialization error
+ */
+ public static Object decode(String text, JSONRecognizer... recognizers) {
+ PushbackReader reader = new PushbackReader(new StringReader(text));
+ try {
+ return decode(reader, recognizers);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ public static Object decode(InputStream in, JSONRecognizer...
recognizers) throws IOException {
+ PushbackReader reader = new PushbackReader(new
InputStreamReader(in, "UTF-8"));
+ return decode(reader, recognizers);
+ }
+ public static Object decode(PushbackReader reader, JSONRecognizer...
recognizers) throws IOException {
+ int start = skipWhitespace(reader);
+ switch(start) {
+ case -1:
+ throw new IllegalArgumentException("EOF at start of decode");
+ case '"':
+ return recognize(readString(reader, recognizers), recognizers);
+ case '{':
+ return recognize(readMap(reader, recognizers), recognizers);
+ case '[':
+ return recognize(readList(reader, recognizers), recognizers);
+ case 't': case 'f': case 'n':
+ return recognize(readTrueFalseNull(reader, recognizers), recognizers);
+ case '0': case '1': case '2': case '3': case '4': case '5': case '6':
case '7': case '8': case '9': case '-':
+ return recognize(readNumber(reader, recognizers), recognizers);
+ default:
+ throw new IllegalArgumentException("Unexpected
character "+(char)start+" at start of decode");
+ }
+ }
+ private static Boolean readTrueFalseNull(PushbackReader in,
JSONRecognizer[] recognizers) throws IOException {
+ int[] data = new int[5];
+ data[0] = in.read();
+ data[1] = in.read();
+ data[2] = in.read();
+ data[3] = in.read();
+ if(data[3] < 0)
+ throw new IllegalArgumentException("End of file while reading
bareword");
+
+ switch(data[0]) {
+ case 't':
+ if(!(data[1] == 'r' && data[2] == 'u' && data[3] == 'e'))
+ throw new IllegalArgumentException("Expected 'true' after
reading 't'");
+ return true;
+ case 'n':
+ if(!(data[1] == 'u' && data[2] == 'l' && data[3] == 'l'))
+ throw new IllegalArgumentException("Expected 'null' after
reading 'n'");
+ return null;
+ case 'f':
+ data[4] = in.read();
+ if(data[4] < 0)
+ throw new IllegalArgumentException("End of file while reading
bareword");
+ if(!(data[1] == 'a' && data[2] == 'l' && data[3] == 's' && data[4]
== 'e'))
+ throw new IllegalArgumentException("Expected 'false' after
reading 'f'");
+ return false;
+ }
+ throw new IllegalStateException();
+ }
+ private static Number readNumber(PushbackReader in, JSONRecognizer[]
recognizers) throws IOException {
+ StringBuffer sb = new StringBuffer();
+ boolean isDecimal=false;
+ out: while(true) {
+ int c = in.read();
+ switch(c) {
+ case -1:
+ break out;
+ case '.':
+ case 'e': case 'E':
+ isDecimal=true; // fall through
+ case '-': case '+':
+ case '0': case '1': case '2': case '3': case '4': case '5': case '6':
case '7': case '8': case '9':
+ sb.append((char)c);
+ break;
+ default:
+ in.unread((char)c);
+ break out;
+ }
+ }
+ if(isDecimal)
+ return Double.parseDouble(sb.toString());
+ long l = Long.parseLong(sb.toString());
+ if(l <= Integer.MAX_VALUE && l >= Integer.MIN_VALUE)
+ return (int)l;
+ return l;
+ }
+ private static String readString(PushbackReader in, JSONRecognizer[]
recognizers) throws IOException {
+ int firstQuote = in.read();
+ if(firstQuote != '"')
+ throw new IllegalStateException();
+
+ StringBuffer data = new StringBuffer();
+ out: while(true) {
+ int c = in.read();
+ switch(c) {
+ case -1:
+ throw new IllegalArgumentException("String meets end of file");
+ case '"':
+ break out;
+ case '\\':
+ int d = in.read();
+ switch(d) {
+ case -1:
+ throw new IllegalArgumentException("Escape sequence meets end of
file");
+ case '\\':
+ case '"':
+ data.append((char)d);
+ break;
+ case 'r':
+ data.append('\r');
+ break;
+ case 'n':
+ data.append('\n');
+ break;
+ case 'b':
+ data.append('\b');
+ break;
+ case 'f':
+ data.append('\f');
+ break;
+ case 't':
+ data.append('\t');
+ break;
+ case 'u':
+ int hex1 = in.read();
+ int hex2 = in.read();
+ int hex3 = in.read();
+ int hex4 = in.read();
+ if(hex4 < 0)
+ throw new IllegalArgumentException("Unicode escape meets end of
file");
+
data.append((char)Integer.parseInt(""+(char)hex1+(char)hex2+(char)hex3+(char)hex4,
16));
+ break;
+ default:
+ throw new IllegalArgumentException("Unknown escape sequence
\\"+(char)d);
+ }
+ break;
+ default:
+ data.append((char)c);
+ break;
+ }
+ }
+ return data.toString();
+ }
+ private static Map<String, Object> readMap(PushbackReader in,
JSONRecognizer... recognizers) throws IOException {
+ int open = in.read();
+ if(open != '{')
+ throw new IllegalStateException();
+ HashMap<String,Object> result = new HashMap<String, Object>();
+ out: while(true) {
+ int next = skipWhitespace(in);
+ if(next < 0)
+ throw new IllegalArgumentException("EOF inside map");
+ else if(next == '}') {
+ in.read();
+ break out;
+ }
+ if(!result.isEmpty()) {
+ if(next == ',') {
+ in.read();
+ next = skipWhitespace(in);
+ } else {
+ throw new IllegalArgumentException("Expected , or } in map,
got "+(char)next);
+ }
+ }
+
+ if (next != '"')
+ throw new IllegalArgumentException("Expected \" to begin key in map,
got "+(char)next);
+
+ String key = readString(in, recognizers);
+ int colon = skipWhitespace(in);
+ if(colon != ':')
+ throw new IllegalArgumentException("Expected : after key name in map,
got "+(char)colon);
+ in.read();
+ skipWhitespace(in);
+ result.put(key, decode(in, recognizers));
+ }
+ return result;
+ }
+ private static List<Object> readList(PushbackReader in, JSONRecognizer...
recognizers) throws IOException {
+ int open = in.read();
+ if(open != '[')
+ throw new IllegalStateException();
+ ArrayList<Object> result = new ArrayList<Object>();
+ out: while(true) {
+ int next = skipWhitespace(in);
+ if(next < 0)
+ throw new IllegalArgumentException("EOF inside list");
+ if(next == ']') {
+ in.read();
+ break out;
+ }
+ if(!result.isEmpty()) {
+ if(next == ',') {
+ in.read();
+ skipWhitespace(in);
+ } else {
+ throw new IllegalArgumentException("Unexpected character in
list "+(char)next+", expected , or ]");
+ }
+ }
+ result.add(decode(in, recognizers));
+ }
+ return result;
+ }
+ @SuppressWarnings("unchecked")
+ private static Object recognize(Object o, JSONRecognizer... recognizers) {
+ if(!(o instanceof Map<?,?>))
+ return o;
+ Map<String,Object> map = (Map<String,Object>)o;
+ for(JSONRecognizer recognizer : recognizers) {
+ Object result = recognizer.recognize(map);
+ if(result != null)
+ return result;
+ }
+ return map;
+ }
+ private static int skipWhitespace(PushbackReader reader) throws
IOException {
+ while(true) {
+ int i = reader.read();
+ if(i < 0)
+ return i;
+ else if(!Character.isWhitespace((char)i)) {
+ reader.unread(i);
+ return i;
+ }
+ }
+ }
+
+ /*
+ public static Object decode(String text, JSONRecognizer... recognizers) {
+ text = text.trim();
+ try {
+ if(text.startsWith("{"))
+ return _wrappedToPOJO(new JSONObject(text), recognizers);
+ if(text.startsWith("["))
+ return _wrappedToPOJO(new JSONArray(text), recognizers);
+ if(text.startsWith("\""))
+ return parseString(text);
+ // bug in JSON lib
+ if(text.length() == 0)
+ throw new IllegalArgumentException("Blank JSON text");
+ return _wrappedToPOJO(JSONObject.stringToValue(text), recognizers);
+ } catch (JSONException e) {
+ throw new IllegalArgumentException(e);
+ }
+ }
+ */
+
+ /**
+ * Convert a String to a Java object using JSON deserialization
+ * @throws IllegalArgumentException on deserialization error
+ * The method signature has two recognizer patterns so that
decode(String) isn't ambiguous
+ * The classes passed must implement the JSONStaticRecognizer interface.
+ * We can't statically enforce this because you can't have varargs of
generic types.
+ */
+ public static Object decode(String text, Class<?> firstStaticRecognizer,
Class<?>... restStaticRecognizers) {
+ Class<?>[] staticRecognizers = new
Class<?>[restStaticRecognizers.length+1];
+ staticRecognizers[0] = firstStaticRecognizer;
+ System.arraycopy(restStaticRecognizers, 0, staticRecognizers, 1,
restStaticRecognizers.length);
+
+ JSONRecognizer[] recognizers = new
JSONRecognizer[staticRecognizers.length];
+ for(int i=0; i<recognizers.length; i++) {
+ final Class<?> type = staticRecognizers[i];
+ if(!JSONStaticRecognizer.class.isAssignableFrom(type))
+ throw new IllegalArgumentException(type.getName()+" does not
implement "+JSONStaticRecognizer.class.getSimpleName());
+ recognizers[i] = new JSONRecognizer() {
+ private Method method;
+ {
+ try {
+ method = type.getMethod("recognize", Map.class);
+ if(!Modifier.isStatic(method.getModifiers()))
+ throw new NoSuchMethodException("recognize method is not static");
+ } catch (NoSuchMethodException e) {
+ throw new IllegalStateException(type.getName()+"
implements "+JSONStaticRecognizer.class.getSimpleName()+" but doesn't have
public static Object recognize(Map<String,Object> value)");
+ }
+ }
+ @Override
+ public Object recognize(Map<String, Object> jsonObject) {
+ try {
+ return method.invoke(null, jsonObject);
+ } catch (InvocationTargetException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ };
+ }
+ return decode(text, recognizers);
+ }
+}
=======================================
--- /dev/null
+++
/trunk/twin/json/src/main/java/org/ebayopensource/twin/json/JSONRecognizer.java
Tue Apr 19 02:37:11 2011
@@ -0,0 +1,22 @@
+// [Twin] Copyright eBay Inc., Twin authors, and other contributors.
+// This file is provided to you under the terms of the Apache License,
Version 2.0.
+// See LICENSE.txt and NOTICE.txt for license and copyright information.
+
+package org.ebayopensource.twin.json;
+
+import java.util.Map;
+
+/**
+ * Used by JSON for deserialization, the counterpart to JSONable.
+ * <p>
+ * When a javascript object is encountered during JSON deserialization, it
is converted to a map.
+ * The recognize() method is called on each recognizer until one returns a
non-null value.
+ * That value is taken to be the deserialized object. If all recognizers
return null, then the map
+ * is the deserialized object.
+ * <p>
+ * Note that when recognize() is called, all members of the map have all
been fully decoded and recognized.
+ */
+public interface JSONRecognizer {
+ /** @return the deserialization of the passed JSON object */
+ public Object recognize(Map<String,Object> jsonObject);
+}
=======================================
--- /dev/null
+++
/trunk/twin/json/src/main/java/org/ebayopensource/twin/json/JSONStaticRecognizer.java
Tue Apr 19 02:37:11 2011
@@ -0,0 +1,23 @@
+// [Twin] Copyright eBay Inc., Twin authors, and other contributors.
+// This file is provided to you under the terms of the Apache License,
Version 2.0.
+// See LICENSE.txt and NOTICE.txt for license and copyright information.
+
+package org.ebayopensource.twin.json;
+
+/**
+ * Used by JSON for deserialization, the counterpart to JSONable.
+ * <p>
+ * The constraints of this interface cannot be enforced by the java type
system. You must implement the following method:
+ * <code>public static Object recognize(Map<String,Object>
jsonObject);</code>
+ * <p>
+ * When a javascript object is encountered during JSON deserialization, it
is converted to a map.
+ * The recognize() method is called on each recognizer until one returns a
non-null value.
+ * That value is taken to be the deserialized object. If all recognizers
return null, then the map
+ * is the deserialized object.
+ * <p>
+ * Note that when recognize() is called, all members of the map have all
been fully decoded and recognized.
+ */
+public interface JSONStaticRecognizer {
+ /* @return the deserialization of the passed JSON object */
+ /* public static Object recognize(Map<String,Object> jsonObject); */
+}
=======================================
--- /dev/null
+++
/trunk/twin/json/src/main/java/org/ebayopensource/twin/json/JSONable.java
Tue Apr 19 02:37:11 2011
@@ -0,0 +1,16 @@
+// [Twin] Copyright eBay Inc., Twin authors, and other contributors.
+// This file is provided to you under the terms of the Apache License,
Version 2.0.
+// See LICENSE.txt and NOTICE.txt for license and copyright information.
+
+package org.ebayopensource.twin.json;
+
+/**
+ * Used by objects to implement custom serialization.
+ * <p>
+ * If an object implements JSONable, when it is serialized its toJSON()
method will be called
+ * and the result will be serialized in its place.
+ */
+public interface JSONable {
+ /** @return an intermediate form in the serialization of this object */
+ public Object toJSON();
+}
=======================================
--- /dev/null
+++
/trunk/twin/json/src/test/java/org/ebayopensource/twin/json/JSONRecognizerTest.java
Tue Apr 19 02:37:11 2011
@@ -0,0 +1,139 @@
+// [Twin] Copyright eBay Inc., Twin authors, and other contributors.
+// This file is provided to you under the terms of the Apache License,
Version 2.0.
+// See LICENSE.txt and NOTICE.txt for license and copyright information.
+
+package org.ebayopensource.twin.json;
+
+import java.util.*;
+
+import org.testng.annotations.*;
+import static org.testng.AssertJUnit.*;
+
+public class JSONRecognizerTest {
+ private static class Tag implements JSONStaticRecognizer {
+ String text;
+ public Tag(String text) {
+ this.text = text;
+ }
+ public String toString() {
+ return "["+text+"]";
+ }
+
+ public boolean equals(Object other) {
+ return other instanceof Tag && text.equals(((Tag)other).text);
+ }
+
+ @SuppressWarnings("unused")
+ public static Tag recognize(Map<String,Object> data) {
+ if(data.containsKey("tag"))
+ return new Tag(String.valueOf(data.get("tag")));
+ return null;
+ }
+ }
+
+ @DataProvider(name="multiRecognizers")
+ public Object[][] multiRecognizers() {
+ String json1 = "{\"tag\": 1}";
+ String json2 = "{\"tag\": 2}";
+ String json3 = "{\"tag\": 3}";
+
+ final Object tag1 = new Tag("tag1");
+ final Object tag2 = new Tag("tag2");
+ final Object tag3 = new Tag("tag3");
+
+ JSONRecognizer recognize1 = new JSONRecognizer() {
+ public Object recognize(Map<String, Object> jsonObject) {
+ if(Integer.valueOf(1).equals(jsonObject.get("tag")))
+ return tag1;
+ return null;
+ }
+ };
+ JSONRecognizer recognize2 = new JSONRecognizer() {
+ public Object recognize(Map<String, Object> jsonObject) {
+ if(Integer.valueOf(2).equals(jsonObject.get("tag")))
+ return tag2;
+ return null;
+ }
+ };
+ JSONRecognizer recognizeAllAs3 = new JSONRecognizer() {
+ public Object recognize(Map<String, Object> jsonObject) {
+ if(jsonObject.containsKey("tag"))
+ return tag3;
+ return null;
+ }
+ };
+
+ return new Object[][]{
+ {"Without recognizer works", Map.class, json1, null},
+ {"recognizer 1 works", tag1, json1, new JSONRecognizer[]{ recognize1
}},
+ {"sole recogniser misses", Map.class, json1, new JSONRecognizer[]{
recognize2 }},
+ {"first hits, second misses", tag1, json1, new JSONRecognizer[]{
recognize1, recognize2 }},
+ {"first misses, second hits", tag2, json2, new JSONRecognizer[]{
recognize1, recognize2 }},
+ {"both miss", Map.class, json3, new JSONRecognizer[]{ recognize1,
recognize2 }},
+ {"first hits, second hits", tag1, json1, new JSONRecognizer[]{
recognize1, recognizeAllAs3 }},
+ {"first hits, second hits", tag3, json1, new JSONRecognizer[]{
recognizeAllAs3, recognize1 }},
+ };
+ }
+
+ @Test(dataProvider="multiRecognizers")
+ public void verifyMultipleRecognizersInvokedCorrectly(String description,
Object expected, String json, JSONRecognizer[] recognizers) {
+ if(recognizers == null)
+ recognizers = new JSONRecognizer[0];
+ Object result = JSON.decode(json, recognizers);
+ if(expected instanceof Class<?>) {
+ assertTrue(description+": decoded "+json+"
instanceof "+((Class<?>)expected).getSimpleName(),
((Class<?>)expected).isInstance(result));
+ } else {
+ assertSame(description, expected, result);
+ }
+ }
+
+ @DataProvider(name="recursiveRecognizers")
+ public Object[][] recursiveRecognizers() {
+ final Object tag1 = new Tag("tag1");
+ final Object tag2 = new Tag("tag2");
+
+ Map<String,Object> tag1map = new HashMap<String,Object>();
+ tag1map.put("data", tag1);
+
+ JSONRecognizer recognize1 = new JSONRecognizer() {
+ public Object recognize(Map<String, Object> jsonObject) {
+ if(Integer.valueOf(1).equals(jsonObject.get("tag")))
+ return tag1;
+ return null;
+ }
+ };
+ JSONRecognizer recognize2 = new JSONRecognizer() {
+ public Object recognize(Map<String, Object> jsonObject) {
+ if(jsonObject.containsKey("data"))
+ assertSame("jsonObject[data]", tag1, jsonObject.get("data"));
+ if(Integer.valueOf(2).equals(jsonObject.get("tag")))
+ return tag2;
+ return null;
+ }
+ };
+
+ return new Object[][]{
+ {"works in list", Arrays.asList(tag1), "[{\"tag\":1}]", new
JSONRecognizer[]{ recognize1 }},
+ {"works in object", tag1map, "{\"data\":{\"tag\":1}}", new
JSONRecognizer[]{ recognize1 }},
+ {"outer overwrites inner", tag2, "{\"tag\":2, \"data\":{\"tag\":1}}",
new JSONRecognizer[]{recognize1, recognize2}},
+ {"outer overwrites inner", tag2, "{\"tag\":2, \"data\":{\"tag\":1}}",
new JSONRecognizer[]{recognize2, recognize1}},
+ };
+ }
+
+ @Test(dataProvider="recursiveRecognizers")
+ public void verifyRecursiveRecognizersInvokedCorrectly(String
description, Object expected, String json, JSONRecognizer[] recognizers) {
+ if(recognizers == null)
+ recognizers = new JSONRecognizer[0];
+ Object result = JSON.decode(json, recognizers);
+ if(expected instanceof Class<?>) {
+ assertTrue(description+": decoded "+json+"
instanceof "+((Class<?>)expected).getSimpleName(),
((Class<?>)expected).isInstance(result));
+ } else {
+ assertEquals(description, expected, result);
+ }
+ }
+
+ @Test
+ public void verifyStaticRecognizer() {
+ assertEquals(new Tag("hello static"), JSON.decode("{\"tag\": \"hello
static\"}", Tag.class));
+ }
+}
=======================================
--- /dev/null
+++
/trunk/twin/json/src/test/java/org/ebayopensource/twin/json/JSONTest.java
Tue Apr 19 02:37:11 2011
@@ -0,0 +1,109 @@
+// [Twin] Copyright eBay Inc., Twin authors, and other contributors.
+// This file is provided to you under the terms of the Apache License,
Version 2.0.
+// See LICENSE.txt and NOTICE.txt for license and copyright information.
+
+package org.ebayopensource.twin.json;
+
+import java.util.*;
+
+import org.testng.annotations.*;
+import static org.testng.AssertJUnit.*;
+
+public class JSONTest {
+ private enum Colors {
+ Red,
+ Green,
+ Blue
+ }
+
+ private Map<String,Object> data;
+ public JSONTest() {
+ data = new HashMap<String,Object>();
+ data.put("integer", 3);
+ data.put("double", 2.5);
+ data.put("string", "foo");
+ data.put("array", new Object[]{ 1,2,3, null});
+ data.put("list", Arrays.asList(1,2,3, null));
+ data.put("null", null);
+ }
+
+ @Test
+ public void testBasicValueDecode() {
+ assertEquals("string", "test", JSON.decode("\"test\""));
+ assertEquals("integer", 3, JSON.decode("3"));
+ assertEquals("double", 2.5, JSON.decode("2.5"));
+ assertEquals("boolean", true, JSON.decode("true"));
+ assertEquals("null", null, JSON.decode("null"));
+ }
+
+ @Test
+ public void testStringEscapeEncode() {
+ assertEquals("string escape", "\"abc\\\"\\u0000\\r\\n\\b\\f\\t\\\\\"",
JSON.encode("abc\"\u0000\r\n\b\f\t\\"));
+ }
+ @Test
+ public void testStringEscapeDecode() {
+ assertEquals("string escape", "abc\"\u0000\r\n\b\f\t\\",
JSON.decode("\"abc\\\"\\u0000\\r\\n\\b\\f\\t\\\\\""));
+ }
+
+ @Test
+ public void testBasicValueEncode() {
+ assertEquals("string", "\"test\"", JSON.encode("test"));
+ assertEquals("integer", "3", JSON.encode(3));
+ assertEquals("double", "2.5", JSON.encode(2.5));
+ assertEquals("boolean", "true", JSON.encode(true));
+ assertEquals("null", "null", JSON.encode(null));
+ }
+
+ @Test
+ public void testDecodeMap() {
+ String json = "{\"integer\":3, \"double\":2.5, \"string\": \"foo\",
\"array\":[1,2,3], \"list\":[1,2,3], \"null\":null }";
+ Object result = JSON.decode(json);
+ assertTrue("result is a map", result instanceof Map<?,?>);
+ Map<?,?> map = (Map<?,?>)result;
+ assertEquals("integer", 3, map.get("integer"));
+ assertEquals("double", 2.5, map.get("double"));
+ assertEquals("string", "foo", map.get("string"));
+ assertEquals("list", Arrays.asList(1,2,3), map.get("list"));
+ assertEquals("array", Arrays.asList(1,2,3), map.get("array"));
+ assertTrue("Map contains 'null' key", map.containsKey("null"));
+ assertEquals("null", null, map.get("null"));
+ }
+
+ @Test
+ public void testEncodeEnum() {
+ List<?> pre = Arrays.asList(Colors.Red);
+ List<?> post = Arrays.asList("Red");
+
+ String json = JSON.encode(pre);
+ Object result = JSON.decode(json);
+ assertEquals(post, result);
+ }
+
+ @Test
+ public void testEncodeMap() {
+ String json = JSON.toString(data);
+ Object result = JSON.decode(json);
+ assertTrue("result is a map", result instanceof Map<?,?>);
+ Map<?,?> map = (Map<?,?>)result;
+ assertEquals("integer", 3, map.get("integer"));
+ assertEquals("double", 2.5, map.get("double"));
+ assertEquals("string", "foo", map.get("string"));
+ assertEquals("list", Arrays.asList(1,2,3, null), map.get("list"));
+ assertEquals("array", Arrays.asList(1,2,3, null), map.get("array"));
+ assertTrue("Map contains 'null' key", map.containsKey("null"));
+ assertEquals("null", null, map.get("null"));
+ }
+
+ @Test
+ public void testEncodeFailure() throws Exception {
+ java.net.URL url = new java.net.URL("http://google.com");
+ try {
+ String encodedURL = JSON.encode(url);
+ assertTrue("Should fail to encode unknown type but URL encodes
to: "+encodedURL, false);
+ } catch (IllegalArgumentException e) {}
+ try {
+ String encodedURL = JSON.encode(Arrays.asList(url));
+ assertTrue("Should fail to encode unknown type but List containing URL
encodes to: "+encodedURL, false);
+ } catch (IllegalArgumentException e) {}
+ }
+}
=======================================
--- /dev/null
+++
/trunk/twin/json/src/test/java/org/ebayopensource/twin/json/JSONableTest.java
Tue Apr 19 02:37:11 2011
@@ -0,0 +1,56 @@
+// [Twin] Copyright eBay Inc., Twin authors, and other contributors.
+// This file is provided to you under the terms of the Apache License,
Version 2.0.
+// See LICENSE.txt and NOTICE.txt for license and copyright information.
+
+package org.ebayopensource.twin.json;
+
+import java.util.*;
+
+import org.testng.annotations.*;
+import static org.testng.AssertJUnit.*;
+
+public class JSONableTest {
+ public static class JSONableExample implements JSONable {
+ private Object result;
+ public JSONableExample(Object result) {
+ this.result = result;
+ }
+ public Object toJSON() {
+ return result;
+ }
+ }
+
+ @DataProvider(name="roundtrip")
+ public static Object[][] data() {
+ String string = "text";
+ Integer integer = 2;
+ Double dbl = 3.5;
+ List<?> list = Arrays.asList(1,2,3,null);
+ Object[] array = new Object[]{1,2,3,null};
+ Map<String,Object> map = new HashMap<String,Object>();
+ map.put("string", string);
+ map.put("list", list);
+ map.put("null", null);
+
+ return new Object[][] {
+ {"string", string, string},
+ {"integer", integer, integer},
+ {"double", dbl, dbl},
+ {"list", list, list},
+ {"array", list, array},
+ {"map", map, map},
+ {"null", null, null},
+ };
+ }
+
+ @Test(dataProvider="roundtrip")
+ public static void jsonableRoundTrip(String description, Object result,
Object input) throws Throwable {
+ assertEquals("roundtrip "+description, result, roundTrip(input));
+ }
+
+ private static Object roundTrip(Object data) {
+ JSONableExample ex = new JSONableExample(data);
+ String json = JSON.toString(ex);
+ return JSON.decode(json);
+ }
+}
=======================================
--- /dev/null
+++ /trunk/twin/maven-templates/dotnet-project/pom.xml Tue Apr 19 02:37:11
2011
@@ -0,0 +1,85 @@
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.ebayopensource.twin</groupId>
+ <artifactId>dotnet-project</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>dotnet-project</name>
+ <description>Parent for .NET projects</description>
+ <packaging>pom</packaging>
+
+ <!-- This public repository hosts the NMaven .NET compiler plugin -->
+ <pluginRepositories>
+ <pluginRepository>
+ <id>npanday-releases</id>
+ <name>npanday-releases</name>
+
<url>http://repo.npanday.org/archiva/repository/npanday-releases/</url>
+ </pluginRepository>
+ </pluginRepositories>
+ <!-- Dependencies for NPanday are here -->
+ <repositories>
+ <repository>
+ <id>aduna-repo</id>
+ <name>aduna-repo</name>
+ <url>http://repository.aduna-software.org/maven2/</url>
+ </repository>
+ <repository>
+ <id>npanday-releases</id>
+ <name>npanday-releases</name>
+ <url>http://repo.npanday.org/archiva/repository/npanday-releases/</url>
+ </repository>
+ <repository>
+ <id>npanday-3rdparty</id>
+ <name>npanday-3rdparty</name>
+ <url>http://repo.npanday.org/archiva/repository/3rdparty/</url>
+ </repository>
+ </repositories>
+
+ <!-- Depend on .NET compiler plugin -->
+ <dependencies>
+ <dependency>
+ <groupId>npanday.plugin</groupId>
+ <artifactId>maven-compile-plugin</artifactId>
+ <version>1.2</version>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ <!-- Projects are UTF-8 -->
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <!-- Make this project parseable on non-windows OS -->
+ </properties>
+
+ <build>
+ <sourceDirectory>src/main/csharp</sourceDirectory>
+ <plugins>
+ <!-- Invoke C# compiler -->
+ <plugin>
+ <groupId>npanday.plugin</groupId>
+ <artifactId>maven-compile-plugin</artifactId>
+ <version>1.2</version>
+ <extensions>true</extensions>
+ <executions>
+ <execution>
+ <phase>compile</phase>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- Don't invoke Java compiler -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-compile</id>
+ <phase>none</phase>
+ </execution>
+ <execution>
+ <id>test-compile</id>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
=======================================
--- /dev/null
+++ /trunk/twin/maven-templates/java-project/pom.xml Tue Apr 19 02:37:11
2011
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.ebayopensource.twin</groupId>
+ <artifactId>java-project</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>java-project</name>
+ <description>Parent for java projects</description>
+ <packaging>pom</packaging>
+
+ <!-- Include TestNG for unit tests and commons-logging -->
+ <dependencies>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.14.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ </dependencies>
+
+ <!-- Projects are UTF-8 -->
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <!-- Use Java 1.6 -->
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
=======================================
--- /dev/null
+++ /trunk/twin/packages/client/java/pom.xml Tue Apr 19 02:37:11 2011
@@ -0,0 +1,46 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd"
+>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.ebayopensource.twin</groupId>
+ <artifactId>twin-client-standalone</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>twin-client-standalone</name>
+ <description>Assembly of twin client and dependencies into a 'super
JAR'</description>
+ <packaging>pom</packaging>
+
+ <parent>
+ <groupId>org.ebayopensource.twin</groupId>
+ <artifactId>java-project</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-5</version>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+
<descriptorRefs><descriptorRef>jar-with-dependencies</descriptorRef></descriptorRefs>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals><goal>single</goal></goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.ebayopensource.twin</groupId>
+ <artifactId>twin-java-client</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
=======================================
--- /dev/null
+++ /trunk/twin/packages/rc/pom.xml Tue Apr 19 02:37:11 2011
@@ -0,0 +1,70 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd"
+>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.ebayopensource.twin</groupId>
+ <artifactId>twin-rc-standalone</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>twin-rc-standalone</name>
+ <description>Assembly of required components for a twin node</description>
+ <packaging>pom</packaging>
+
+ <parent>
+ <groupId>org.ebayopensource.twin</groupId>
+ <artifactId>java-project</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <!-- This public repository hosts the NMaven .NET compiler plugin -->
+ <pluginRepositories>
+ <pluginRepository>
+ <id>npanday-releases</id>
+ <name>npanday-releases</name>
+
<url>http://repo.npanday.org/archiva/repository/npanday-releases/</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-5</version>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+
<descriptorSourceDirectory>src/main/assembly/</descriptorSourceDirectory>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>npanday.plugin</groupId>
+ <artifactId>maven-compile-plugin</artifactId>
+ <version>1.2</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.ebayopensource.twin</groupId>
+ <artifactId>sharpclaws-server</artifactId>
+ <version>1.0.0.0-SNAPSHOT</version>
+ <type>dotnet-executable</type>
+ </dependency>
+ <dependency>
+ <groupId>org.ebayopensource.twin</groupId>
+ <artifactId>twin-rc</artifactId>
+ <version>1.0.0.0-SNAPSHOT</version>
+ <type>dotnet-library</type>
+ </dependency>
+ </dependencies>
+</project>
=======================================
--- /dev/null
+++ /trunk/twin/packages/rc/src/main/assembly/assembly.xml Tue Apr 19
02:37:11 2011
@@ -0,0 +1,31 @@
+<assembly>
+ <id>default</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <fileSets>
+ <fileSet>
+ <directory>src/main/contents</directory>
+ <outputDirectory>.</outputDirectory>
+ </fileSet>
+ </fileSets>
+ <dependencySets>
+ <!-- For entry points, remove the version from the filename, for easy
configuration/scripting -->
+ <dependencySet>
+ <useProjectArtifact>false</useProjectArtifact>
+
<outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
+ <includes>
+ <include>org.ebayopensource.twin:twin-rc</include>
+ <include>org.ebayopensource.twin:dotnet-logging</include>
+ <include>org.ebayopensource.twin:sharpclaws-api</include>
+ </includes>
+ </dependencySet>
+ <dependencySet>
+ <useProjectArtifact>false</useProjectArtifact>
+ <outputFileNameMapping>sharpclaws.exe</outputFileNameMapping>
+ <includes>
+ <include>org.ebayopensource.twin:sharpclaws-server</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
=======================================
--- /dev/null
+++ /trunk/twin/packages/rc/src/main/contents/sharpclaws.xml Tue Apr 19
02:37:11 2011
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+<server> defines an HTTP server.
+ port (80): numbered port to listen on
+ log-level (INFO): log severity level (ERROR/INFO/DEBUG/TRACE)
+ log (none): log file (stdout if none is specified)
+-->
+
+<server port="4444" log-level="INFO">
+
+ <!--
+ <servlet> defines a web application running inside the server
+ context (/): the root path of the servlet, relative to the server
+ class: the subclass of Servlet to instantiate
+ assembly: the DLL to load that contains the specified servlet class
+ -->
+
+ <servlet context="/" class="Twin.TwinRC" assembly="twin-rc.dll">
+ <!--
+ <param> defines a parameter to be passed to the the servlet through its
configuration property
+ name: the parameter name
+ content: the parameter value
+
+ Recognized parameters for Twin RC:
+ app.{IDENTIFIER}.path - the path to application IDENTIFIER
+ app.{IDENTIFIER}.name - the exposed name of application IDENTIFIER
+ (if not given, IDENTIFIER is used as the name)
+ -->
+ <param name="app.notepad.path">C:\windows\notepad.exe</param>
+ <param name="app.paint.name">Microsoft Paint</param>
+ <param name="app.paint.path">C:\WINDOWS\system32\mspaint.exe</param>
+ </servlet>
+</server>
=======================================
--- /dev/null
+++ /trunk/twin/pom.xml Tue Apr 19 02:37:11 2011
@@ -0,0 +1,36 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.ebayopensource.twin</groupId>
+ <artifactId>twin-project-aggregator</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>twin-container</name>
+ <description>Twin and all subprojects</description>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>maven-templates/java-project</module>
+ <module>json</module>
+ <module>twin/client/java</module>
+ <module>twin/ide</module>
+ <module>packages/client/java</module>
+ </modules>
+
+ <!--
+ <profiles>
+ <profile>
+ <id>rc</id>
+ <activation>
+ <os><family>Windows</family></os>
+ </activation>
+ <modules>
+ <module>maven-templates/java-project</module>
+ <module>maven-templates/dotnet-project</module>
+ <module>dotnet-logging</module>
+ <module>sharpclaws</module>
+ <module>twin/rc</module>
+ <module>packages/rc</module>
+ </modules>
+ </profile>
+ </profiles>
+ -->
+</project>
=======================================
***Additional files exist in this changeset.***
Reply all
Reply to author
Forward
0 new messages