Exemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @GET @Path(DOMAINS_PATH) public javax.ws.rs.core.Response listDomains() throws NullPointerException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual Response ListDomains()
        {
            MBeanServer        server  = ManagementFactory.PlatformMBeanServer;
            ListRepresentation domains = ListRepresentation.strings(server.Domains);

            return(_output.ok(domains));
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void canFormatListOfStrings()
        public virtual void CanFormatListOfStrings()
        {
            string entity         = _json.assemble(ListRepresentation.strings("hello", "world"));
            string expectedString = JsonHelper.createJsonFrom(Arrays.asList("hello", "world"));

            assertEquals(expectedString, entity);
        }
 public RestSnapshot(IOidStrategy oidStrategy, MenuContextFacade menus, HttpRequestMessage req, RestControlFlags flags)
     : this(oidStrategy, req, true)
 {
     populator = () => {
         Representation = ListRepresentation.Create(oidStrategy, menus, req, flags);
         SetHeaders();
     };
 }
 public RestSnapshot(IOidStrategy oidStrategy, ListContextFacade listContext, HttpRequest req, RestControlFlags flags)
     : this(oidStrategy, req, true)
 {
     populator = logger => {
         Representation = ListRepresentation.Create(oidStrategy, listContext, req, flags);
         SetHeaders(logger);
     };
 }
Exemplo n.º 5
0
 public RestSnapshot(ListContextSurface listContext, HttpRequestMessage req, RestControlFlags flags)
     : this(req, true)
 {
     logger.DebugFormat("RestSnapshot:ServicesList");
     populator = () => {
         representation = ListRepresentation.Create(listContext, req, flags);
         SetHeaders();
     };
 }
Exemplo n.º 6
0
 public RestSnapshot(IOidStrategy oidStrategy, IMenuFacade[] menus, HttpRequestMessage req, RestControlFlags flags)
     : this(oidStrategy, req, true)
 {
     logger.DebugFormat("RestSnapshot:MenuList");
     populator = () => {
         representation = ListRepresentation.Create(oidStrategy, menus, req, flags);
         SetHeaders();
     };
 }
Exemplo n.º 7
0
        public void ConstructorTest()
        {
            ListRepresentation listRepresentation = new ListRepresentation(5);

            if (listRepresentation.Nodes != 5)
            {
                Assert.Fail();
            }
        }
Exemplo n.º 8
0
 public override ListRepresentation GetNodesWithLabel(string labelName, IDictionary <string, object> properties)
 {
     using (Transaction transaction = _graph.beginTx())
     {
         ListRepresentation nodesWithLabel = base.GetNodesWithLabel(labelName, properties);
         transaction.Success();
         return(nodesWithLabel);
     }
 }
Exemplo n.º 9
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public org.neo4j.server.rest.repr.ListRepresentation getNodeRelationships(long nodeId, RelationshipDirection direction, java.util.Collection<String> types) throws NodeNotFoundException
        public override ListRepresentation GetNodeRelationships(long nodeId, RelationshipDirection direction, ICollection <string> types)
        {
            using (Transaction transaction = _graph.beginTx())
            {
                ListRepresentation nodeRelationships = base.GetNodeRelationships(nodeId, direction, types);
                transaction.Success();
                return(nodeRelationships);
            }
        }
Exemplo n.º 10
0
        public RestSnapshot(INakedObjectSpecificationSurface[] specs, HttpRequestMessage req, RestControlFlags flags)
            : this(req, true)
        {
            logger.DebugFormat("RestSnapshot:TypeList");


            populator = () => {
                representation = ListRepresentation.Create(specs, req, flags);
                SetHeaders();
            };
        }
Exemplo n.º 11
0
        public void AddEdgeTest()
        {
            ListRepresentation listRepresentation = new ListRepresentation(5);

            listRepresentation.AddEdge(new Edge(1, 2, 5));
            listRepresentation.AddEdge(new Edge(3, 1, 5));
            if (listRepresentation.Edges != 2)
            {
                Assert.Fail();
            }
        }
Exemplo n.º 12
0
        public void GetEdgesTest()
        {
            ListRepresentation listRepresentation = new ListRepresentation(5);

            listRepresentation.AddEdge(new Edge(1, 2, 5));
            listRepresentation.AddEdge(new Edge(3, 1, 5));
            listRepresentation.AddEdge(new Edge(1, 3, 5));
            listRepresentation.AddEdge(new Edge(1, 4, 5));
            if (listRepresentation.GetEdges(1).Count != 3)
            {
                Assert.Fail();
            }
        }
Exemplo n.º 13
0
 public virtual void AddList(ListRepresentation value)
 {
     Serialize(Writer.newList(value.Type), value);
 }
Exemplo n.º 14
0
 public override void Serialize(MappingSerializer serializer)
 {
     base.Serialize(serializer);
     serializer.PutList("engines", ListRepresentation.@string(_engines));
 }